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