Browse Source

fix: ConditionRule后端无type、opName字段

Lesan 7 months ago
parent
commit
a1933a781e

+ 0 - 2
src/components/SimpleProcessDesignerV2/src/consts.ts

@@ -439,8 +439,6 @@ export enum OperationButtonType {
  * 条件规则结构定义
  */
 export type ConditionRule = {
-  type: number
-  opName: string
   opCode: string
   leftSide: string
   rightSide: string

+ 0 - 4
src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue

@@ -319,8 +319,6 @@ const conditionGroups = ref<ConditionGroup>({
       and: true,
       rules: [
         {
-          type: 1,
-          opName: '等于',
           opCode: '==',
           leftSide: '',
           rightSide: ''
@@ -353,8 +351,6 @@ const deleteConditionGroup = (idx: number) => {
 // 添加条件规则
 const addConditionRule = (condition: Condition, idx: number) => {
   const rule: ConditionRule = {
-    type: 1,
-    opName: '等于',
     opCode: '==',
     leftSide: '',
     rightSide: ''

+ 12 - 17
src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue

@@ -1,7 +1,6 @@
 <!-- TODO @lesan:其它路由条件,可以使用这个哇? -->
 <template>
   <el-form ref="formRef" :model="condition" :rules="formRules" label-position="top">
-    <!-- TODO @lesan:1)默认选中 条件规则;2)条件规则放前面,因为更常用!-->
     <el-form-item label="配置方式" prop="conditionType">
       <el-radio-group v-model="condition.conditionType">
         <el-radio
@@ -14,18 +13,6 @@
         </el-radio>
       </el-radio-group>
     </el-form-item>
-    <el-form-item
-      v-if="condition.conditionType === ConditionType.EXPRESSION"
-      label="条件表达式"
-      prop="conditionExpression"
-    >
-      <el-input
-        type="textarea"
-        v-model="condition.conditionExpression"
-        clearable
-        style="width: 100%"
-      />
-    </el-form-item>
     <el-form-item v-if="condition.conditionType === ConditionType.RULE" label="条件规则">
       <div class="condition-group-tool">
         <div class="flex items-center">
@@ -114,6 +101,18 @@
         />
       </div>
     </el-form-item>
+    <el-form-item
+      v-if="condition.conditionType === ConditionType.EXPRESSION"
+      label="条件表达式"
+      prop="conditionExpression"
+    >
+      <el-input
+        type="textarea"
+        v-model="condition.conditionExpression"
+        clearable
+        style="width: 100%"
+      />
+    </el-form-item>
   </el-form>
 </template>
 
@@ -181,8 +180,6 @@ const deleteConditionRule = (condition, index) => {
 
 const addConditionRule = (condition, index) => {
   const rule = {
-    type: 1,
-    opName: '等于',
     opCode: '==',
     leftSide: '',
     rightSide: ''
@@ -195,8 +192,6 @@ const addConditionGroup = (conditions) => {
     and: true,
     rules: [
       {
-        type: 1, // TODO @lesan:枚举~
-        opName: '等于',
         opCode: '==',
         leftSide: '',
         rightSide: ''