From 9c3133aa29d1d6f57b7d26fe7437bbd056a5604e Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 4 Jul 2023 14:18:08 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20=E8=A7=A3=E5=86=B3=E4=B8=80=E9=83=A8?= =?UTF-8?q?=E5=88=860703=E5=8F=8D=E9=A6=88bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 3 +- src/components/BaseSearchForm.vue | 42 ++++++++++---- src/components/DialogWithMenu.vue | 10 ++-- src/mixins/basic-page.js | 6 +- src/router/index.js | 2 +- src/views/atomViews/ListViewWithHead.vue | 1 - .../pms/order/components/BaseSearchForm.vue | 57 ++++++++++--------- .../pms/order/components/DialogJustForm.vue | 2 +- .../order/components/ListSectionWithHead.vue | 6 +- src/views/modules/pms/order/index.vue | 52 +---------------- src/views/modules/sys/user-add-or-update.vue | 2 + src/views/modules/sys/user.vue | 40 +++++++------ 12 files changed, 104 insertions(+), 119 deletions(-) diff --git a/public/index.html b/public/index.html index eafa36f..eab3827 100644 --- a/public/index.html +++ b/public/index.html @@ -39,8 +39,9 @@ <% } %> diff --git a/src/components/BaseSearchForm.vue b/src/components/BaseSearchForm.vue index f9cefe6..59f3932 100644 --- a/src/components/BaseSearchForm.vue +++ b/src/components/BaseSearchForm.vue @@ -8,20 +8,40 @@ :key="opt.prop" :label="opt.label ? opt.label : null" :prop="opt.prop ?? '' + index" - :rules="opt.bind?.rules ? opt.bind.rules : undefined" - > - - - + :rules="opt.bind?.rules ? opt.bind.rules : undefined"> + + + - + + action="https://jsonplaceholder.typicode.com/posts/"> 上传文件 {{ opt.button.name }} + @click="handleBtnClick(opt.button.name)"> + {{ opt.button.name }} + diff --git a/src/components/DialogWithMenu.vue b/src/components/DialogWithMenu.vue index 3ce20d9..38e1e21 100644 --- a/src/components/DialogWithMenu.vue +++ b/src/components/DialogWithMenu.vue @@ -4,7 +4,7 @@ :visible="dialogVisible" :destroy-on-close="false" @close="handleClose" - :close-on-click-modal="configs.clickModalToClose ?? true"> + :close-on-click-modal="configs.clickModalToClose ?? false">

@@ -497,16 +497,18 @@ export default { setTimeout( () => { Object.keys(this.dataForm).forEach((key) => { + console.log('reset form, key', key) if (excludeId && key === "id") return; if ("files" in this.dataForm) this.dataForm.files = []; - if ("fileIds" in this.dataForm) this.dataForm.fileIds = []; - else this.dataForm[key] = null; + else if ("fileIds" in this.dataForm) this.dataForm.fileIds = []; + else this.$set(this.dataForm, key, null) if (Array.isArray(this.fileList)) { this.fileList = []; } }); this.activeMenu = this.configs.menu[0].name; - this.$refs.dataForm[0].clearValidate(); + this.$refs.dataForm[0].resetFields(); + console.log("清除Form...", this.dataForm); }, immediate ? 0 : 200 ); diff --git a/src/mixins/basic-page.js b/src/mixins/basic-page.js index 93c812c..391c639 100644 --- a/src/mixins/basic-page.js +++ b/src/mixins/basic-page.js @@ -103,18 +103,20 @@ export default { this.$refs.addOrUpdate.init(val.data.id); }); } else if (val.type === "delete") { + console.log('va', val) this.deleteHandle(val.data.id, val.data.name) } }, // 删除 deleteHandle(id, name) { - this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", { + this.$confirm(`确定对删除 ${name}?`, "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", }) .then(() => { - this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => { + // this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => { + this.$http.delete(this.urlOptions.deleteURL + `/${id}`).then(({ data }) => { if (data && data.code === 0) { this.$message({ message: "操作成功", diff --git a/src/router/index.js b/src/router/index.js index 8f8771f..0e37e2d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -74,7 +74,7 @@ export function addDynamicRoute(routeParams, router) { } const router = new Router({ - mode: 'history', + mode: 'hash', scrollBehavior: () => ({ y: 0 }), routes: pageRoutes.concat(moduleRoutes) }) diff --git a/src/views/atomViews/ListViewWithHead.vue b/src/views/atomViews/ListViewWithHead.vue index bebfe7e..a35394b 100644 --- a/src/views/atomViews/ListViewWithHead.vue +++ b/src/views/atomViews/ListViewWithHead.vue @@ -274,7 +274,6 @@ export default { }).then(({ data: res }) => { if (res.code === 0) { this.$message.success("删除成功!"); - this.page = 1; this.size = "defaultPageSize" in this.tableConfig.column ? this.tableConfig.column.defaultPageSize : 20; diff --git a/src/views/modules/pms/order/components/BaseSearchForm.vue b/src/views/modules/pms/order/components/BaseSearchForm.vue index c4a3436..edef11f 100644 --- a/src/views/modules/pms/order/components/BaseSearchForm.vue +++ b/src/views/modules/pms/order/components/BaseSearchForm.vue @@ -6,26 +6,45 @@
- - - - + :rules="opt.bind?.rules ? opt.bind.rules : undefined"> + + + - + + action="https://jsonplaceholder.typicode.com/posts/"> 上传文件 {{ opt.button.name }} + @click="handleBtnClick(opt.button.name)"> + {{ opt.button.name }} +
@@ -61,21 +80,7 @@ export default { dataForm: {}, }; }, - - // 这个 watch 出现得没啥必要...... - // watch: { - // dataForm: { - // handler: (val) => { - // console.log("[BaseSearchForm::watcher::dataForm]", val); - // }, - // deep: true, - // }, - // }, - - created() {}, mounted() { - // console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig))); - this.headConfig.fields.forEach((field, index) => { // 没有 field.prop ,则为按钮之类的 if (!field.prop) return; diff --git a/src/views/modules/pms/order/components/DialogJustForm.vue b/src/views/modules/pms/order/components/DialogJustForm.vue index f35e8e7..36b02c8 100644 --- a/src/views/modules/pms/order/components/DialogJustForm.vue +++ b/src/views/modules/pms/order/components/DialogJustForm.vue @@ -410,7 +410,7 @@ export default { if (res.code === 0) { this.$message.success(method === "POST" ? "添加成功" : "更新成功"); this.$emit("refreshDataList"); - if (method === "POST") this.handleClose(); + this.handleClose(); } else { this.$message({ message: `${res.code}: ${res.msg}`, diff --git a/src/views/modules/pms/order/components/ListSectionWithHead.vue b/src/views/modules/pms/order/components/ListSectionWithHead.vue index 021869e..6830209 100644 --- a/src/views/modules/pms/order/components/ListSectionWithHead.vue +++ b/src/views/modules/pms/order/components/ListSectionWithHead.vue @@ -35,7 +35,8 @@ v-if="renderDialog" fullscreen :configs="dialogConfig" - @destroy-dialog="renderDialog = false" /> + @destroy-dialog="renderDialog = false" + @refreshDataList="getAList(Object.assign({}, listQuery, extraSearchConditions, params));" /> + @destroy-dialog="renderMenuDialog = false" + @refreshDataList="getAList(Object.assign({}, listQuery, extraSearchConditions, params));" />
- -
- -->
- -