wxy merge master
This commit is contained in:
36
src/api/phone-traffic-config/index.js
Normal file
36
src/api/phone-traffic-config/index.js
Normal file
@@ -0,0 +1,36 @@
|
||||
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'
|
||||
})
|
||||
}
|
||||
|
||||
30
src/api/sensitive-words/index.js
Normal file
30
src/api/sensitive-words/index.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import request from '@/utils/request.js'
|
||||
|
||||
export const addSensitive = (data) => {
|
||||
return request({
|
||||
url: '/sensitive/add',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export const getSensitiveDetail = (sensitiveId) => {
|
||||
return request({
|
||||
url: `/sensitive/${sensitiveId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export const editSensitive = (data) => {
|
||||
return request({
|
||||
url: '/sensitive/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteSensitive = (sensitiveIds) => {
|
||||
return request({
|
||||
url: `/sensitive/${sensitiveIds}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
30
src/api/verbal-trick/index.js
Normal file
30
src/api/verbal-trick/index.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import request from '@/utils/request.js'
|
||||
|
||||
export const addVerbal = (data) => {
|
||||
return request({
|
||||
url: '/verbal/add',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export const getVerbalDetail = (verbalId) => {
|
||||
return request({
|
||||
url: `/verbal/${verbalId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export const editVerbal = (data) => {
|
||||
return request({
|
||||
url: '/verbal/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export const deleteVerbal = (verbalIds) => {
|
||||
return request({
|
||||
url: `/verbal/${verbalIds}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div style="display: flex;justify-content: center">
|
||||
<div style="display: flex;justify-content: center;position:relative;">
|
||||
<span class="stateIcon" :style="{backgroundColor: filterDictClass(cacheStore.getDict(dictType), value)}"></span>
|
||||
<span>{{ tagConfig.label }}</span>
|
||||
<span> {{ filterDict(cacheStore.getDict(dictType), value) }}</span>
|
||||
<span >{{ tagConfig.label }}</span>
|
||||
<span :style="{color: filterDictClass(cacheStore.getDict(dictType), value)}"> {{ filterDict(cacheStore.getDict(dictType), value) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -122,13 +122,13 @@ const initWebSocket = () => {
|
||||
console.log("服务器返回的信息: ", data);
|
||||
if(data.type=='1'){
|
||||
recordLeftObj.value.content.push(data.content)
|
||||
console.info("🚀 ~method:onmessage -----", recordLeftObj.value)
|
||||
// console.info("🚀 ~method:onmessage -----", recordLeftObj.value)
|
||||
nextTick(() => {
|
||||
scrollToBottom(recordLeftRef.value)
|
||||
})
|
||||
}else {
|
||||
recordRightObj.value.content.push(data.content)
|
||||
console.info("🚀 ~method:onmessage -----", recordRightObj.value)
|
||||
// console.info("🚀 ~method:onmessage -----", recordRightObj.value)
|
||||
nextTick(() => {
|
||||
scrollToBottom(recordRightRef.value);
|
||||
})
|
||||
@@ -138,7 +138,7 @@ const initWebSocket = () => {
|
||||
}
|
||||
//连接关闭的回调方法
|
||||
socket.onclose = function () {
|
||||
initWebSocket()
|
||||
// initWebSocket()
|
||||
console.log("ws连接关闭");
|
||||
}
|
||||
setInterval(() => {
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
<el-button v-if="searchConfig.length>=4" link type="primary" @click="showMore = !showMore">
|
||||
{{ showMore ? '收起' : '展开' }}
|
||||
</el-button>
|
||||
<el-button type="primary" @click="getValues" :icon="Search">查询</el-button>
|
||||
<el-button @click="handleReset" :icon="Refresh">重置</el-button>
|
||||
<el-button type="primary" @click="getValues" >查询</el-button>
|
||||
<el-button @click="handleReset" >重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router';
|
||||
import { getCodeImg } from '../../api/login';
|
||||
import { getCodeImg } from '@/api/login';
|
||||
import { useAuthStore } from '@/stores/userstore'
|
||||
import { ElLoading } from 'element-plus'
|
||||
import { User,Lock, Key } from '@element-plus/icons-vue'
|
||||
@@ -85,6 +85,7 @@ const handleLogin = (instance) => {
|
||||
getCode()
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
getCode()
|
||||
ElLoading.service({
|
||||
lock: true,
|
||||
text: '登录中...',
|
||||
|
||||
@@ -1,21 +1,42 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
|
||||
<fvFormDialog ref="formDialogRef" :isVisited="showAddOrEditAddressBookDialog" :title="dialogTitle" :dialogType="dialogType"
|
||||
:form-schema="formSchema" :form-rules="formRules" @dialogCancel="handleCancel"
|
||||
@dialogSubmit="handleSubmit"></fvFormDialog>
|
||||
<div class="address-book">
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="searchAddressBook"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="addressBookTableConfig" @headBtnClick="headBtnClick"
|
||||
@selectionChange="selectionChange"></fvTable>
|
||||
<fvFormDialog ref="formDialogRef" :title="dialogTitle" :dialogType="dialogType"
|
||||
:form-schema="formSchema" :form-rules="formRules"
|
||||
@dialogSubmit="handleSubmitAddressBook"></fvFormDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import {addContact,editContact,getContactDetail,deleteContact} from "@/api/address-book";
|
||||
import {addContact, editContact, getContactDetail, deleteContact} from "@/api/address-book";
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
|
||||
const router = useRouter()
|
||||
const tableIns = ref()
|
||||
const formDialogRef = ref()
|
||||
const contactIds = ref("");
|
||||
const dialogTitle = ref("");
|
||||
const dialogType = ref("");
|
||||
|
||||
|
||||
// 手机号验证
|
||||
const checkPhone = (rule, value, callback) => {
|
||||
const phoneReg = /^1[3|4|5|6|7|8][0-9]{9}$/
|
||||
setTimeout(() => {
|
||||
if (!Number.isInteger(+value)) {
|
||||
callback(new Error('请输入数字值'))
|
||||
} else {
|
||||
if (phoneReg.test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('手机号码格式不正确'))
|
||||
}
|
||||
}
|
||||
}, 100)
|
||||
};
|
||||
const formRules = reactive({
|
||||
siteName: [
|
||||
{required: true, message: "请输入电站", trigger: ["change", "blur"]}
|
||||
@@ -27,7 +48,8 @@ const formRules = reactive({
|
||||
{required: true, message: "请输入姓名", trigger: ["change", "blur"]}
|
||||
],
|
||||
phone: [
|
||||
{required: true, message: "请输入手机号", trigger: ["change", "blur"]}
|
||||
{required: true, message: "请输入手机号码", trigger: ["change", "blur"]},
|
||||
{ validator: checkPhone, trigger: ["change", "blur"]},
|
||||
]
|
||||
});
|
||||
const formSchema = computed(() => {
|
||||
@@ -73,13 +95,14 @@ const formSchema = computed(() => {
|
||||
{
|
||||
label: '手机号',
|
||||
prop: 'phone',
|
||||
component: 'el-input',
|
||||
component: 'el-input-number',
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请输入手机号',
|
||||
clearable: true,
|
||||
controls:false
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -129,8 +152,12 @@ const searchConfig = reactive([
|
||||
component: 'el-input',
|
||||
}
|
||||
])
|
||||
const tableConfig = reactive({
|
||||
const addressBookTableConfig = reactive({
|
||||
columns: [
|
||||
{
|
||||
type: 'selection',
|
||||
prop: 'selection'
|
||||
},
|
||||
{
|
||||
prop: 'index',
|
||||
type: 'index',
|
||||
@@ -178,12 +205,12 @@ const tableConfig = reactive({
|
||||
fixed: 'right',
|
||||
width: 150,
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({ row, index }) => {
|
||||
currentRender: ({row, index}) => {
|
||||
let btn = []
|
||||
btn.push({ label: '编辑', func: () => handleEdit(row), type: 'primary' })
|
||||
btn.push({ label: '删除', func: () => handleDelete(row), type: 'danger' })
|
||||
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
|
||||
btn.push({label: '删除', func: () => handleSingleDelete(row), type: 'danger'})
|
||||
return (
|
||||
<div style={{ width: '100%' }}>
|
||||
<div style={{width: '100%'}}>
|
||||
{
|
||||
btn.map(item => (
|
||||
<el-button
|
||||
@@ -204,17 +231,18 @@ const tableConfig = reactive({
|
||||
api: '/contact/list',
|
||||
params: {},
|
||||
btns: [
|
||||
{name: '新增', key: 'add', type: 'primary', icon: 'Plus'},
|
||||
{name: '新增', key: 'add', type: 'primary'},
|
||||
{name: '删除', key: 'delete', type: 'danger'},
|
||||
]
|
||||
})
|
||||
const search = (val) => {
|
||||
const searchAddressBook = (val) => {
|
||||
let obj = {...val}
|
||||
if (obj.dateValue) {
|
||||
obj.startTime = obj.dateValue[0]
|
||||
obj.endTime = obj.dateValue[1]
|
||||
delete obj.dateValue
|
||||
}
|
||||
tableConfig.params = obj
|
||||
addressBookTableConfig.params = obj
|
||||
tableIns.value.refresh()
|
||||
}
|
||||
|
||||
@@ -223,6 +251,9 @@ const headBtnClick = (key) => {
|
||||
case 'add':
|
||||
handleAdd()
|
||||
break;
|
||||
case 'delete':
|
||||
handleMoreDelete()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,6 +262,7 @@ const handleAdd = () => {
|
||||
dialogTitle.value = "新增通讯录";
|
||||
dialogType.value = "add";
|
||||
nextTick(() => {
|
||||
formDialogRef.value.getFormInstance().setValues({})
|
||||
// 清空校验
|
||||
formDialogRef.value.getFormInstance().clearValidate()
|
||||
formDialogRef.value.getFormInstance().resetFields()
|
||||
@@ -242,7 +274,7 @@ const handleEdit = (row) => {
|
||||
dialogTitle.value = "编辑通讯录";
|
||||
dialogType.value = "edit";
|
||||
}
|
||||
const getDetail=(row)=>{
|
||||
const getDetail = (row) => {
|
||||
getContactDetail(row.contactsId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
@@ -255,25 +287,49 @@ const getDetail=(row)=>{
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleDelete = (row) => {
|
||||
|
||||
const selectionChange = (selection) => {
|
||||
if (selection.length !== 0) {
|
||||
contactIds.value = selection.map(item => item.contactsId).join()
|
||||
} else {
|
||||
contactIds.value=''
|
||||
}
|
||||
}
|
||||
const deleteContactMethod = (contactsId) => {
|
||||
deleteContact(contactsId).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.name}的通讯录吗?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteContact(row.contactsId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
tableIns.value.refresh()
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
deleteContactMethod(row.contactsId)
|
||||
})
|
||||
}
|
||||
|
||||
//提交
|
||||
const handleSubmit = async (formInstance) => {
|
||||
const handleSubmitAddressBook = async (formInstance) => {
|
||||
if (!formInstance) return;
|
||||
let validate = await formInstance.validate()
|
||||
if (!validate.isValidate) return;
|
||||
@@ -300,7 +356,14 @@ const handleSubmit = async (formInstance) => {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.address-book{
|
||||
|
||||
<style scoped>
|
||||
|
||||
.el-input-number {
|
||||
width: 100% !important;
|
||||
.el-input__inner{
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,72 +1,142 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search">
|
||||
</fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="searchPhoneTraffic"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="phoneTrafficTableConfig" @headBtnClick="headBtnClick" @selectionChange="selectionChange"></fvTable>
|
||||
<fvFormDialog ref="formDialogRef" :title="dialogTitle" :dialogType="dialogType"
|
||||
:form-schema="formSchema" :form-rules="formRules"
|
||||
@dialogSubmit="handleSubmitAddressBook"></fvFormDialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import { shallowRef } from '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 tableIns = ref()
|
||||
const mockData = ref([
|
||||
{
|
||||
workOrderNumber: 1211,
|
||||
workOrderTime: '2022-02-09 00 : 12',
|
||||
state: 0,
|
||||
callState: 0
|
||||
},
|
||||
{
|
||||
workOrderNumber: 232,
|
||||
state: 1,
|
||||
callState: 1
|
||||
}
|
||||
])
|
||||
const formDialogRef = ref()
|
||||
const extraConfigType = ref(0)
|
||||
const contactIds = ref("");
|
||||
const dialogTitle = ref("");
|
||||
const dialogType = ref("");
|
||||
const formRules = reactive({
|
||||
configName: [
|
||||
{required: true, message: "参数名称不能为空", trigger: "blur"},
|
||||
],
|
||||
configKey: [
|
||||
{required: true, message: "参数键名不能为空", trigger: "blur"},
|
||||
],
|
||||
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([
|
||||
{
|
||||
label: '配置ID',
|
||||
prop: 'requirementName',
|
||||
label: '参数名称',
|
||||
prop: 'configName',
|
||||
props: {
|
||||
placeholder: '请输入配置ID查询',
|
||||
placeholder: '请输入参数名称查询',
|
||||
clearable: true,
|
||||
checkStrictly: true
|
||||
},
|
||||
component: 'el-input',
|
||||
},
|
||||
{
|
||||
label: '名称',
|
||||
prop: 'requirementName',
|
||||
label: '参数键名',
|
||||
prop: 'configKey',
|
||||
props: {
|
||||
placeholder: '请输入名称查询',
|
||||
placeholder: '请输入参数键名查询',
|
||||
clearable: true,
|
||||
checkStrictly: true
|
||||
},
|
||||
component: 'el-input',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'requirementName',
|
||||
label: '系统内置',
|
||||
prop: 'configType',
|
||||
props: {
|
||||
placeholder: '请选择状态查询',
|
||||
cacheKey: 'work_order_status',
|
||||
placeholder: '请选择系统内置查询',
|
||||
cacheKey: 'yes_no',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
component: shallowRef(fvSelect),
|
||||
},
|
||||
{
|
||||
label: '创建日期',
|
||||
prop: 'requirementName',
|
||||
props: {
|
||||
placeholder: '请选择',
|
||||
clearable: true,
|
||||
checkStrictly: true
|
||||
},
|
||||
component: 'el-date-picker',
|
||||
}
|
||||
])
|
||||
const tableConfig = reactive({
|
||||
const phoneTrafficTableConfig = reactive({
|
||||
columns: [
|
||||
{
|
||||
type: 'selection',
|
||||
prop: 'selection'
|
||||
},
|
||||
{
|
||||
prop: 'index',
|
||||
type: 'index',
|
||||
@@ -75,62 +145,205 @@ const tableConfig = reactive({
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
label: '配置ID',
|
||||
prop: 'configName',
|
||||
label: '参数名称',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
label: '名称',
|
||||
prop: 'configKey',
|
||||
label: '参数键名',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
label: '类型',
|
||||
prop: 'configValue',
|
||||
label: '参数键值',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
label: '内容',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'state',
|
||||
label: '状态',
|
||||
prop: 'configType',
|
||||
label: '系统内置',
|
||||
align: 'center',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({ row, index }) => {
|
||||
if (row.state !== null) {
|
||||
return (<Tag dictType={'work_order_status'} value={row.state} />)
|
||||
if (row.configType !== null) {
|
||||
return (<Tag dictType={'yes_no'} value={row.configType} />)
|
||||
} else {
|
||||
return '--'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'workOrderTime',
|
||||
label: '创建时间',
|
||||
align: 'center',
|
||||
width: 200
|
||||
},
|
||||
// {
|
||||
// prop: 'workOrderTime',
|
||||
// label: '创建时间',
|
||||
// align: 'center',
|
||||
// width: 200
|
||||
// },
|
||||
{
|
||||
prop: 'remark',
|
||||
label: '备注',
|
||||
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: '',
|
||||
params: {},
|
||||
api: '/extra/config',
|
||||
params: {
|
||||
extraConfigType:extraConfigType.value
|
||||
},
|
||||
btns: [
|
||||
{name: '新增', key: 'add',type:'primary',icon:'Plus'},
|
||||
{name: '新增', key: 'add',type:'primary'},
|
||||
{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) => {
|
||||
switch (key) {
|
||||
case 'add':
|
||||
handleAdd()
|
||||
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)
|
||||
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>
|
||||
|
||||
@@ -1,31 +1,89 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search">
|
||||
</fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="searchSensitive"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="sensitiveTableConfig" @headBtnClick="headBtnClick" @selectionChange="selectionChange"></fvTable>
|
||||
<fvFormDialog ref="formDialogRef" :title="dialogTitle" :dialogType="dialogType"
|
||||
:form-schema="formSchema" :form-rules="formRules"
|
||||
@dialogSubmit="handleSubmitAddressBook"></fvFormDialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import { shallowRef } from 'vue';
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {addSensitive, deleteSensitive, editSensitive,getSensitiveDetail} from "@/api/sensitive-words";
|
||||
const router = useRouter()
|
||||
const tableIns = ref()
|
||||
const mockData = ref([
|
||||
{
|
||||
workOrderNumber: 1211,
|
||||
workOrderTime: '2022-02-09 00 : 12',
|
||||
state: 0,
|
||||
callState: 0
|
||||
},
|
||||
{
|
||||
workOrderNumber: 232,
|
||||
state: 1,
|
||||
callState: 1
|
||||
}
|
||||
])
|
||||
const formDialogRef = ref()
|
||||
const contactIds = ref("");
|
||||
const dialogTitle = ref("");
|
||||
const dialogType = ref("");
|
||||
const formRules = reactive({
|
||||
content: [
|
||||
{required: true, message: "请输入内容", trigger: ["change", "blur"]}
|
||||
],
|
||||
substituteWord: [
|
||||
{required: true, message: "请输入替换词", trigger: ["change", "blur"]}
|
||||
],
|
||||
state: [
|
||||
{required: true, message: "请选择状态", trigger: ["change", "blur"]}
|
||||
],
|
||||
});
|
||||
const formSchema = computed(() => {
|
||||
return [
|
||||
{
|
||||
label: '内容',
|
||||
prop: 'content',
|
||||
component: 'el-input',
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请输入内容',
|
||||
clearable: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '替换词',
|
||||
prop: 'substituteWord',
|
||||
component: 'el-input',
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请输入替换词',
|
||||
clearable: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'state',
|
||||
component: shallowRef(fvSelect),
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请选择状态',
|
||||
cacheKey: 'verbal_trick_state',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
}
|
||||
},
|
||||
]
|
||||
})
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '内容',
|
||||
prop: 'content',
|
||||
props: {
|
||||
placeholder: '请输入内容查询',
|
||||
clearable: true,
|
||||
checkStrictly: true
|
||||
},
|
||||
component: 'el-input',
|
||||
},
|
||||
{
|
||||
label: '替换词',
|
||||
prop: 'requirementName',
|
||||
prop: 'substituteWord',
|
||||
props: {
|
||||
placeholder: '请输入替换词查询',
|
||||
clearable: true,
|
||||
@@ -35,18 +93,22 @@ const searchConfig = reactive([
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'requirementName',
|
||||
prop: 'state',
|
||||
props: {
|
||||
placeholder: '请选择状态查询',
|
||||
cacheKey: 'work_order_status',
|
||||
cacheKey: 'verbal_trick_state',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
component: shallowRef(fvSelect),
|
||||
},
|
||||
])
|
||||
const tableConfig = reactive({
|
||||
const sensitiveTableConfig= reactive({
|
||||
columns: [
|
||||
{
|
||||
type: 'selection',
|
||||
prop: 'selection'
|
||||
},
|
||||
{
|
||||
prop: 'index',
|
||||
type: 'index',
|
||||
@@ -55,22 +117,22 @@ const tableConfig = reactive({
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
prop: 'sensitiveId',
|
||||
label: '敏感词ID',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
prop: 'content',
|
||||
label: '内容',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
prop: 'substituteWord',
|
||||
label: '替换词',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
align: 'center'
|
||||
},
|
||||
@@ -81,29 +143,168 @@ const tableConfig = reactive({
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({ row, index }) => {
|
||||
if (row.state !== null) {
|
||||
return (<Tag dictType={'work_order_status'} value={row.state} />)
|
||||
return (<Tag dictType={'verbal_trick_state'} value={row.state} />)
|
||||
} else {
|
||||
return '--'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
label: '备注',
|
||||
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: '',
|
||||
api: '/sensitive/list',
|
||||
params: {},
|
||||
btns: [
|
||||
{name: '新增', key: 'add',type:'primary',icon:'Plus'},
|
||||
{name: '删除', key: 'delete', type: 'danger'},
|
||||
]
|
||||
})
|
||||
const searchSensitive = (val) => {
|
||||
let obj = {...val}
|
||||
if (obj.dateValue) {
|
||||
obj.startTime = obj.dateValue[0]
|
||||
obj.endTime = obj.dateValue[1]
|
||||
delete obj.dateValue
|
||||
}
|
||||
sensitiveTableConfig.params = obj
|
||||
tableIns.value.refresh()
|
||||
}
|
||||
|
||||
const headBtnClick = (key) => {
|
||||
switch (key) {
|
||||
case 'add':
|
||||
handleAdd()
|
||||
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) => {
|
||||
getSensitiveDetail(row.sensitiveId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
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.sensitiveId).join()
|
||||
} else {
|
||||
contactIds.value=''
|
||||
}
|
||||
}
|
||||
const deleteContactMethod = (sensitiveId) => {
|
||||
deleteSensitive(sensitiveId).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.content}的敏感词吗?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteContactMethod(row.sensitiveId)
|
||||
})
|
||||
}
|
||||
|
||||
//提交
|
||||
const handleSubmitAddressBook = async (formInstance) => {
|
||||
if (!formInstance) return;
|
||||
let validate = await formInstance.validate()
|
||||
if (!validate.isValidate) return;
|
||||
if (dialogType.value === "add") {
|
||||
addSensitive(formInstance.getValues()).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg);
|
||||
tableIns.value.refresh()
|
||||
formDialogRef.value.openOrCloseDialog(false)
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
editSensitive(formInstance.getValues()).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg);
|
||||
tableIns.value.refresh()
|
||||
formDialogRef.value.openOrCloseDialog(false)
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,31 +1,25 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search">
|
||||
</fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="searchVerbalTrick"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="verbalTrickTableConfig" @selectionChange="selectionChange" @headBtnClick="headBtnClick"></fvTable>
|
||||
<fvFormDialog ref="formDialogRef" :title="dialogTitle" :dialogType="dialogType"
|
||||
:form-schema="formSchema" :form-rules="formRules"
|
||||
@dialogSubmit="handleSubmitVerbalTrick"></fvFormDialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import { shallowRef } from 'vue';
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {addVerbal, editVerbal,deleteVerbal, getVerbalDetail} from "@/api/verbal-trick";
|
||||
const router = useRouter()
|
||||
const dialogTitle = ref("");
|
||||
const dialogType = ref("");
|
||||
const verbalIds = ref("");
|
||||
const formDialogRef = ref()
|
||||
const tableIns = ref()
|
||||
const mockData = ref([
|
||||
{
|
||||
workOrderNumber: 1211,
|
||||
workOrderTime: '2022-02-09 00 : 12',
|
||||
state: 0,
|
||||
callState: 0
|
||||
},
|
||||
{
|
||||
workOrderNumber: 232,
|
||||
state: 1,
|
||||
callState: 1
|
||||
}
|
||||
])
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '名称',
|
||||
prop: 'requirementName',
|
||||
prop: 'verbalName',
|
||||
props: {
|
||||
placeholder: '请输入名称查询',
|
||||
clearable: true,
|
||||
@@ -33,20 +27,44 @@ const searchConfig = reactive([
|
||||
},
|
||||
component: 'el-input',
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
prop: 'verbalType',
|
||||
props: {
|
||||
placeholder: '请输入类型查询',
|
||||
clearable: true,
|
||||
checkStrictly: true
|
||||
},
|
||||
component: 'el-input',
|
||||
},
|
||||
{
|
||||
label: '内容',
|
||||
prop: 'verbalContent',
|
||||
props: {
|
||||
placeholder: '请输入内容查询',
|
||||
clearable: true,
|
||||
checkStrictly: true
|
||||
},
|
||||
component: 'el-input',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'requirementName',
|
||||
prop: 'state',
|
||||
props: {
|
||||
placeholder: '请选择状态查询',
|
||||
cacheKey: 'work_order_status',
|
||||
cacheKey: 'verbal_trick_state',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
component: shallowRef(fvSelect),
|
||||
},
|
||||
])
|
||||
const tableConfig = reactive({
|
||||
const verbalTrickTableConfig = reactive({
|
||||
columns: [
|
||||
{
|
||||
type: 'selection',
|
||||
prop: 'selection'
|
||||
},
|
||||
{
|
||||
prop: 'index',
|
||||
type: 'index',
|
||||
@@ -55,27 +73,27 @@ const tableConfig = reactive({
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
prop: 'verbalId',
|
||||
label: '话术ID',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
prop: 'verbalName',
|
||||
label: '名称',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
prop: 'verbalType',
|
||||
label: '类型',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
prop: 'verbalContent',
|
||||
label: '内容',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
align: 'center'
|
||||
},
|
||||
@@ -86,29 +104,234 @@ const tableConfig = reactive({
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({ row, index }) => {
|
||||
if (row.state !== null) {
|
||||
return (<Tag dictType={'work_order_status'} value={row.state} />)
|
||||
return (<Tag dictType={'verbal_trick_state'} value={row.state} />)
|
||||
} else {
|
||||
return '--'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
label: '备注',
|
||||
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: '',
|
||||
api: '/verbal/list',
|
||||
params: {},
|
||||
btns: [
|
||||
{name: '新增', key: 'add',type:'primary',icon:'Plus'},
|
||||
{name: '删除', key: 'delete', type: 'danger'},
|
||||
]
|
||||
})
|
||||
const formRules = reactive({
|
||||
verbalName: [
|
||||
{required: true, message: "请输入名称", trigger: ["change", "blur"]}
|
||||
],
|
||||
verbalType: [
|
||||
{required: true, message: "请输入类型", trigger: ["change", "blur"]}
|
||||
],
|
||||
verbalContent: [
|
||||
{required: true, message: "请输入内容", trigger: ["change", "blur"]}
|
||||
],
|
||||
state: [
|
||||
{required: true, message: "请选择状态", trigger: ["change", "blur"]}
|
||||
],
|
||||
});
|
||||
const formSchema = computed(() => {
|
||||
return [
|
||||
{
|
||||
label: '名称',
|
||||
prop: 'verbalName',
|
||||
component: 'el-input',
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请输入名称',
|
||||
clearable: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '类型',
|
||||
prop: 'verbalType',
|
||||
component: 'el-input',
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请输入类型',
|
||||
clearable: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '内容',
|
||||
prop: 'verbalContent',
|
||||
component: 'el-input',
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请输入内容',
|
||||
clearable: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'state',
|
||||
component: shallowRef(fvSelect),
|
||||
colProps: {
|
||||
span: 24
|
||||
},
|
||||
props: {
|
||||
placeholder: '请选择状态',
|
||||
cacheKey: 'verbal_trick_state',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
}
|
||||
},
|
||||
]
|
||||
})
|
||||
const searchVerbalTrick = (val) => {
|
||||
let obj = {...val}
|
||||
if (obj.dateValue) {
|
||||
obj.startTime = obj.dateValue[0]
|
||||
obj.endTime = obj.dateValue[1]
|
||||
delete obj.dateValue
|
||||
}
|
||||
verbalTrickTableConfig.params = obj
|
||||
tableIns.value.refresh()
|
||||
}
|
||||
|
||||
const headBtnClick = (key) => {
|
||||
switch (key) {
|
||||
case 'add':
|
||||
handleAdd()
|
||||
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) => {
|
||||
getVerbalDetail(row.verbalId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
nextTick(() => {
|
||||
formDialogRef.value.getFormInstance().setValues(res.data)
|
||||
// 清空校验
|
||||
formDialogRef.value.getFormInstance().clearValidate()
|
||||
})
|
||||
} else {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const selectionChange = (selection) => {
|
||||
if (selection.length !== 0) {
|
||||
verbalIds.value = selection.map(item => item.verbalId).join()
|
||||
} else {
|
||||
verbalIds.value=''
|
||||
}
|
||||
}
|
||||
const deleteContactMethod = (verbalId) => {
|
||||
deleteVerbal(verbalId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
tableIns.value.refresh()
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleMoreDelete = () => {
|
||||
if(verbalIds.value){
|
||||
ElMessageBox.confirm(`确认删除选择的话术吗?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteContactMethod(verbalIds.value)
|
||||
})
|
||||
}else{
|
||||
ElMessage.warning("请选择要删除的话术")
|
||||
}
|
||||
}
|
||||
const handleSingleDelete = (row) => {
|
||||
ElMessageBox.confirm(`确认删除名称为${row.verbalName}的话术吗?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteContactMethod(row.verbalId)
|
||||
})
|
||||
}
|
||||
|
||||
//提交
|
||||
const handleSubmitVerbalTrick = async (formInstance) => {
|
||||
if (!formInstance) return;
|
||||
let validate = await formInstance.validate()
|
||||
if (!validate.isValidate) return;
|
||||
if (dialogType.value === "add") {
|
||||
addVerbal(formInstance.getValues()).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg);
|
||||
tableIns.value.refresh()
|
||||
formDialogRef.value.openOrCloseDialog(false)
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
editVerbal(formInstance.getValues()).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg);
|
||||
tableIns.value.refresh()
|
||||
formDialogRef.value.openOrCloseDialog(false)
|
||||
} else {
|
||||
ElMessage.error(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,52 +1,142 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search">
|
||||
</fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="searchPhoneTraffic"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="phoneTrafficTableConfig" @headBtnClick="headBtnClick" @selectionChange="selectionChange"></fvTable>
|
||||
<fvFormDialog ref="formDialogRef" :title="dialogTitle" :dialogType="dialogType"
|
||||
:form-schema="formSchema" :form-rules="formRules"
|
||||
@dialogSubmit="handleSubmitAddressBook"></fvFormDialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import { shallowRef } from '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 tableIns = ref()
|
||||
const mockData = ref([
|
||||
{
|
||||
workOrderNumber: 1211,
|
||||
workOrderTime: '2022-02-09 00 : 12',
|
||||
state: 0,
|
||||
callState: 0
|
||||
},
|
||||
{
|
||||
workOrderNumber: 232,
|
||||
state: 1,
|
||||
callState: 1
|
||||
}
|
||||
])
|
||||
const formDialogRef = ref()
|
||||
const extraConfigType = ref(1)
|
||||
const contactIds = ref("");
|
||||
const dialogTitle = ref("");
|
||||
const dialogType = ref("");
|
||||
const formRules = reactive({
|
||||
configName: [
|
||||
{required: true, message: "参数名称不能为空", trigger: "blur"},
|
||||
],
|
||||
configKey: [
|
||||
{required: true, message: "参数键名不能为空", trigger: "blur"},
|
||||
],
|
||||
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([
|
||||
{
|
||||
label: '名称',
|
||||
prop: 'requirementName',
|
||||
label: '参数名称',
|
||||
prop: 'configName',
|
||||
props: {
|
||||
placeholder: '请输入名称查询',
|
||||
placeholder: '请输入参数名称查询',
|
||||
clearable: true,
|
||||
checkStrictly: true
|
||||
},
|
||||
component: 'el-input',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'requirementName',
|
||||
label: '参数键名',
|
||||
prop: 'configKey',
|
||||
props: {
|
||||
placeholder: '请选择状态查询',
|
||||
cacheKey: 'work_order_status',
|
||||
placeholder: '请输入参数键名查询',
|
||||
clearable: true,
|
||||
checkStrictly: true
|
||||
},
|
||||
component: 'el-input',
|
||||
},
|
||||
{
|
||||
label: '系统内置',
|
||||
prop: 'configType',
|
||||
props: {
|
||||
placeholder: '请选择系统内置查询',
|
||||
cacheKey: 'yes_no',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
component: shallowRef(fvSelect),
|
||||
},
|
||||
}
|
||||
])
|
||||
const tableConfig = reactive({
|
||||
const phoneTrafficTableConfig = reactive({
|
||||
columns: [
|
||||
{
|
||||
type: 'selection',
|
||||
prop: 'selection'
|
||||
},
|
||||
{
|
||||
prop: 'index',
|
||||
type: 'index',
|
||||
@@ -55,60 +145,205 @@ const tableConfig = reactive({
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
label: 'ID',
|
||||
prop: 'configName',
|
||||
label: '参数名称',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
label: '名称',
|
||||
prop: 'configKey',
|
||||
label: '参数键名',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
label: '类型',
|
||||
prop: 'configValue',
|
||||
label: '参数键值',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
label: '内容',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
label: '创建时间',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'state',
|
||||
label: '状态',
|
||||
prop: 'configType',
|
||||
label: '系统内置',
|
||||
align: 'center',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({ row, index }) => {
|
||||
if (row.state !== null) {
|
||||
return (<Tag dictType={'work_order_status'} value={row.state} />)
|
||||
if (row.configType !== null) {
|
||||
return (<Tag dictType={'yes_no'} value={row.configType} />)
|
||||
} else {
|
||||
return '--'
|
||||
}
|
||||
}
|
||||
},
|
||||
// {
|
||||
// prop: 'workOrderTime',
|
||||
// label: '创建时间',
|
||||
// align: 'center',
|
||||
// width: 200
|
||||
// },
|
||||
{
|
||||
prop: 'workOrderNumber',
|
||||
prop: 'remark',
|
||||
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: '',
|
||||
params: {},
|
||||
api: '/extra/config',
|
||||
params: {
|
||||
extraConfigType:extraConfigType.value
|
||||
},
|
||||
btns: [
|
||||
{name: '新增', key: 'add',type:'primary',icon:'Plus'},
|
||||
{name: '新增', key: 'add',type:'primary'},
|
||||
{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) => {
|
||||
switch (key) {
|
||||
case 'add':
|
||||
handleAdd()
|
||||
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)
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user