Эх сурвалжийг харах

reactor:事件和热点选择可清除;

zhangchong 1 жил өмнө
parent
commit
24f219a71d

+ 2 - 2
src/components/Hotspot/index.vue

@@ -275,13 +275,13 @@ const clear = () => {
 		treeRef.value.setCheckedKeys([]);
 		state.name = '';
 		state.id = [];
-		emit('choose', {});
+    emit('choose', [], [], []);
 		emit('update:modelValue', []);
 	} else {
 		state.id = '';
 		state.name = '';
 		treeRef.value.setCurrentKey(null);
-		emit('choose', [], [], []);
+    emit('choose', {});
 		emit('update:modelValue', '');
 	}
 };

+ 10 - 8
src/views/todo/seats/accept/index.vue

@@ -318,6 +318,7 @@
 											@choose="chooseEvent"
 											type="event"
 											placeholder="请选择事件分类"
+											clearable
 										/>
 									</el-form-item>
 								</el-col>
@@ -329,6 +330,7 @@
 											:externalArr="state.hotspotExternal"
 											@choose="chooseHotSpot"
 											placeholder="请选择热点分类"
+											clearable
 										/>
 									</el-form-item>
 								</el-col>
@@ -633,16 +635,16 @@ const licenceNoPattern = computed(() => {
 });
 // 选择事件分类
 const chooseEvent = (val: any) => {
-	state.ruleForm.eventCategoryName = val.eventName; // 事件分类名称
-	state.ruleForm.eventCategorySpliceName = val.eventFullName; // 事件分类拼接名称
-	state.ruleForm.eventCategoryExternal = val.externalArr.join(','); // 事件分类id
+	state.ruleForm.eventCategoryName = val?.eventName; // 事件分类名称
+	state.ruleForm.eventCategorySpliceName = val?.eventFullName; // 事件分类拼接名称
+	state.ruleForm.eventCategoryExternal = val?.externalArr?.join(',') ?? ''; // 事件分类id
 };
 // 选择热点分类
 const chooseHotSpot = (val: any) => {
-	state.ruleForm.hotspotSpliceName = val.hotSpotFullName; // 热点分类拼接名称
-	state.ruleForm.hotspotName = val.hotSpotName; // 热点分类名称
-	state.ruleForm.hotspotCode = val.provinceCode; // 热点分类code
-	state.ruleForm.hotspotExternal = val.externalArr.join(','); // 热点分类默认展开项
+	state.ruleForm.hotspotSpliceName = val?.hotSpotFullName; // 热点分类拼接名称
+	state.ruleForm.hotspotName = val?.hotSpotName; // 热点分类名称
+	state.ruleForm.hotspotCode = val?.provinceCode; // 热点分类code
+	state.ruleForm.hotspotExternal = val?.externalArr?.join(',') ?? ''; // 热点分类默认展开项
 };
 // 获取事发地址
 const areaRef = ref<RefType>();
@@ -661,7 +663,7 @@ const changeArea = () => {
 		state.ruleForm.county = currentNode[0].pathLabels[2] ?? ''; // 区
 		state.ruleForm.town = currentNode[0].pathLabels[3] ?? ''; // 地区
 		state.ruleForm.areaText = currentNode[0].pathLabels.slice(4).join('') ?? ''; // 地区
-    console.log(state.ruleForm.areaText)
+		console.log(state.ruleForm.areaText);
 	}
 };
 // 根据热点和事发地址去查询重复性事件 是否展示重复性事件