预算多选不限同一父级|oa模块加载速度优化

master
weizong song 21 hours ago
parent ee64421275
commit 3afdcfd1b1

@ -949,7 +949,9 @@ export default {
if (!auths || auths.length === 0) {
this.selectionError = "该预算来源未配置部门授权";
this.$message.warning(this.selectionError);
this.selectedBudgetIds = [...this.lastValidBudgetIds];
this.setCheckedIds(this.lastValidBudgetIds);
this.selectionError = "";
return;
}
@ -983,23 +985,15 @@ export default {
return;
}
// +
const parentId = selectedNodes[0].parent_id ?? null;
const parentMismatch = selectedNodes.some((n) => (n.parent_id ?? null) !== parentId);
if (parentMismatch) {
this.selectionError = "多条预算来源必须同属一个直接父级";
this.$message.warning(this.selectionError);
this.setCheckedIds(this.lastValidBudgetIds);
return;
}
const rows = [];
for (const node of selectedNodes) {
const auths = await this.getDepartmentAuthorizations(node.id);
if (!auths || auths.length !== 1) {
this.selectionError = "多条预算来源时,每条预算必须且仅能授权给一个部门";
this.$message.warning(this.selectionError);
this.selectedBudgetIds = [...this.lastValidBudgetIds];
this.setCheckedIds(this.lastValidBudgetIds);
this.selectionError = "";
return;
}
const a = auths[0];
@ -1009,7 +1003,6 @@ export default {
budget_name: node.name || "",
department_id: a.department_id,
department_name: a.department?.name || "",
// (3) 0
allocated_amount: existingMap[key] ?? 0,
});
}
@ -1367,5 +1360,3 @@ export default {
font-weight: 500;
}
</style>

@ -15,47 +15,25 @@ import router from './router'
import '@/icons' // icon
import '@/permission' // permission control
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
* you can execute: mockXHR()
*
* Currently MockJs will be used in the production environment,
* please remove it before going online ! ! !
*/
if (process.env.NODE_ENV === 'production') {
const { mockXHR } = require('../mock')
mockXHR()
}
// set ElementUI lang to EN
//Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui按如下方式声明
Vue.use(ElementUI)
// vxe-table / vxe-pc-ui
// 注意vxe-pc-ui 的部分组件(如 vxe-modal需要显式 Vue.use 注册,否则会退化成“未知标签”,其内容会直接渲染在页面里
import { VxeUI, VxeUpload, VxeDatePicker, VxeNumberInput, VxeModal } from 'vxe-pc-ui'
import 'vxe-pc-ui/lib/style.css'
Vue.use(VxeUpload)
Vue.use(VxeDatePicker)
Vue.use(VxeNumberInput)
Vue.use(VxeModal)
import VxeTable from 'vxe-table'
import "vxe-table/styles/index.scss"
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
import ExcelJS from 'exceljs'
VxeTable.use(VXETablePluginExportXLSX, {
ExcelJS
})
Vue.use(VxeTable)
Vue.config.productionTip = false
//vant
import Vant from 'vant'
import 'vant/lib/index.css';
Vue.use(Vant)
// vant: only register components used as global tags
import { Popup, Picker, Uploader } from 'vant'
import 'vant/lib/popup/style'
import 'vant/lib/picker/style'
import 'vant/lib/uploader/style'
import 'vant/lib/checkbox/style'
import 'vant/lib/checkbox-group/style'
import 'vant/lib/dropdown-menu/style'
import 'vant/lib/dropdown-item/style'
Vue.use(Popup)
Vue.use(Picker)
Vue.use(Uploader)
import domZIndex from 'dom-zindex'
domZIndex.setCurrent(2000)

@ -0,0 +1,18 @@
import Vue from 'vue'
import { VxeUpload, VxeDatePicker, VxeNumberInput, VxeModal } from 'vxe-pc-ui'
import 'vxe-pc-ui/lib/style.css'
import VxeTable from 'vxe-table'
import 'vxe-table/styles/index.scss'
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
import ExcelJS from 'exceljs'
VxeTable.use(VXETablePluginExportXLSX, {
ExcelJS
})
Vue.use(VxeUpload)
Vue.use(VxeDatePicker)
Vue.use(VxeNumberInput)
Vue.use(VxeModal)
Vue.use(VxeTable)

@ -6,6 +6,8 @@ Vue.use(Router);
/* Layout */
import Layout from "@/layout";
const loadVxeView = (view) => () => import("@/plugins/vxe").then(() => view());
/**
* Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
@ -68,24 +70,24 @@ export const constantRoutes = [
path: "list/:type",
name: "flowList",
hidden: true,
component: () => import("@/views/flow/list.vue"),
component: loadVxeView(() => import("@/views/flow/list.vue")),
},
{
path: "create",
name: "create",
component: () => import("@/views/flow/create"),
component: loadVxeView(() => import("@/views/flow/create")),
hidden: true,
},
{
path: "detail",
name: "detail",
component: () => import("@/views/flow/create"),
component: loadVxeView(() => import("@/views/flow/create")),
hidden: true,
},
{
path: "detailCommon",
name: "detailCommon",
component: () => import("@/views/flow/detailCommon"),
component: loadVxeView(() => import("@/views/flow/detailCommon")),
hidden: true,
}
],
@ -100,7 +102,7 @@ export const constantRoutes = [
{
path: "index",
name: "MeetingMinutes",
component: () => import("@/views/MeetingMinutes/index"),
component: loadVxeView(() => import("@/views/MeetingMinutes/index")),
meta: { title: "会议纪要管理", icon: "el-icon-document" },
},
],

@ -5,7 +5,9 @@ import Layout from "@/layout"
import Nested from "@/layout/nested.vue"
const loadView = (view) => {
return (resolve) => require([`@/views${view}`], resolve);
return () => import('@/plugins/vxe').then(() => new Promise((resolve, reject) => {
require([`@/views${view}`], resolve, reject)
}))
}
const componentHandle = (url, route)=> {
if (/^#+/.test(route.path) && route.pid === 0) {

@ -589,7 +589,7 @@ export default {
const res = await axios.get(
`https://restapi.amap.com/v3/weather/weatherInfo?city=320400&key=15ecd1e7de61e684959f43d8965a89f0`
);
if (res.status === 200) {
if (res.status === 200 && Array.isArray(res.data && res.data.lives) && res.data.lives.length > 0) {
this.weather = res.data.lives[0];
}
} catch (err) {

@ -7,7 +7,7 @@
@input="e => $emit('update:isShow', e)"
size="mini"
:loading="loading"
:id="id.toString()"
id="flow-list-popover"
:lock-view="false"
:lock-scroll="false"
:mask="false"

Loading…
Cancel
Save