From ae780b7675bd3735d5c20a85b654adfaf1ebdc77 Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 16 Mar 2023 17:11:24 +0800 Subject: [PATCH] =?UTF-8?q?update=20table=E6=A0=B7=E5=BC=8F=20-=20?= =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E8=87=B3=E5=85=A8=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 4 ++-- src/components/BaseListTable.vue | 10 ++++++++-- .../operationComponent.css | 16 ++++++++++++++++ .../noTemplateComponents/operationComponent.js | 18 ++++++++++++++---- src/views/modules/pms/blenderOrder/config.js | 6 +++--- 5 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 src/components/noTemplateComponents/operationComponent.css diff --git a/public/index.html b/public/index.html index 2bac74f..c743726 100644 --- a/public/index.html +++ b/public/index.html @@ -39,8 +39,8 @@ <% } %> diff --git a/src/components/BaseListTable.vue b/src/components/BaseListTable.vue index e651d7b..d9ed37a 100644 --- a/src/components/BaseListTable.vue +++ b/src/components/BaseListTable.vue @@ -9,7 +9,9 @@ padding: '8px 0', }" row-key="id" - > + :cell-style="{ padding: 0 }" + border + > @@ -125,4 +127,8 @@ export default { }; - + diff --git a/src/components/noTemplateComponents/operationComponent.css b/src/components/noTemplateComponents/operationComponent.css new file mode 100644 index 0000000..e521bc2 --- /dev/null +++ b/src/components/noTemplateComponents/operationComponent.css @@ -0,0 +1,16 @@ + + +.operate--btn { + position: relative; +} + + +.operate--btn:not(:last-child)::after { + position: absolute; + content: ""; + width: 1px; + background: #ccc; + right: -6px; + top: 15%; + height: 70%; +} \ No newline at end of file diff --git a/src/components/noTemplateComponents/operationComponent.js b/src/components/noTemplateComponents/operationComponent.js index c6a28b3..8d4814a 100644 --- a/src/components/noTemplateComponents/operationComponent.js +++ b/src/components/noTemplateComponents/operationComponent.js @@ -1,5 +1,7 @@ // import i18n from '@/i18n' +import './operationComponent.css' + export default { name: "TableOperations", props: { @@ -100,14 +102,18 @@ export default { props: { type: opt.type ?? "text", icon: opt.icon ? `el-icon-${opt.icon}` : "", - title: opt.label ?? opt.name, disabled: shouldDisabled, }, - style: { color: !shouldDisabled && (opt.color || this.colors[opt.name] || "#0b58ff") }, + domProps: { + title: opt.label ?? opt.name, + }, + style: { color: !shouldDisabled && (opt.color || this.colors[opt.name] || "#0b58ff"), padding: '5px 0' }, + class: ['operate--btn'], on: { click: this.emit.bind(null, opt) }, }, opt.icon ? (opt.showText ? this.text[opt.name] ?? opt.label : "") : opt.label ?? this.text[opt.name] ) + ); } } else { @@ -117,7 +123,11 @@ export default { "el-button", { props: { type: "text" }, - style: { color: this.colors[opt] || "#0b58ff" }, + domProps: { + title: opt.label ?? opt.name, + }, + style: { color: this.colors[opt] || "#0b58ff", padding: 0 }, + class: ['operate--btn'], on: { click: this.emit.bind(null, opt) }, }, this.text[opt] ?? opt @@ -125,6 +135,6 @@ export default { ); } } - return h("span", null, btns); + return h("div", null, btns); }, }; diff --git a/src/views/modules/pms/blenderOrder/config.js b/src/views/modules/pms/blenderOrder/config.js index 4e45fd1..8d73144 100644 --- a/src/views/modules/pms/blenderOrder/config.js +++ b/src/views/modules/pms/blenderOrder/config.js @@ -35,9 +35,9 @@ export default function () { width: 180, subcomponent: TableOperaionComponent, options: [ - { name: "edit", label: "编辑", emitFull: true }, - { name: "view-batch", label: "查看批次", color: "#ff8000", toRouter: 'pms-blenderBatch' }, // 路由跳转至 pms-blenderBatch - { name: "detach", label: "下发", color: "#099" }, + { name: "edit", label: "编辑", emitFull: true, icon: 'edit-outline' }, + { name: "view-batch", label: "查看批次", color: "#ff8000", toRouter: 'pms-blenderBatch', icon: 'document-copy' }, // 路由跳转至 pms-blenderBatch + { name: "detach", label: "下发", color: "#099", icon: 'bottom-right' }, ], // , url: '/pms/trans/pressDeli' }] // options: ["copy", "edit", { name: "delete", emitFull: true, permission: "pms:blenderStep:delete" }], },