From 766de83debeefe869e2c08b5d8bf13ed5d2eda19 Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 24 Mar 2023 14:48:11 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=B7=BB=E5=8A=A0=E5=B9=B6=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E7=8A=B6=E6=80=81=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StateSelect.vue | 90 +++++++++++++++++++ src/views/modules/pms/carHistory/config.js | 5 +- .../modules/pms/currentCarLocation/config.js | 5 +- .../modules/pms/detectionPlatform/config.js | 5 +- .../modules/pms/kilnWaitingRoom/config.js | 5 +- .../modules/pms/palletizingLine/config.js | 5 +- 6 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 src/components/StateSelect.vue diff --git a/src/components/StateSelect.vue b/src/components/StateSelect.vue new file mode 100644 index 0000000..2bb9e16 --- /dev/null +++ b/src/components/StateSelect.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/src/views/modules/pms/carHistory/config.js b/src/views/modules/pms/carHistory/config.js index fcd76e1..fa1dce6 100644 --- a/src/views/modules/pms/carHistory/config.js +++ b/src/views/modules/pms/carHistory/config.js @@ -1,5 +1,5 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; - +import StateSelect from '@/components/StateSelect.vue'; import request from "@/utils/request"; import { timeFilter } from '@/utils/filters' @@ -8,7 +8,8 @@ export default function () { { type: 'index', label: '序号' }, { prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "code", label: "窑车号" }, - { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent + { prop: "stateDictValue", label: "状态", subcomponent: StateSelect }, + // { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent { prop: "orderCode", label: "订单号" }, { prop: "posCode", label: "位置" }, { prop: "startTime", label: "开始时间", filter: timeFilter }, diff --git a/src/views/modules/pms/currentCarLocation/config.js b/src/views/modules/pms/currentCarLocation/config.js index 54e493f..5771217 100644 --- a/src/views/modules/pms/currentCarLocation/config.js +++ b/src/views/modules/pms/currentCarLocation/config.js @@ -2,12 +2,15 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationC import request from "@/utils/request"; import { timeFilter } from "@/utils/filters"; +import StateSelect from '@/components/StateSelect.vue'; + export default function () { const tableProps = [ { type: "index", label: "序号" }, { prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "code", label: "窑车号" }, - { prop: "stateDictValue", label: "状态", filter: (v) => (v !== null && v !== undefined ? ["没有数据", "正常", "判废", "过渡"][v] : "-") }, // subcomponent + { prop: "stateDictValue", label: "状态", subcomponent: StateSelect }, + // { prop: "stateDictValue", label: "状态", filter: (v) => (v !== null && v !== undefined ? ["没有数据", "正常", "判废", "过渡"][v] : "-") }, // subcomponent { prop: "orderCode", label: "订单号" }, { prop: "posCode", label: "位置" }, { prop: "startTime", label: "开始时间", filter: timeFilter }, diff --git a/src/views/modules/pms/detectionPlatform/config.js b/src/views/modules/pms/detectionPlatform/config.js index 41245d1..87525a5 100644 --- a/src/views/modules/pms/detectionPlatform/config.js +++ b/src/views/modules/pms/detectionPlatform/config.js @@ -1,5 +1,5 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; - +import StateSelect from '@/components/StateSelect.vue'; import request from "@/utils/request"; import { timeFilter } from '@/utils/filters' import { getDictDataList } from '@/utils' @@ -9,7 +9,8 @@ export default function () { { type: 'index', label: '序号' }, { prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "code", label: "窑车号" }, - { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent + { prop: "stateDictValue", label: "状态", subcomponent: StateSelect }, + // { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent { prop: "orderCode", label: "订单号" }, { prop: "posCode", label: "位置" }, { prop: "startTime", label: "开始时间", filter: timeFilter }, diff --git a/src/views/modules/pms/kilnWaitingRoom/config.js b/src/views/modules/pms/kilnWaitingRoom/config.js index 4e63eed..439dd47 100644 --- a/src/views/modules/pms/kilnWaitingRoom/config.js +++ b/src/views/modules/pms/kilnWaitingRoom/config.js @@ -1,5 +1,5 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; - +import StateSelect from '@/components/StateSelect.vue'; import request from "@/utils/request"; import { timeFilter } from '@/utils/filters' import { getDictDataList } from '@/utils' @@ -9,7 +9,8 @@ export default function () { { type: 'index', label: '序号' }, { prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "code", label: "窑车号" }, - { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent + { prop: "stateDictValue", label: "状态", subcomponent: StateSelect }, + // { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent { prop: "orderCode", label: "订单号" }, { prop: "posCode", label: "位置" }, { prop: "startTime", label: "开始时间", filter: timeFilter }, diff --git a/src/views/modules/pms/palletizingLine/config.js b/src/views/modules/pms/palletizingLine/config.js index 7dd21cf..00754fa 100644 --- a/src/views/modules/pms/palletizingLine/config.js +++ b/src/views/modules/pms/palletizingLine/config.js @@ -1,5 +1,5 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; - +import StateSelect from '@/components/StateSelect.vue'; import request from "@/utils/request"; import { timeFilter } from '@/utils/filters' import { getDictDataList } from '@/utils' @@ -9,7 +9,8 @@ export default function () { { type: 'index', label: '序号' }, { prop: "createTime", label: "添加时间", filter: timeFilter }, { prop: "code", label: "窑车号" }, - { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent + { prop: "stateDictValue", label: "状态", subcomponent: StateSelect }, + // { prop: "stateDictValue", label: "状态", filter: v => (v !== null && v !== undefined) ? ['没有数据', '正常', '判废', '过渡'][v] : '-' }, // subcomponent { prop: "orderCode", label: "订单号" }, { prop: "posCode", label: "位置" }, { prop: "startTime", label: "开始时间", filter: timeFilter },