From bea02c6d0d41bb8a018d21f8734c57af2e1ccea6 Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 6 Jul 2023 13:35:44 +0800 Subject: [PATCH] bugfix 0706 doc --- src/views/atomViews/ListView.vue | 5 +++-- src/views/atomViews/ListViewWithHead.vue | 12 +++++++++--- .../pms/blenderOrder/components/ListViewWithHead.vue | 4 +++- .../pms/blenderPress/components/ListViewWithHead.vue | 5 +++-- .../pms/carHistory/components/ListViewWithHead.vue | 8 +++++++- .../components/ListViewWithHead.vue | 7 ++++++- .../finishedOrder/components/ListViewWithHead.vue | 7 ++++++- .../pms/finishedOrder/components/tabs/carDetail.vue | 7 ++++++- .../kilnWaitingRoom/components/ListViewWithHead.vue | 7 ++++++- .../pms/material/components/ListViewWithHead.vue | 4 +++- src/views/modules/pms/material/config.js | 9 +++++++-- .../modules/pms/materialStorageDynamic/config.js | 4 ++-- .../pms/order/components/ListSectionWithHead.vue | 4 +++- .../pms/order/components/ListViewWithHead.vue | 4 +++- .../modules/pms/order/components/tabs/carDetail.vue | 7 ++++++- .../palletizingLine/components/ListViewWithHead.vue | 7 ++++++- 16 files changed, 79 insertions(+), 22 deletions(-) diff --git a/src/views/atomViews/ListView.vue b/src/views/atomViews/ListView.vue index b546b9d..4784a9e 100644 --- a/src/views/atomViews/ListView.vue +++ b/src/views/atomViews/ListView.vue @@ -233,9 +233,10 @@ export default { // payload: { type: string, data: string | number | object } switch (type) { case "delete": { - let currenPageListLength = this.dataList.length + let hintMsg = "name" in data ? `确定要删除记录 "${data.name}" 吗?` : "确定删除该记录?"; + let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除记录 "${data.name ?? data.id}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/atomViews/ListViewWithHead.vue b/src/views/atomViews/ListViewWithHead.vue index 0844391..fecb5e9 100644 --- a/src/views/atomViews/ListViewWithHead.vue +++ b/src/views/atomViews/ListViewWithHead.vue @@ -88,7 +88,7 @@ export default { props: { navigator: { type: Boolean, - default: true + default: true, }, tableConfig: { type: Object, @@ -241,7 +241,7 @@ export default { })); this.totalPage = res.data.total; } else if (Array.isArray(res.data)) { - this.dataList = res.data + this.dataList = res.data; } else { this.dataList.splice(0); this.totalPage = 0; @@ -284,9 +284,15 @@ export default { promptName = data[deleteConfig.promptField]; } + let hintMsg = `确定要删除记录 "${promptName}" 吗?`; + if (promptName == data.id) { + // 如果 promptName 计算出来是 data.id 就以'该记录'代称 + hintMsg = "确定删除该记录?"; + } + let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/blenderOrder/components/ListViewWithHead.vue b/src/views/modules/pms/blenderOrder/components/ListViewWithHead.vue index 7377264..a5bbfe6 100644 --- a/src/views/modules/pms/blenderOrder/components/ListViewWithHead.vue +++ b/src/views/modules/pms/blenderOrder/components/ListViewWithHead.vue @@ -175,9 +175,11 @@ export default { // payload: { type: string, data: string | number | object } switch (type) { case "delete": { + let hintMsg = "name" in data ? `确定要删除记录 "${data.name}" 吗?` : "确定删除该记录?"; + let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除记录 "${data.name ?? data.id}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/blenderPress/components/ListViewWithHead.vue b/src/views/modules/pms/blenderPress/components/ListViewWithHead.vue index 27069d7..0b2a7c0 100644 --- a/src/views/modules/pms/blenderPress/components/ListViewWithHead.vue +++ b/src/views/modules/pms/blenderPress/components/ListViewWithHead.vue @@ -252,10 +252,11 @@ export default { // payload: { type: string, data: string | number | object } switch (type) { case "delete": { - let currenPageListLength = this.dataList.length; + let hintMsg = "name" in data ? `确定要删除记录 "${data.name}" 吗?` : "确定删除该记录?"; + let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除记录 "${data.name ?? data.id}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/carHistory/components/ListViewWithHead.vue b/src/views/modules/pms/carHistory/components/ListViewWithHead.vue index dcd673d..060c456 100644 --- a/src/views/modules/pms/carHistory/components/ListViewWithHead.vue +++ b/src/views/modules/pms/carHistory/components/ListViewWithHead.vue @@ -243,9 +243,15 @@ export default { promptName = data[deleteConfig.promptField]; } + let hintMsg = `确定要删除记录 "${promptName}" 吗?`; + if (promptName == data.id) { + // 如果 promptName 计算出来是 data.id 就以'该记录'代称 + hintMsg = "确定删除该记录?"; + } + let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/detectionPlatform/components/ListViewWithHead.vue b/src/views/modules/pms/detectionPlatform/components/ListViewWithHead.vue index e9a57d3..7459e74 100644 --- a/src/views/modules/pms/detectionPlatform/components/ListViewWithHead.vue +++ b/src/views/modules/pms/detectionPlatform/components/ListViewWithHead.vue @@ -232,10 +232,15 @@ export default { if (deleteConfig && "promptField" in deleteConfig) { promptName = data[deleteConfig.promptField]; } + let hintMsg = `确定要删除记录 "${promptName}" 吗?`; + if (promptName == data.id) { + // 如果 promptName 计算出来是 data.id 就以'该记录'代称 + hintMsg = "确定删除该记录?"; + } let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/finishedOrder/components/ListViewWithHead.vue b/src/views/modules/pms/finishedOrder/components/ListViewWithHead.vue index 7236558..6407e66 100644 --- a/src/views/modules/pms/finishedOrder/components/ListViewWithHead.vue +++ b/src/views/modules/pms/finishedOrder/components/ListViewWithHead.vue @@ -213,9 +213,14 @@ export default { if (deleteConfig && "promptField" in deleteConfig) { promptName = data[deleteConfig.promptField]; } + let hintMsg = `确定要删除记录 "${promptName}" 吗?`; + if (promptName == data.id) { + // 如果 promptName 计算出来是 data.id 就以'该记录'代称 + hintMsg = "确定删除该记录?"; + } let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/finishedOrder/components/tabs/carDetail.vue b/src/views/modules/pms/finishedOrder/components/tabs/carDetail.vue index 4bd4097..27958e6 100644 --- a/src/views/modules/pms/finishedOrder/components/tabs/carDetail.vue +++ b/src/views/modules/pms/finishedOrder/components/tabs/carDetail.vue @@ -142,9 +142,14 @@ export default { if (deleteConfig && "promptField" in deleteConfig) { promptName = data[deleteConfig.promptField]; } + let hintMsg = `确定要删除记录 "${promptName}" 吗?`; + if (promptName == data.id) { + // 如果 promptName 计算出来是 data.id 就以'该记录'代称 + hintMsg = "确定删除该记录?"; + } let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/kilnWaitingRoom/components/ListViewWithHead.vue b/src/views/modules/pms/kilnWaitingRoom/components/ListViewWithHead.vue index 4b22b34..2e85a6a 100644 --- a/src/views/modules/pms/kilnWaitingRoom/components/ListViewWithHead.vue +++ b/src/views/modules/pms/kilnWaitingRoom/components/ListViewWithHead.vue @@ -229,9 +229,14 @@ export default { if (deleteConfig && "promptField" in deleteConfig) { promptName = data[deleteConfig.promptField]; } + let hintMsg = `确定要删除记录 "${promptName}" 吗?`; + if (promptName == data.id) { + // 如果 promptName 计算出来是 data.id 就以'该记录'代称 + hintMsg = "确定删除该记录?"; + } let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/material/components/ListViewWithHead.vue b/src/views/modules/pms/material/components/ListViewWithHead.vue index e44e036..881df41 100644 --- a/src/views/modules/pms/material/components/ListViewWithHead.vue +++ b/src/views/modules/pms/material/components/ListViewWithHead.vue @@ -272,9 +272,11 @@ export default { // payload: { type: string, data: string | number | object } switch (type) { case "delete": { + let hintMsg = "name" in data ? `确定要删除记录 "${data.name}" 吗?` : "确定删除该记录?"; + let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除 "${data.name}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/material/config.js b/src/views/modules/pms/material/config.js index bc52826..d129510 100644 --- a/src/views/modules/pms/material/config.js +++ b/src/views/modules/pms/material/config.js @@ -8,7 +8,7 @@ export default function () { { type: "index", label: "序号" }, { width: 90, prop: "code", label: "原料编码" }, { width: 240, prop: "description", label: "原料描述" }, - { width: 90, prop: "name", label: "原料名称" }, + { width: 90, prop: "name", label: "中文名称" }, { width: 120, prop: "maxSize", label: "原料最大尺寸", filter: val => val ?? '-' }, { width: 90, prop: "typeDictValue", label: "类型", filter: dictFilter("material_category") }, // subcomponent: {/** TODO: create a new component for this option */} }, { prop: "baseMaterialCode", label: "基础原料编码" }, @@ -175,7 +175,12 @@ export default function () { // }, ], [ - { input: true, label: "堆积密度(g/cm³)", prop: "density", elparams: { placeholder: "请输入堆积密度" } }, + { + input: true, label: "堆积密度(g/cm³)", + prop: "density", + rules: [{ type: "number", message: "请输入正确的数字类型", trigger: "blur", transform: (val) => Number(val) }], + elparams: { placeholder: "请输入堆积密度" } + }, { input: true, label: "加料下限", diff --git a/src/views/modules/pms/materialStorageDynamic/config.js b/src/views/modules/pms/materialStorageDynamic/config.js index 5b0eed8..82ff94e 100644 --- a/src/views/modules/pms/materialStorageDynamic/config.js +++ b/src/views/modules/pms/materialStorageDynamic/config.js @@ -25,12 +25,12 @@ export default function () { prop: "operations", name: "操作", fixed: "right", - width: 120, + width: 90, subcomponent: TableOperaionComponent, options: [ { name: "edit", label: "编辑", icon: "edit-outline" }, { name: "sync", label: "同步", icon: "refresh" }, - { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:materialStorage:delete" } + // { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:materialStorage:delete" } ], }, ]; diff --git a/src/views/modules/pms/order/components/ListSectionWithHead.vue b/src/views/modules/pms/order/components/ListSectionWithHead.vue index 275d84a..2b3e75d 100644 --- a/src/views/modules/pms/order/components/ListSectionWithHead.vue +++ b/src/views/modules/pms/order/components/ListSectionWithHead.vue @@ -313,9 +313,11 @@ export default { }); } case "delete": { + let hintMsg = "code" in data ? `确定要删除记录 "${data.code}" 吗?` : "确定删除该记录?"; + let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除 "${data.code ?? data.id}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/order/components/ListViewWithHead.vue b/src/views/modules/pms/order/components/ListViewWithHead.vue index 201efd6..2d26a6b 100644 --- a/src/views/modules/pms/order/components/ListViewWithHead.vue +++ b/src/views/modules/pms/order/components/ListViewWithHead.vue @@ -365,9 +365,11 @@ export default { // payload: { type: string, data: string | number | object } switch (type) { case "delete": { + let hintMsg = "name" in data ? `确定要删除记录 "${data.name}" 吗?` : "确定删除该记录?"; + let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除 "${data.name}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/order/components/tabs/carDetail.vue b/src/views/modules/pms/order/components/tabs/carDetail.vue index 4bd4097..27958e6 100644 --- a/src/views/modules/pms/order/components/tabs/carDetail.vue +++ b/src/views/modules/pms/order/components/tabs/carDetail.vue @@ -142,9 +142,14 @@ export default { if (deleteConfig && "promptField" in deleteConfig) { promptName = data[deleteConfig.promptField]; } + let hintMsg = `确定要删除记录 "${promptName}" 吗?`; + if (promptName == data.id) { + // 如果 promptName 计算出来是 data.id 就以'该记录'代称 + hintMsg = "确定删除该记录?"; + } let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning", diff --git a/src/views/modules/pms/palletizingLine/components/ListViewWithHead.vue b/src/views/modules/pms/palletizingLine/components/ListViewWithHead.vue index d0f0478..b6e548c 100644 --- a/src/views/modules/pms/palletizingLine/components/ListViewWithHead.vue +++ b/src/views/modules/pms/palletizingLine/components/ListViewWithHead.vue @@ -232,9 +232,14 @@ export default { if (deleteConfig && "promptField" in deleteConfig) { promptName = data[deleteConfig.promptField]; } + let hintMsg = `确定要删除记录 "${promptName}" 吗?`; + if (promptName == data.id) { + // 如果 promptName 计算出来是 data.id 就以'该记录'代称 + hintMsg = "确定删除该记录?"; + } let currenPageListLength = this.dataList.length; // 确认是否删除 - return this.$confirm(`确定要删除记录 "${promptName}" 吗?`, "提示", { + return this.$confirm(hintMsg, "提示", { confirmButtonText: "确认", cancelButtonText: "我再想想", type: "warning",