Compare commits
1 Commits
wxy
...
clay-patch
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31e0349443 |
@@ -12,5 +12,5 @@ docker rmi smartopsweb:latest
|
|||||||
echo '----build image start----'
|
echo '----build image start----'
|
||||||
docker build -t smartopsweb:latest .
|
docker build -t smartopsweb:latest .
|
||||||
echo '----build image success----'
|
echo '----build image success----'
|
||||||
docker run --name smartopsweb -d -p 8080:80 smartopsweb:latest
|
docker run --name smartopsweb --restart=always -d -p 8080:80 smartopsweb:latest
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import request from "@/utils/request.js";
|
import request from "@/utils/request.js";
|
||||||
import { method } from "lodash";
|
|
||||||
|
|
||||||
export const modifyUser=(data)=>{
|
export const modifyUser=(data)=>{
|
||||||
return request({
|
return request({
|
||||||
@@ -10,16 +9,8 @@ export const modifyUser=(data)=>{
|
|||||||
}
|
}
|
||||||
export const editPassword=(data)=>{
|
export const editPassword=(data)=>{
|
||||||
return request({
|
return request({
|
||||||
url:'/ops/user/update/password',
|
url:'/admin/mosr/user/update/password',
|
||||||
method:'post',
|
method:'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询用户详细
|
|
||||||
export const detailsUser=()=>{
|
|
||||||
return request({
|
|
||||||
url:'ops/user/detail/info',
|
|
||||||
method:'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
import request from '@/utils/request.js'
|
|
||||||
|
|
||||||
// 获取参数配置表详情
|
|
||||||
export const getConfigDetails = (configId,extraConfigType) => {
|
|
||||||
return request({
|
|
||||||
url: `/extra/config/${configId}/${extraConfigType}`,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增参数配置表
|
|
||||||
export const addConfig = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/extra/config',
|
|
||||||
method: 'post',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改参数配置表
|
|
||||||
export const editConfig = (data) => {
|
|
||||||
return request({
|
|
||||||
url: '/extra/config',
|
|
||||||
method: 'put',
|
|
||||||
data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除参数配置表
|
|
||||||
export const delConfig =(configIdList,extraConfigType) => {
|
|
||||||
return request({
|
|
||||||
url: `/extra/config/${configIdList}/${extraConfigType}`,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import request from '@/utils/request.js'
|
|
||||||
import { method } from 'lodash'
|
|
||||||
|
|
||||||
//获取历史通话文本记录
|
|
||||||
|
|
||||||
export const getHistoryCallContent=(params)=>{
|
|
||||||
return request({
|
|
||||||
url:`/text/history/list/${params}`,
|
|
||||||
method:'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,87 +1,30 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import LiveCallItem from '@/components/liveCall/LiveCallItem.vue'
|
import LiveCall from '@/components/liveCall/index.vue'
|
||||||
import {getHistoryCallContent} from '@/api/workbench';
|
|
||||||
|
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
const recordLeftRef = ref(null);
|
|
||||||
const props = defineProps({
|
|
||||||
rowData: String
|
|
||||||
})
|
|
||||||
|
|
||||||
const open = (row) => {
|
const open = (row) => {
|
||||||
dialogVisible.value = true;
|
dialogVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const leftHeadData = ref({
|
|
||||||
username: '张三',
|
|
||||||
phone: '13546812315',
|
|
||||||
orderName: '张三工单',
|
|
||||||
})
|
|
||||||
|
|
||||||
const recordLeftObj = ref({
|
|
||||||
content: []
|
|
||||||
});
|
|
||||||
const convertArrayToMap=(array)=> {
|
|
||||||
const map = new Map();
|
|
||||||
array.forEach(item => {
|
|
||||||
// 如果时间戳对应的键已经存在,则添加到现有数组中
|
|
||||||
if (map.has(item.conversationTimestamp)) {
|
|
||||||
map.get(item.conversationTimestamp).push(item);
|
|
||||||
} else {
|
|
||||||
// 否则,创建一个新的数组并添加元素
|
|
||||||
map.set(item.conversationTimestamp, [item]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
watch(() => props.rowData, async (newVal) => {
|
|
||||||
recordLeftObj.value.content = []
|
|
||||||
// let map1 = new Map()
|
|
||||||
await getHistoryCallContent(newVal).then(res => {
|
|
||||||
res.data?.forEach(item => {
|
|
||||||
item.textVoList = convertArrayToMap(item.textVoList);
|
|
||||||
})
|
|
||||||
recordLeftObj.value = res.data
|
|
||||||
// console.info("🚀 ~method:res.data -----", res.data)
|
|
||||||
if (res.data && res.data.length > 0) {
|
|
||||||
leftHeadData.value.username = res.data[0].callIdNumber || '--';
|
|
||||||
leftHeadData.value.phone = res.data[0].callPhone || '--';
|
|
||||||
leftHeadData.value.orderName = res.data[0].orderName || '--';
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
const scrollToBottom = (scrollbarRef) => {
|
|
||||||
if (scrollbarRef) {
|
|
||||||
const container = scrollbarRef.$el.querySelector('.el-scrollbar__wrap');
|
|
||||||
container.style.scrollBehavior = 'smooth'; // 添加平滑滚动效果
|
|
||||||
container.scrollTop = container.scrollHeight;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
scrollToBottom(recordLeftRef.value)
|
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="dialogVisible" title="历史通话记录" width="600" class="box">
|
<el-dialog v-model="dialogVisible" title="历史通话记录" width="1000" :before-close="handleClose" class="box">
|
||||||
<LiveCallItem ref="recordLeftRef" :recordArray="recordLeftObj" :headData="leftHeadData" style="width: 100%;"/>
|
<LiveCall />
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button type="primary" @click="dialogVisible = false">
|
<el-button type="primary" @click="dialogVisible = false">
|
||||||
关闭
|
关闭
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.box {
|
.box{
|
||||||
height: 68vh;
|
height: 68vh;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -3,35 +3,30 @@
|
|||||||
<div class="header">
|
<div class="header">
|
||||||
<div>
|
<div>
|
||||||
<span style="margin-right: 20px">{{ headData.username }}</span>
|
<span style="margin-right: 20px">{{ headData.username }}</span>
|
||||||
<span>电话号码:{{ headData.phone }}</span>
|
<span>{{ headData.phone }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div><span>工单名称:{{ headData.orderName }}</span></div>
|
<div><span>工单名称:{{ headData.orderName }}</span></div>
|
||||||
</div>
|
</div>
|
||||||
<el-scrollbar ref="scrollbarRef" class="scrollbar">
|
<el-scrollbar ref="scrollbarRef" class="scrollbar">
|
||||||
<div class="chat-content" ref="innerRef">
|
<div class="chat-content" ref="innerRef">
|
||||||
<div v-for="(item,index) in recordArray" :key="index">
|
<div v-for="(item,index) in recordObj.content" :key="index">
|
||||||
<div v-for="[key,value] of item.textVoList">
|
<div class="time-grap"><span>{{ item.conversationTimestamp || '6月5日 12:05' }}</span></div>
|
||||||
<div class="time-grap"><span>{{ key || '6月5日 12:05' }}</span></div>
|
<!-- 我的 -->
|
||||||
<div v-for="(recordItem) in value">
|
<div v-if="item.speaker==0" class="word-my">
|
||||||
<!-- 我的 -->
|
<div class="info">
|
||||||
<div v-if="recordItem.speaker==0" class="word-my">
|
<p class="name">{{ item.speaker==0?headData.username:'AI助手' }} </p>
|
||||||
<div class="info">
|
<div class="info-content">{{ item.message }}</div>
|
||||||
<p class="name">{{ recordItem.speaker == 0 ? recordItem.callIdNumber : 'AI助手' }} </p>
|
</div>
|
||||||
<div class="info-content">{{ recordItem.message }}</div>
|
<el-avatar text="我"/>
|
||||||
</div>
|
</div>
|
||||||
<el-avatar text="我"/>
|
<!-- 对方 -->
|
||||||
</div>
|
<div v-else class="word">
|
||||||
<!-- 对方 -->
|
<el-avatar text="对方"/>
|
||||||
<div v-else class="word">
|
<div class="info">
|
||||||
<el-avatar text="对方"/>
|
<p class="name">{{ item.speaker==0?headData.username:'AI助手' }} </p>
|
||||||
<div class="info">
|
<div class="info-content">{{ item.message }}</div>
|
||||||
<p class="name">{{ recordItem.speaker == 0 ? recordItem.callIdNumber : 'AI助手' }} </p>
|
|
||||||
<div class="info-content">{{ recordItem.message }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-divider border-style="dotted" v-if="item">一轮通话结束~~</el-divider>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
@@ -40,20 +35,19 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {defineProps} from "vue";
|
import {defineProps} from "vue";
|
||||||
|
const scrollbarRef=ref()
|
||||||
const scrollbarRef = ref()
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
recordArray: {
|
recordObj: {
|
||||||
type: Array,
|
type: Object,
|
||||||
default: []
|
default: {}
|
||||||
},
|
},
|
||||||
headData: {
|
headData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {}
|
default: {}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
const getScrollbarRef = () => {
|
const getScrollbarRef=()=>{
|
||||||
return scrollbarRef.value
|
return scrollbarRef.value
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
getScrollbarRef
|
getScrollbarRef
|
||||||
|
|||||||
@@ -1,201 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="live-call">
|
|
||||||
<div class="header">
|
|
||||||
<div>
|
|
||||||
<span style="margin-right: 20px">{{ headData.username }}</span>
|
|
||||||
<span>{{ headData.phone }}</span>
|
|
||||||
</div>
|
|
||||||
<div><span>工单名称:{{ headData.orderName }}</span></div>
|
|
||||||
</div>
|
|
||||||
<el-scrollbar ref="scrollbarRef" class="scrollbar">
|
|
||||||
<div class="chat-content" ref="innerRef">
|
|
||||||
<div v-for="(item,index) in recordObj.content" :key="index">
|
|
||||||
<div class="time-grap"><span>{{ item.conversationTimestamp || '6月5日 12:05' }}</span></div>
|
|
||||||
<!-- 我的 -->
|
|
||||||
<div v-if="item.speaker==0" class="word-my">
|
|
||||||
<div class="info">
|
|
||||||
<p class="name">{{ item.speaker==0?headData.username:'AI助手' }} </p>
|
|
||||||
<div class="info-content">{{ item.message }}</div>
|
|
||||||
</div>
|
|
||||||
<el-avatar text="我"/>
|
|
||||||
</div>
|
|
||||||
<!-- 对方 -->
|
|
||||||
<div v-else class="word">
|
|
||||||
<el-avatar text="对方"/>
|
|
||||||
<div class="info">
|
|
||||||
<p class="name">{{ item.speaker==0?headData.username:'AI助手' }} </p>
|
|
||||||
<div class="info-content">{{ item.message }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-scrollbar>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import {defineProps} from "vue";
|
|
||||||
const scrollbarRef=ref()
|
|
||||||
const props = defineProps({
|
|
||||||
recordObj: {
|
|
||||||
type: Object,
|
|
||||||
default: {}
|
|
||||||
},
|
|
||||||
headData: {
|
|
||||||
type: Object,
|
|
||||||
default: {}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
const getScrollbarRef=()=>{
|
|
||||||
return scrollbarRef.value
|
|
||||||
}
|
|
||||||
defineExpose({
|
|
||||||
getScrollbarRef
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.live-call {
|
|
||||||
width: 48%;
|
|
||||||
height: 47vh;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
overflow: hidden;
|
|
||||||
border: 1px solid #d5d4d4;
|
|
||||||
border-radius: 10px;
|
|
||||||
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
align-items: center;
|
|
||||||
height: 40px;
|
|
||||||
border-bottom: 1px solid #d5d4d4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.scrollbar {
|
|
||||||
padding: 10px 10px 0 10px;
|
|
||||||
height: 42vh;
|
|
||||||
|
|
||||||
.el-scrollbar__wrap {
|
|
||||||
height: 100%;
|
|
||||||
overflow: scroll;
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 聊天内容样式
|
|
||||||
.chat-content {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.time-grap {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
> span {
|
|
||||||
font-size: 13px;
|
|
||||||
padding: 5px 10px;
|
|
||||||
border: 1px solid #d7d9da;
|
|
||||||
border-radius: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.word {
|
|
||||||
display: flex;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
margin-left: 10px;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
font-size: 12px;
|
|
||||||
color: rgba(51, 51, 51, 0.8);
|
|
||||||
margin: 0;
|
|
||||||
height: 20px;
|
|
||||||
line-height: 20px;
|
|
||||||
margin-top: -5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-content {
|
|
||||||
padding: 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
background: #f5f5f5;
|
|
||||||
position: relative;
|
|
||||||
margin-top: 8px;
|
|
||||||
border: 1px solid #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
//小三角形
|
|
||||||
.info-content::before {
|
|
||||||
position: absolute;
|
|
||||||
left: -8px;
|
|
||||||
top: 8px;
|
|
||||||
content: '';
|
|
||||||
border-right: 10px solid #f5f5f5;
|
|
||||||
border-top: 8px solid transparent;
|
|
||||||
border-bottom: 8px solid transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.word-my {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
width: 90%;
|
|
||||||
margin-left: 10px;
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
font-size: 12px;
|
|
||||||
color: rgba(51, 51, 51, 0.8);
|
|
||||||
height: 20px;
|
|
||||||
line-height: 20px;
|
|
||||||
margin-top: -5px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-content {
|
|
||||||
max-width: 70%;
|
|
||||||
padding: 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
float: right;
|
|
||||||
margin-right: 10px;
|
|
||||||
position: relative;
|
|
||||||
margin-top: 8px;
|
|
||||||
background: #A3C3F6;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
//小三角形
|
|
||||||
.info-content::after {
|
|
||||||
position: absolute;
|
|
||||||
right: -8px;
|
|
||||||
top: 8px;
|
|
||||||
content: '';
|
|
||||||
border-left: 10px solid #A3C3F6;
|
|
||||||
border-top: 8px solid transparent;
|
|
||||||
border-bottom: 8px solid transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,33 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<!--测试 张三 : 17260625724565 李四: 17260625724123-->
|
<!--测试 张三 : 17260625724565 李四: 17260625724123-->
|
||||||
<div class="live-call-block">
|
<div class="live-call-block">
|
||||||
<live-call-item-home ref="recordLeftRef" :recordObj="recordLeftObj" :headData="leftHeadData"/>
|
<live-call-item ref="recordLeftRef" :recordObj="recordLeftObj" :headData="leftHeadData" />
|
||||||
<live-call-item-home ref="recordRightRef" :recordObj="recordRightObj" :headData="rightHeadData"/>
|
<live-call-item ref="recordRightRef" :recordObj="recordRightObj" :headData="rightHeadData" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {useAuthStore} from '@/stores/userstore.js'
|
|
||||||
import {getToken} from '@/utils/auth'
|
import {getToken} from '@/utils/auth'
|
||||||
import {usePermisstionStroe} from '@/stores/permisstion'
|
|
||||||
|
|
||||||
const permisstionStore = usePermisstionStroe()
|
|
||||||
const authStore = useAuthStore()
|
|
||||||
//聊天消息滚动面板dom
|
//聊天消息滚动面板dom
|
||||||
const recordLeftRef = ref(null);
|
const recordLeftRef = ref(null);
|
||||||
const recordRightRef = ref(null);
|
const recordRightRef = ref(null);
|
||||||
const leftHeadData = ref({
|
const leftHeadData=ref({
|
||||||
username: '张三',
|
username:'张三',
|
||||||
phone: '13546812315',
|
phone:'13546812315',
|
||||||
orderName: '张三工单',
|
orderName:'张三工单',
|
||||||
})
|
})
|
||||||
const rightHeadData = ref({
|
const rightHeadData=ref({
|
||||||
username: '李四',
|
username:'李四',
|
||||||
phone: '18246812546',
|
phone:'18246812546',
|
||||||
orderName: '李四工单',
|
orderName:'李四工单',
|
||||||
})
|
})
|
||||||
const recordLeftObj = ref({
|
const recordLeftObj = ref({
|
||||||
content: []
|
content:[]
|
||||||
}
|
}
|
||||||
// {
|
// {
|
||||||
// "callIdNumber": "17260625724565",
|
// "callIdNumber": "17260625724565",
|
||||||
@@ -55,7 +50,7 @@ const recordLeftObj = ref({
|
|||||||
// }
|
// }
|
||||||
)
|
)
|
||||||
const recordRightObj = ref({
|
const recordRightObj = ref({
|
||||||
content: []
|
content:[]
|
||||||
}
|
}
|
||||||
// {
|
// {
|
||||||
// "callIdNumber": "17260625724123",
|
// "callIdNumber": "17260625724123",
|
||||||
@@ -100,16 +95,10 @@ const scrollToBottom = (scrollbarRef) => {
|
|||||||
const setWsUrl = (url) => {
|
const setWsUrl = (url) => {
|
||||||
return (window.location.protocol === 'http:' ? "ws://" : "wss://") + window.location.host + import.meta.env.VITE_BASE_WSURL + url;
|
return (window.location.protocol === 'http:' ? "ws://" : "wss://") + window.location.host + import.meta.env.VITE_BASE_WSURL + url;
|
||||||
}
|
}
|
||||||
const handleLogout = () => {
|
|
||||||
authStore.userLogout()
|
|
||||||
permisstionStore.removeMenu()
|
|
||||||
router.push('/login')
|
|
||||||
}
|
|
||||||
const initWebSocket = () => {
|
const initWebSocket = () => {
|
||||||
try {
|
try {
|
||||||
// const wsUrl=setWsUrl(`/ws/text/${token}`)
|
// const wsUrl=setWsUrl(`/ws/text/${token}`)
|
||||||
// const wsUrl = `ws://frp.feashow.cn:31800/ws/text/${token}`
|
const wsUrl = `ws://frp.feashow.cn:31800/ws/text/${token}`
|
||||||
const wsUrl = `ws://112.19.165.99:20002/api/ws/text/${token}`
|
|
||||||
socket = new WebSocket(wsUrl)
|
socket = new WebSocket(wsUrl)
|
||||||
// 2. ws.send()给服务器发送信息
|
// 2. ws.send()给服务器发送信息
|
||||||
//连接发生错误的回调方法
|
//连接发生错误的回调方法
|
||||||
@@ -130,37 +119,31 @@ const initWebSocket = () => {
|
|||||||
socket.onmessage = function (event) {
|
socket.onmessage = function (event) {
|
||||||
let data = JSON.parse(event.data)
|
let data = JSON.parse(event.data)
|
||||||
if (data.type !== 'pong') {
|
if (data.type !== 'pong') {
|
||||||
if (data.type === 'error') {
|
|
||||||
handleLogout()
|
|
||||||
return;
|
|
||||||
} else if (data.type === 'failed') {
|
|
||||||
initWebSocket()
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log("服务器返回的信息: ", data);
|
console.log("服务器返回的信息: ", data);
|
||||||
if (data.type == '1') {
|
if(data.type=='1'){
|
||||||
recordLeftObj.value.content.push(data.content)
|
recordLeftObj.value.content.push(data.content)
|
||||||
// console.info("🚀 ~method:onmessage -----", recordLeftObj.value)
|
console.info("🚀 ~method:onmessage -----", recordLeftObj.value)
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
scrollToBottom(recordLeftRef.value)
|
scrollToBottom(recordLeftRef.value)
|
||||||
})
|
})
|
||||||
} else {
|
}else {
|
||||||
recordRightObj.value.content.push(data.content)
|
recordRightObj.value.content.push(data.content)
|
||||||
// console.info("🚀 ~method:onmessage -----", recordRightObj.value)
|
console.info("🚀 ~method:onmessage -----", recordRightObj.value)
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
scrollToBottom(recordRightRef.value);
|
scrollToBottom(recordRightRef.value);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//连接关闭的回调方法
|
//连接关闭的回调方法
|
||||||
socket.onclose = function () {
|
socket.onclose = function () {
|
||||||
// initWebSocket()
|
initWebSocket()
|
||||||
console.log("ws连接关闭");
|
console.log("ws连接关闭");
|
||||||
}
|
}
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
socket.send(JSON.stringify(send))
|
socket.send(JSON.stringify(send))
|
||||||
}, 5000)
|
}, 10000)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
console.log("ws连接失败");
|
console.log("ws连接失败");
|
||||||
|
|||||||
@@ -3,23 +3,15 @@ const dialogVisible = ref(false);
|
|||||||
const open = (row) => {
|
const open = (row) => {
|
||||||
dialogVisible.value = true;
|
dialogVisible.value = true;
|
||||||
};
|
};
|
||||||
// console.log(dialogVisible.value);
|
|
||||||
defineProps({
|
|
||||||
title:String,
|
|
||||||
rowUrl:String
|
|
||||||
})
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// console.log(props.rowUrl);
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-dialog v-model="dialogVisible" :title="title" width="500" >
|
<el-dialog v-model="dialogVisible" title="语音详情" width="500" :before-close="handleClose">
|
||||||
<audio :src=rowUrl controls style="width: 100%;"></audio>
|
<audio src="" controls style="width: 100%;"></audio>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
|
|
||||||
|
|||||||
@@ -20,11 +20,10 @@
|
|||||||
<User />
|
<User />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<strong>工号 :</strong>
|
<strong>工号 :</strong>
|
||||||
<!-- <p>{{ userInfo.orderNum }}</p> -->
|
|
||||||
<div class="box-info">{{ userParams.userNumber||'--' }}</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div>{{ userParams.userNumber }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="userInfo_item">
|
<div class="userInfo_item">
|
||||||
<div style="display: flex;align-items: center" class="userInfo_label">
|
<div style="display: flex;align-items: center" class="userInfo_label">
|
||||||
@@ -32,18 +31,18 @@
|
|||||||
<Notification />
|
<Notification />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<strong>邮箱 :</strong>
|
<strong>邮箱 :</strong>
|
||||||
<div class="box-info">{{ userParams.email||'--' }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div>{{ userParams.email }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="userInfo_item">
|
<div class="userInfo_item">
|
||||||
<div style="display: flex;align-items: center" class="userInfo_label">
|
<div style="display: flex;align-items: center" class="userInfo_label">
|
||||||
<el-icon size="18" style="margin-right: 5px">
|
<el-icon size="18" style="margin-right: 5px">
|
||||||
<Notification />
|
<Notification />
|
||||||
</el-icon><strong>登录账号 :</strong>
|
</el-icon><strong>登录账号 :</strong>
|
||||||
<div class="box-info">{{ userParams.loginAccount||'--' }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div>{{ userParams.loginAccount }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="userInfo_item">
|
<div class="userInfo_item">
|
||||||
<div style="display: flex;align-items: center" class="userInfo_label">
|
<div style="display: flex;align-items: center" class="userInfo_label">
|
||||||
@@ -51,9 +50,9 @@
|
|||||||
<Folder />
|
<Folder />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<strong>用户名称 :</strong>
|
<strong>用户名称 :</strong>
|
||||||
<div class="box-info">{{ userParams.userName||'--' }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div>{{ userParams.userName }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="userInfo_item">
|
<div class="userInfo_item">
|
||||||
<div style="display: flex;align-items: center" class="userInfo_label">
|
<div style="display: flex;align-items: center" class="userInfo_label">
|
||||||
@@ -61,9 +60,9 @@
|
|||||||
<Folder />
|
<Folder />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<strong>手机号码 :</strong>
|
<strong>手机号码 :</strong>
|
||||||
<div class="box-info">{{ userParams.phoneNumber||'--' }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div>{{ userParams.userPhone }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="userInfo_item">
|
<div class="userInfo_item">
|
||||||
<div style="display: flex;align-items: center" class="userInfo_label">
|
<div style="display: flex;align-items: center" class="userInfo_label">
|
||||||
@@ -71,9 +70,9 @@
|
|||||||
<Folder />
|
<Folder />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<strong>账号类型 :</strong>
|
<strong>账号类型 :</strong>
|
||||||
<div class="box-info">{{ userParams.remark||'--' }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div>{{ userParams.accountType }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -123,8 +122,7 @@ import { ElNotification } from 'element-plus'
|
|||||||
import { useTagsView } from '@/stores/tagsview.js'
|
import { useTagsView } from '@/stores/tagsview.js'
|
||||||
import { editPassword } from "@/api/auth/auth";
|
import { editPassword } from "@/api/auth/auth";
|
||||||
import { Lock } from '@element-plus/icons-vue'
|
import { Lock } from '@element-plus/icons-vue'
|
||||||
import { onMounted, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { detailsUser } from '@/api/auth/auth';
|
|
||||||
|
|
||||||
const infoWidth = ref(22)
|
const infoWidth = ref(22)
|
||||||
const isShowDiv = ref(true)
|
const isShowDiv = ref(true)
|
||||||
@@ -140,18 +138,6 @@ const userPassword = ref({
|
|||||||
});
|
});
|
||||||
const tagsViewStore = useTagsView()
|
const tagsViewStore = useTagsView()
|
||||||
|
|
||||||
const getUserInfo= async ()=>{
|
|
||||||
const res= await detailsUser()
|
|
||||||
userParams.value=res.data.user
|
|
||||||
console.log(userParams.value);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
getUserInfo()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const validatePasswordComplexity = (rule, value, callback) => {
|
const validatePasswordComplexity = (rule, value, callback) => {
|
||||||
const reg = /^(?=.*[a-zA-Z])(?=.*\d).{1,9}$/; //密码必须是至少包含字母、数字,1-9位
|
const reg = /^(?=.*[a-zA-Z])(?=.*\d).{1,9}$/; //密码必须是至少包含字母、数字,1-9位
|
||||||
if (!reg.test(value)) {
|
if (!reg.test(value)) {
|
||||||
@@ -205,19 +191,7 @@ const belongToRole = (roles) => {
|
|||||||
|
|
||||||
// 修改密码
|
// 修改密码
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
// console.log(userPassword.value);
|
ElMessageBox.confirm(
|
||||||
await passwordRef.value.validate()
|
|
||||||
editPassword({
|
|
||||||
...userPassword.value
|
|
||||||
}).then(res => {
|
|
||||||
ElNotification({
|
|
||||||
title: '提示',
|
|
||||||
message: res.msg,
|
|
||||||
type: res.code === 1000 ? 'success' : 'error'
|
|
||||||
})
|
|
||||||
if (res.code === 1000) {
|
|
||||||
passwordRef.value.resetFields()
|
|
||||||
ElMessageBox.confirm(
|
|
||||||
'提交成功',
|
'提交成功',
|
||||||
{
|
{
|
||||||
confirmButtonText: '关闭',
|
confirmButtonText: '关闭',
|
||||||
@@ -235,6 +209,16 @@ const handleSubmit = async () => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
editPassword({
|
||||||
|
...userPassword.value
|
||||||
|
}).then(res => {
|
||||||
|
ElNotification({
|
||||||
|
title: '提示',
|
||||||
|
message: res.msg,
|
||||||
|
type: res.code === 1000 ? 'success' : 'error'
|
||||||
|
})
|
||||||
|
if (res.code === 1000) {
|
||||||
|
passwordRef.value.resetFields()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -337,12 +321,6 @@ div {
|
|||||||
border-bottom-style: solid;
|
border-bottom-style: solid;
|
||||||
border-color: #daddd2;
|
border-color: #daddd2;
|
||||||
border-width: 2px;
|
border-width: 2px;
|
||||||
|
|
||||||
.box-info{
|
|
||||||
// background-color: red;
|
|
||||||
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -4,11 +4,10 @@
|
|||||||
<div class="real-time-call">
|
<div class="real-time-call">
|
||||||
<LiveCall />
|
<LiveCall />
|
||||||
</div>
|
</div>
|
||||||
<div class="call-history">
|
<div class="call-history"><h3 >历史通话记录</h3>
|
||||||
<h3>历史通话记录</h3>
|
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
|
||||||
<fvTable ref="tableIns" :tableConfig="tableConfig"></fvTable>
|
<voice ref="voiceRef" />
|
||||||
<voice ref="voiceRef" title="语音详情" :rowUrl="rowUrl" />
|
<infoLiveCall ref="infoLiveCallRef"/>
|
||||||
<infoLiveCall ref="infoLiveCallRef" :rowData="rowData" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -17,11 +16,22 @@
|
|||||||
import LiveCall from '@/components/liveCall/index.vue'
|
import LiveCall from '@/components/liveCall/index.vue'
|
||||||
import Voice from '@/components/voice/index.vue'
|
import Voice from '@/components/voice/index.vue'
|
||||||
import InfoLiveCall from '@/components/infoLiveCall/index.vue'
|
import InfoLiveCall from '@/components/infoLiveCall/index.vue'
|
||||||
const rowData = ref()
|
const infoLiveCallRef=ref()
|
||||||
const rowUrl = ref()
|
const voiceRef=ref()
|
||||||
const infoLiveCallRef = ref()
|
|
||||||
const voiceRef = ref()
|
|
||||||
const tableIns = ref()
|
const tableIns = ref()
|
||||||
|
const mockData = ref([
|
||||||
|
{
|
||||||
|
workOrderNumber: 1211,
|
||||||
|
workOrderTime: '2022-02-09 00 : 12',
|
||||||
|
state: 0,
|
||||||
|
callState: '01'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
workOrderNumber: 232,
|
||||||
|
state: 1,
|
||||||
|
callState: '02'
|
||||||
|
}
|
||||||
|
])
|
||||||
const auths = reactive({
|
const auths = reactive({
|
||||||
report: ['mosr:collect:reported'],
|
report: ['mosr:collect:reported'],
|
||||||
})
|
})
|
||||||
@@ -30,32 +40,27 @@ const tableConfig = reactive({
|
|||||||
{
|
{
|
||||||
prop: 'index',
|
prop: 'index',
|
||||||
type: 'index',
|
type: 'index',
|
||||||
label: '序号',
|
label: '工单号',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 80,
|
width: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'orderNumber',
|
prop: 'workOrderNumber',
|
||||||
label: '工单号',
|
|
||||||
align: 'center',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'orderName',
|
|
||||||
label: '工单名称',
|
label: '工单名称',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'orderContent',
|
prop: 'workOrderNumber',
|
||||||
label: '工单内容',
|
label: '工单内容',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'operationUser',
|
prop: 'workOrderNumber',
|
||||||
label: '处理人',
|
label: '处理人',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'knotter',
|
prop: 'workOrderNumber',
|
||||||
label: '关单人',
|
label: '关单人',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
@@ -66,7 +71,7 @@ const tableConfig = reactive({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'workOrderNumber',
|
prop: 'workOrderNumber',
|
||||||
label: '电话号码',
|
label: '号码',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -119,28 +124,17 @@ const tableConfig = reactive({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
api: '/order/list',
|
api: '',
|
||||||
params: {
|
params: {},
|
||||||
orderState: '2'
|
btns: [
|
||||||
}
|
// {name: '新增', key: 'add',type:'primary',icon:'Plus'},
|
||||||
|
]
|
||||||
})
|
})
|
||||||
const handleVoice = (row) => {
|
const handleVoice = (row) => {
|
||||||
if (row.recordUrl !== null) {
|
voiceRef.value.open(true)
|
||||||
voiceRef.value.open(true)
|
|
||||||
rowUrl.value = row.recordUrl
|
|
||||||
}else{
|
|
||||||
ElMessage({
|
|
||||||
message: '暂无语音',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
const handleInfo = (row) => {
|
const handleInfo = (row) => {
|
||||||
console.log(row);
|
|
||||||
|
|
||||||
infoLiveCallRef.value.open(true)
|
infoLiveCallRef.value.open(true)
|
||||||
rowData.value = row.orderNumber
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ const router = useRouter()
|
|||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const loginForm = reactive({
|
const loginForm = reactive({
|
||||||
username: 'admin',
|
username: 'admin',
|
||||||
password: 'qwe123',
|
password: '123456',
|
||||||
code: '',
|
code: '',
|
||||||
uuid: ''
|
uuid: ''
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,142 +1,72 @@
|
|||||||
<template>
|
<template>
|
||||||
<fvSearchForm :searchConfig="searchConfig" @search="searchPhoneTraffic"></fvSearchForm>
|
<fvSearchForm :searchConfig="searchConfig" @search="search">
|
||||||
<fvTable ref="tableIns" :tableConfig="phoneTrafficTableConfig" @headBtnClick="headBtnClick" @selectionChange="selectionChange"></fvTable>
|
</fvSearchForm>
|
||||||
<fvFormDialog ref="formDialogRef" :title="dialogTitle" :dialogType="dialogType"
|
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
|
||||||
:form-schema="formSchema" :form-rules="formRules"
|
|
||||||
@dialogSubmit="handleSubmitAddressBook"></fvFormDialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import { shallowRef } from 'vue';
|
import { shallowRef } from 'vue';
|
||||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
|
||||||
import {addConfig, delConfig, editConfig, getConfigDetails} from "@/api/phone-traffic-config";
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const tableIns = ref()
|
const tableIns = ref()
|
||||||
const formDialogRef = ref()
|
const mockData = ref([
|
||||||
const extraConfigType = ref(0)
|
{
|
||||||
const contactIds = ref("");
|
workOrderNumber: 1211,
|
||||||
const dialogTitle = ref("");
|
workOrderTime: '2022-02-09 00 : 12',
|
||||||
const dialogType = ref("");
|
state: 0,
|
||||||
const formRules = reactive({
|
callState: 0
|
||||||
configName: [
|
},
|
||||||
{required: true, message: "参数名称不能为空", trigger: "blur"},
|
{
|
||||||
],
|
workOrderNumber: 232,
|
||||||
configKey: [
|
state: 1,
|
||||||
{required: true, message: "参数键名不能为空", trigger: "blur"},
|
callState: 1
|
||||||
],
|
}
|
||||||
configValue: [
|
])
|
||||||
{required: true, message: "参数键值不能为空", trigger: "blur"},
|
|
||||||
],
|
|
||||||
configType: [
|
|
||||||
{required: true, message: "系统内置不能为空", trigger: "change"},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
const formSchema = computed(() => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '参数名称',
|
|
||||||
prop: 'configName',
|
|
||||||
component: 'el-input',
|
|
||||||
colProps: {
|
|
||||||
span: 24
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
placeholder: '请输入参数名称',
|
|
||||||
clearable: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '参数键名',
|
|
||||||
prop: 'configKey',
|
|
||||||
component: 'el-input',
|
|
||||||
colProps: {
|
|
||||||
span: 24
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
placeholder: '请输入参数键名',
|
|
||||||
clearable: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '参数键值',
|
|
||||||
prop: 'configValue',
|
|
||||||
component: 'el-input',
|
|
||||||
colProps: {
|
|
||||||
span: 24
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
placeholder: '请输入参数键值',
|
|
||||||
clearable: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '系统内置',
|
|
||||||
prop: 'configType',
|
|
||||||
component: shallowRef(fvSelect),
|
|
||||||
colProps: {
|
|
||||||
span: 24
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
placeholder: '请选择系统内置',
|
|
||||||
cacheKey: 'yes_no',
|
|
||||||
clearable: true,
|
|
||||||
filterable: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '备注',
|
|
||||||
prop: 'remark',
|
|
||||||
component: 'el-input',
|
|
||||||
colProps: {
|
|
||||||
span: 24
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
placeholder: '请输入备注',
|
|
||||||
clearable: true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
]
|
|
||||||
})
|
|
||||||
const searchConfig = reactive([
|
const searchConfig = reactive([
|
||||||
{
|
{
|
||||||
label: '参数名称',
|
label: '配置ID',
|
||||||
prop: 'configName',
|
prop: 'requirementName',
|
||||||
props: {
|
props: {
|
||||||
placeholder: '请输入参数名称查询',
|
placeholder: '请输入配置ID查询',
|
||||||
clearable: true,
|
clearable: true,
|
||||||
checkStrictly: true
|
checkStrictly: true
|
||||||
},
|
},
|
||||||
component: 'el-input',
|
component: 'el-input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '参数键名',
|
label: '名称',
|
||||||
prop: 'configKey',
|
prop: 'requirementName',
|
||||||
props: {
|
props: {
|
||||||
placeholder: '请输入参数键名查询',
|
placeholder: '请输入名称查询',
|
||||||
clearable: true,
|
clearable: true,
|
||||||
checkStrictly: true
|
checkStrictly: true
|
||||||
},
|
},
|
||||||
component: 'el-input',
|
component: 'el-input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '系统内置',
|
label: '状态',
|
||||||
prop: 'configType',
|
prop: 'requirementName',
|
||||||
props: {
|
props: {
|
||||||
placeholder: '请选择系统内置查询',
|
placeholder: '请选择状态查询',
|
||||||
cacheKey: 'yes_no',
|
cacheKey: 'work_order_status',
|
||||||
clearable: true,
|
clearable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
},
|
},
|
||||||
component: shallowRef(fvSelect),
|
component: shallowRef(fvSelect),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '创建日期',
|
||||||
|
prop: 'requirementName',
|
||||||
|
props: {
|
||||||
|
placeholder: '请选择',
|
||||||
|
clearable: true,
|
||||||
|
checkStrictly: true
|
||||||
|
},
|
||||||
|
component: 'el-date-picker',
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
const phoneTrafficTableConfig = reactive({
|
const tableConfig = reactive({
|
||||||
columns: [
|
columns: [
|
||||||
{
|
|
||||||
type: 'selection',
|
|
||||||
prop: 'selection'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
prop: 'index',
|
prop: 'index',
|
||||||
type: 'index',
|
type: 'index',
|
||||||
@@ -145,206 +75,62 @@ const phoneTrafficTableConfig = reactive({
|
|||||||
width: 80,
|
width: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'configName',
|
prop: 'workOrderNumber',
|
||||||
label: '参数名称',
|
label: '配置ID',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'configKey',
|
prop: 'workOrderNumber',
|
||||||
label: '参数键名',
|
label: '名称',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'configValue',
|
prop: 'workOrderNumber',
|
||||||
label: '参数键值',
|
label: '类型',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'configType',
|
prop: 'workOrderNumber',
|
||||||
label: '系统内置',
|
label: '内容',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'state',
|
||||||
|
label: '状态',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
showOverflowTooltip: false,
|
||||||
currentRender: ({ row, index }) => {
|
currentRender: ({ row, index }) => {
|
||||||
if (row.configType !== null) {
|
if (row.state !== null) {
|
||||||
return (<Tag dictType={'yes_no'} value={row.configType} />)
|
return (<Tag dictType={'work_order_status'} value={row.state} />)
|
||||||
} else {
|
} else {
|
||||||
return '--'
|
return '--'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// prop: 'workOrderTime',
|
prop: 'workOrderTime',
|
||||||
// label: '创建时间',
|
label: '创建时间',
|
||||||
// align: 'center',
|
align: 'center',
|
||||||
// width: 200
|
width: 200
|
||||||
// },
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
label: '备注',
|
label: '备注',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
width: 200
|
||||||
{
|
|
||||||
prop: 'oper',
|
|
||||||
label: '操作',
|
|
||||||
align: 'center',
|
|
||||||
fixed: 'right',
|
|
||||||
width: 150,
|
|
||||||
showOverflowTooltip: false,
|
|
||||||
currentRender: ({row, index}) => {
|
|
||||||
let btn = []
|
|
||||||
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
|
|
||||||
btn.push({label: '删除', func: () => handleSingleDelete(row), type: 'danger'})
|
|
||||||
return (
|
|
||||||
<div style={{width: '100%'}}>
|
|
||||||
{
|
|
||||||
btn.map(item => (
|
|
||||||
<el-button
|
|
||||||
type={item.type}
|
|
||||||
// v-perm={item.prem}
|
|
||||||
onClick={() => item.func()}
|
|
||||||
link
|
|
||||||
>
|
|
||||||
{item.label}
|
|
||||||
</el-button>
|
|
||||||
))
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
api: '/extra/config',
|
api: '',
|
||||||
params: {
|
params: {},
|
||||||
extraConfigType:extraConfigType.value
|
|
||||||
},
|
|
||||||
btns: [
|
btns: [
|
||||||
{name: '新增', key: 'add',type:'primary'},
|
{name: '新增', key: 'add',type:'primary',icon:'Plus'},
|
||||||
{name: '删除', key: 'delete', type: 'danger'},
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
const searchPhoneTraffic = (val) => {
|
|
||||||
let obj = {...val,extraConfigType:extraConfigType.value}
|
|
||||||
if (obj.dateValue) {
|
|
||||||
obj.startTime = obj.dateValue[0]
|
|
||||||
obj.endTime = obj.dateValue[1]
|
|
||||||
delete obj.dateValue
|
|
||||||
}
|
|
||||||
phoneTrafficTableConfig.params = obj
|
|
||||||
tableIns.value.refresh()
|
|
||||||
}
|
|
||||||
|
|
||||||
const headBtnClick = (key) => {
|
const headBtnClick = (key) => {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'add':
|
case 'add':
|
||||||
handleAdd()
|
handleAdd()
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
|
||||||
handleMoreDelete()
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleAdd = () => {
|
|
||||||
formDialogRef.value.openOrCloseDialog(true)
|
|
||||||
dialogTitle.value = "新增话务配置";
|
|
||||||
dialogType.value = "add";
|
|
||||||
nextTick(() => {
|
|
||||||
formDialogRef.value.getFormInstance().setValues({})
|
|
||||||
// 清空校验
|
|
||||||
formDialogRef.value.getFormInstance().clearValidate()
|
|
||||||
formDialogRef.value.getFormInstance().resetFields()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const handleEdit = (row) => {
|
|
||||||
formDialogRef.value.openOrCloseDialog(true)
|
|
||||||
getDetail(row)
|
|
||||||
dialogTitle.value = "编辑话务配置";
|
|
||||||
dialogType.value = "edit";
|
|
||||||
}
|
|
||||||
const getDetail = (row) => {
|
|
||||||
getConfigDetails(row.configId,extraConfigType.value).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success(res.msg)
|
|
||||||
res.data.configType=''+res.data.configType
|
|
||||||
nextTick(() => {
|
|
||||||
formDialogRef.value.getFormInstance().setValues(res.data)
|
|
||||||
// 清空校验
|
|
||||||
formDialogRef.value.getFormInstance().clearValidate()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectionChange = (selection) => {
|
|
||||||
if (selection.length !== 0) {
|
|
||||||
contactIds.value = selection.map(item => item.configId).join()
|
|
||||||
} else {
|
|
||||||
contactIds.value=''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const deleteContactMethod = (configId) => {
|
|
||||||
delConfig(configId,extraConfigType.value).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success(res.msg)
|
|
||||||
tableIns.value.refresh()
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const handleMoreDelete = () => {
|
|
||||||
if(contactIds.value){
|
|
||||||
ElMessageBox.confirm(`确认删除选择的话务配置吗?`, '系统提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
deleteContactMethod(contactIds.value)
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
ElMessage.warning("请选择要删除的话务配置")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const handleSingleDelete = (row) => {
|
|
||||||
ElMessageBox.confirm(`确认删除参数名称为${row.configName}的话务配置吗?`, '系统提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
deleteContactMethod(row.configId)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//提交
|
|
||||||
const handleSubmitAddressBook = async (formInstance) => {
|
|
||||||
if (!formInstance) return;
|
|
||||||
let validate = await formInstance.validate()
|
|
||||||
if (!validate.isValidate) return;
|
|
||||||
let params={
|
|
||||||
...formInstance.getValues(),
|
|
||||||
configType:parseInt(formInstance.getValues().configType),
|
|
||||||
extraConfigType:extraConfigType.value
|
|
||||||
}
|
|
||||||
if (dialogType.value === "add") {
|
|
||||||
addConfig(params).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success(res.msg);
|
|
||||||
tableIns.value.refresh()
|
|
||||||
formDialogRef.value.openOrCloseDialog(false)
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
editConfig(params).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success(res.msg);
|
|
||||||
tableIns.value.refresh()
|
|
||||||
formDialogRef.value.openOrCloseDialog(false)
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -85,16 +85,13 @@ const searchConfig = reactive([
|
|||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
props: {
|
props: {
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
type: 'datetime',
|
|
||||||
clearable: true,
|
clearable: true,
|
||||||
checkStrictly: true,
|
checkStrictly: true
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
},
|
},
|
||||||
component: 'el-date-picker',
|
component: 'el-date-picker',
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
label: '处理时间',
|
label: '处理时间',
|
||||||
prop: 'processedTime',
|
prop: 'te',
|
||||||
props: {
|
props: {
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
clearable: true,
|
clearable: true,
|
||||||
@@ -170,14 +167,7 @@ const tableConfig = reactive({
|
|||||||
{
|
{
|
||||||
prop: 'operationUser',
|
prop: 'operationUser',
|
||||||
label: '处理人',
|
label: '处理人',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
currentRender: ({ row, index }) => {
|
|
||||||
if (row.operationUser) {
|
|
||||||
return row.operationUser
|
|
||||||
} else {
|
|
||||||
return '--'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -221,7 +211,7 @@ const tableConfig = reactive({
|
|||||||
let btn = []
|
let btn = []
|
||||||
btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' })
|
btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' })
|
||||||
btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' })
|
btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' })
|
||||||
btn.push({ label: '删除', prem: auths.detail, func: () => handleDelete(row), type: 'danger'})
|
btn.push({ label: '删除', prem: auths.detail, func: () => handleDelete(row), type: 'primary' })
|
||||||
return (
|
return (
|
||||||
<div style={{ width: '100%' }}>
|
<div style={{ width: '100%' }}>
|
||||||
{
|
{
|
||||||
@@ -268,9 +258,7 @@ const headBtnClick = (key) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleDetail = (row) => {
|
const handleDetail = (row) => {
|
||||||
// console.log(row);
|
workDialogRef.value.open(row)
|
||||||
|
|
||||||
workDialogRef.value.open()
|
|
||||||
rowData.value = row
|
rowData.value = row
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,27 +274,25 @@ const handleClose = async (row) => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
const info = await orderdClose(row.orderNumber)
|
await orderdClose(row.orderNumber)
|
||||||
// console.log(info);
|
tableIns.value.refresh()
|
||||||
if (info.code === 1000) {
|
ElMessage({
|
||||||
tableIns.value.refresh()
|
type: 'success',
|
||||||
ElMessage({
|
message: '关闭成功',
|
||||||
message: '关闭成功',
|
})
|
||||||
type: 'success',
|
})
|
||||||
})
|
.catch(() => {
|
||||||
} else {
|
// tableIns.value.refresh()
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: info.msg,
|
type: 'info',
|
||||||
type: 'warning',
|
message: '关闭失败',
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ElMessageBox.alert('此工单已被关闭!', '温馨提示', {
|
ElMessageBox.alert('此工单已被关闭!', '温馨提示', {
|
||||||
// if you want to disable its autofocus
|
// if you want to disable its autofocus
|
||||||
// autofocus: false,
|
// autofocus: false,
|
||||||
type: 'warning',
|
type:'warning',
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -325,20 +311,19 @@ const handleDelete = async (row) => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
const info = await orderdDetele(row.orderNumber)
|
await orderdDetele(row.orderNumber)
|
||||||
console.log(info);
|
tableIns.value.refresh()
|
||||||
if (info.code === 1000) {
|
ElMessage({
|
||||||
tableIns.value.refresh()
|
type: 'success',
|
||||||
ElMessage({
|
message: '删除成功',
|
||||||
message: '删除成功',
|
})
|
||||||
type: 'success',
|
})
|
||||||
})
|
.catch(() => {
|
||||||
} else {
|
// tableIns.value.refresh()
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: info.msg,
|
type: 'info',
|
||||||
type: 'warning',
|
message: '删除失败',
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,24 +1,20 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { nextTick, onMounted, reactive, ref, watch } from "vue";
|
import { nextTick, onMounted, reactive, ref, watch } from "vue";
|
||||||
import { ElMessageBox } from "element-plus";
|
import { ElMessageBox } from "element-plus";
|
||||||
import { MoreFilled, Check, Download, VideoPlay } from "@element-plus/icons-vue";
|
import { MoreFilled } from "@element-plus/icons-vue";
|
||||||
import { time } from "echarts";
|
import { time } from "echarts";
|
||||||
import { defineExpose } from "vue";
|
import { defineExpose } from "vue";
|
||||||
import { defineProps } from "vue";
|
import { defineProps } from "vue";
|
||||||
import { orderGetDetails } from "@/api/order/order.js"
|
import { orderGetDetails } from "@/api/order/order.js"
|
||||||
import Voice from '@/components/voice/index.vue'
|
|
||||||
//控制显示隐藏
|
//控制显示隐藏
|
||||||
const dialogVisible = ref(false);
|
const dialogVisible = ref(false);
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
rowData: Object
|
rowData: Object
|
||||||
})
|
})
|
||||||
|
|
||||||
let opsCallList = ref([]);
|
let opsCallList = ref([]);
|
||||||
let orderData = ref([]);
|
let orderData = ref([]);
|
||||||
let orderContent = ref([]);
|
let orderContent = ref([]);
|
||||||
const voiceRef = ref()
|
|
||||||
const rowUrl = ref()
|
|
||||||
const open = (row) => {
|
const open = (row) => {
|
||||||
dialogVisible.value = true;
|
dialogVisible.value = true;
|
||||||
};
|
};
|
||||||
@@ -26,77 +22,29 @@ const open = (row) => {
|
|||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
// console.log(123);
|
// console.log(123);
|
||||||
const data = await orderGetDetails(props.rowData.orderNumber)
|
const data = await orderGetDetails(props.rowData.orderNumber)
|
||||||
|
|
||||||
// console.log("111", data);
|
// console.log("111", data);
|
||||||
return data
|
return data
|
||||||
|
|
||||||
}
|
}
|
||||||
let contentState0 = [
|
|
||||||
|
let content = [
|
||||||
{
|
{
|
||||||
content: "待处理",
|
content: "待处理",
|
||||||
timestamp: "orderData.value",
|
timestamp: "orderData.value",
|
||||||
icon: Check,
|
|
||||||
color: "#0bbd87",
|
color: "#0bbd87",
|
||||||
size: "large",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content: "已处理",
|
content: "已处理",
|
||||||
timestamp: "--",
|
timestamp: "2022-07-20 20:00",
|
||||||
type: "primary",
|
type: "primary",
|
||||||
icon: MoreFilled,
|
icon: MoreFilled,
|
||||||
size: "large",
|
size: "large",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
content: "结单",
|
content: "结单",
|
||||||
timestamp: "--",
|
timestamp: "2022-07-20 20:00",
|
||||||
size: "large",
|
size: "large",
|
||||||
// icon: Check,
|
|
||||||
// color: "#0bbd87",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let contentState1 = [
|
|
||||||
{
|
|
||||||
content: "待处理",
|
|
||||||
timestamp: "orderData.value",
|
|
||||||
icon: Check,
|
|
||||||
color: "#0bbd87",
|
|
||||||
size: "large",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
content: "已处理",
|
|
||||||
timestamp: "2022-07-20 20:00:00",
|
|
||||||
icon: Check,
|
|
||||||
color: "#0bbd87",
|
|
||||||
size: "large",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
content: "结单",
|
|
||||||
timestamp: "--",
|
|
||||||
size: "large",
|
|
||||||
type: "primary",
|
|
||||||
icon: MoreFilled,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let contentState2 = [
|
|
||||||
{
|
|
||||||
content: "待处理",
|
|
||||||
timestamp: "orderData.value",
|
|
||||||
icon: Check,
|
|
||||||
color: "#0bbd87",
|
|
||||||
size: "large",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
content: "已处理",
|
|
||||||
timestamp: "2022-07-20 20:00:00",
|
|
||||||
icon: Check,
|
|
||||||
color: "#0bbd87",
|
|
||||||
size: "large",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
content: "结单",
|
|
||||||
timestamp: "2022-07-20 20:00:00",
|
|
||||||
size: "large",
|
|
||||||
icon: Check,
|
|
||||||
color: "#0bbd87",
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -106,57 +54,50 @@ watch(() => props.rowData, (newRowData) => {
|
|||||||
getData(newRowData).then((data) => {
|
getData(newRowData).then((data) => {
|
||||||
opsCallList.value = []
|
opsCallList.value = []
|
||||||
orderData.value = data.data
|
orderData.value = data.data
|
||||||
|
|
||||||
//电话拨打记录
|
//电话拨打记录
|
||||||
const dataDetails = data.data.opsCallList
|
const dataDetails = data.data.opsCallList
|
||||||
// console.log(dataDetails);
|
// console.log(dataDetails);
|
||||||
const theData = [{ createTime: '', data: [] }]
|
const theData = [{ createTime: '', data: [] }]
|
||||||
|
|
||||||
dataDetails.forEach(for1data => {
|
dataDetails.forEach(for1data => {
|
||||||
// console.log(for1data.createTime, '--------');
|
theData.forEach(for2data => {
|
||||||
for (let i = 0; i < theData.length; i++) {
|
if (for1data.createTime !== for2data.createTime) {
|
||||||
// console.log(theData[i]);
|
// console.log(for2data);
|
||||||
if (theData[i].createTime === for1data.createTime) {
|
for2data.createTime = for1data.createTime
|
||||||
theData[i].data.push(for1data)
|
for2data.data.push(for1data)
|
||||||
break;
|
theData.push({ createTime: for1data.createTime, data: [] })
|
||||||
} else if (theData[i].createTime === '') {
|
|
||||||
theData[i].createTime = for1data.createTime
|
|
||||||
theData[i].data.push(for1data)
|
|
||||||
} else {
|
} else {
|
||||||
theData.push({ createTime: '', data: [] })
|
for2data.data.push(for1data)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
});
|
});
|
||||||
// theData.pop()
|
theData.pop()
|
||||||
// theData[0].data.sort((a, b) => b.answer_time- a.answer_time)
|
// theData[0].data.sort((a, b) => b.answer_time- a.answer_time)
|
||||||
// console.log(theData);
|
// console.log(theData);
|
||||||
theData.forEach(item => {
|
theData.forEach(item => {
|
||||||
item.data.forEach(info => {
|
item.data.sort((a, b) => b.answer_time- a.answer_time)
|
||||||
if (info.answeredTime !== null) {
|
|
||||||
// console.log(info.answeredTime);
|
|
||||||
let startIndex = info.answeredTime.indexOf(' ') + 1;
|
|
||||||
let timeOnly = info.answeredTime.slice(startIndex, startIndex + 8);
|
|
||||||
info.answeredTime = timeOnly.replace(/:/g, ':')
|
|
||||||
// info.answeredTime = timeOnly
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// item.data.sort((a, b) => a.answeredTime - b.answeredTime)
|
|
||||||
opsCallList.value.push(item)
|
opsCallList.value.push(item)
|
||||||
})
|
})
|
||||||
|
|
||||||
//工单时间线
|
//工单时间线
|
||||||
orderContent.value = []
|
orderContent.value = []
|
||||||
// console.log(orderData.value);
|
// console.log(orderData.value);
|
||||||
// orderData.value.orderState='2'
|
content.map((item, index) => {
|
||||||
if (orderData.value.orderState === '0') {
|
if (index === 0) {
|
||||||
inputOrderContent(contentState0)
|
item.timestamp = orderData.value.operationTime || '--'
|
||||||
}
|
} else if (index === 1) {
|
||||||
else if (orderData.value.orderState === '1') {
|
item.timestamp = orderData.value.processedTime || '--'
|
||||||
inputOrderContent(contentState1)
|
|
||||||
}
|
} else {
|
||||||
else if (orderData.value.orderState === '2') {
|
item.timestamp = orderData.value.completionTime || '--'
|
||||||
inputOrderContent(contentState2)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
content.forEach(item => {
|
||||||
|
orderContent.value.push(item)
|
||||||
|
})
|
||||||
|
|
||||||
// console.log(orderContent.value);
|
// console.log(orderContent.value);
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -164,48 +105,37 @@ watch(() => props.rowData, (newRowData) => {
|
|||||||
}, {
|
}, {
|
||||||
immediate: true // 立即执行一次,以便在rowData初始值非空时也能触发
|
immediate: true // 立即执行一次,以便在rowData初始值非空时也能触发
|
||||||
});
|
});
|
||||||
const inputOrderTime = (item, index) => {
|
// getData()
|
||||||
|
|
||||||
|
|
||||||
|
const test2 = [
|
||||||
{
|
{
|
||||||
if (index === 0) {
|
|
||||||
item.timestamp = orderData.value.operationTime || '--'
|
date: '2024-8-31',
|
||||||
} else if (index === 1) {
|
type: "primary",
|
||||||
// item.timestamp = orderData.value.processedTime || '--'
|
icon: MoreFilled,
|
||||||
} else {
|
size: "large",
|
||||||
// item.timestamp = orderData.value.completionTime || '--'
|
}, {
|
||||||
}
|
content: "结单",
|
||||||
|
size: "large",
|
||||||
}
|
}
|
||||||
}
|
];
|
||||||
|
// const data = [
|
||||||
const inputOrderContent = (contentState) => {
|
// {
|
||||||
contentState.map((item, index) => {
|
// number: '17628661307',
|
||||||
inputOrderTime(item, index)
|
// state: '通话中',
|
||||||
})
|
// time: '18 : 32',
|
||||||
contentState.forEach(item => {
|
// },
|
||||||
orderContent.value.push(item)
|
// {
|
||||||
})
|
// number: '17628661307',
|
||||||
}
|
// state: '已接通',
|
||||||
|
// time: '18 : 32',
|
||||||
const openRecord = () => {
|
// },
|
||||||
if ( props.rowData.recordUrl !== null) {
|
// {
|
||||||
voiceRef.value.open(true)
|
// number: '17628661307',
|
||||||
rowUrl.value = props.rowData.recordUrl
|
// state: '已接通',
|
||||||
} else {
|
// time: '18 : 32',
|
||||||
ElMessage({
|
// }]
|
||||||
message: '暂无语音',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const downloadRecord = () => {
|
|
||||||
if(props.rowData.recordUrl === null){
|
|
||||||
ElMessage({
|
|
||||||
message: '暂无语音',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
});
|
});
|
||||||
@@ -219,7 +149,7 @@ defineExpose({
|
|||||||
<div class="common-layout">
|
<div class="common-layout">
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header class="header"><span>工单号:</span>
|
<el-header class="header"><span>工单号:</span>
|
||||||
<span>{{ rowData.orderNumber || '--' }}</span>
|
<span>{{ rowData.orderNumber }}</span>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-container class="main-container">
|
<el-container class="main-container">
|
||||||
<el-aside width="200px" :style="{ position: 'static' }">
|
<el-aside width="200px" :style="{ position: 'static' }">
|
||||||
@@ -236,12 +166,12 @@ defineExpose({
|
|||||||
<el-main :style="{ position: 'static' }" class="main-content">
|
<el-main :style="{ position: 'static' }" class="main-content">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<!-- <span>创始人:{{ rowData.createBy }}</span> -->
|
<span>创始人:{{ rowData.createBy }}</span>
|
||||||
<span>处理人:{{ rowData.operationUser || '--' }}</span>
|
<span>处理人:{{ rowData.operationUser }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span>工单名称:{{ rowData.orderName || '--' }}</span>
|
<span>工单名称:{{ rowData.siteName }}</span>
|
||||||
<span>关单人:{{ rowData.knotter || '--' }}</span>
|
<span>关单人:{{ rowData.knotter }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
@@ -249,34 +179,25 @@ defineExpose({
|
|||||||
<div>工单内容:</div>
|
<div>工单内容:</div>
|
||||||
<div class="textBox">
|
<div class="textBox">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<div class="text">{{ rowData.orderContent || '暂无工单内容' }}</div>
|
<div class="text">{{ rowData.orderContent }}</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div>通话记录:</div>
|
<div>处理内容:</div>
|
||||||
<div class="textBox">
|
<div class="textBox">
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<div class="text">{{ rowData.processedContent || '暂无通话记录' }}</div>
|
<div class="text">{{ rowData.processedContent }}</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div>录音信息:</div>
|
<div>录音信息:</div>
|
||||||
<div class="textBox—record">
|
<div class="textBox">
|
||||||
|
<el-scrollbar>
|
||||||
<el-button @click="openRecord" type="primary" :icon="VideoPlay"
|
<div class="text">{{ rowData.recordUrl }}</div>
|
||||||
style="margin-right: 10px ;">播放录音
|
</el-scrollbar>
|
||||||
</el-button>
|
|
||||||
<voice ref="voiceRef" title="录音详情" :rowUrl="rowUrl" />
|
|
||||||
<a :href=rowData.recordUrl download>
|
|
||||||
<el-button type="primary" :icon="Download"
|
|
||||||
@click="downloadRecord">下载录音</el-button>
|
|
||||||
</a>
|
|
||||||
<!-- <el-scrollbar> -->
|
|
||||||
<!-- <div class="text">{{ rowData.recordUrl }}</div> -->
|
|
||||||
<!-- </el-scrollbar> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -286,7 +207,6 @@ defineExpose({
|
|||||||
<div class="timebox">
|
<div class="timebox">
|
||||||
<div>
|
<div>
|
||||||
<el-scrollbar height="20vh">
|
<el-scrollbar height="20vh">
|
||||||
<p v-if="opsCallList.length === 0">暂无电话拨打记录</p>
|
|
||||||
<el-timeline style="max-width: 99%" class="timeline">
|
<el-timeline style="max-width: 99%" class="timeline">
|
||||||
<el-timeline-item v-for="(activity, index) in opsCallList" :key="index"
|
<el-timeline-item v-for="(activity, index) in opsCallList" :key="index"
|
||||||
icon="MoreFilled" type="primary" size="large">
|
icon="MoreFilled" type="primary" size="large">
|
||||||
@@ -296,13 +216,12 @@ defineExpose({
|
|||||||
<div class="timeline-row">
|
<div class="timeline-row">
|
||||||
<span :style="{ color: '#a8abb2' }">{{ info.callIdNumber
|
<span :style="{ color: '#a8abb2' }">{{ info.callIdNumber
|
||||||
}}</span>
|
}}</span>
|
||||||
<PointTag dictType="call_status" :value="info.callState"
|
<PointTag dictType="call_status" :value="info.callState" class="tag"/>
|
||||||
class="tag" />
|
|
||||||
<!-- <span :style="{
|
<!-- <span :style="{
|
||||||
color: info.callState === '通话中' ? '#6cc23a' : '#409eff'
|
color: info.callState === '通话中' ? '#6cc23a' : '#409eff'
|
||||||
}">{{ info.callState }}</span> -->
|
}">{{ info.callState }}</span> -->
|
||||||
<span class="span-3th" :style="{ color: '#a8abb2' }">{{
|
<span class="span-3th" :style="{ color: '#a8abb2' }">{{
|
||||||
info.answeredTime || '00:00:00' }}</span>
|
info.answer_time ||'00 : 00'}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -366,19 +285,13 @@ defineExpose({
|
|||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content .body .textBox—record {
|
|
||||||
width: 100%;
|
|
||||||
min-height: 10vh;
|
|
||||||
// max-height: 15vh;
|
|
||||||
// border: 1.5px solid #e4e7ed;
|
|
||||||
// box-shadow: 0 4px 8px 0 rgba(242, 242, 242, 1);
|
|
||||||
// margin-bottom: 20px;
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-content .body .text {
|
.main-content .body .text {
|
||||||
|
|
||||||
resize: none;
|
resize: none;
|
||||||
|
|
||||||
|
|
||||||
// overflow-y: auto;
|
// overflow-y: auto;
|
||||||
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 25px
|
line-height: 25px
|
||||||
}
|
}
|
||||||
@@ -406,29 +319,26 @@ defineExpose({
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content .timeline-row {
|
.main-content .timeline-row{
|
||||||
// border: 1px solid #000;
|
// border: 1px solid #000;
|
||||||
display: flex;
|
display: flex;
|
||||||
// justify-content: space-between;
|
// justify-content: space-between;
|
||||||
// border: 1px solid #000;
|
// border: 1px solid #000;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.main-content .tag{
|
||||||
.main-content .tag {
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
// background-color: red;
|
// background-color: red;
|
||||||
margin-left: 30px;
|
margin-left: 30px;
|
||||||
}
|
}
|
||||||
|
.main-content .span-3th{
|
||||||
.main-content .span-3th {
|
|
||||||
// flex-grow: 1;
|
// flex-grow: 1;
|
||||||
// margin-right:;
|
// margin-right:;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
margin-right: 100px;
|
margin-right: 100px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-card {
|
.custom-card {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|||||||
@@ -52,6 +52,16 @@ const searchConfig = reactive([
|
|||||||
checkStrictly: true
|
checkStrictly: true
|
||||||
},
|
},
|
||||||
component: 'el-input',
|
component: 'el-input',
|
||||||
|
}, {
|
||||||
|
label: '工单状态',
|
||||||
|
prop: 'orderState',
|
||||||
|
props: {
|
||||||
|
placeholder: '请选择工单状态查询',
|
||||||
|
cacheKey: 'work_order_status',
|
||||||
|
clearable: true,
|
||||||
|
filterable: true,
|
||||||
|
},
|
||||||
|
component: shallowRef(fvSelect),
|
||||||
}, {
|
}, {
|
||||||
label: '处理人',
|
label: '处理人',
|
||||||
prop: 'operationUser',
|
prop: 'operationUser',
|
||||||
@@ -82,7 +92,7 @@ const searchConfig = reactive([
|
|||||||
component: 'el-date-picker',
|
component: 'el-date-picker',
|
||||||
}, {
|
}, {
|
||||||
label: '处理时间',
|
label: '处理时间',
|
||||||
prop: 'processedTime',
|
prop: 'te',
|
||||||
props: {
|
props: {
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
clearable: true,
|
clearable: true,
|
||||||
@@ -202,7 +212,7 @@ const tableConfig = reactive({
|
|||||||
let btn = []
|
let btn = []
|
||||||
btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' })
|
btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' })
|
||||||
btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' })
|
btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' })
|
||||||
btn.push({ label: '删除', prem: auths.detail, func: () => handleDelete(row), type: 'danger' })
|
btn.push({ label: '删除', prem: auths.detail, func: () => handleDelete(row), type: 'primary' })
|
||||||
return (
|
return (
|
||||||
<div style={{ width: '100%' }}>
|
<div style={{ width: '100%' }}>
|
||||||
{
|
{
|
||||||
@@ -223,14 +233,14 @@ const tableConfig = reactive({
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
api: '/order/list',
|
api: '/order/list',
|
||||||
params: { orderState: "2" },
|
params: {orderState:"2"},
|
||||||
btns: [
|
btns: [
|
||||||
// {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report},
|
// {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report},
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
const search = (val) => {
|
const search = (val) => {
|
||||||
let obj = { ...val, orderState: '2' }
|
let obj = {...val}
|
||||||
if (obj.dateValue) {
|
if (obj.dateValue) {
|
||||||
obj.startTime = obj.dateValue[0]
|
obj.startTime = obj.dateValue[0]
|
||||||
obj.endTime = obj.dateValue[1]
|
obj.endTime = obj.dateValue[1]
|
||||||
@@ -266,26 +276,25 @@ const handleClose = async (row) => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
const info = await orderdClose(row.orderNumber)
|
await orderdClose(row.orderNumber)
|
||||||
// console.log(info);
|
tableIns.value.refresh()
|
||||||
if (info.code === 1000) {
|
ElMessage({
|
||||||
tableIns.value.refresh()
|
type: 'success',
|
||||||
ElMessage({
|
message: '关闭成功',
|
||||||
message: '关闭成功',
|
})
|
||||||
type: 'success',
|
})
|
||||||
})
|
.catch(() => {
|
||||||
} else {
|
// tableIns.value.refresh()
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: info.msg,
|
type: 'info',
|
||||||
type: 'warning',
|
message: '关闭失败',
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
ElMessageBox.alert('此工单已被关闭!', '温馨提示', {
|
ElMessageBox.alert('此工单已被关闭!', '温馨提示', {
|
||||||
// if you want to disable its autofocus
|
// if you want to disable its autofocus
|
||||||
// autofocus: false,
|
// autofocus: false,
|
||||||
type: 'warning',
|
type:'warning',
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -304,20 +313,19 @@ const handleDelete = async (row) => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
const info = await orderdDetele(row.orderNumber)
|
await orderdDetele(row.orderNumber)
|
||||||
console.log(info);
|
tableIns.value.refresh()
|
||||||
if (info.code === 1000) {
|
ElMessage({
|
||||||
tableIns.value.refresh()
|
type: 'success',
|
||||||
ElMessage({
|
message: '删除成功',
|
||||||
message: '删除成功',
|
})
|
||||||
type: 'success',
|
})
|
||||||
})
|
.catch(() => {
|
||||||
} else {
|
// tableIns.value.refresh()
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: info.msg,
|
type: 'info',
|
||||||
type: 'warning',
|
message: '删除失败',
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -52,6 +52,16 @@ const searchConfig = reactive([
|
|||||||
checkStrictly: true
|
checkStrictly: true
|
||||||
},
|
},
|
||||||
component: 'el-input',
|
component: 'el-input',
|
||||||
|
}, {
|
||||||
|
label: '工单状态',
|
||||||
|
prop: 'orderState',
|
||||||
|
props: {
|
||||||
|
placeholder: '请选择工单状态查询',
|
||||||
|
cacheKey: 'work_order_status',
|
||||||
|
clearable: true,
|
||||||
|
filterable: true,
|
||||||
|
},
|
||||||
|
component: shallowRef(fvSelect),
|
||||||
}, {
|
}, {
|
||||||
label: '处理人',
|
label: '处理人',
|
||||||
prop: 'operationUser',
|
prop: 'operationUser',
|
||||||
@@ -82,7 +92,7 @@ const searchConfig = reactive([
|
|||||||
component: 'el-date-picker',
|
component: 'el-date-picker',
|
||||||
}, {
|
}, {
|
||||||
label: '处理时间',
|
label: '处理时间',
|
||||||
prop: 'processedTime',
|
prop: 'te',
|
||||||
props: {
|
props: {
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
clearable: true,
|
clearable: true,
|
||||||
@@ -202,7 +212,7 @@ const tableConfig = reactive({
|
|||||||
let btn = []
|
let btn = []
|
||||||
btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' })
|
btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' })
|
||||||
btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' })
|
btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' })
|
||||||
btn.push({ label: '删除', prem: auths.detail, func: () => handleDelete(row), type: 'danger' })
|
btn.push({ label: '删除', prem: auths.detail, func: () => handleDelete(row), type: 'primary' })
|
||||||
return (
|
return (
|
||||||
<div style={{ width: '100%' }}>
|
<div style={{ width: '100%' }}>
|
||||||
{
|
{
|
||||||
@@ -223,14 +233,14 @@ const tableConfig = reactive({
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
api: '/order/list',
|
api: '/order/list',
|
||||||
params: { orderState: "0" },
|
params: {orderState:"0"},
|
||||||
btns: [
|
btns: [
|
||||||
// {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report},
|
// {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report},
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
const search = (val) => {
|
const search = (val) => {
|
||||||
let obj = { ...val, orderState: '0' }
|
let obj = {...val}
|
||||||
if (obj.dateValue) {
|
if (obj.dateValue) {
|
||||||
obj.startTime = obj.dateValue[0]
|
obj.startTime = obj.dateValue[0]
|
||||||
obj.endTime = obj.dateValue[1]
|
obj.endTime = obj.dateValue[1]
|
||||||
@@ -266,26 +276,25 @@ const handleClose = async (row) => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
const info = await orderdClose(row.orderNumber)
|
await orderdClose(row.orderNumber)
|
||||||
// console.log(info);
|
tableIns.value.refresh()
|
||||||
if (info.code === 1000) {
|
ElMessage({
|
||||||
tableIns.value.refresh()
|
type: 'success',
|
||||||
ElMessage({
|
message: '关闭成功',
|
||||||
message: '关闭成功',
|
})
|
||||||
type: 'success',
|
})
|
||||||
})
|
.catch(() => {
|
||||||
} else {
|
// tableIns.value.refresh()
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: info.msg,
|
type: 'info',
|
||||||
type: 'warning',
|
message: '关闭失败',
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
ElMessageBox.alert('此工单已被关闭!', '温馨提示', {
|
ElMessageBox.alert('此工单已被关闭!', '温馨提示', {
|
||||||
// if you want to disable its autofocus
|
// if you want to disable its autofocus
|
||||||
// autofocus: false,
|
// autofocus: false,
|
||||||
type: 'warning',
|
type:'warning',
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -304,20 +313,19 @@ const handleDelete = async (row) => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
const info = await orderdDetele(row.orderNumber)
|
await orderdDetele(row.orderNumber)
|
||||||
console.log(info);
|
tableIns.value.refresh()
|
||||||
if (info.code === 1000) {
|
ElMessage({
|
||||||
tableIns.value.refresh()
|
type: 'success',
|
||||||
ElMessage({
|
message: '删除成功',
|
||||||
message: '删除成功',
|
})
|
||||||
type: 'success',
|
})
|
||||||
})
|
.catch(() => {
|
||||||
} else {
|
// tableIns.value.refresh()
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: info.msg,
|
type: 'info',
|
||||||
type: 'warning',
|
message: '删除失败',
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,142 +1,52 @@
|
|||||||
<template>
|
<template>
|
||||||
<fvSearchForm :searchConfig="searchConfig" @search="searchPhoneTraffic"></fvSearchForm>
|
<fvSearchForm :searchConfig="searchConfig" @search="search">
|
||||||
<fvTable ref="tableIns" :tableConfig="phoneTrafficTableConfig" @headBtnClick="headBtnClick" @selectionChange="selectionChange"></fvTable>
|
</fvSearchForm>
|
||||||
<fvFormDialog ref="formDialogRef" :title="dialogTitle" :dialogType="dialogType"
|
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
|
||||||
:form-schema="formSchema" :form-rules="formRules"
|
|
||||||
@dialogSubmit="handleSubmitAddressBook"></fvFormDialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import { shallowRef } from 'vue';
|
import { shallowRef } from 'vue';
|
||||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
|
||||||
import {addConfig, delConfig, editConfig, getConfigDetails} from "@/api/phone-traffic-config";
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const tableIns = ref()
|
const tableIns = ref()
|
||||||
const formDialogRef = ref()
|
const mockData = ref([
|
||||||
const extraConfigType = ref(1)
|
{
|
||||||
const contactIds = ref("");
|
workOrderNumber: 1211,
|
||||||
const dialogTitle = ref("");
|
workOrderTime: '2022-02-09 00 : 12',
|
||||||
const dialogType = ref("");
|
state: 0,
|
||||||
const formRules = reactive({
|
callState: 0
|
||||||
configName: [
|
},
|
||||||
{required: true, message: "参数名称不能为空", trigger: "blur"},
|
{
|
||||||
],
|
workOrderNumber: 232,
|
||||||
configKey: [
|
state: 1,
|
||||||
{required: true, message: "参数键名不能为空", trigger: "blur"},
|
callState: 1
|
||||||
],
|
}
|
||||||
configValue: [
|
])
|
||||||
{required: true, message: "参数键值不能为空", trigger: "blur"},
|
|
||||||
],
|
|
||||||
configType: [
|
|
||||||
{required: true, message: "系统内置不能为空", trigger: "change"},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
const formSchema = computed(() => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
label: '参数名称',
|
|
||||||
prop: 'configName',
|
|
||||||
component: 'el-input',
|
|
||||||
colProps: {
|
|
||||||
span: 24
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
placeholder: '请输入参数名称',
|
|
||||||
clearable: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '参数键名',
|
|
||||||
prop: 'configKey',
|
|
||||||
component: 'el-input',
|
|
||||||
colProps: {
|
|
||||||
span: 24
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
placeholder: '请输入参数键名',
|
|
||||||
clearable: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '参数键值',
|
|
||||||
prop: 'configValue',
|
|
||||||
component: 'el-input',
|
|
||||||
colProps: {
|
|
||||||
span: 24
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
placeholder: '请输入参数键值',
|
|
||||||
clearable: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '系统内置',
|
|
||||||
prop: 'configType',
|
|
||||||
component: shallowRef(fvSelect),
|
|
||||||
colProps: {
|
|
||||||
span: 24
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
placeholder: '请选择系统内置',
|
|
||||||
cacheKey: 'yes_no',
|
|
||||||
clearable: true,
|
|
||||||
filterable: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '备注',
|
|
||||||
prop: 'remark',
|
|
||||||
component: 'el-input',
|
|
||||||
colProps: {
|
|
||||||
span: 24
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
placeholder: '请输入备注',
|
|
||||||
clearable: true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
]
|
|
||||||
})
|
|
||||||
const searchConfig = reactive([
|
const searchConfig = reactive([
|
||||||
{
|
{
|
||||||
label: '参数名称',
|
label: '名称',
|
||||||
prop: 'configName',
|
prop: 'requirementName',
|
||||||
props: {
|
props: {
|
||||||
placeholder: '请输入参数名称查询',
|
placeholder: '请输入名称查询',
|
||||||
clearable: true,
|
clearable: true,
|
||||||
checkStrictly: true
|
checkStrictly: true
|
||||||
},
|
},
|
||||||
component: 'el-input',
|
component: 'el-input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '参数键名',
|
label: '状态',
|
||||||
prop: 'configKey',
|
prop: 'requirementName',
|
||||||
props: {
|
props: {
|
||||||
placeholder: '请输入参数键名查询',
|
placeholder: '请选择状态查询',
|
||||||
clearable: true,
|
cacheKey: 'work_order_status',
|
||||||
checkStrictly: true
|
|
||||||
},
|
|
||||||
component: 'el-input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '系统内置',
|
|
||||||
prop: 'configType',
|
|
||||||
props: {
|
|
||||||
placeholder: '请选择系统内置查询',
|
|
||||||
cacheKey: 'yes_no',
|
|
||||||
clearable: true,
|
clearable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
},
|
},
|
||||||
component: shallowRef(fvSelect),
|
component: shallowRef(fvSelect),
|
||||||
}
|
},
|
||||||
])
|
])
|
||||||
const phoneTrafficTableConfig = reactive({
|
const tableConfig = reactive({
|
||||||
columns: [
|
columns: [
|
||||||
{
|
|
||||||
type: 'selection',
|
|
||||||
prop: 'selection'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
prop: 'index',
|
prop: 'index',
|
||||||
type: 'index',
|
type: 'index',
|
||||||
@@ -145,206 +55,60 @@ const phoneTrafficTableConfig = reactive({
|
|||||||
width: 80,
|
width: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'configName',
|
prop: 'workOrderNumber',
|
||||||
label: '参数名称',
|
label: 'ID',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'configKey',
|
prop: 'workOrderNumber',
|
||||||
label: '参数键名',
|
label: '名称',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'configValue',
|
prop: 'workOrderNumber',
|
||||||
label: '参数键值',
|
label: '类型',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'configType',
|
prop: 'workOrderNumber',
|
||||||
label: '系统内置',
|
label: '内容',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'workOrderNumber',
|
||||||
|
label: '创建时间',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'state',
|
||||||
|
label: '状态',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
showOverflowTooltip: false,
|
||||||
currentRender: ({ row, index }) => {
|
currentRender: ({ row, index }) => {
|
||||||
if (row.configType !== null) {
|
if (row.state !== null) {
|
||||||
return (<Tag dictType={'yes_no'} value={row.configType} />)
|
return (<Tag dictType={'work_order_status'} value={row.state} />)
|
||||||
} else {
|
} else {
|
||||||
return '--'
|
return '--'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// prop: 'workOrderTime',
|
|
||||||
// label: '创建时间',
|
|
||||||
// align: 'center',
|
|
||||||
// width: 200
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'workOrderNumber',
|
||||||
label: '备注',
|
label: '备注',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'oper',
|
|
||||||
label: '操作',
|
|
||||||
align: 'center',
|
|
||||||
fixed: 'right',
|
|
||||||
width: 150,
|
|
||||||
showOverflowTooltip: false,
|
|
||||||
currentRender: ({row, index}) => {
|
|
||||||
let btn = []
|
|
||||||
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
|
|
||||||
btn.push({label: '删除', func: () => handleSingleDelete(row), type: 'danger'})
|
|
||||||
return (
|
|
||||||
<div style={{width: '100%'}}>
|
|
||||||
{
|
|
||||||
btn.map(item => (
|
|
||||||
<el-button
|
|
||||||
type={item.type}
|
|
||||||
// v-perm={item.prem}
|
|
||||||
onClick={() => item.func()}
|
|
||||||
link
|
|
||||||
>
|
|
||||||
{item.label}
|
|
||||||
</el-button>
|
|
||||||
))
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
api: '/extra/config',
|
api: '',
|
||||||
params: {
|
params: {},
|
||||||
extraConfigType:extraConfigType.value
|
|
||||||
},
|
|
||||||
btns: [
|
btns: [
|
||||||
{name: '新增', key: 'add',type:'primary'},
|
{name: '新增', key: 'add',type:'primary',icon:'Plus'},
|
||||||
{name: '删除', key: 'delete', type: 'danger'},
|
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
const searchPhoneTraffic = (val) => {
|
|
||||||
let obj = {...val,extraConfigType:extraConfigType.value}
|
|
||||||
if (obj.dateValue) {
|
|
||||||
obj.startTime = obj.dateValue[0]
|
|
||||||
obj.endTime = obj.dateValue[1]
|
|
||||||
delete obj.dateValue
|
|
||||||
}
|
|
||||||
phoneTrafficTableConfig.params = obj
|
|
||||||
tableIns.value.refresh()
|
|
||||||
}
|
|
||||||
|
|
||||||
const headBtnClick = (key) => {
|
const headBtnClick = (key) => {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'add':
|
case 'add':
|
||||||
handleAdd()
|
handleAdd()
|
||||||
break;
|
break;
|
||||||
case 'delete':
|
|
||||||
handleMoreDelete()
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleAdd = () => {
|
|
||||||
formDialogRef.value.openOrCloseDialog(true)
|
|
||||||
dialogTitle.value = "新增语音配置";
|
|
||||||
dialogType.value = "add";
|
|
||||||
nextTick(() => {
|
|
||||||
formDialogRef.value.getFormInstance().setValues({})
|
|
||||||
// 清空校验
|
|
||||||
formDialogRef.value.getFormInstance().clearValidate()
|
|
||||||
formDialogRef.value.getFormInstance().resetFields()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const handleEdit = (row) => {
|
|
||||||
formDialogRef.value.openOrCloseDialog(true)
|
|
||||||
getDetail(row)
|
|
||||||
dialogTitle.value = "编辑语音配置";
|
|
||||||
dialogType.value = "edit";
|
|
||||||
}
|
|
||||||
const getDetail = (row) => {
|
|
||||||
getConfigDetails(row.configId,extraConfigType.value).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success(res.msg)
|
|
||||||
res.data.configType=''+res.data.configType
|
|
||||||
nextTick(() => {
|
|
||||||
formDialogRef.value.getFormInstance().setValues(res.data)
|
|
||||||
// 清空校验
|
|
||||||
formDialogRef.value.getFormInstance().clearValidate()
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const selectionChange = (selection) => {
|
|
||||||
if (selection.length !== 0) {
|
|
||||||
contactIds.value = selection.map(item => item.configId).join()
|
|
||||||
} else {
|
|
||||||
contactIds.value=''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const deleteContactMethod = (configId) => {
|
|
||||||
delConfig(configId,extraConfigType.value).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success(res.msg)
|
|
||||||
tableIns.value.refresh()
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const handleMoreDelete = () => {
|
|
||||||
if(contactIds.value){
|
|
||||||
ElMessageBox.confirm(`确认删除选择的语音配置吗?`, '系统提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
deleteContactMethod(contactIds.value)
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
ElMessage.warning("请选择要删除的语音配置")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const handleSingleDelete = (row) => {
|
|
||||||
ElMessageBox.confirm(`确认删除参数名称为${row.configName}的语音配置吗?`, '系统提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
deleteContactMethod(row.configId)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
//提交
|
|
||||||
const handleSubmitAddressBook = async (formInstance) => {
|
|
||||||
if (!formInstance) return;
|
|
||||||
let validate = await formInstance.validate()
|
|
||||||
if (!validate.isValidate) return;
|
|
||||||
let params={
|
|
||||||
...formInstance.getValues(),
|
|
||||||
configType:parseInt(formInstance.getValues().configType),
|
|
||||||
extraConfigType:extraConfigType.value
|
|
||||||
}
|
|
||||||
if (dialogType.value === "add") {
|
|
||||||
addConfig(params).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success(res.msg);
|
|
||||||
tableIns.value.refresh()
|
|
||||||
formDialogRef.value.openOrCloseDialog(false)
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
editConfig(params).then(res => {
|
|
||||||
if (res.code === 1000) {
|
|
||||||
ElMessage.success(res.msg);
|
|
||||||
tableIns.value.refresh()
|
|
||||||
formDialogRef.value.openOrCloseDialog(false)
|
|
||||||
} else {
|
|
||||||
ElMessage.error(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user