feat: 迁移 Vue3 + Vite + view-ui-plus(对齐 NoticeFront 框架)
- 构建:Vue CLI 4 → Vite 5,入口迁至根 index.html(含 env-config + 主题通道 loader)
- 技术栈:Vue 2.6 → Vue 3.4,view-design → view-ui-plus 1.3.24,vue-router 3 → 4(hash)
- 壳层重写:App.vue / components/layout.vue 对齐 Notice 骨架(logo-badge、icon-* 通道图标、resolveMenuPage、crumb-home 基线)
- 机械转换:具名 slot → template #x、.sync → v-model:、@click.native、$set、beforeDestroy、/deep/ → :deep()
- render:h('Button')/h('Input') → 真组件 + 扁平 props/onClick
- 组件适配:vuedraggable 4 的 #item 插槽;vue-treeselect → @zanmato/vue3-treeselect;Page 分页改 v-model + pageSize 显式回写
- 清理:删除 Vue2 死代码(layout_old/bak/child、App.Net、codeModal、未引用组件)
- 修复:深链接首次加载被重定向到首个模块(router.isReady)
验证:vite build 通过;headless CDP 全 15 路由无异常;教师列表 2 行渲染、操作列按钮点击弹窗正常。
This commit is contained in:
@@ -15,10 +15,10 @@
|
||||
添加班级
|
||||
<Icon type="ios-arrow-down"></Icon>
|
||||
</Button>
|
||||
<DropdownMenu slot="list">
|
||||
<template #list><DropdownMenu>
|
||||
<DropdownItem name="openAddSingleClass">添加单个班级</DropdownItem>
|
||||
<DropdownItem name="openMultiNumModal">添加多个班级</DropdownItem>
|
||||
</DropdownMenu>
|
||||
</DropdownMenu></template>
|
||||
</Dropdown>
|
||||
<Button type="success" style="margin-left:10px" @click="openImportModal">班级信息导入</Button>
|
||||
</div>
|
||||
@@ -42,10 +42,10 @@
|
||||
<Input v-model.number="addClassCount" type="number" min="1" />
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer" align="right">
|
||||
<template #footer><div align="right">
|
||||
<Button @click="multiClassModal = false">取消</Button>
|
||||
<Button type="primary" @click="submitBatchAdd">提交</Button>
|
||||
</div>
|
||||
</div></template>
|
||||
</Modal>
|
||||
|
||||
<!-- 弹窗2:班级信息导入 -->
|
||||
@@ -61,9 +61,9 @@
|
||||
<Button type="primary" @click="confirmImport">确定</Button>
|
||||
</div> -->
|
||||
<div class="main-contents">
|
||||
<Form ref="UpParmas.datapre" :model="UpParmas.datapre" :label-width="100" inline>
|
||||
<Form ref="UpParmas.datapre" :model="UpParmas.datapre" ::label-width="100" inline>
|
||||
<FormItem label="Excel上传:" style="margin-bottom:10px;width:100%;">
|
||||
<i-input type="text" style="width:90%;" v-model="UpParmas.fileName" class="import-input" placeholder="未选中任何文件.." readonly></i-input>
|
||||
<Input type="text" style="width:90%;" v-model="UpParmas.fileName" class="import-input" placeholder="未选中任何文件.." readonly></Input>
|
||||
<Upload class="fr btn"
|
||||
:action="UpParmas.actionUrl"
|
||||
:data="UpParmas.datapre"
|
||||
@@ -73,7 +73,7 @@
|
||||
:before-upload="handleUpload"
|
||||
:on-success="importFile"
|
||||
>
|
||||
<i-button icon="md-add"></i-button>
|
||||
<Button icon="md-add"></Button>
|
||||
</Upload>
|
||||
</FormItem>
|
||||
<FormItem v-if="UpParmas.fileName" style="margin-bottom:10px">
|
||||
@@ -84,8 +84,8 @@
|
||||
|
||||
<Alert show-icon>
|
||||
操作说明:
|
||||
<Icon type="ios-bulb-outline" slot="icon" size="20"></Icon>
|
||||
<template slot="desc" style="font-size: 12px;">
|
||||
<template #icon><Icon type="ios-bulb-outline" size="20"></Icon></template>
|
||||
<template #desc style="font-size: 12px;">
|
||||
请先上传EXCEL文件,若成功则显示导入成功数据,否则显示错误的数据及错误原因;<br>
|
||||
EXCEL文件的格式():工作表(WorkSheet)的名称应设为缺省的[Sheet1];<br>
|
||||
<a @click="MoBanExceldaochu" style="font-size:12px;">点击链接下载[班级导入模板.xls]</a>
|
||||
@@ -98,9 +98,9 @@
|
||||
<Icon type="ios-loading" size=30 class="demo-spin-icon-load"></Icon>
|
||||
<div>上传中...</div>
|
||||
</Spin>
|
||||
<div slot="footer">
|
||||
<template #footer><div>
|
||||
<i-Button @click="UpfileModalcloseclick" style="margin-left: 8px">关闭</i-Button>
|
||||
</div>
|
||||
</div></template>
|
||||
</Modal>
|
||||
|
||||
<!-- 弹窗3:选择教师 -->
|
||||
@@ -119,10 +119,10 @@
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer" align="right">
|
||||
<template #footer><div align="right">
|
||||
<Button @click="selectTeacherModal = false">取消</Button>
|
||||
<Button type="primary" @click="confirmSelectTeacher">提交</Button>
|
||||
</div>
|
||||
</div></template>
|
||||
</Modal>
|
||||
|
||||
<!-- 弹窗5:选择校区 -->
|
||||
@@ -135,15 +135,16 @@
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer" align="right">
|
||||
<template #footer><div align="right">
|
||||
<Button @click="selectCampusModal = false">取消</Button>
|
||||
<Button type="primary" @click="confirmSelectCampus">提交</Button>
|
||||
</div>
|
||||
</div></template>
|
||||
</Modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Button, Input } from "view-ui-plus";
|
||||
import myTree from "../../components/my_tree";
|
||||
export default {
|
||||
components: { myTree},
|
||||
@@ -336,16 +337,12 @@ export default {
|
||||
title: '班级别名',
|
||||
align: 'center',
|
||||
render: (h, params) => {
|
||||
return h('Input', {
|
||||
props: { value: params.row.cname },
|
||||
style: { width: '150px' },
|
||||
on: {
|
||||
input: (val) => {
|
||||
this.$set(params.row, 'classAlias', val)
|
||||
return h(Input, {modelValue: params.row.cname,
|
||||
'onUpdate:modelValue': (val) => {
|
||||
params.row.classAlias = val
|
||||
this.cellChange(params.index, 'classAlias', val)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
style: { width: '150px' }})
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -543,14 +540,10 @@ export default {
|
||||
width: 100,
|
||||
render: (h, params) => {
|
||||
return h('div', { style: { display: 'flex', gap: '8px', justifyContent: 'center' } }, [
|
||||
h('Button', {
|
||||
props: { icon: 'ios-eye-outline', type: 'text', size: 'large' },
|
||||
on: { click: () => this.viewDetail(params.row) }
|
||||
}),
|
||||
h('Button', {
|
||||
props: { icon: 'ios-trash-outline', type: 'text', color: 'red', size: 'large',disabled:params.row.disableDel },
|
||||
on: { click: () => this.deleteRow(params.index, params.row) }
|
||||
})
|
||||
h(Button, {icon: 'ios-eye-outline', type: 'text', size: 'large',
|
||||
onClick: () => this.viewDetail(params.row)}),
|
||||
h(Button, {icon: 'ios-trash-outline', type: 'text', color: 'red', size: 'large',disabled:params.row.disableDel,
|
||||
onClick: () => this.deleteRow(params.index, params.row)})
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user