Merge pull request 'wxy' (#101) from wxy into master

Reviewed-on: http://git.feashow.cn/feashow/SmartOpsWeb/pulls/101
This commit is contained in:
springlog
2024-09-24 19:09:34 +00:00
6 changed files with 132 additions and 51 deletions

View File

@@ -1,4 +1,5 @@
import request from "@/utils/request.js";
import { method } from "lodash";
export const modifyUser=(data)=>{
return request({
@@ -9,8 +10,16 @@ export const modifyUser=(data)=>{
}
export const editPassword=(data)=>{
return request({
url:'/admin/mosr/user/update/password',
url:'/ops/user/detail/info',
method:'post',
data
})
}
//查询用户详细
export const detailsUser=()=>{
return request({
url:'ops/user/detail/info',
method:'get'
})
}

View File

@@ -0,0 +1,11 @@
import request from '@/utils/request.js'
import { method } from 'lodash'
//获取历史通话文本记录
export const getHistoryCallContent=(params)=>{
return request({
url:`/text/history/list/${params}`,
method:'get'
})
}

View File

@@ -1,7 +1,13 @@
<script setup>
import LiveCallItem from '@/components/liveCall/LiveCallItem.vue'
import { watch } from 'vue';
import { getHistoryCallContent } from '../../api/workbench';
const dialogVisible = ref(false);
const recordLeftRef = ref(null);
const props = defineProps({
rowData: String
})
const open = (row) => {
dialogVisible.value = true;
};
@@ -16,6 +22,26 @@ const recordLeftObj = ref({
content: []
});
watch(() => props.rowData, async (newVal) => {
recordLeftObj.value.content = []
const info = ref({})
await getHistoryCallContent(newVal).then(data => {
// console.log(data);
info.value=data.data[0]
data.data[0].textVoList.forEach(item => {
recordLeftObj.value.content.push(item)
})
})
console.log(info.value);
leftHeadData.value.username = info.value.callIdNumber;
leftHeadData.value.phone = info.value.callPhone;
leftHeadData.value.orderName = info.value.orderName||'--';
})
const scrollToBottom = (scrollbarRef) => {
if (scrollbarRef) {
const container = scrollbarRef.$el.querySelector('.el-scrollbar__wrap');
@@ -29,11 +55,11 @@ scrollToBottom(recordLeftRef.value)
defineExpose({
open,
});
//5555
</script>
<template>
<el-dialog v-model="dialogVisible" title="历史通话记录" width="600" :before-close="handleClose" class="box">
<el-dialog v-model="dialogVisible" title="历史通话记录" width="600" class="box">
<LiveCallItem ref="recordLeftRef" :recordObj="recordLeftObj" :headData="leftHeadData" style="width: 100%;" />
<template #footer>
<div class="dialog-footer">

View File

@@ -20,10 +20,11 @@
<User />
</el-icon>
<strong>工号 :</strong>
<!-- <p>{{ userInfo.orderNum }}</p> -->
<div class="box-info">{{ userParams.userNumber||'--' }}</div>
</div>
<div>{{ userParams.userNumber }}</div>
</div>
<div class="userInfo_item">
<div style="display: flex;align-items: center" class="userInfo_label">
@@ -31,18 +32,18 @@
<Notification />
</el-icon>
<strong>邮箱 :</strong>
<div class="box-info">{{ userParams.email||'--' }}</div>
</div>
<div>{{ userParams.email }}</div>
</div>
<div class="userInfo_item">
<div style="display: flex;align-items: center" class="userInfo_label">
<el-icon size="18" style="margin-right: 5px">
<Notification />
</el-icon><strong>登录账号 :</strong>
<div class="box-info">{{ userParams.loginAccount||'--' }}</div>
</div>
<div>{{ userParams.loginAccount }}</div>
</div>
<div class="userInfo_item">
<div style="display: flex;align-items: center" class="userInfo_label">
@@ -50,9 +51,9 @@
<Folder />
</el-icon>
<strong>用户名称 :</strong>
<div class="box-info">{{ userParams.userName||'--' }}</div>
</div>
<div>{{ userParams.userName }}</div>
</div>
<div class="userInfo_item">
<div style="display: flex;align-items: center" class="userInfo_label">
@@ -60,9 +61,9 @@
<Folder />
</el-icon>
<strong>手机号码 :</strong>
<div class="box-info">{{ userParams.phoneNumber||'--' }}</div>
</div>
<div>{{ userParams.userPhone }}</div>
</div>
<div class="userInfo_item">
<div style="display: flex;align-items: center" class="userInfo_label">
@@ -70,9 +71,9 @@
<Folder />
</el-icon>
<strong>账号类型 :</strong>
<div class="box-info">{{ userParams.remark||'--' }}</div>
</div>
<div>{{ userParams.accountType }}</div>
</div>
</div>
@@ -122,7 +123,8 @@ import { ElNotification } from 'element-plus'
import { useTagsView } from '@/stores/tagsview.js'
import { editPassword } from "@/api/auth/auth";
import { Lock } from '@element-plus/icons-vue'
import { ref } from 'vue';
import { onMounted, ref } from 'vue';
import { detailsUser } from '@/api/auth/auth';
const infoWidth = ref(22)
const isShowDiv = ref(true)
@@ -138,6 +140,18 @@ const userPassword = ref({
});
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 reg = /^(?=.*[a-zA-Z])(?=.*\d).{1,9}$/; //密码必须是至少包含字母、数字1-9位
if (!reg.test(value)) {
@@ -191,7 +205,19 @@ const belongToRole = (roles) => {
// 修改密码
const handleSubmit = async () => {
ElMessageBox.confirm(
// console.log(userPassword.value);
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: '关闭',
@@ -209,16 +235,6 @@ 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()
}
})
}
@@ -321,6 +337,12 @@ div {
border-bottom-style: solid;
border-color: #daddd2;
border-width: 2px;
.box-info{
// background-color: red;
margin: auto;
}
}
//

View File

@@ -7,7 +7,7 @@
<div class="call-history"><h3 >历史通话记录</h3>
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
<voice ref="voiceRef" title="语音详情"/>
<infoLiveCall ref="infoLiveCallRef"/>
<infoLiveCall ref="infoLiveCallRef" :rowData="rowData"/>
</div>
</div>
</template>
@@ -16,6 +16,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 infoLiveCallRef=ref()
const voiceRef=ref()
const tableIns = ref()
@@ -37,30 +38,36 @@ const auths = reactive({
})
const tableConfig = reactive({
columns: [
{
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
width: 80,
},
{
prop: 'orderNumber',
label: '工单号',
align: 'center',
width: 80,
},
{
prop: 'workOrderNumber',
prop: 'orderName',
label: '工单名称',
align: 'center'
},
{
prop: 'workOrderNumber',
prop: 'orderContent',
label: '工单内容',
align: 'center'
},
{
prop: 'workOrderNumber',
prop: 'operationUser',
label: '处理人',
align: 'center'
},
{
prop: 'workOrderNumber',
prop: 'knotter',
label: '关单人',
align: 'center'
},
@@ -124,7 +131,7 @@ const tableConfig = reactive({
}
}
],
api: '',
api: '/order/list',
params: {},
btns: [
// {name: '新增', key: 'add',type:'primary',icon:'Plus'},
@@ -134,7 +141,10 @@ const handleVoice = (row) => {
voiceRef.value.open(true)
}
const handleInfo = (row) => {
// console.log(row);
infoLiveCallRef.value.open(true)
rowData.value = row.orderNumber
}
</script>

View File

@@ -1,7 +1,7 @@
<script setup>
import { nextTick, onMounted, reactive, ref, watch } from "vue";
import { ElMessageBox } from "element-plus";
import { MoreFilled, Check, Download ,VideoPlay} from "@element-plus/icons-vue";
import { MoreFilled, Check, Download, VideoPlay } from "@element-plus/icons-vue";
import { time } from "echarts";
import { defineExpose } from "vue";
import { defineProps } from "vue";
@@ -17,7 +17,7 @@ const props = defineProps({
let opsCallList = ref([]);
let orderData = ref([]);
let orderContent = ref([]);
const voiceRef=ref()
const voiceRef = ref()
const open = (row) => {
dialogVisible.value = true;
};
@@ -108,25 +108,27 @@ watch(() => props.rowData, (newRowData) => {
//电话拨打记录
const dataDetails = data.data.opsCallList
// console.log(dataDetails);
console.log(dataDetails);
const theData = [{ createTime: '', data: [] }]
dataDetails.forEach(for1data => {
theData.forEach(for2data => {
if (for1data.createTime !== for2data.createTime) {
// console.log(for2data);
for2data.createTime = for1data.createTime
for2data.data.push(for1data)
theData.push({ createTime: for1data.createTime, data: [] })
// console.log(for1data.createTime, '--------');
for (let i = 0; i < theData.length; i++) {
// console.log(theData[i]);
if (theData[i].createTime === for1data.createTime) {
theData[i].data.push(for1data)
break;
} else if (theData[i].createTime === '') {
theData[i].createTime = for1data.createTime
theData[i].data.push(for1data)
} else {
for2data.data.push(for1data)
return;
theData.push({ createTime: '', data: [] })
}
})
}
});
theData.pop()
// theData.pop()
// theData[0].data.sort((a, b) => b.answer_time- a.answer_time)
// console.log(theData);
console.log(theData);
theData.forEach(item => {
item.data.forEach(info => {
if (info.answeredTime !== null) {
@@ -183,7 +185,7 @@ const inputOrderContent = (contentState) => {
}
const openRecord = () => {
voiceRef.value.open(true)
voiceRef.value.open(true)
}
defineExpose({
@@ -246,9 +248,10 @@ defineExpose({
<div>录音信息</div>
<div class="textBox—record">
<el-button @click="openRecord" type="primary" :icon="VideoPlay" style="margin-right: 10px ;">播放录音
<el-button @click="openRecord" type="primary" :icon="VideoPlay"
style="margin-right: 10px ;">播放录音
</el-button>
<voice ref="voiceRef" title="录音详情"/>
<voice ref="voiceRef" title="录音详情" />
<a :href="opsCallList.recordUrl" download="record.mp3">
<el-button type="primary" :icon="Download">下载录音</el-button>
</a>