From 16d9d6ebacfb92f61d75fa9c5e5bde012a5ca5dc Mon Sep 17 00:00:00 2001 From: KindSeven <2845382437@qq.com> Date: Mon, 16 Sep 2024 01:04:37 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E4=BC=A0=E5=8F=82=E5=88=97=E8=A1=A8=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task-management/components/WorkDialog.vue | 128 ++++++++++-------- .../historical-work-order/index.vue | 2 +- .../pending-work-order/index.vue | 2 +- 3 files changed, 74 insertions(+), 58 deletions(-) diff --git a/src/views/task-management/components/WorkDialog.vue b/src/views/task-management/components/WorkDialog.vue index 1d7059e..9584a3e 100644 --- a/src/views/task-management/components/WorkDialog.vue +++ b/src/views/task-management/components/WorkDialog.vue @@ -13,9 +13,13 @@ const dialogVisible = ref(false); const props = defineProps({ rowData: Object }) -let opsCallList = ref([]); -// let mergedData = ref([]); +const rowData=props.rowData +console.log(rowData); + +let opsCallList = ref([]); +let orderData = ref([]); +let orderContent = ref([]); const open = (row) => { dialogVisible.value = true; }; @@ -29,59 +33,10 @@ const getData = async () => { } -watch(() => props.rowData, (newRowData) => { - if (newRowData) { - // console.log(getData(newRowData)); - getData(newRowData).then((data) => { - const dataDetails = data.data.opsCallList - // console.log(dataDetails); - const theData=[{createTime:'',data:[]}] - - dataDetails.forEach(for1data => { - theData.forEach(for2data => { - if(for1data.createTime!==for2data.createTime){ - console.log(for2data); - for2data.createTime=for1data.createTime - // for2data.data.push(for1data) - theData.push({createTime:for1data.createTime,data:[]}) - }else{ - for2data.data.push(for1data) - return; - } - }) - }); - theData.pop() - // console.log(theData); - theData.forEach(item => { - opsCallList.value.push(item) - }) - console.log(opsCallList.value); - - - // dataDetails.forEach(item => { - // // console.log(item); - // opsCallList.value.push(item) - // }); - - // console.log(mergedData.value); - - }) - } -}, { - immediate: true // 立即执行一次,以便在rowData初始值非空时也能触发 -}); -// getData() -function omitCreateTime(item) { - const { createTime, ...rest } = item; - return rest; -} - - - -const test = [ +let content = [ { content: "待处理", - timestamp: "2022-07-20 20:00", + timestamp: "orderData.value", color: "#0bbd87", }, { @@ -98,6 +53,67 @@ const test = [ }, ]; +watch(() => props.rowData, (newRowData) => { + if (newRowData) { + // console.log(getData(newRowData)); + getData(newRowData).then((data) => { + orderData.value = data.data + //电话拨打记录 + const dataDetails = data.data.opsCallList + // console.log(dataDetails); + const theData = [{ createTime: '', data: [] }] + + dataDetails.forEach(for1data => { + theData.forEach(for2data => { + if (for1data.createTime !== for2data.createTime) { + // console.log(for2data); + for2data.createTime = for1data.createTime + // for2data.data.push(for1data) + theData.push({ createTime: for1data.createTime, data: [] }) + } else { + for2data.data.push(for1data) + return; + } + }) + }); + theData.pop() + // console.log(theData); + theData.forEach(item => { + opsCallList.value.push(item) + }) + //工单时间线 + console.log(orderData.value); + content.map((item, index) => { + if (index === 0) { + item.timestamp = orderData.value.operationTime || '--' + } else if (index === 1) { + item.timestamp = orderData.value.processedTime || '--' + + } else { + item.timestamp = orderData.value.completionTime || '--' + + } + + }) + content.forEach(item => { + // if (orderContent.value.length < 1) { + orderContent.value.push(item) + // }else{ + // orderContent.value.pop() + // } + + }) + + console.log(orderContent.value); + + }) + } +}, { + immediate: true // 立即执行一次,以便在rowData初始值非空时也能触发 +}); +// getData() + + const test2 = [ { @@ -145,9 +161,9 @@ defineExpose({
- +

{{ activity.content }}

diff --git a/src/views/task-management/historical-work-order/index.vue b/src/views/task-management/historical-work-order/index.vue index 55a0c0d..5f592b9 100644 --- a/src/views/task-management/historical-work-order/index.vue +++ b/src/views/task-management/historical-work-order/index.vue @@ -233,7 +233,7 @@ const tableConfig = reactive({ } ], api: '/order/list', - params: {state:"1",name:"已处理"}, + params: {orderState:"2"}, btns: [ // {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report}, ] diff --git a/src/views/task-management/pending-work-order/index.vue b/src/views/task-management/pending-work-order/index.vue index 549fc6c..4f559c0 100644 --- a/src/views/task-management/pending-work-order/index.vue +++ b/src/views/task-management/pending-work-order/index.vue @@ -233,7 +233,7 @@ const tableConfig = reactive({ } ], api: '/order/list', - params: {state:"0",name:"待处理"}, + params: {orderState:"0"}, btns: [ // {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report}, ] From 884285fdd218ae5655962864217f20a968e05ef8 Mon Sep 17 00:00:00 2001 From: KindSeven <2845382437@qq.com> Date: Mon, 16 Sep 2024 01:47:24 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat:=E5=AE=8C=E6=88=90=E4=BA=86=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E7=9A=84=E5=AE=9E=E6=97=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task-management/components/WorkDialog.vue | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/views/task-management/components/WorkDialog.vue b/src/views/task-management/components/WorkDialog.vue index 9584a3e..da95ee0 100644 --- a/src/views/task-management/components/WorkDialog.vue +++ b/src/views/task-management/components/WorkDialog.vue @@ -6,17 +6,12 @@ import { time } from "echarts"; import { defineExpose } from "vue"; import { defineProps } from "vue"; import { orderGetDetails } from "@/api/order/order.js" - //控制显示隐藏 const dialogVisible = ref(false); const props = defineProps({ rowData: Object }) -const rowData=props.rowData -console.log(rowData); - - let opsCallList = ref([]); let orderData = ref([]); let orderContent = ref([]); @@ -57,6 +52,7 @@ watch(() => props.rowData, (newRowData) => { if (newRowData) { // console.log(getData(newRowData)); getData(newRowData).then((data) => { + opsCallList.value=[] orderData.value = data.data //电话拨打记录 const dataDetails = data.data.opsCallList @@ -68,7 +64,7 @@ watch(() => props.rowData, (newRowData) => { if (for1data.createTime !== for2data.createTime) { // console.log(for2data); for2data.createTime = for1data.createTime - // for2data.data.push(for1data) + for2data.data.push(for1data) theData.push({ createTime: for1data.createTime, data: [] }) } else { for2data.data.push(for1data) @@ -82,6 +78,7 @@ watch(() => props.rowData, (newRowData) => { opsCallList.value.push(item) }) //工单时间线 + orderContent.value=[] console.log(orderData.value); content.map((item, index) => { if (index === 0) { @@ -95,13 +92,8 @@ watch(() => props.rowData, (newRowData) => { } }) - content.forEach(item => { - // if (orderContent.value.length < 1) { + content.forEach(item => { orderContent.value.push(item) - // }else{ - // orderContent.value.pop() - // } - }) console.log(orderContent.value); @@ -223,6 +215,7 @@ defineExpose({
{{ info.callIdNumber }} + {{ info.callState }} From 77c6f667530aa15cd556897e26d81b9f67b153d4 Mon Sep 17 00:00:00 2001 From: KindSeven <2845382437@qq.com> Date: Mon, 16 Sep 2024 01:51:42 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=86=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85=E7=9A=84=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/task-management/components/WorkDialog.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/task-management/components/WorkDialog.vue b/src/views/task-management/components/WorkDialog.vue index da95ee0..0ba141e 100644 --- a/src/views/task-management/components/WorkDialog.vue +++ b/src/views/task-management/components/WorkDialog.vue @@ -215,7 +215,7 @@ defineExpose({
{{ info.callIdNumber }} - + {{ info.callState }} From 8d55b3b97c26c39fe3b6f4b5c70b097e9fc2a57f Mon Sep 17 00:00:00 2001 From: odjbin <1042039504@qq.com> Date: Mon, 16 Sep 2024 02:39:46 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix=20:=20=E4=BF=AE=E5=A4=8DpointTag?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PointTag.vue | 60 ++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/src/components/PointTag.vue b/src/components/PointTag.vue index 5c873a4..2fddb21 100644 --- a/src/components/PointTag.vue +++ b/src/components/PointTag.vue @@ -1,7 +1,7 @@ @@ -21,37 +21,42 @@ const props = defineProps({ default: null } }); -const tag = reactive({ +const tagConfig = reactive({ listClass: "green", isType: true, label: "" }); -// const dictList = cacheStore.getDict(props.dictType); -// const dictFormat = () => { -// if(dictList===undefined) return; -// for (let i = 0; i < dictList.length; i++) { -// if(dictList[i].value=== props.value){ -// tag.label = dictList[i].label; -// tag.listClass=changeParams(dictList[i].listClass) -// tag.isType = dictList[i].isType; -// } -// } -// }; const filterDictClass = (data, value) => { - if(!data) return - - if(data instanceof Array) { - tag.value = data.find(item => item.value == value) + if (!data) return + if (data instanceof Array) { + tagConfig.value = data.find(item => item.value == value) + if (!tagConfig.value) { + return '#409EFF' + } else { + if (tagConfig.value?.isType) { + return changeParams(tagConfig.value.listClass) + } else { + return tagConfig.value.listClass + } + } } - return changeParams(tag.value.listClass) } const filterDict = (data, value) => { - if(!data) return - - if(data instanceof Array) { - tag.value = data.find(item => item.value == value) + if (!data || value == null) return + if (data instanceof Array) { + if (value == true || value == false) { + tagConfig.value = data.find(item => item.value == value.toString()) + } else if (typeof value === "object") { + if (value !== null) { + tagConfig.value = data.find(item => item.value == value[0]) + } else { + tagConfig.value = {} + } + } else { + tagConfig.value = data.find(item => item.value == value) + } } - return tag.value.label + return tagConfig.value?.label || '未知' } /** * 根据接口返回的listClass切换成对应的颜色 @@ -63,18 +68,17 @@ const changeParams = (listClass) => { case 'danger': return 'red' case 'success': - return '#67C23A' + return '#67C23A' case 'info': - return '#909399' + return '#909399' case 'primary': return '#409EFF' case 'warning': - return '#E6A23C' + return '#E6A23C' default: return listClass } } -// dictFormat()