From 84e6647befcec95621d89a3e6a36d8208c8c8a23 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Thu, 20 Jul 2023 13:45:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=AF=B9=E6=AF=94=E6=9F=A5=E8=AF=A2=E8=A1=A8?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wwwroot/components/list/index.js | 93 +++++++++++-------- .../wwwroot/layouts/menu-item.js | 8 ++ 2 files changed, 64 insertions(+), 37 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js index ef2dc6d7..59c3c20a 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js @@ -227,12 +227,27 @@ export default { /> @@ -391,16 +406,22 @@ export default { const editFormTitle = ref(""); const editFormSchema = ref(null); const editFormModel = ref(null); - const exportModel = reactive({ - includeAll: false, - includeDeleted: false, - }); - const importModel = reactive({ - // partial: true, - // replace: false, + const defaultExportModel = { + version: "", + date1: "", + date2: "", + date3: "", + date4: "", + ln: "", + pn: "", + enumBusinessType: route.meta.enumBusinessType, + }; + const exportModel = ref(defaultExportModel); + const defaultImportModel = { factory: "", version: "", - }); + }; + const importModel = ref(defaultExportModel); const factories = ref([]); const versions = ref([]); const fileList = ref([]); @@ -550,7 +571,7 @@ export default { await load(); } else if (item.path === "export") { //export - if ((item.pattern = "paged")) { + if (item.pattern === "paged") { const url = config.edit.exportUrl; const method = config.edit.exportMethod; const postData = buildQuery(); @@ -558,13 +579,21 @@ export default { if (!response.errors) { window.open(getUrl(`settleaccount/getblobfile/download/${response.data}`)); } - } else { - editFormTitle.value = `${t(item.path)}${querySchema.value?.title}`; + } else if (item.meta.isTop) { + exportModel.value = defaultExportModel; + versions.value = ( + await request("settleaccount/centralized-control/get-all", null, { method: "POST" }) + ).data.items.map((o) => ({ + value: o.version, + label: o.version, + })); + editFormTitle.value = `${t(item.path)}${config.query.schema.title}`; dialogVisible.value = true; } } else if (item.path === "import") { //import try { + importModel.value = Object.assign({}, defaultImportModel); editFormloading.value = true; editFormTitle.value = `${t(item.path)}${config.query.schema.title}`; fileList.value = []; @@ -624,20 +653,22 @@ export default { dialogVisible.value = false; editFormMode.value = null; } else if (editFormMode.value === "export") { - const postData = JSON.parse(JSON.stringify(queryModel.value)); - postData.filters = filterList.value.filter((o) => o.property && o.value); - delete postData.query["items"]; - delete postData.query["id"]; - const url = `${baseUrl}/${editFormMode.value}?${qs.stringify(exportModel)}`; - const response = await post(url, postData); - download(response); + // const postData = JSON.parse(JSON.stringify(queryModel.value)); + // postData.filters = filterList.value.filter((o) => o.property && o.value); + // delete postData.query["items"]; + // delete postData.query["id"]; + // const url = `${baseUrl}/${editFormMode.value}?${qs.stringify(exportModel)}`; + // const response = await post(url, postData); + // download(response); + const url = config.edit.exportUrl; + await request(url, exportModel.value, { method: config.edit.exportMethod }); dialogVisible.value = false; } else if (editFormMode.value === "import") { editFormloading.value = true; const url = config.edit.importUrl; const formData = new FormData(); - formData.append("version", importModel.version); - formData.append("factory", importModel.factory); + formData.append("version", importModel.value.version); + formData.append("factory", importModel.value.factory); for (let i = 0; i < fileList.value.length; i++) { formData.append(`files`, fileList.value[i].raw); } @@ -788,18 +819,6 @@ export default { queryModel.value = schemaToModel(config.query.schema); getSortModel(queryModel.value); filterList.value = queryModel.value?.filters ?? []; - //pushfilterList(); - // if (!querySchema.value) { - // const vm = (await get(indexUrl)).data; - // querySchema.value = vm.schema.properties.query; - // tableSchema.value = vm.schema.properties.items.items; - // data.value = vm.model ?? schemaToModel(vm.schema); - // if (props.query) { - // Object.assign(data.value.query, props.query); - // } - // getSortModel(data.value); - // getColumns(vm.schema.properties.query); - // } getColumns(config.table.schema); if (props.query) { Object.assign(queryModel.value.query, props.query); diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/menu-item.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/menu-item.js index ab5483cf..d11dfac4 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/menu-item.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/layouts/menu-item.js @@ -1,6 +1,8 @@ import html from "html"; import { defineAsyncComponent, reactive, watch } from "vue"; import { useRouter } from "vue-router"; +import { useAppStore } from "../store/index.js"; +import { ElMessageBox } from "element-plus"; export default { name: "menuItem", @@ -33,6 +35,7 @@ export default { }, }, setup(props, context) { + const appStore = useAppStore(); const router = useRouter(); const model = reactive(props.modelValue); watch( @@ -45,6 +48,11 @@ export default { // const click = (route) => { if (!route.meta.isExternal) { + // if (appStore.routes.length >= 10) { + // ElMessageBox.alert(`已经页签数量`, `提示`); + // } else { + // router.push(route.meta.path); + // } router.push(route.meta.path); } else { window.open(route.path); From a225f00465ff8d9e37e1bcebe1a8e81695a396ea Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Thu, 20 Jul 2023 13:52:05 +0800 Subject: [PATCH 2/2] update --- .../wwwroot/components/list/index.js | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js index 59c3c20a..0ca4da42 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js @@ -233,16 +233,18 @@ export default { - - - - - - - - - - - - + @@ -807,6 +809,13 @@ export default { } return postData; } + function isNotJit() { + return ( + route.meta.enumBusinessType !== "ZhiGongJian" || + route.meta.enumBusinessType !== "BeiJian" || + route.meta.enumBusinessType !== "YingDuJian" + ); + } onMounted(async () => { if (route.meta.children?.length) { for (const item of route.meta.children) { @@ -876,6 +885,7 @@ export default { versions, pushfilterList, getOperators, + isNotJit, }; }, };