Merge pull request 'dd' (#133) from dd into master
Reviewed-on: http://git.feashow.cn/feashow/SmartOpsWeb/pulls/133
This commit is contained in:
@@ -20,9 +20,9 @@ steps:
|
||||
- npm -v
|
||||
- mkdir -p ./node_modules
|
||||
- export NODE_MODULES_PATH=`pwd`/node_modules
|
||||
# - npm config set registry https://registry.npmmirror.com
|
||||
- set NODE_OPTIONS=--openssl-legacy-provider
|
||||
# - npm install
|
||||
# - npm config set registry https://registry.npmmirror.com
|
||||
# - set NODE_OPTIONS=--openssl-legacy-provider
|
||||
# - npm install
|
||||
- npm run build
|
||||
- echo $NODE_MODULES_PATH
|
||||
- cp -r dist /app/build/$DRONE_REPO_NAME
|
||||
|
||||
@@ -12,5 +12,5 @@ docker rmi smartopsweb:latest
|
||||
echo '----build image start----'
|
||||
docker build -t smartopsweb:latest .
|
||||
echo '----build image success----'
|
||||
docker run --name smartopsweb -d -p 28081:80 smartopsweb:latest
|
||||
docker run --name smartopsweb --restart=always -d -p 28081:80 smartopsweb:latest
|
||||
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
<script setup>
|
||||
import LiveCallItem from '@/components/liveCall/LiveCallItem.vue'
|
||||
import {getHistoryCallContent} from '@/api/workbench';
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
const dialogVisible = ref(false);
|
||||
const recordLeftRef = ref(null);
|
||||
const emit = defineEmits(['update:value'])
|
||||
const props = defineProps({
|
||||
rowData: String
|
||||
value: {
|
||||
type:String,
|
||||
default:''
|
||||
}
|
||||
})
|
||||
|
||||
const open = (row) => {
|
||||
@@ -13,14 +18,20 @@ const open = (row) => {
|
||||
};
|
||||
|
||||
const leftHeadData = ref({
|
||||
username: '张三',
|
||||
phone: '13546812315',
|
||||
orderName: '张三工单',
|
||||
// username: '张三',
|
||||
// phone: '13546812315',
|
||||
// orderName: '张三工单',
|
||||
})
|
||||
const detailLoading=ref(false)
|
||||
const recordLeftObj = ref({});
|
||||
const _value = computed({
|
||||
get() {
|
||||
return props.value;
|
||||
},
|
||||
set(val) {
|
||||
emit("update:value", val);
|
||||
}
|
||||
})
|
||||
|
||||
const recordLeftObj = ref({
|
||||
content: []
|
||||
});
|
||||
const convertArrayToMap=(array)=> {
|
||||
const map = new Map();
|
||||
array.forEach(item => {
|
||||
@@ -35,22 +46,33 @@ const convertArrayToMap=(array)=> {
|
||||
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 || '--';
|
||||
}
|
||||
})
|
||||
watch(() => props.value, async (newVal) => {
|
||||
if(newVal){
|
||||
|
||||
getHistoryDetail(newVal)
|
||||
}
|
||||
})
|
||||
const getHistoryDetail=(newVal)=>{
|
||||
detailLoading.value=true
|
||||
getHistoryCallContent(newVal).then(res => {
|
||||
if (res.code === 1000) {
|
||||
detailLoading.value=false
|
||||
res.data?.forEach(item => {
|
||||
if( item.textVoList&& item.textVoList.length>0){
|
||||
item.textVoList = convertArrayToMap(item.textVoList);
|
||||
}
|
||||
})
|
||||
recordLeftObj.value = 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 || '--';
|
||||
}
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const scrollToBottom = (scrollbarRef) => {
|
||||
if (scrollbarRef) {
|
||||
@@ -68,8 +90,8 @@ defineExpose({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" title="历史通话记录" width="600" class="box">
|
||||
<LiveCallItem ref="recordLeftRef" :recordArray="recordLeftObj" :headData="leftHeadData" style="width: 100%;"/>
|
||||
<el-dialog v-model="dialogVisible" title="历史通话记录" width="700" class="box">
|
||||
<LiveCallItem ref="recordLeftRef" :recordArray="recordLeftObj" :headData="leftHeadData" style="width: 100%;" :detailLoading="detailLoading"/>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogVisible = false">
|
||||
@@ -82,6 +104,6 @@ defineExpose({
|
||||
|
||||
<style>
|
||||
.box {
|
||||
height: 68vh;
|
||||
/*height: 68vh;*/
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<template>
|
||||
<div class="live-call">
|
||||
<div class="live-call" v-loading="detailLoading">
|
||||
<div class="header">
|
||||
<div>
|
||||
<span style="margin-right: 20px">{{ headData.username }}</span>
|
||||
<span>电话号码:{{ headData.phone }}</span>
|
||||
</div>
|
||||
<div><span>工单名称:{{ headData.orderName }}</span></div>
|
||||
<div>
|
||||
<span>电话号码:{{ headData.phone ||'--'}}</span>
|
||||
</div>
|
||||
<div><span>工单名称:{{ headData.orderName ||'--'}}</span></div>
|
||||
</div>
|
||||
<el-scrollbar ref="scrollbarRef" class="scrollbar">
|
||||
<div class="chat-content" ref="innerRef">
|
||||
@@ -31,8 +33,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider border-style="dotted" v-if="item">一轮通话结束~~</el-divider>
|
||||
<el-divider border-style="dotted" v-if="item.textVoList&&item.textVoList.length>0">一轮通话结束~~</el-divider>
|
||||
</div>
|
||||
<!-- <el-empty description="暂无通话记录~" v-if="recordArray"/>-->
|
||||
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
@@ -51,10 +55,17 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
detailLoading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
})
|
||||
const getScrollbarRef = () => {
|
||||
return scrollbarRef.value
|
||||
}
|
||||
watch(() => props.detailLoading, (newVal) => {
|
||||
props.detailLoading=newVal
|
||||
})
|
||||
defineExpose({
|
||||
getScrollbarRef
|
||||
})
|
||||
@@ -62,7 +73,7 @@ defineExpose({
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.live-call {
|
||||
width: 48%;
|
||||
width: 50%;
|
||||
height: 47vh;
|
||||
margin-bottom: 20px;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
<div class="live-call">
|
||||
<div class="header">
|
||||
<div>
|
||||
<span style="margin-right: 20px">{{ headData.username }}</span>
|
||||
<span>{{ headData.phone }}</span>
|
||||
<span style="margin-right: 20px">姓名:{{ recordObj.name ||'--'}}</span>
|
||||
<span>电话号码:{{ recordObj.phone ||'--'}}</span>
|
||||
</div>
|
||||
<div><span>工单名称:{{ headData.orderName }}</span></div>
|
||||
<div><span>工单名称:{{ recordObj.orderName||'--' }}</span></div>
|
||||
<div><span>{{ recordObj.type=='1'?'线路一':recordObj.type=='2'?'线路二':'' }}</span></div>
|
||||
</div>
|
||||
<el-scrollbar ref="scrollbarRef" class="scrollbar">
|
||||
<div class="chat-content" ref="innerRef">
|
||||
@@ -14,7 +15,8 @@
|
||||
<!-- 我的 -->
|
||||
<div v-if="item.speaker==0" class="word-my">
|
||||
<div class="info">
|
||||
<p class="name">{{ item.speaker==0?headData.username:'AI助手' }} </p>
|
||||
<!-- <p class="name">{{ item.speaker==0?recordObj.name:'AI助手' }} </p>-->
|
||||
<p class="name">{{ item.speaker==0?item.callIdNumber:'AI助手' }} </p>
|
||||
<div class="info-content">{{ item.message }}</div>
|
||||
</div>
|
||||
<el-avatar text="我"/>
|
||||
@@ -23,11 +25,15 @@
|
||||
<div v-else class="word">
|
||||
<el-avatar text="对方"/>
|
||||
<div class="info">
|
||||
<p class="name">{{ item.speaker==0?headData.username:'AI助手' }} </p>
|
||||
<p class="name">{{ item.speaker==0?item.callIdNumber:'AI助手' }} </p>
|
||||
<div class="info-content">{{ item.message }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <el-divider border-style="dotted" v-if="handleShowDeadLine(recordObj)">一轮通话结束~~</el-divider>-->
|
||||
<!-- <el-empty description="暂无通话记录~" v-else/>-->
|
||||
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
@@ -46,9 +52,28 @@ const props = defineProps({
|
||||
default: {}
|
||||
},
|
||||
})
|
||||
|
||||
const getScrollbarRef=()=>{
|
||||
return scrollbarRef.value
|
||||
}
|
||||
const handleShowDeadLine=(recordObj)=>{
|
||||
console.info("🚀 ~method:'recordObj' -----", recordObj)
|
||||
let flag=false
|
||||
if(recordObj.content&&recordObj.content.length>1){
|
||||
let indices = recordObj.content.reduce(function (r, v, i) {
|
||||
return r.concat(v === 'a' ? i : []);
|
||||
}, []);
|
||||
|
||||
console.log(indices);
|
||||
|
||||
recordObj.content.forEach((item,index)=>{
|
||||
console.info("🚀 ~method:.callIdNumber -----",recordObj.content.findIndex(item=>item.callIdNumber), item.callIdNumber)
|
||||
flag=recordObj.content[recordObj.content.length-2]?.callIdNumber!=recordObj.content[recordObj.content.length-1].callIdNumber
|
||||
|
||||
})
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
defineExpose({
|
||||
getScrollbarRef
|
||||
})
|
||||
|
||||
@@ -17,71 +17,21 @@ const authStore = useAuthStore()
|
||||
const recordLeftRef = ref(null);
|
||||
const recordRightRef = ref(null);
|
||||
const leftHeadData = ref({
|
||||
username: '张三',
|
||||
phone: '13546812315',
|
||||
orderName: '张三工单',
|
||||
// username: '张三',
|
||||
// phone: '13546812315',
|
||||
// orderName: '张三工单',
|
||||
})
|
||||
const rightHeadData = ref({
|
||||
username: '李四',
|
||||
phone: '18246812546',
|
||||
orderName: '李四工单',
|
||||
// username: '李四',
|
||||
// phone: '18246812546',
|
||||
// orderName: '李四工单',
|
||||
})
|
||||
const recordLeftObj = ref({
|
||||
content: []
|
||||
}
|
||||
// {
|
||||
// "callIdNumber": "17260625724565",
|
||||
// "content": [{
|
||||
// "callIdNumber": "17260625724565",
|
||||
// "conversationId": 0,
|
||||
// "conversationTimestamp": "2024-09-15 12:10",
|
||||
// "createTime": "2024-09-16",
|
||||
// "message": "你好11",
|
||||
// "speaker": "1"
|
||||
// },
|
||||
// {
|
||||
// "callIdNumber": "17260625724565",
|
||||
// "conversationId": 0,
|
||||
// "conversationTimestamp": "2024-09-15 16:10",
|
||||
// "createTime": "2024-09-16",
|
||||
// "message": "你好好11!",
|
||||
// "speaker": "0"
|
||||
// }
|
||||
// ],
|
||||
// "name": "",
|
||||
// "phone": "",
|
||||
// "timestamp": "1726416597958",
|
||||
// "type": "1"
|
||||
// }
|
||||
)
|
||||
content: []
|
||||
})
|
||||
const recordRightObj = ref({
|
||||
content: []
|
||||
}
|
||||
// {
|
||||
// "callIdNumber": "17260625724123",
|
||||
// "content": [{
|
||||
// "callIdNumber": "17260625724123",
|
||||
// "conversationId": 0,
|
||||
// "conversationTimestamp": "2024-09-15 12:10",
|
||||
// "createTime": "2024-09-16",
|
||||
// "message": "你好22",
|
||||
// "speaker": "1"
|
||||
// },
|
||||
// {
|
||||
// "callIdNumber": "17260625724123",
|
||||
// "conversationId": 0,
|
||||
// "conversationTimestamp": "2024-09-15 16:10",
|
||||
// "createTime": "2024-09-16",
|
||||
// "message": "你好好222!",
|
||||
// "speaker": "0"
|
||||
// }
|
||||
// ],
|
||||
// "name": "",
|
||||
// "phone": "",
|
||||
// "timestamp": "1726416597958",
|
||||
// "type": "2"
|
||||
// }
|
||||
)
|
||||
content: []
|
||||
})
|
||||
let socket = reactive("");
|
||||
let token = getToken();
|
||||
let send = {
|
||||
@@ -139,12 +89,20 @@ const initWebSocket = () => {
|
||||
}
|
||||
console.log("服务器返回的信息: ", data);
|
||||
if (data.type == '1') {
|
||||
recordLeftObj.value.name=data.name
|
||||
recordLeftObj.value.phone=data.phone
|
||||
recordLeftObj.value.type=data.type
|
||||
recordLeftObj.value.orderName=data.orderName
|
||||
recordLeftObj.value.content.push(data.content)
|
||||
// console.info("🚀 ~method:onmessage -----", recordLeftObj.value)
|
||||
nextTick(() => {
|
||||
scrollToBottom(recordLeftRef.value)
|
||||
})
|
||||
} else {
|
||||
recordRightObj.value.name=data.name
|
||||
recordRightObj.value.phone=data.phone
|
||||
recordRightObj.value.type=data.type
|
||||
recordRightObj.value.orderName=data.orderName
|
||||
recordRightObj.value.content.push(data.content)
|
||||
// console.info("🚀 ~method:onmessage -----", recordRightObj.value)
|
||||
nextTick(() => {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<h3>历史通话记录</h3>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig"></fvTable>
|
||||
<voice ref="voiceRef" title="语音详情" :rowUrl="rowUrl" />
|
||||
<infoLiveCall ref="infoLiveCallRef" :rowData="rowData" />
|
||||
<infoLiveCall ref="infoLiveCallRef" v-model:value="orderNumber" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -17,7 +17,7 @@
|
||||
import LiveCall from '@/components/liveCall/index.vue'
|
||||
import Voice from '@/components/voice/index.vue'
|
||||
import InfoLiveCall from '@/components/infoLiveCall/index.vue'
|
||||
const rowData = ref()
|
||||
const orderNumber = ref('')
|
||||
const rowUrl = ref()
|
||||
const infoLiveCallRef = ref()
|
||||
const voiceRef = ref()
|
||||
@@ -121,7 +121,6 @@ const tableConfig = reactive({
|
||||
],
|
||||
api: '/order/list',
|
||||
params: {
|
||||
orderState: '2'
|
||||
}
|
||||
})
|
||||
const handleVoice = (row) => {
|
||||
@@ -137,10 +136,9 @@ const handleVoice = (row) => {
|
||||
|
||||
}
|
||||
const handleInfo = (row) => {
|
||||
console.log(row);
|
||||
|
||||
infoLiveCallRef.value.open(true)
|
||||
rowData.value = row.orderNumber
|
||||
console.log('fefe',row.orderNumber);
|
||||
orderNumber.value = row.orderNumber
|
||||
infoLiveCallRef.value.open()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
|
||||
<fvFormDialog v-if="showAddOrEditUserDialog" ref="formDialogRef" :title="dialogTitle" :form-schema="formSchema" :form-rules="formRules" @dialogCancel="handleCancel" @dialogSubmit="handleSubmit"></fvFormDialog>
|
||||
<fvFormDialog ref="formDialogRef" :title="dialogTitle" :dialogType="dialogType"
|
||||
:form-schema="formSchema" :form-rules="formRules"
|
||||
@dialogSubmit="handleSubmitAddressBook"></fvFormDialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -11,6 +13,7 @@ import {useCacheStore} from "@/stores/cache.js";
|
||||
|
||||
const tableIns = ref()
|
||||
const formDialogRef = ref()
|
||||
const dialogType = ref("");
|
||||
const showAddOrEditUserDialog = ref(false)
|
||||
const dialogTitle = ref("");
|
||||
const searchConfig = reactive([
|
||||
@@ -68,7 +71,7 @@ const tableConfig = reactive({
|
||||
api: '/user',
|
||||
params: {},
|
||||
btns: [
|
||||
{name: '导入', key: 'add', type: 'primary'},
|
||||
{name: '新增', key: 'add', type: 'primary'},
|
||||
]
|
||||
})
|
||||
const formRules = reactive({
|
||||
@@ -179,36 +182,60 @@ const headBtnClick = (key) => {
|
||||
}
|
||||
//新增用户
|
||||
const handleAdd = () => {
|
||||
// showAddOrEditUserDialog.value = true
|
||||
showAddOrEditUserDialog.value = true
|
||||
// formRules.value.password[0].required = true
|
||||
// restForm();
|
||||
// dialogTitle.value = "新增用户";
|
||||
// nextTick(()=>{
|
||||
// // 清空校验
|
||||
// formDialogRef.value.getFormInstance().clearValidate()
|
||||
// formDialogRef.value.getFormInstance().resetFields()
|
||||
// })
|
||||
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) => {
|
||||
getUserDetail(row.userId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
nextTick(() => {
|
||||
formDialogRef.value.getFormInstance().setValues(res.data)
|
||||
// 清空校验
|
||||
formDialogRef.value.getFormInstance().clearValidate()
|
||||
})
|
||||
} else {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//取消
|
||||
const handleCancel = () => {
|
||||
showAddOrEditUserDialog.value = false;
|
||||
};
|
||||
|
||||
//提交
|
||||
const handleSubmit = async (formInstance) => {
|
||||
if (!formInstance) return;
|
||||
formInstance.validate(async (valid) => {
|
||||
if (!valid) return;
|
||||
// if (title.value === "新增用户") {
|
||||
// addUser(userForm.value).then(res => {
|
||||
// if (res.code === 1000) {
|
||||
// ElMessage.success(res.msg);
|
||||
// isVisited.value = false;
|
||||
// } else {
|
||||
// ElMessage.error(res.msg);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
})
|
||||
let validate = await formInstance.validate()
|
||||
if (!validate.isValidate) return;
|
||||
if (dialogType.value === "add") {
|
||||
addUser(formInstance.getValues()).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg);
|
||||
tableIns.value.refresh()
|
||||
formDialogRef.value.openOrCloseDialog(false)
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
// editUser
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user