baijunde пре 10 месеци
родитељ
комит
123d2dfb8d
2 измењених фајлова са 293 додато и 163 уклоњено
  1. 251 154
      src/views/quoteConfig/dispatch/components/rule.vue
  2. 42 9
      src/views/quoteConfig/dispatch/index.vue

+ 251 - 154
src/views/quoteConfig/dispatch/components/rule.vue

@@ -69,10 +69,10 @@
                   v-if="getConditionType(domain.attrCode) === 'radio'"
                   v-if="getConditionType(domain.attrCode) === 'radio'"
                 >
                 >
                   <el-radio
                   <el-radio
-                    :value="item.id"
+                    :value="item.id+''"
                     size="large"
                     size="large"
                     v-for="item in getOptions(domain.attrCode)"
                     v-for="item in getOptions(domain.attrCode)"
-                    :key="item.id"
+                    :key="item.id+''"
                     >{{ item.name }}</el-radio
                     >{{ item.name }}</el-radio
                   >
                   >
                 </el-radio-group>
                 </el-radio-group>
@@ -291,10 +291,12 @@
                 style="display: inline-block; margin: 0 20px"
                 style="display: inline-block; margin: 0 20px"
               >
               >
                 <el-input
                 <el-input
-                   v-model="formData.actionJson[1].name"
+                  v-model="formData.actionJson[1].name"
                   style="width: 327px"
                   style="width: 327px"
                   placeholder="变更后对接人姓名"
                   placeholder="变更后对接人姓名"
-                 :disabled="formData.actionJson[1].linkType === 'select_account'"
+                  :disabled="
+                    formData.actionJson[1].linkType === 'select_account'
+                  "
                   clearable
                   clearable
                 />
                 />
               </el-form-item>
               </el-form-item>
@@ -309,7 +311,9 @@
                   placeholder="变更后对接人手机号"
                   placeholder="变更后对接人手机号"
                   maxlength="11"
                   maxlength="11"
                   @input="handlePhoneInput"
                   @input="handlePhoneInput"
-                  :disabled="formData.actionJson[1].linkType === 'select_account'"
+                  :disabled="
+                    formData.actionJson[1].linkType === 'select_account'
+                  "
                   clearable
                   clearable
                 />
                 />
               </el-form-item>
               </el-form-item>
@@ -333,7 +337,7 @@
                   :disabled="formData.actionJson[1].linkType === 'manual_input'"
                   :disabled="formData.actionJson[1].linkType === 'manual_input'"
                   clearable
                   clearable
                 >
                 >
-                <!--  -->
+                  <!--  -->
                   <el-option
                   <el-option
                     v-for="item in accountList"
                     v-for="item in accountList"
                     :key="item.id"
                     :key="item.id"
@@ -379,6 +383,7 @@ const props = defineProps({
     validator: (value: string | number) => value !== "" && value !== 0,
     validator: (value: string | number) => value !== "" && value !== 0,
   },
   },
   editData: {},
   editData: {},
+  editType: "",
   drawerTitle: {
   drawerTitle: {
     type: String,
     type: String,
     default: "规则配置",
     default: "规则配置",
@@ -414,7 +419,7 @@ const formData = ref<{
   actionJson: [
   actionJson: [
     {
     {
       actionCode: "specify_agreement"; // 固定:指定报价协议
       actionCode: "specify_agreement"; // 固定:指定报价协议
-      agreementId: string; // 报价协议ID  
+      agreementId: string; // 报价协议ID
     },
     },
     {
     {
       actionCode: "change_bs_account"; // 固定:变更对接人
       actionCode: "change_bs_account"; // 固定:变更对接人
@@ -463,10 +468,15 @@ const accountList = ref([]);
 const dictionaries = ref([]);
 const dictionaries = ref([]);
 
 
 const dispatchId = ref(""); //调度id
 const dispatchId = ref(""); //调度id
+const editType = ref("");
 
 
 // 表单校验规则
 // 表单校验规则
 // 先定义独立校验函数(放在formRules之前)
 // 先定义独立校验函数(放在formRules之前)
-const validateConditionGroups = (rule: any, value: ConditionGroup[], callback: any) => {
+const validateConditionGroups = (
+  rule: any,
+  value: ConditionGroup[],
+  callback: any
+) => {
   // 1. 校验:至少1组条件
   // 1. 校验:至少1组条件
   if (value.length === 0) {
   if (value.length === 0) {
     return callback(new Error("至少配置1组“或者”条件"));
     return callback(new Error("至少配置1组“或者”条件"));
@@ -501,7 +511,9 @@ const validateConditionGroups = (rule: any, value: ConditionGroup[], callback: a
       // 3.1 多选/标签类型(依赖minArray)
       // 3.1 多选/标签类型(依赖minArray)
       if (["checkbox", "inputTag"].includes(attrType)) {
       if (["checkbox", "inputTag"].includes(attrType)) {
         if (!row.minArray || row.minArray.length === 0) {
         if (!row.minArray || row.minArray.length === 0) {
-          row.errorMsg = `请选择至少一个条件值(当前为${attrType === "checkbox" ? "多选" : "标签"}类型)`;
+          row.errorMsg = `请选择至少一个条件值(当前为${
+            attrType === "checkbox" ? "多选" : "标签"
+          }类型)`;
           return callback(new Error(row.errorMsg));
           return callback(new Error(row.errorMsg));
         }
         }
       }
       }
@@ -518,11 +530,17 @@ const validateConditionGroups = (rule: any, value: ConditionGroup[], callback: a
       }
       }
       // 3.3 普通类型(单选/输入框,依赖min或max)
       // 3.3 普通类型(单选/输入框,依赖min或max)
       else {
       else {
-        const targetVal = ["radio", "select", "plate", "datetime"].includes(attrType) 
-          ? row.max 
+        const targetVal = ["radio", "select", "plate", "datetime"].includes(
+          attrType
+        )
+          ? row.max
           : row.min;
           : row.min;
         if (targetVal === null || targetVal === "" || targetVal === undefined) {
         if (targetVal === null || targetVal === "" || targetVal === undefined) {
-          row.errorMsg = `请${attrType === "datetime" ? "选择" : "输入"}条件值(当前为${attrType === "select" ? "下拉选择" : "文本输入"}类型)`;
+          row.errorMsg = `请${
+            attrType === "datetime" ? "选择" : "输入"
+          }条件值(当前为${
+            attrType === "select" ? "下拉选择" : "文本输入"
+          }类型)`;
           return callback(new Error(row.errorMsg));
           return callback(new Error(row.errorMsg));
         }
         }
       }
       }
@@ -558,7 +576,9 @@ const validateLinkManPhone = (rule: any, value: string, callback: any) => {
     return callback(new Error("请输入对接人手机号(手动输入模式)"));
     return callback(new Error("请输入对接人手机号(手动输入模式)"));
   }
   }
   if (!/^1[3-9]\d{9}$/.test(value)) {
   if (!/^1[3-9]\d{9}$/.test(value)) {
-    return callback(new Error("手机号格式错误,请输入11位有效号码(如13800138000)"));
+    return callback(
+      new Error("手机号格式错误,请输入11位有效号码(如13800138000)")
+    );
   }
   }
   callback();
   callback();
 };
 };
@@ -616,7 +636,6 @@ const formRules = reactive<FormRules>({
   ],
   ],
 });
 });
 
 
-
 // 工具函数:根据条件类型获取对应的运算符列表
 // 工具函数:根据条件类型获取对应的运算符列表
 const getOperations = (conditionValue: string) => {
 const getOperations = (conditionValue: string) => {
   const target = dispatchList.value.find(
   const target = dispatchList.value.find(
@@ -661,7 +680,7 @@ const handleOperatorChange = (domain: ConditionRow) => {
 
 
 // 组内添加并且条件行
 // 组内添加并且条件行
 const handleAddRow = (groupIndex: number) => {
 const handleAddRow = (groupIndex: number) => {
-  formData.conditionGroups[groupIndex].actions.push({
+  formData.value.conditionGroups[groupIndex].actions.push({
     key: Date.now(),
     key: Date.now(),
     min: "",
     min: "",
     attrCode: "",
     attrCode: "",
@@ -674,12 +693,12 @@ const handleAddRow = (groupIndex: number) => {
 
 
 // 删除组内条件行
 // 删除组内条件行
 const handleRemoveRow = (groupIndex: number, rowIndex: number) => {
 const handleRemoveRow = (groupIndex: number, rowIndex: number) => {
-  formData.conditionGroups[groupIndex].actions.splice(rowIndex, 1);
+  formData.value.conditionGroups[groupIndex].actions.splice(rowIndex, 1);
 };
 };
 
 
 // 添加新的或者条件组
 // 添加新的或者条件组
 const handleAddGroup = () => {
 const handleAddGroup = () => {
-  formData.conditionGroups.push({
+  formData.value.conditionGroups.push({
     groupKey: Date.now(),
     groupKey: Date.now(),
     actions: [
     actions: [
       {
       {
@@ -728,7 +747,9 @@ const getByCompanyId = async () => {
 // 获取保司账号列表
 // 获取保司账号列表
 const getAccountList = async () => {
 const getAccountList = async () => {
   try {
   try {
-    const res = await api.dispatchApi.getAgreementAttributionByCompanyId(props.companyId);
+    const res = await api.dispatchApi.getAgreementAttributionByCompanyId(
+      props.companyId
+    );
     accountList.value = res.data;
     accountList.value = res.data;
   } catch (error) {
   } catch (error) {
     console.error("获取保司账号列表失败:", error);
     console.error("获取保司账号列表失败:", error);
@@ -752,55 +773,52 @@ const handleTypeChange = () => {
 
 
 // 提交表单
 // 提交表单
 const submit = async () => {
 const submit = async () => {
+  const { editType } = props;
   // if (!formRef.value) return;
   // if (!formRef.value) return;
 
 
- 
-    // await formRef.value.validate();
-    const actionJson = formData.value.actionJson;
-
-    // 构建提交的actions数据
-    // const actions =formData.value.actionJson
-       const actions = [
-      // 报价协议动作
-      {
-        actionCode: actionJson[0].actionCode,
-        actionJson:{
+  // await formRef.value.validate();
+  const actionJson = formData.value.actionJson;
 
 
-          agreementId: actionJson[0].agreementId,
-        }
+  // const actions =formData.value.actionJson
+  const actions = [
+    {
+      actionCode: actionJson[0].actionCode,
+      actionJson: {
+        agreementId: actionJson[0].agreementId,
       },
       },
-      // 对接人动作(仅保留当前方式的有效字段)
-      {
-        actionCode: actionJson[1].linkType=='manual_input'?'change_poc':'change_bs_account',
-        actionJson:{
-           ...(actionJson[1].linkType === "manual_input"
+    },
+    {
+      actionCode:
+        actionJson[1].linkType == "manual_input"
+          ? "change_poc"
+          : "change_bs_account",
+      actionJson: {
+        ...(actionJson[1].linkType === "manual_input"
           ? { name: actionJson[1].name, phone: actionJson[1].phone }
           ? { name: actionJson[1].name, phone: actionJson[1].phone }
           : { accountId: actionJson[1].accountId }),
           : { accountId: actionJson[1].accountId }),
-        }
-       
       },
       },
-    ];
-
-    // 最终提交数据
-    const submitData = {
-      companyId: props.companyId + "",
-      attrLinks: formData.value.conditionGroups.flatMap((group => group.actions)),
-      actions,
-      // ...(dispatchId.value && { dispatchId: dispatchId.value }), // 编辑时携带ID
-    };
-
-    // 调用接口(新增/编辑)
-    const apiFunc = dispatchId.value
-      ? api.dispatchApi.updateAgreementDispatch
-      : api.dispatchApi.addAgreementDispatch;
-    const res = await apiFunc(submitData);
-
-    if (res.code === 200) {
-      ElMessage.success('保存成功');
-      handleClose();
-    } else {
-      ElMessage.error('保存失败');
-    }
+    },
+  ];
+
+  const submitData = {
+    companyId: props.companyId + "",
+    attrLinks: formData.value.conditionGroups.flatMap((group) => group.actions),
+    actions,
+    ...(dispatchId.value && { dispatchId: dispatchId.value }), // 编辑时携带ID
+  };
+
+  const apiFunc = editType==="edit"
+    ? api.dispatchApi.updateAgreementDispatch
+    : api.dispatchApi.addAgreementDispatch;
+  // const apiFunc = api.dispatchApi.addAgreementDispatch;
+  const res = await apiFunc(submitData);
+
+  if (res.code === 200) {
+    ElMessage.success("保存成功");
+    handleClose();
+  } else {
+    ElMessage.error("保存失败");
+  }
   //    try {
   //    try {
   // } catch (error) {
   // } catch (error) {
   //   ElMessage.error("表单校验失败,请检查填写内容");
   //   ElMessage.error("表单校验失败,请检查填写内容");
@@ -822,112 +840,185 @@ const handleClose = () => {
 //   formData.value = props.editData;
 //   formData.value = props.editData;
 // });
 // });
 onMounted(async () => {
 onMounted(async () => {
-  await Promise.all([getList(), getByCompanyId(), getAccountList()]);
+  // 1. 加载基础数据(条件类型、协议列表等)
+  await Promise.all([
+    getList(), // 条件类型列表
+    getByCompanyId(), // 报价协议列表
+    getAccountList(), // 保司账号列表
+  ]);
   dictionaries.value = await getDictItems({ dictCode: "dispatch_action" });
   dictionaries.value = await getDictItems({ dictCode: "dispatch_action" });
 
 
-  dispatchId.value = props.editData.dispatchId;
-  if (props.editData && Object.keys(props.editData).length > 0) {
-    const rawData = props.editData;
-
-    const conditionGroups: ConditionGroup[] = [];
-    const rawGroups = rawData.groupedAttrLinks
-      ? rawData.groupedAttrLinks
-      : rawData.attrLinks
-      ? [rawData.attrLinks]
-      : [];
+  // 2. 提取props参数
+  const { editType, editData } = props;
+  console.log("当前操作类型:", editType);
+  
+  dispatchId.value = editData?.dispatchId || "";
 
 
-    rawGroups.forEach((rawGroup: any[], groupIndex: number) => {
+  // 3. 初始化formData基础结构(固定保留actionJson默认值,仅动态处理conditionGroups)
+  const baseFormData = {
+    // actionJson保持初始默认结构(新增/编辑通用基础配置)
+    actionJson: [
+      {
+        actionCode: "specify_agreement",
+        agreementId: "", // 新增时为空,编辑时后续单独处理
+      },
+      {
+        actionCode: "change_bs_account",
+        linkType: "manual_input" as "manual_input" | "select_account",
+        name: "",
+        phone: "",
+        accountId: "",
+      },
+    ],
+    // 条件组:根据editType动态赋值
+    conditionGroups: [] as ConditionGroup[],
+  };
+ let isDefaultScene = false;
+  // 4. 新增场景:仅初始化conditionGroups为默认一组条件
+    if (!editType || editType === "add") { 
+    isDefaultScene = true;
+    console.log("[初始化] 进入场景:无editType或add"); // 新增日志
+
+    // 提取原始条件组(兼容editData可能的格式)
+    const rawGroups = editData?.groupedAttrLinks 
+      ? editData.groupedAttrLinks 
+      : editData?.attrLinks 
+        ? [editData.attrLinks] 
+        : [];
+    console.log("[初始化] 提取到的rawGroups:", rawGroups, "长度:", rawGroups.length); // 新增日志
+
+    // 转换rawGroups为conditionGroups
+    baseFormData.conditionGroups = rawGroups.map((rawGroup: any[], groupIdx: number) => {
       const group: ConditionGroup = {
       const group: ConditionGroup = {
-        groupKey: rawData.dispatchId || Date.now(),
-        actions: [], // 组内"并且"条件行
+        groupKey: editData?.dispatchId || `group_${groupIdx}_${Date.now()}`,
+        actions: [],
       };
       };
 
 
-      rawGroup.forEach((rawAttr: any) => {
-        // 每个原始条件项对应一个 action 行
-        group.actions.push({
-          key: rawAttr.id || Date.now(),
-          attrCode: rawAttr.attrCode || "",
-          operator: rawAttr.operator || "",
-          min: rawAttr.min ? parseInt(rawAttr.min) : "",
-          max: rawAttr.max ? parseInt(rawAttr.max) : "",
-          // 强制确保minArray为数组(避免undefined导致校验失败)
-          minArray: rawAttr.minArray ? [...rawAttr.minArray] : [],
+      // 处理组内条件行
+      if (rawGroup.length > 0) {
+        group.actions = rawGroup.map((rawRow: any, rowIdx: number) => ({
+          key: rawRow.id || `row_${groupIdx}_${rowIdx}_${Date.now()}`,
+          attrCode: rawRow.attrCode || "",
+          operator: rawRow.operator || "",
+          min: rawRow.min !== undefined ? rawRow.min : null,
+          max: rawRow.max !== undefined ? rawRow.max : null,
+          minArray: rawRow.minArray ? [...rawRow.minArray] : [],
           errorMsg: "",
           errorMsg: "",
-        });
-      });
-
-      // 确保每个组至少有一行条件(防止空组)
-      if (group.actions.length === 0) {
+        }));
+      } else {
+        // 组内无数据时,兜底1行
         group.actions.push({
         group.actions.push({
           key: Date.now(),
           key: Date.now(),
           attrCode: "",
           attrCode: "",
           operator: "",
           operator: "",
-          min: "",
-          max: "",
+          min: null,
+          max: null,
           errorMsg: "",
           errorMsg: "",
           minArray: [],
           minArray: [],
         });
         });
       }
       }
-
-      conditionGroups.push(group);
+      return group;
     });
     });
 
 
-    // 3. 组装最终的formData
-    formData.value = {
-      agreement: "",
-      actionJson: [
-        // 第一个对象:报价协议(对应初始 actionJson[0])
-        {
-          actionCode: "specify_agreement",
-          agreementId: "", // 从编辑数据中取协议ID
-        },
-        // 第二个对象:对接人信息(对应初始 actionJson[1])
-        {
-          actionCode: "",
-          accountId: "",
-          name: "",
-          phone: "",
-        },
-      ],
-      conditionGroups:
-        conditionGroups.length > 0
-          ? conditionGroups
-          : [
-              {
-                groupKey: Date.now(),
-                actions: [
-                  {
-                    key: Date.now(),
-                    attrCode: "",
-                    operator: "",
-                    min: "",
-                    max: "",
-                    errorMsg: "",
-                    minArray: [],
-                  },
-                ],
-              },
-            ],
-    };
-  } else {
-    // 如果没有编辑数据,使用默认初始值
-    formData.value = {
-      agreement: "",
-      actionJson: [
-        // 第一个对象:报价协议(对应初始 actionJson[0])
-        {
-          actionCode: "specify_agreement",
-          agreementId: "", // 从编辑数据中取协议ID
-        },
-        // 第二个对象:对接人信息(对应初始 actionJson[1])
-        {
-          actionCode: "", // 显式添加 actionCode
-          accountId: "",
-          name: "",
-          phone: "",
-        },
-      ],
-      conditionGroups: [
+    // 第一次兜底:如果转换后还是空,直接加1组
+    if (baseFormData.conditionGroups.length === 0) {
+      console.log("[初始化] rawGroups为空,第一次兜底添加1组条件"); // 新增日志
+      baseFormData.conditionGroups.push({
+        groupKey: Date.now(),
+        actions: [
+          {
+            key: Date.now(),
+            attrCode: "",
+            operator: "",
+            min: null,
+            max: null,
+            errorMsg: "",
+            minArray: [],
+          },
+        ],
+      });
+    }
+  }
+
+  // 5. 编辑场景:从editData解析conditionGroups(保持之前的编辑逻辑)
+  else if (
+    editType === "edit" &&
+    editData &&
+    Object.keys(editData).length > 0
+  ) {
+    const rawGroups = editData.groupedAttrLinks
+      ? editData.groupedAttrLinks
+      : editData.attrLinks
+      ? [editData.attrLinks]
+      : [];
+
+    baseFormData.conditionGroups = rawGroups.map(
+      (rawGroup: any[], groupIdx: number) => {
+        const group: ConditionGroup = {
+          groupKey: editData.dispatchId || `group_${groupIdx}_${Date.now()}`,
+          actions: [],
+        };
+
+        rawGroup.forEach((rawRow: any, rowIdx: number) => {
+          group.actions.push({
+            key: rawRow.id || `row_${groupIdx}_${rowIdx}_${Date.now()}`,
+            attrCode: rawRow.attrCode || "",
+            operator: rawRow.operator || "",
+            min: rawRow.min !== undefined ? rawRow.min : null,
+            max: rawRow.max !== undefined ? rawRow.max : null,
+            minArray: rawRow.minArray ? [...rawRow.minArray] : [],
+            errorMsg: "",
+          });
+        });
+
+        // 兜底:确保每组至少有一行条件
+        if (group.actions.length === 0) {
+          group.actions.push({
+            key: Date.now(),
+            attrCode: "",
+            operator: "",
+            min: null,
+            max: null,
+            errorMsg: "",
+            minArray: [],
+          });
+        }
+        return group;
+      }
+    );
+
+    // 编辑场景补充:回显actionJson(报价协议和对接人信息)
+    if (editData.actions && editData.actions.length > 0) {
+      // 回显报价协议
+      const agreementAction = editData.actions.find(
+        (action: any) => action.actionCode === "specify_agreement"
+      );
+      if (agreementAction?.actionJson?.agreementId) {
+        baseFormData.actionJson[0].agreementId =
+          agreementAction.actionJson.agreementId;
+      }
+
+      // 回显对接人信息
+      const linkAction = editData.actions.find(
+        (action: any) =>
+          action.actionCode === "change_bs_account" ||
+          action.actionCode === "change_poc"
+      );
+      if (linkAction?.actionJson) {
+        const linkJson = linkAction.actionJson;
+        if (linkJson.accountId) {
+          baseFormData.actionJson[1].linkType = "select_account";
+          baseFormData.actionJson[1].accountId = linkJson.accountId;
+        } else {
+          baseFormData.actionJson[1].linkType = "manual_input";
+          baseFormData.actionJson[1].name = linkJson.name || "";
+          baseFormData.actionJson[1].phone = linkJson.phone || "";
+        }
+      }
+    }
+
+    if (baseFormData.conditionGroups.length === 0) {
+      baseFormData.conditionGroups = [
         {
         {
           groupKey: Date.now(),
           groupKey: Date.now(),
           actions: [
           actions: [
@@ -935,17 +1026,23 @@ onMounted(async () => {
               key: Date.now(),
               key: Date.now(),
               attrCode: "",
               attrCode: "",
               operator: "",
               operator: "",
-              min: "",
-              max: "",
+              min: null,
+              max: null,
               errorMsg: "",
               errorMsg: "",
               minArray: [],
               minArray: [],
             },
             },
           ],
           ],
         },
         },
-      ],
-    };
+      ];
+    }
   }
   }
-  console.log(formData.value);
+
+  // 6. 赋值给formData(确保响应式生效)
+  formData.value = baseFormData;
+  console.log(
+    `[${editType}] 场景初始化完成,conditionGroups长度:`,
+    formData.value.conditionGroups.length
+  );
 });
 });
 </script>
 </script>
 
 

+ 42 - 9
src/views/quoteConfig/dispatch/index.vue

@@ -64,6 +64,7 @@
                 class="rule-item"
                 class="rule-item"
                 v-for="(item, ruleIndex) in ruleList"
                 v-for="(item, ruleIndex) in ruleList"
                 :key="item.dispatchId"
                 :key="item.dispatchId"
+                
               >
               >
                 <div class="item-title">
                 <div class="item-title">
                   <div class="name" v-if="!item.editMode">
                   <div class="name" v-if="!item.editMode">
@@ -79,12 +80,12 @@
                   </div>
                   </div>
                   <img
                   <img
                     src="@/assets/images/edit.png"
                     src="@/assets/images/edit.png"
-                    @click="item.editMode = true"
+                    @click.stop="item.editMode = !item.editMode"
                   />
                   />
                   <img
                   <img
                     src="@/assets/images/add.png"
                     src="@/assets/images/add.png"
                     style="margin: 0px 12px"
                     style="margin: 0px 12px"
-                    @click="editDispatch(item)"
+                    @click.stop="editDispatch(item)"
                   />
                   />
                   <el-popconfirm
                   <el-popconfirm
                     class="box-item"
                     class="box-item"
@@ -92,10 +93,10 @@
                     placement="bottom"
                     placement="bottom"
                     width="196px"
                     width="196px"
                     confirm-button-text="确定删除"
                     confirm-button-text="确定删除"
-                    @confirm="deleteRule(item.dispatchId)"
+                    @confirm.stop.prevent="deleteRule( item.dispatchId)"
                   >
                   >
                     <template #reference>
                     <template #reference>
-                      <img src="@/assets/images/delete.png"
+                      <img src="@/assets/images/delete.png"  @click.stop
                     /></template>
                     /></template>
                   </el-popconfirm>
                   </el-popconfirm>
                 </div>
                 </div>
@@ -107,7 +108,7 @@
                     v-for="(sectionGroup, groupIndex) in item.groupedAttrLinks"
                     v-for="(sectionGroup, groupIndex) in item.groupedAttrLinks"
                     :key="groupIndex"
                     :key="groupIndex"
                   >
                   >
-                    <div class="condition-one">
+                    <div class="condition-one" @click.stop="ruleitemEdit(item)">
                       <div
                       <div
                         class="dispatch-item"
                         class="dispatch-item"
                         v-for="(row, index) in sectionGroup"
                         v-for="(row, index) in sectionGroup"
@@ -117,7 +118,7 @@
                         <div class="opera">
                         <div class="opera">
                           {{ row.operatorDesc }}
                           {{ row.operatorDesc }}
                         </div>
                         </div>
-                        <div class="value">
+                        <!-- <div class="value">
                           <template
                           <template
                             v-if="
                             v-if="
                               
                               
@@ -140,6 +141,27 @@
                           <template v-else>
                           <template v-else>
                             {{ row.min }}~{{ row.max }}
                             {{ row.min }}~{{ row.max }}
                           </template>
                           </template>
+                        </div> -->
+                        <div class="value">
+                          <template
+                            v-if="  row.min &&row.max"
+                          >
+                            {{ row.min }}~{{ row.max }}
+                          </template>
+                          <template
+                            v-else-if="row.attrDesc "
+                          >
+                           {{
+                              Array.isArray(row.attrDesc)
+                                ? row.attrDesc.join(",")
+                                : row.attrDesc || "无"
+                            }}
+                          </template>
+                          <template
+                            v-else
+                          >
+                            {{ row.min }}
+                          </template>
                         </div>
                         </div>
                       </div>
                       </div>
                     </div>
                     </div>
@@ -153,7 +175,7 @@
                   </div>
                   </div>
 
 
                   <div style="margin: 0px 16px 10px">将执行以下动作</div>
                   <div style="margin: 0px 16px 10px">将执行以下动作</div>
-                  <div class="action" v-if="item.actions.length > 0">
+                  <div class="action" v-if="item.actions.length > 0"  @click.stop="ruleitemEdit(item)">
                     <div class="name">
                     <div class="name">
                       {{ item.actions[0].actionName }}
                       {{ item.actions[0].actionName }}
                     </div>
                     </div>
@@ -162,7 +184,7 @@
                       "未设置协议名称"
                       "未设置协议名称"
                     }}
                     }}
                   </div>
                   </div>
-                  <div class="action" v-if="item.actions.length > 1">
+                  <div class="action" v-if="item.actions.length > 1"  @click.stop="ruleitemEdit(item)">
                     <div class="name">
                     <div class="name">
                       变更 {{ item.actions[1].actionName }}的
                       变更 {{ item.actions[1].actionName }}的
                       {{
                       {{
@@ -256,6 +278,7 @@
       @close="handleClose"
       @close="handleClose"
       :editData="editData"
       :editData="editData"
       :companyId="currentId"
       :companyId="currentId"
+      :editType="editType"
     />
     />
     <other v-if="isother" :companyId="companyId" @close="closeOther"></other>
     <other v-if="isother" :companyId="companyId" @close="closeOther"></other>
   </div>
   </div>
@@ -281,11 +304,12 @@ const currentIndex = ref(0);
 const currentId = ref("");
 const currentId = ref("");
 const companyId = ref(""); // 用于“其他情况”组件的companyId传递
 const companyId = ref(""); // 用于“其他情况”组件的companyId传递
 const editData = ref({});
 const editData = ref({});
-
+const editType = ref("");
 // 关闭弹窗
 // 关闭弹窗
 const handleClose = () => {
 const handleClose = () => {
   drawer.value = false;
   drawer.value = false;
   editData.value = {};
   editData.value = {};
+  editType.value = "";
   getRuleList(currentId.value);
   getRuleList(currentId.value);
 };
 };
 //关闭其他弹窗
 //关闭其他弹窗
@@ -377,6 +401,13 @@ const findpage = () => {
 const editDispatch = (item: any) => {
 const editDispatch = (item: any) => {
   // console.log(item);
   // console.log(item);
   editData.value = item;
   editData.value = item;
+  editType.value = 'add'
+  drawer.value = true;
+};
+
+const ruleitemEdit = (item:any) => {
+  editData.value = item;
+  editType.value = 'edit'
   drawer.value = true;
   drawer.value = true;
 };
 };
 
 
@@ -515,6 +546,7 @@ getCompanyList();
         border-radius: 4px 4px 4px 4px;
         border-radius: 4px 4px 4px 4px;
         border: 1px solid #eeeeee;
         border: 1px solid #eeeeee;
         margin: 10px auto 20px;
         margin: 10px auto 20px;
+        cursor: pointer;
       }
       }
       .dispatch-item {
       .dispatch-item {
         display: flex;
         display: flex;
@@ -549,6 +581,7 @@ getCompanyList();
         font-size: 14px;
         font-size: 14px;
         color: #333333;
         color: #333333;
         line-height: 22px;
         line-height: 22px;
+        cursor: pointer;
         .name {
         .name {
           width: 100%;
           width: 100%;
           height: 40px;
           height: 40px;