From b4f512d5114d778c5aeed6449241673a87019cbc Mon Sep 17 00:00:00 2001 From: lb Date: Wed, 15 Mar 2023 15:37:55 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=9F=BA=E6=9C=AC=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E6=B7=B7=E6=96=99=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../noTemplateComponents/operationComponent.js | 5 +++-- src/views/atomViews/ListViewWithHead.vue | 9 +++++++++ src/views/modules/pms/blenderBatch/config.js | 7 +++++-- src/views/modules/pms/blenderBatchDetails/config.js | 2 +- src/views/modules/pms/blenderBatchDetails/index.vue | 2 +- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/components/noTemplateComponents/operationComponent.js b/src/components/noTemplateComponents/operationComponent.js index 3132e72..c6a28b3 100644 --- a/src/components/noTemplateComponents/operationComponent.js +++ b/src/components/noTemplateComponents/operationComponent.js @@ -90,8 +90,9 @@ export default { // 检查可用状态 let shouldDisabled = false; if ("enable" in opt && typeof opt.enable === "function") { - shouldDisabled = opt.enable(this.injectData); + shouldDisabled = !opt.enable(this.injectData); } + console.log('should disabled', shouldDisabled) btns.push( h( "el-button", @@ -102,7 +103,7 @@ export default { title: opt.label ?? opt.name, disabled: shouldDisabled, }, - style: { color: opt.color || this.colors[opt.name] || "#0b58ff" }, + style: { color: !shouldDisabled && (opt.color || this.colors[opt.name] || "#0b58ff") }, on: { click: this.emit.bind(null, opt) }, }, opt.icon ? (opt.showText ? this.text[opt.name] ?? opt.label : "") : opt.label ?? this.text[opt.name] diff --git a/src/views/atomViews/ListViewWithHead.vue b/src/views/atomViews/ListViewWithHead.vue index 99308b6..db74a1f 100644 --- a/src/views/atomViews/ListViewWithHead.vue +++ b/src/views/atomViews/ListViewWithHead.vue @@ -257,6 +257,15 @@ export default { this.openDialog(data, true); break; } + case "view-blender-batch-details": { + this.$router.push({ + name: 'pms-blenderBatchDetails', + query: { + batchId: data + } + }) + break; + } case "status": { console.log("status", data); // TODO: 类似于这种字符串,可以统一集中到一个文件里 diff --git a/src/views/modules/pms/blenderBatch/config.js b/src/views/modules/pms/blenderBatch/config.js index 61f49dd..7d34a80 100644 --- a/src/views/modules/pms/blenderBatch/config.js +++ b/src/views/modules/pms/blenderBatch/config.js @@ -24,14 +24,17 @@ export default function () { // { prop: "remark", label: "备注" }, // { prop: 'version', label: '配方号' }, // { prop: 'status', label: '状态', subcomponent: StatusComponent }, // subcomponent - { prop: "description", label: "详情", subcomponent: TableTextComponent }, + { prop: "description", label: "详情", subcomponent: TableTextComponent, actionName: 'view-blender-batch-details' }, { prop: "operations", name: "操作", fixed: "right", width: 120, subcomponent: TableOperaionComponent, - options: [{ name: 'edit', enable: injectRow => { return 'task' in injectRow && injectRow.task === 'Manual' } }] // 只有 injectRow.task 为手动时,才允许编辑 + options: [ + { name: 'edit', enable: injectRow => { return 'task' in injectRow && injectRow.task === 'Manual' } }, + { name: 'delete', enable: injectRow => { return 'task' in injectRow && injectRow.task === 'Manual' } }, + ] // 只有 injectRow.task 为手动时,才允许编辑 }, ]; diff --git a/src/views/modules/pms/blenderBatchDetails/config.js b/src/views/modules/pms/blenderBatchDetails/config.js index b1494ef..71aa10b 100644 --- a/src/views/modules/pms/blenderBatchDetails/config.js +++ b/src/views/modules/pms/blenderBatchDetails/config.js @@ -76,7 +76,7 @@ export default function () { }, urls: { base: "/pms/blenderDetail", - page: "/pms/blenderDetail/page", + page: "/pms/blenderDetail/pageView", // pageIsPostApi: true, // 使用post接口来获取page数据,极少用,目前基本上只有工艺管理模块里在用 // subase: "/pms/equipmentTechParam", }, diff --git a/src/views/modules/pms/blenderBatchDetails/index.vue b/src/views/modules/pms/blenderBatchDetails/index.vue index f59e5e3..57e3d70 100644 --- a/src/views/modules/pms/blenderBatchDetails/index.vue +++ b/src/views/modules/pms/blenderBatchDetails/index.vue @@ -14,7 +14,7 @@ import initConfig from "./config"; import ListViewWithHead from "@/views/atomViews/ListViewWithHead.vue"; export default { - name: "BlenderBatchView", + name: "BlenderBatchDetailsView", components: { ListViewWithHead }, provide() { return {