zhangchong 2 жил өмнө
parent
commit
64c7babbfc

+ 3 - 18
src/components/LogicFlow/PropertySetting/summary.vue

@@ -19,14 +19,7 @@
 				prop="handlerClassifiesOrgin"
 				:rules="[{ required: true, message: `请选择${itemName}`, trigger: 'change' }]"
 			>
-				<el-select
-					v-model="form.handlerClassifiesOrgin"
-					multiple
-					filterable
-					class="w100"
-					@change="getSelectValue"
-					value-key="id"
-				>
+				<el-select v-model="form.handlerClassifiesOrgin" multiple filterable class="w100" @change="getSelectValue" value-key="id">
 					<el-option v-for="item in selectList" :key="item.id" :label="item.name" :value="item" />
 				</el-select>
 			</el-form-item>
@@ -111,6 +104,7 @@
 import { reactive, watch, onMounted, ref } from 'vue';
 import { baseData, getSelectList } from '/@/api/system/workflow';
 import { ElMessageBox, ElMessage } from 'element-plus';
+import { removeDuplicate } from '/@/utils/arrayOperation';
 import { queryUser } from '/@/api/login/user';
 import { auth } from '/@/utils/authFunction';
 import { getcanuseorg } from '/@/api/system/user';
@@ -185,15 +179,6 @@ const checkChange = () => {
 	// 使用模板字符串
 	form.handlerClassifies = `${JSON.stringify(arr)}`;
 };
-const removeDuplicateObj = (arr: any[]) => {
-	let obj = {};
-	arr = arr.reduce((newArr: any, next: any) => {
-		obj[next.id] ? '' : (obj[next.id] = true && newArr.push(next));
-		return newArr;
-	}, []);
-	return arr;
-};
-
 // 远程搜索用户名称
 const remoteMethod = (query: string) => {
 	if (query !== '') {
@@ -201,7 +186,7 @@ const remoteMethod = (query: string) => {
 		queryUser({ name: query }).then((res: any) => {
 			loading.value = false;
 			usetList.value.push(...res.result);
-			usetList.value = removeDuplicateObj(usetList.value);
+			usetList.value = removeDuplicate(usetList.value, 'id');
 			usetList.value = usetList.value.map((item: any) => {
 				if (!item.name.includes('-')) {
 					return {

+ 3 - 17
src/components/LogicFlow/PropertySetting/task.vue

@@ -19,14 +19,7 @@
 				prop="handlerClassifiesOrgin"
 				:rules="[{ required: true, message: `请选择${itemName}`, trigger: 'change' }]"
 			>
-				<el-select
-					v-model="form.handlerClassifiesOrgin"
-					multiple
-					filterable
-					class="w100"
-					@change="getSelectValue"
-					value-key="id"
-				>
+				<el-select v-model="form.handlerClassifiesOrgin" multiple filterable class="w100" @change="getSelectValue" value-key="id">
 					<el-option v-for="item in selectList" :key="item.id" :label="item.name" :value="item" />
 				</el-select>
 			</el-form-item>
@@ -107,6 +100,7 @@ import { queryUser } from '/@/api/login/user';
 import { ElMessage } from 'element-plus';
 import { auth } from '/@/utils/authFunction';
 import { getcanuseorg } from '/@/api/system/user';
+import { removeDuplicate } from '/@/utils/arrayOperation';
 // 注意:ref不能与model一样,相同的话表单双向绑定将会失效
 const form = reactive<any>({} as any);
 const ruleFormRef = ref();
@@ -156,14 +150,6 @@ const changeOptions = (e: any) => {
 		getcanuseorgFn();
 	}
 };
-const removeDuplicateObj = (arr: any[]) => {
-	let obj = {};
-	arr = arr.reduce((newArr: any, next: any) => {
-		obj[next.id] ? '' : (obj[next.id] = true && newArr.push(next));
-		return newArr;
-	}, []);
-	return arr;
-};
 // 远程搜索用户名称
 const remoteMethod = (query: string) => {
 	if (query !== '') {
@@ -171,7 +157,7 @@ const remoteMethod = (query: string) => {
 		queryUser({ name: query }).then((res: any) => {
 			loading.value = false;
 			usetList.value.push(...res.result);
-			usetList.value = removeDuplicateObj(usetList.value);
+			usetList.value = removeDuplicate(usetList.value, 'id');
 			usetList.value = usetList.value.map((item: any) => {
 				if (!item.name.includes('-')) {
 					return {

+ 2 - 0
src/views/knowledge/apply/component/ApplyHandle.vue

@@ -110,6 +110,7 @@ const state = reactive<any>({
 	ruleForm: {
 		knowledgeApplyType: 1,
 		KnowledgeId: '',
+		code:''
 	},
 	orgData: [], // 上级
 	loading: false,
@@ -168,6 +169,7 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
 				id: state.ruleForm.id,
 				knowledgeId: state.ruleForm.knowledgeId,
 				opinion: state.ruleForm.opinion,
+				code:state.ruleForm.code
 			};
 			KnowledgeHandle(request)
 				.then(() => {

+ 125 - 61
src/views/system/config/timeLimit/component/TimelimitAdd.vue

@@ -3,17 +3,17 @@
 		<el-dialog v-model="state.isShowDialog" width="60%" draggable title="新增时限">
 			<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="100px" scroll-to-error>
 				<el-row :gutter="5">
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="8">
+					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
 						<el-form-item label="配置名称" prop="timeLimitName" :rules="[{ required: true, message: '请输入配置名称', trigger: 'blur' }]">
 							<el-input v-model="state.ruleForm.timeLimitName" placeholder="请输入配置名称" clearable max-length="50"></el-input>
 						</el-form-item>
 					</el-col>
-					<el-col :xs="24" :sm="10" :md="10" :lg="10" :xl="8">
+					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
 						<el-form-item label="业务名称" prop="workflowObj" :rules="[{ required: true, message: '请选择业务名称', trigger: 'change' }]">
 							<el-select
 								v-model="state.ruleForm.workflowObj"
 								placeholder="请选择业务名称"
-								class="w100"
+								style="width: calc(100% - 60px);"
 								value-key="key"
 								@change="(val:any)=>{
 								state.ruleForm.workflowCode = val.key;
@@ -22,14 +22,8 @@
 							>
 								<el-option v-for="item in state.moduleOptions" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="2" :md="2" :lg="2" :xl="8" v-if="state.ruleForm.workflowCode === 'Order'">
-						<el-form-item label="" label-width="10px">
-							<el-tooltip placement="top-start">
-								<div style="height: 34px" class="flex-center-align">
-									<SvgIcon name="ele-InfoFilled" size="24px" color="var(--el-color-primary)" />
-								</div>
+							<el-tooltip placement="top-start" v-if="state.ruleForm.workflowCode === 'Order'">
+									<SvgIcon name="ele-InfoFilled" size="24px" color="var(--el-color-primary)" class="ml15"/>
 								<template #content>
 									说明:时限计算优先级依次为指定优先级、组合、时限最短。<br />
 									若已配置指定参数优先级的,则先按指定的优先级计算办理期限;
@@ -41,7 +35,7 @@
 					</el-col>
 				</el-row>
 			</el-form>
-			<el-collapse v-model="state.collapseArr" class="collapse-box" v-loading="state.loading" v-if="state.ruleForm.workflowCode === 'Order'">
+			<el-collapse v-model="state.collapseArr"  class="collapse-box mt20" style="border-top:none" v-loading="state.loading" v-if="state.ruleForm.workflowCode === 'Order'">
 				<p class="border-title mb10">参数信息</p>
 				<!-- 参数多选 -->
 				<div class="pl20 pr20">
@@ -209,7 +203,7 @@
 						<template #default="{ row }">
 							<div class="flex-center-align">
 								<span class="omit text-no-wrap" :title="row.combinationDisplayParam">{{ row.combinationDisplayParam }}</span>
-								<el-button class="ml3" text title="查看" type="primary" @click="chooseCombination(row)">
+								<el-button class="ml3" text title="配置参数" type="primary" @click="chooseCombination(row)">
 									<SvgIcon name="ele-Edit" size="16px" />
 								</el-button>
 							</div>
@@ -270,7 +264,14 @@
 				<el-row :gutter="5">
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="受理类型" prop="acceptType" :rules="[{ required: false, message: '请选择受理类型', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.acceptType" placeholder="请选择受理类型" class="w100" value-key="key">
+							<el-select
+								v-model="state.paramForm.acceptType"
+								placeholder="请选择受理类型"
+								class="w100"
+								value-key="key"
+								clearable
+								@clear="clearCombinationParam('AcceptType')"
+							>
 								<el-option v-for="item in state.result.acceptType" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
 						</el-form-item>
@@ -291,48 +292,90 @@
 								@node-click="getComHotspot"
 								ref="hotspotComRef"
 								:default-expanded-keys="state.hotspotExternalCom"
+								clearable
+								@clear="clearCombinationParam('HotPots')"
 							/>
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="来源渠道" prop="sourceChannel" :rules="[{ required: false, message: '请选择来源渠道', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.sourceChannel" placeholder="请选择来源渠道" class="w100" value-key="key" filterable>
+							<el-select
+								v-model="state.paramForm.sourceChannel"
+								placeholder="请选择来源渠道"
+								class="w100"
+								value-key="key"
+								filterable
+								clearable
+								@clear="clearCombinationParam('SourceChannel')"
+							>
 								<el-option v-for="item in state.result.sourceChannel" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="来电人身份" prop="identityType" :rules="[{ required: false, message: '请选择来电人身份', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.identityType" placeholder="请选择来电人身份" class="w100" value-key="key" filterable>
+							<el-select
+								v-model="state.paramForm.identityType"
+								placeholder="请选择来电人身份"
+								class="w100"
+								value-key="key"
+								filterable
+								clearable
+								@clear="clearCombinationParam('IdentityType')"
+							>
 								<el-option v-for="item in state.result.identityType" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="工单类型" prop="orderType" :rules="[{ required: false, message: '请选择工单类型', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.orderType" placeholder="请选择工单类型" class="w100" value-key="key" filterable>
+							<el-select
+								v-model="state.paramForm.orderType"
+								placeholder="请选择工单类型"
+								class="w100"
+								value-key="key"
+								filterable
+								clearable
+								@clear="clearCombinationParam('OrderType')"
+							>
 								<el-option v-for="item in state.result.orderType" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="证件类型" prop="certType" :rules="[{ required: false, message: '请选择证件类型类', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.certType" placeholder="请选择证件类型" class="w100" value-key="dicDataValue" filterable>
+							<el-select
+								v-model="state.paramForm.certType"
+								placeholder="请选择证件类型"
+								class="w100"
+								value-key="dicDataValue"
+								filterable
+								clearable
+								@clear="clearCombinationParam('LicenceType')"
+							>
 								<el-option v-for="item in state.result.certType" :key="item.dicDataValue" :label="item.dicDataName" :value="item" />
 							</el-select>
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="紧急程度" prop="emergencyLevel" :rules="[{ required: false, message: '请选择紧急程度', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.emergencyLevel" placeholder="请选择紧急程度" class="w100" value-key="key" filterable>
+							<el-select
+								v-model="state.paramForm.emergencyLevel"
+								placeholder="请选择紧急程度"
+								class="w100"
+								value-key="key"
+								filterable
+								clearable
+								@clear="clearCombinationParam('EmergencyLevel')"
+							>
 								<el-option v-for="item in state.result.emergencyLevel" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
 						</el-form-item>
 					</el-col>
 					<!-- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="默认参数" prop="emergencyLevel" :rules="[{ required: false, message: '请选择默认参数', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.emergencyLevel" placeholder="请选择默认参数" class="w100" value-key="key" filterable>
-								<el-option v-for="item in state.result.emergencyLevel" :key="item.key" :label="item.value" :value="item"  />
+							<el-select v-model="state.paramForm.emergencyLevel" placeholder="请选择默认参数" class="w100" value-key="key" filterable clearable>
+								<el-option v-for="item in state.result.emergencyLevel" :key="item.key" :label="item.value" :value="item" @clear="clearCombinationParam('EmergencyLevel')" />
 							</el-select>
 						</el-form-item>
 					</el-col> -->
@@ -352,9 +395,11 @@
 import { ref, reactive } from 'vue';
 import { ElMessage, ElMessageBox } from 'element-plus';
 import { guid } from '/@/utils/tools';
+import { removeDuplicate } from '/@/utils/arrayOperation';
 import draggable from 'vuedraggable';
 import { hotspottype } from '/@/api/business/order';
 import { timelimitAdd, timelimitUpdate } from '/@/api/system/timeLimit';
+import { ConsoleLogger } from '@microsoft/signalr/dist/esm/Utils';
 // 定义子组件向父组件传值/事件
 const emit = defineEmits(['updateList', 'openDialog', 'closeDialog']);
 const paramTypeNameType = {
@@ -413,6 +458,19 @@ const getParentId = (val: any, arr: string[]) => {
 	}
 	return arr;
 };
+const resetState = () => {
+	state.parameterList = [];
+	state.paramArr = [];
+	state.currentParm = null;
+	state.selectArray = [];
+	state.paramSelect = [];
+	state.priority = [];
+	state.combination = [];
+	state.hotspotExternal = [];
+	state.external = [];
+	state.hotspotExternalCom = [];
+	state.externalCom = [];
+};
 const openDialog = (baseData: any) => {
 	state.ruleForm.workflowCode = '';
 	const { baseData: stateBaseData = [], timeType = [], moduleOptions = [] } = baseData;
@@ -420,6 +478,7 @@ const openDialog = (baseData: any) => {
 	state.baseData = stateBaseData; //基础数据
 	state.timeType = timeType; //单位
 	state.moduleOptions = moduleOptions; //业务名称
+	resetState();
 	ruleFormRef.value?.resetFields();
 	state.isShowDialog = true;
 	emit('openDialog');
@@ -617,73 +676,78 @@ const getComHotspot = (val: any, e: any) => {
 	state.hotspotExternalCom = getParentId(e, state.externalCom);
 	state.paramForm.hotspotSpliceName = val.hotSpotFullName;
 };
+// 删除组合参数
+const clearCombinationParam = (val: any) => {
+	let item = state.combination.find((item: any) => item.id === state.paramForm.id);
+	item.combinationParam = item.combinationParam.filter((v: any) => v.paramType !== val);
+};
 // 参数组合确定
 const onConfirmCom = () => {
 	let comName: string[] = [];
-	const index = state.combination.findIndex((item: any) => item.id === state.paramForm.id);
-	if (index != -1) {
-		if (state.combination[index].acceptType?.value) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].acceptType.value,
-				paramValue: state.combination[index].acceptType.key,
+	let item = state.combination.find((item: any) => item.id === state.paramForm.id);
+	if (item) {
+		if (item.acceptType?.value) {
+			item.combinationParam.push({
+				paramName: item.acceptType.value,
+				paramValue: item.acceptType.key,
 				hotParamParent: '',
 				paramType: 'AcceptType',
 			});
-			comName.push(`受理类型-${state.combination[index].acceptType.value}`);
+			comName.push(`受理类型-${item.acceptType.value}`);
 		}
-		if (state.combination[index]?.hotspot) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].hotspotSpliceName,
-				paramValue: state.combination[index].hotspot,
+		if (item?.hotspot) {
+			item.combinationParam.push({
+				paramName: item.hotspotSpliceName,
+				paramValue: item.hotspot,
 				hotParamParent: state.hotspotExternalCom.join(','),
 				paramType: 'HotPots',
 			});
-			comName.push(`热点分类-${state.combination[index].hotspotSpliceName}`);
+			comName.push(`热点分类-${item.hotspotSpliceName}`);
 		}
-		if (state.combination[index].identityType?.value) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].identityType.value,
-				paramValue: state.combination[index].identityType.key,
+		if (item.identityType?.value) {
+			item.combinationParam.push({
+				paramName: item.identityType.value,
+				paramValue: item.identityType.key,
 				hotParamParent: '',
 				paramType: 'IdentityType',
 			});
-			comName.push(`来电人身份-${state.combination[index].identityType.value}`);
+			comName.push(`来电人身份-${item.identityType.value}`);
 		}
-		if (state.combination[index].sourceChannel?.value) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].sourceChannel.value,
-				paramValue: state.combination[index].sourceChannel.key,
+		if (item.sourceChannel?.value) {
+			item.combinationParam.push({
+				paramName: item.sourceChannel.value,
+				paramValue: item.sourceChannel.key,
 				hotParamParent: '',
 				paramType: 'SourceChannel',
 			});
-			comName.push(`来源渠道-${state.combination[index].sourceChannel.value}`);
+			comName.push(`来源渠道-${item.sourceChannel.value}`);
 		}
-		if (state.combination[index].orderType?.value) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].orderType.value,
-				paramValue: state.combination[index].orderType.key,
+		if (item.orderType?.value) {
+			item.combinationParam.push({
+				paramName: item.orderType.value,
+				paramValue: item.orderType.key,
 				hotParamParent: '',
 				paramType: 'OrderType',
 			});
-			comName.push(`工单类型-${state.combination[index].orderType.value}`);
+			comName.push(`工单类型-${item.orderType.value}`);
 		}
-		if (state.combination[index].certType?.dicDataName) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].certType.dicDataName,
-				paramValue: state.combination[index].certType.dicDataValue,
+		if (item.certType?.dicDataName) {
+			item.combinationParam.push({
+				paramName: item.certType.dicDataName,
+				paramValue: item.certType.dicDataValue,
 				hotParamParent: '',
 				paramType: 'LicenceType',
 			});
-			comName.push(`证件类型-${state.combination[index].certType.dicDataName}`);
+			comName.push(`证件类型-${item.certType.dicDataName}`);
 		}
-		if (state.combination[index].emergencyLevel?.value) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].emergencyLevel.value,
-				paramValue: state.combination[index].emergencyLevel.key,
+		if (item.emergencyLevel?.value) {
+			item.combinationParam.push({
+				paramName: item.emergencyLevel.value,
+				paramValue: item.emergencyLevel.key,
 				hotParamParent: '',
 				paramType: 'EmergencyLevel',
 			});
-			comName.push(`紧急程度-${state.combination[index].emergencyLevel.value}`);
+			comName.push(`紧急程度-${item.emergencyLevel.value}`);
 		}
 		// if(state.paramForm.emergencyLevel.value){
 		// 	state.paramForm.push({
@@ -696,14 +760,14 @@ const onConfirmCom = () => {
 		// }
 	}
 	state.paramForm.hotParamParent = state.hotspotExternalCom.join(',');
-
-	if (state.combination[index].combinationParam.length < 2) {
+	item.combinationParam = removeDuplicate(item.combinationParam, 'paramType');
+	if (item.combinationParam.length < 2) {
 		ElMessageBox.alert('一个组合中至少包含两个参数', '提示', {
 			confirmButtonText: '确定',
 		});
 		return;
 	}
-	state.combination[index].combinationDisplayParam = comName.join('&');
+	item.combinationDisplayParam = comName.join('&');
 	state.paramDialog = false;
 };
 // 定义一个函数来检查某个属性是否存在,如果不存在就给出提示信息,并返回false

+ 109 - 68
src/views/system/config/timeLimit/component/TimelimitEdit.vue

@@ -3,17 +3,17 @@
 		<el-dialog v-model="state.isShowDialog" width="60%" draggable title="新增时限">
 			<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="100px" scroll-to-error>
 				<el-row :gutter="5">
-					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="8">
+					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
 						<el-form-item label="配置名称" prop="timeLimitName" :rules="[{ required: true, message: '请输入配置名称', trigger: 'blur' }]">
 							<el-input v-model="state.ruleForm.timeLimitName" placeholder="请输入配置名称" clearable max-length="50"></el-input>
 						</el-form-item>
 					</el-col>
-					<el-col :xs="24" :sm="10" :md="10" :lg="10" :xl="8">
+					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
 						<el-form-item label="业务名称" prop="workflowObj" :rules="[{ required: true, message: '请选择业务名称', trigger: 'change' }]">
 							<el-select
 								v-model="state.ruleForm.workflowObj"
 								placeholder="请选择业务名称"
-								class="w100"
+								style="width: calc(100% - 60px);"
 								value-key="key"
 								@change="(val:any)=>{
 								state.ruleForm.workflowCode = val.key;
@@ -22,14 +22,8 @@
 							>
 								<el-option v-for="item in state.moduleOptions" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
-						</el-form-item>
-					</el-col>
-					<el-col :xs="24" :sm="2" :md="2" :lg="2" :xl="8" v-if="state.ruleForm.workflowCode === 'Order'">
-						<el-form-item label="" label-width="10px">
-							<el-tooltip placement="top-start">
-								<div style="height: 34px" class="flex-center-align">
-									<SvgIcon name="ele-InfoFilled" size="24px" color="var(--el-color-primary)" />
-								</div>
+							<el-tooltip placement="top-start" v-if="state.ruleForm.workflowCode === 'Order'">
+								<SvgIcon name="ele-InfoFilled" size="24px" color="var(--el-color-primary)" class="ml15" />
 								<template #content>
 									说明:时限计算优先级依次为指定优先级、组合、时限最短。<br />
 									若已配置指定参数优先级的,则先按指定的优先级计算办理期限;
@@ -41,7 +35,7 @@
 					</el-col>
 				</el-row>
 			</el-form>
-			<el-collapse v-model="state.collapseArr" class="collapse-box" v-loading="state.loading" v-if="state.ruleForm.workflowCode === 'Order'">
+			<el-collapse v-model="state.collapseArr" class="collapse-box mt20" style="border-top:none" v-loading="state.loading" v-if="state.ruleForm.workflowCode === 'Order'">
 				<p class="border-title mb10">参数信息</p>
 				<!-- 参数多选 -->
 				<div class="pl20 pr20">
@@ -209,7 +203,7 @@
 						<template #default="{ row }">
 							<div class="flex-center-align">
 								<span class="omit text-no-wrap" :title="row.combinationDisplayParam">{{ row.combinationDisplayParam }}</span>
-								<el-button class="ml3" text title="查看" type="primary" @click="chooseCombination(row)">
+								<el-button class="ml3" text title="配置参数" type="primary" @click="chooseCombination(row)">
 									<SvgIcon name="ele-Edit" size="16px" />
 								</el-button>
 							</div>
@@ -270,7 +264,14 @@
 				<el-row :gutter="5">
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="受理类型" prop="acceptType" :rules="[{ required: false, message: '请选择受理类型', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.acceptType" placeholder="请选择受理类型" class="w100" value-key="key">
+							<el-select
+								v-model="state.paramForm.acceptType"
+								placeholder="请选择受理类型"
+								class="w100"
+								value-key="key"
+								clearable
+								@clear="clearCombinationParam('AcceptType')"
+							>
 								<el-option v-for="item in state.result.acceptType" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
 						</el-form-item>
@@ -291,40 +292,82 @@
 								@node-click="getComHotspot"
 								ref="hotspotComRef"
 								:default-expanded-keys="state.hotspotExternalCom"
+								clearable
+								@clear="clearCombinationParam('HotPots')"
 							/>
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="来源渠道" prop="sourceChannel" :rules="[{ required: false, message: '请选择来源渠道', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.sourceChannel" placeholder="请选择来源渠道" class="w100" value-key="key" filterable>
+							<el-select
+								v-model="state.paramForm.sourceChannel"
+								placeholder="请选择来源渠道"
+								class="w100"
+								value-key="key"
+								filterable
+								clearable
+								@clear="clearCombinationParam('SourceChannel')"
+							>
 								<el-option v-for="item in state.result.sourceChannel" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="来电人身份" prop="identityType" :rules="[{ required: false, message: '请选择来电人身份', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.identityType" placeholder="请选择来电人身份" class="w100" value-key="key" filterable>
+							<el-select
+								v-model="state.paramForm.identityType"
+								placeholder="请选择来电人身份"
+								class="w100"
+								value-key="key"
+								filterable
+								clearable
+								@clear="clearCombinationParam('IdentityType')"
+							>
 								<el-option v-for="item in state.result.identityType" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="工单类型" prop="orderType" :rules="[{ required: false, message: '请选择工单类型', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.orderType" placeholder="请选择工单类型" class="w100" value-key="key" filterable>
+							<el-select
+								v-model="state.paramForm.orderType"
+								placeholder="请选择工单类型"
+								class="w100"
+								value-key="key"
+								filterable
+								clearable
+								@clear="clearCombinationParam('OrderType')"
+							>
 								<el-option v-for="item in state.result.orderType" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="证件类型" prop="certType" :rules="[{ required: false, message: '请选择证件类型类', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.certType" placeholder="请选择证件类型" class="w100" value-key="dicDataValue" filterable>
+							<el-select
+								v-model="state.paramForm.certType"
+								placeholder="请选择证件类型"
+								class="w100"
+								value-key="dicDataValue"
+								filterable
+								clearable
+								@clear="clearCombinationParam('LicenceType')"
+							>
 								<el-option v-for="item in state.result.certType" :key="item.dicDataValue" :label="item.dicDataName" :value="item" />
 							</el-select>
 						</el-form-item>
 					</el-col>
 					<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
 						<el-form-item label="紧急程度" prop="emergencyLevel" :rules="[{ required: false, message: '请选择紧急程度', trigger: 'change' }]">
-							<el-select v-model="state.paramForm.emergencyLevel" placeholder="请选择紧急程度" class="w100" value-key="key" filterable>
+							<el-select
+								v-model="state.paramForm.emergencyLevel"
+								placeholder="请选择紧急程度"
+								class="w100"
+								value-key="key"
+								filterable
+								clearable
+								@clear="clearCombinationParam('EmergencyLevel')"
+							>
 								<el-option v-for="item in state.result.emergencyLevel" :key="item.key" :label="item.value" :value="item" />
 							</el-select>
 						</el-form-item>
@@ -352,6 +395,7 @@
 import { ref, reactive } from 'vue';
 import { ElMessage, ElMessageBox } from 'element-plus';
 import { guid } from '/@/utils/tools';
+import { removeDuplicate } from '/@/utils/arrayOperation';
 import draggable from 'vuedraggable';
 import { hotspottype } from '/@/api/business/order';
 import { timelimitDetail, timelimitUpdate } from '/@/api/system/timeLimit';
@@ -427,14 +471,6 @@ const resetState = () => {
 	state.hotspotExternalCom = [];
 	state.externalCom = [];
 };
-const removeDuplicateObj = (arr: any[]) => {
-	let obj = {};
-	arr = arr.reduce((newArr, next) => {
-		obj[next.typeCode] ? '' : (obj[next.typeCode] = true && newArr.push(next));
-		return newArr;
-	}, []);
-	return arr;
-};
 // 打开弹窗
 const openDialog = (val: any, baseData: any) => {
 	state.isShowDialog = true;
@@ -465,7 +501,7 @@ const openDialog = (val: any, baseData: any) => {
 						state.parameterList.push({
 							...j,
 						});
-						state.parameterList = removeDuplicateObj(state.parameterList);
+						state.parameterList = removeDuplicate(state.parameterList, 'typeCode');
 						parameterChange(true, j);
 					}
 				}
@@ -762,73 +798,78 @@ const getComHotspot = (val: any, e: any) => {
 	state.hotspotExternalCom = getParentId(e, state.externalCom);
 	state.paramForm.hotspotSpliceName = val.hotSpotFullName;
 };
+// 删除组合参数
+const clearCombinationParam = (val: any) => {
+	let item = state.combination.find((item: any) => item.id === state.paramForm.id);
+	item.combinationParam = item.combinationParam.filter((v: any) => v.paramType !== val);
+};
 // 参数组合确定
 const onConfirmCom = () => {
 	let comName: string[] = [];
-	const index = state.combination.findIndex((item: any) => item.id === state.paramForm.id);
-	if (index != -1) {
-		if (state.combination[index].acceptType?.value) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].acceptType.value,
-				paramValue: state.combination[index].acceptType.key,
+	let item = state.combination.find((item: any) => item.id === state.paramForm.id);
+	if (item) {
+		if (item.acceptType?.value) {
+			item.combinationParam.push({
+				paramName: item.acceptType.value,
+				paramValue: item.acceptType.key,
 				hotParamParent: '',
 				paramType: 'AcceptType',
 			});
-			comName.push(`受理类型-${state.combination[index].acceptType.value}`);
+			comName.push(`受理类型-${item.acceptType.value}`);
 		}
-		if (state.combination[index]?.hotspot) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].hotspotSpliceName,
-				paramValue: state.combination[index].hotspot,
+		if (item?.hotspot) {
+			item.combinationParam.push({
+				paramName: item.hotspotSpliceName,
+				paramValue: item.hotspot,
 				hotParamParent: state.hotspotExternalCom.join(','),
 				paramType: 'HotPots',
 			});
-			comName.push(`热点分类-${state.combination[index].hotspotSpliceName}`);
+			comName.push(`热点分类-${item.hotspotSpliceName}`);
 		}
-		if (state.combination[index].identityType?.value) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].identityType.value,
-				paramValue: state.combination[index].identityType.key,
+		if (item.identityType?.value) {
+			item.combinationParam.push({
+				paramName: item.identityType.value,
+				paramValue: item.identityType.key,
 				hotParamParent: '',
 				paramType: 'IdentityType',
 			});
-			comName.push(`来电人身份-${state.combination[index].identityType.value}`);
+			comName.push(`来电人身份-${item.identityType.value}`);
 		}
-		if (state.combination[index].sourceChannel?.value) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].sourceChannel.value,
-				paramValue: state.combination[index].sourceChannel.key,
+		if (item.sourceChannel?.value) {
+			item.combinationParam.push({
+				paramName: item.sourceChannel.value,
+				paramValue: item.sourceChannel.key,
 				hotParamParent: '',
 				paramType: 'SourceChannel',
 			});
-			comName.push(`来源渠道-${state.combination[index].sourceChannel.value}`);
+			comName.push(`来源渠道-${item.sourceChannel.value}`);
 		}
-		if (state.combination[index].orderType?.value) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].orderType.value,
-				paramValue: state.combination[index].orderType.key,
+		if (item.orderType?.value) {
+			item.combinationParam.push({
+				paramName: item.orderType.value,
+				paramValue: item.orderType.key,
 				hotParamParent: '',
 				paramType: 'OrderType',
 			});
-			comName.push(`工单类型-${state.combination[index].orderType.value}`);
+			comName.push(`工单类型-${item.orderType.value}`);
 		}
-		if (state.combination[index].certType?.dicDataName) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].certType.dicDataName,
-				paramValue: state.combination[index].certType.dicDataValue,
+		if (item.certType?.dicDataName) {
+			item.combinationParam.push({
+				paramName: item.certType.dicDataName,
+				paramValue: item.certType.dicDataValue,
 				hotParamParent: '',
 				paramType: 'LicenceType',
 			});
-			comName.push(`证件类型-${state.combination[index].certType.dicDataName}`);
+			comName.push(`证件类型-${item.certType.dicDataName}`);
 		}
-		if (state.combination[index].emergencyLevel?.value) {
-			state.combination[index].combinationParam.push({
-				paramName: state.combination[index].emergencyLevel.value,
-				paramValue: state.combination[index].emergencyLevel.key,
+		if (item.emergencyLevel?.value) {
+			item.combinationParam.push({
+				paramName: item.emergencyLevel.value,
+				paramValue: item.emergencyLevel.key,
 				hotParamParent: '',
 				paramType: 'EmergencyLevel',
 			});
-			comName.push(`紧急程度-${state.combination[index].emergencyLevel.value}`);
+			comName.push(`紧急程度-${item.emergencyLevel.value}`);
 		}
 		// if(state.paramForm.emergencyLevel.value){
 		// 	state.paramForm.push({
@@ -840,14 +881,15 @@ const onConfirmCom = () => {
 		// 	comName+=`默认参数-${state.paramForm.emergencyLevel.value}&`;
 		// }
 	}
+	item.combinationParam = removeDuplicate(item.combinationParam, 'paramType');
 	state.paramForm.hotParamParent = state.hotspotExternalCom.join(',');
-	if (state.combination[index].combinationParam.length < 2) {
+	if (item.combinationParam.length < 2) {
 		ElMessageBox.alert('一个组合中至少包含两个参数', '提示', {
 			confirmButtonText: '确定',
 		});
 		return;
 	}
-	state.combination[index].combinationDisplayParam = comName.join('&');
+	item.combinationDisplayParam = comName.join('&');
 	state.paramDialog = false;
 };
 // 定义一个函数来检查某个属性是否存在,如果不存在就给出提示信息,并返回false
@@ -951,7 +993,6 @@ const onConfirm = () => {
 				// 检查timeLimit或者timeLimi(这里可能是拼写错误)是否存在或者为0
 				if (!checkProperty(i, 'timeLimit', `请选择组合单位`)) return;
 			}
-			console.log(state.paramArr, state.priority, state.combination);
 			// timelimitAdd(state.ruleForm).then(() => {
 			// 	ElMessage.success('操作成功');
 			// 	emit('updateList');

+ 2 - 9
src/views/system/config/timeLimit/component/TimelmitDetail.vue

@@ -187,6 +187,7 @@
 <script lang="ts" setup name="addTimeLimit">
 import { reactive } from 'vue';
 import { timelimitDetail } from '/@/api/system/timeLimit';
+import { removeDuplicate } from '/@/utils/arrayOperation';
 // 定义子组件向父组件传值/事件
 const emit = defineEmits(['updateList', 'openDialog', 'closeDialog']);
 const paramTypeNameType = {
@@ -218,14 +219,6 @@ const state = reactive<any>({
 	loading: false,
 	timeLimitId: null as any,
 });
-const removeDuplicateObj = (arr: any[]) => {
-	let obj = {};
-	arr = arr.reduce((newArr, next) => {
-		obj[next.typeCode] ? '' : (obj[next.typeCode] = true && newArr.push(next));
-		return newArr;
-	}, []);
-	return arr;
-};
 // 打开弹窗
 const openDialog = (val: any, baseData: any) => {
 	state.isShowDialog = true;
@@ -250,7 +243,7 @@ const openDialog = (val: any, baseData: any) => {
 						state.parameterList.push({
 							...j,
 						});
-						state.parameterList = removeDuplicateObj(state.parameterList);
+						state.parameterList = removeDuplicate(state.parameterList, 'typeCode');
 						parameterChange(true, j);
 					}
 				}