Merge pull request 'master' (#68) from master into test
Reviewed-on: http://git.feashow.cn/feashow/SmartOpsWeb/pulls/68
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div style="display: flex;justify-content: center">
|
||||
<span class="stateIcon" :style="{backgroundColor: filterDictClass(cacheStore.getDict(dictType), value)}"></span>
|
||||
<span>{{tag.label}}</span>
|
||||
<span>{{ tagConfig.label }}</span>
|
||||
<span> {{ filterDict(cacheStore.getDict(dictType), value) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -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()
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -85,7 +89,7 @@ const changeParams = (listClass) => {
|
||||
// background-color: green;
|
||||
// z-index: 99999;
|
||||
//}
|
||||
:deep(.el-tag){
|
||||
:deep(.el-tag) {
|
||||
position: relative;
|
||||
margin-top: 9px;
|
||||
margin-right: 7px;
|
||||
|
||||
@@ -6,7 +6,6 @@ import { time } from "echarts";
|
||||
import { defineExpose } from "vue";
|
||||
import { defineProps } from "vue";
|
||||
import { orderGetDetails } from "@/api/order/order.js"
|
||||
|
||||
//控制显示隐藏
|
||||
const dialogVisible = ref(false);
|
||||
|
||||
@@ -14,8 +13,8 @@ const props = defineProps({
|
||||
rowData: Object
|
||||
})
|
||||
let opsCallList = ref([]);
|
||||
// let mergedData = ref([]);
|
||||
|
||||
let orderData = ref([]);
|
||||
let orderContent = ref([]);
|
||||
const open = (row) => {
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
@@ -29,59 +28,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 +48,64 @@ const test = [
|
||||
},
|
||||
];
|
||||
|
||||
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
|
||||
// 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)
|
||||
})
|
||||
//工单时间线
|
||||
orderContent.value=[]
|
||||
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 => {
|
||||
orderContent.value.push(item)
|
||||
})
|
||||
|
||||
console.log(orderContent.value);
|
||||
|
||||
})
|
||||
}
|
||||
}, {
|
||||
immediate: true // 立即执行一次,以便在rowData初始值非空时也能触发
|
||||
});
|
||||
// getData()
|
||||
|
||||
|
||||
const test2 = [
|
||||
{
|
||||
|
||||
@@ -145,9 +153,9 @@ defineExpose({
|
||||
<el-aside width="200px" :style="{ position: 'static' }">
|
||||
<div class="aside-content">
|
||||
<el-timeline style="max-width: 600px">
|
||||
<el-timeline-item v-for="(activity, index) in test" :key="index" :icon="activity.icon"
|
||||
:type="activity.type" :color="activity.color" :size="activity.size"
|
||||
:hollow="activity.hollow" :timestamp="activity.timestamp">
|
||||
<el-timeline-item v-for="(activity, index) in orderContent" :key="index"
|
||||
:icon="activity.icon" :type="activity.type" :color="activity.color"
|
||||
:size="activity.size" :hollow="activity.hollow" :timestamp="activity.timestamp">
|
||||
<p style="font-size: 17px;"> {{ activity.content }}</p>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
@@ -207,6 +215,7 @@ defineExpose({
|
||||
<div>
|
||||
<span :style="{ color: '#a8abb2' }">{{ info.callIdNumber
|
||||
}}</span>
|
||||
<PointTag dictType="call_status" :value="info.callState" />
|
||||
<span :style="{
|
||||
color: info.callState === '通话中' ? '#6cc23a' : '#409eff'
|
||||
}">{{ info.callState }}</span>
|
||||
|
||||
@@ -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},
|
||||
]
|
||||
|
||||
@@ -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},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user