策略管理添加新的策略页面开发
Showing
2 changed files
with
55 additions
and
11 deletions
| ... | @@ -4,9 +4,11 @@ | ... | @@ -4,9 +4,11 @@ |
| 4 | <el-button v-if="!isLook" plain @click="invokeTemplate" v-preReClick>合约模板调用</el-button> | 4 | <el-button v-if="!isLook" plain @click="invokeTemplate" v-preReClick>合约模板调用</el-button> |
| 5 | </div> | 5 | </div> |
| 6 | <el-table class="strategyTable" ref="strategyTableRef" v-loading="strategyDataLoading" :data="strategyData" | 6 | <el-table class="strategyTable" ref="strategyTableRef" v-loading="strategyDataLoading" :data="strategyData" |
| 7 | :height="isReport ? 'auto' : '250px'" :highlight-current-row="true" stripe tooltip-effect="light" border :span-method="arraySpanMethod"> | 7 | :height="isReport ? 'auto' : '250px'" :highlight-current-row="true" stripe tooltip-effect="light" border |
| 8 | :span-method="arraySpanMethod"> | ||
| 8 | <el-table-column label="序号" width="56" align="center" fixed="left" :formatter="formatIndex" /> | 9 | <el-table-column label="序号" width="56" align="center" fixed="left" :formatter="formatIndex" /> |
| 9 | <el-table-column prop="action" label="操作行为" :width="isReport ? 'auto' : '150px'" :min-width="isReport ? '100px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | 10 | <el-table-column prop="action" label="操作行为" :width="isReport ? 'auto' : '150px'" |
| 11 | :min-width="isReport ? '100px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | ||
| 10 | <template #header> | 12 | <template #header> |
| 11 | <span>操作行为</span> | 13 | <span>操作行为</span> |
| 12 | <span style="color:red;margin-left: 2px;">*</span> | 14 | <span style="color:red;margin-left: 2px;">*</span> |
| ... | @@ -14,20 +16,23 @@ | ... | @@ -14,20 +16,23 @@ |
| 14 | <template #default="scope"> | 16 | <template #default="scope"> |
| 15 | <el-select v-if="!isLook" v-model="scope.row['action']" placeholder="请选择" :disabled="isLook" | 17 | <el-select v-if="!isLook" v-model="scope.row['action']" placeholder="请选择" :disabled="isLook" |
| 16 | @change="(val) => selectOperationChange(val, scope)" clearable filterable> | 18 | @change="(val) => selectOperationChange(val, scope)" clearable filterable> |
| 19 | <!-- 合约模板时不可以设置这个属性,只能在合约创建时设置 --> | ||
| 17 | <el-option | 20 | <el-option |
| 18 | v-for="opt in actionOptionsList.filter(a => scope.row.action == a.policyName || !strategyData.some(s => s.action == a.policyName))" | 21 | v-for="opt in actionOptionsList.filter(a => scope.row.action == a.policyName || !strategyData.some(s => s.action == a.policyName) || ((a.policyEnName == 'limitField' || a.policyEnName == 'limitedDeliveryConnector' || a.policyEnName == 'limitedUseConnector') && productFieldList != null))" |
| 19 | :key="opt['policyName']" :label="opt['policyName']" :value="opt['policyName']" /> | 22 | :key="opt['policyName']" :label="opt['policyName']" :value="opt['policyName']" /> |
| 20 | </el-select> | 23 | </el-select> |
| 21 | <span v-else>{{ scope.row['action'] || '--' }}</span> | 24 | <span v-else>{{ scope.row['action'] || '--' }}</span> |
| 22 | </template> | 25 | </template> |
| 23 | </el-table-column> | 26 | </el-table-column> |
| 24 | <el-table-column prop="actionEnName" label="操作行为英文名称" :width="isReport ? 'auto' : '150px'" :min-width="isReport ? '120px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | 27 | <el-table-column prop="actionEnName" label="操作行为英文名称" :width="isReport ? 'auto' : '150px'" |
| 28 | :min-width="isReport ? '120px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | ||
| 25 | <template #default="scope"> | 29 | <template #default="scope"> |
| 26 | <el-input v-if="!isLook" v-model="scope.row['actionEnName']" :disabled="true" placeholder="-"></el-input> | 30 | <el-input v-if="!isLook" v-model="scope.row['actionEnName']" :disabled="true" placeholder="-"></el-input> |
| 27 | <span v-else>{{ scope.row['actionEnName'] || '--' }}</span> | 31 | <span v-else>{{ scope.row['actionEnName'] || '--' }}</span> |
| 28 | </template> | 32 | </template> |
| 29 | </el-table-column> | 33 | </el-table-column> |
| 30 | <el-table-column prop="constraintName" label="约束条件" :width="isReport ? 'auto' : '150px'" :min-width="isReport ? '100px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | 34 | <el-table-column prop="constraintName" label="约束条件" :width="isReport ? 'auto' : '150px'" |
| 35 | :min-width="isReport ? '100px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | ||
| 31 | <template #header> | 36 | <template #header> |
| 32 | <span>约束条件</span> | 37 | <span>约束条件</span> |
| 33 | <span style="color:red;margin-left: 2px;">*</span> | 38 | <span style="color:red;margin-left: 2px;">*</span> |
| ... | @@ -41,13 +46,15 @@ | ... | @@ -41,13 +46,15 @@ |
| 41 | <span v-else>{{ scope.row['constraintName'] || '--' }}</span> | 46 | <span v-else>{{ scope.row['constraintName'] || '--' }}</span> |
| 42 | </template> | 47 | </template> |
| 43 | </el-table-column> | 48 | </el-table-column> |
| 44 | <el-table-column prop="constraintEnName" label="约束条件英文名称" :width="isReport ? 'auto' : '150px'" :min-width="isReport ? '120px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | 49 | <el-table-column prop="constraintEnName" label="约束条件英文名称" :width="isReport ? 'auto' : '150px'" |
| 50 | :min-width="isReport ? '120px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | ||
| 45 | <template #default="scope"> | 51 | <template #default="scope"> |
| 46 | <el-input v-if="!isLook" v-model="scope.row['constraintEnName']" :disabled="true" placeholder="-"></el-input> | 52 | <el-input v-if="!isLook" v-model="scope.row['constraintEnName']" :disabled="true" placeholder="-"></el-input> |
| 47 | <span v-else>{{ scope.row['constraintEnName'] || '--' }}</span> | 53 | <span v-else>{{ scope.row['constraintEnName'] || '--' }}</span> |
| 48 | </template> | 54 | </template> |
| 49 | </el-table-column> | 55 | </el-table-column> |
| 50 | <el-table-column prop="constraintOperatorCode" label="运算符" :width="isReport ? 'auto' : '150px'" :min-width="isReport ? '100px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | 56 | <el-table-column prop="constraintOperatorCode" label="运算符" :width="isReport ? 'auto' : '150px'" |
| 57 | :min-width="isReport ? '100px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | ||
| 51 | <template #header> | 58 | <template #header> |
| 52 | <span>运算符</span> | 59 | <span>运算符</span> |
| 53 | <span style="color:red;margin-left: 2px;">*</span> | 60 | <span style="color:red;margin-left: 2px;">*</span> |
| ... | @@ -61,14 +68,30 @@ | ... | @@ -61,14 +68,30 @@ |
| 61 | <span v-else>{{ scope.row['constraintOperatorName'] || '--' }}</span> | 68 | <span v-else>{{ scope.row['constraintOperatorName'] || '--' }}</span> |
| 62 | </template> | 69 | </template> |
| 63 | </el-table-column> | 70 | </el-table-column> |
| 64 | <el-table-column prop="constraintValue" label="约束值" :width="isReport ? 'auto' : '240px'" :min-width="isReport ? '160px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | 71 | <el-table-column prop="constraintValue" label="约束值" :width="isReport ? 'auto' : '240px'" |
| 72 | :min-width="isReport ? '160px' : undefined" align="left" :show-overflow-tooltip="!isReport"> | ||
| 65 | <template #header> | 73 | <template #header> |
| 66 | <span>约束值</span> | 74 | <span>约束值</span> |
| 67 | <span style="color:red;margin-left: 2px;">*</span> | 75 | <span style="color:red;margin-left: 2px;">*</span> |
| 68 | </template> | 76 | </template> |
| 69 | <template #default="scope"> | 77 | <template #default="scope"> |
| 70 | <el-input v-if="!isLook" v-model="scope.row['constraintValue']" placeholder="请输入" :maxlength="200" | 78 | <el-input |
| 71 | @change="(val) => handleOperatorSelectChange(val, scope, 'constraintValue')" clearable></el-input> | 79 | v-if="!isLook && !( (scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector'))" |
| 80 | v-model="scope.row['constraintValue']" placeholder="请输入" :maxlength="200" | ||
| 81 | @change="(val) => handleOperatorSelectChange(val, scope, 'constraintValue')" clearable></el-input> | ||
| 82 | <!-- 限定连接器 --> | ||
| 83 | <el-select | ||
| 84 | v-else-if="!isLook && (scope.row.constraintEnName == 'limitedDeliveryConnector' || scope.row.constraintEnName == 'limitedUseConnector')" | ||
| 85 | v-model="scope.row['constraintValue']" :remote="true" :remote-method="remoteMethod" filterable clearable placeholder="请选择"> | ||
| 86 | <el-option v-for="opt in connectorList" :key="opt['guid']" :label="opt['connectorName']" | ||
| 87 | :value="opt['guid']" /> | ||
| 88 | </el-select> | ||
| 89 | <!-- 加密字段 --> | ||
| 90 | <el-select v-else-if="!isLook && scope.row.constraintEnName == 'limitField'" | ||
| 91 | v-model="scope.row['constraintValue']" filterable clearable placeholder="请选择"> | ||
| 92 | <el-option v-for="opt in productFieldList" :key="opt['enName']" :label="opt['chName']" | ||
| 93 | :value="opt['guid']" /> | ||
| 94 | </el-select> | ||
| 72 | <span v-else>{{ scope.row['constraintValue'] || '--' }}</span> | 95 | <span v-else>{{ scope.row['constraintValue'] || '--' }}</span> |
| 73 | </template> | 96 | </template> |
| 74 | </el-table-column> | 97 | </el-table-column> |
| ... | @@ -122,12 +145,19 @@ const props = defineProps({ | ... | @@ -122,12 +145,19 @@ const props = defineProps({ |
| 122 | type: Array<any>, | 145 | type: Array<any>, |
| 123 | default: [] | 146 | default: [] |
| 124 | }, | 147 | }, |
| 148 | productFieldList: { //字段列表 | ||
| 149 | type: Array<any>, | ||
| 150 | default: [] | ||
| 151 | }, | ||
| 125 | isReport: { | 152 | isReport: { |
| 126 | type: Boolean, | 153 | type: Boolean, |
| 127 | default: false | 154 | default: false |
| 128 | } | 155 | } |
| 129 | }) | 156 | }) |
| 130 | 157 | ||
| 158 | /** 连接器下拉列表,搜索取得 */ | ||
| 159 | const connectorList: any = ref([]); | ||
| 160 | |||
| 131 | const getActualOperationList = (scope) => { | 161 | const getActualOperationList = (scope) => { |
| 132 | let val = scope.row.constraintName; | 162 | let val = scope.row.constraintName; |
| 133 | let conditionItem = val && props.constraintOptionsList.find(c => c.policyName == val); | 163 | let conditionItem = val && props.constraintOptionsList.find(c => c.policyName == val); |
| ... | @@ -417,6 +447,20 @@ const validateValue = () => { | ... | @@ -417,6 +447,20 @@ const validateValue = () => { |
| 417 | return true; | 447 | return true; |
| 418 | } | 448 | } |
| 419 | 449 | ||
| 450 | const remoteMethod = (query: string) => { | ||
| 451 | if (query) { | ||
| 452 | // loading.value = true | ||
| 453 | // setTimeout(() => { | ||
| 454 | // loading.value = false | ||
| 455 | // options.value = list.value.filter((item) => { | ||
| 456 | // return item.label.toLowerCase().includes(query.toLowerCase()) | ||
| 457 | // }) | ||
| 458 | // }, 200) | ||
| 459 | } else { | ||
| 460 | connectorList.value = [] | ||
| 461 | } | ||
| 462 | } | ||
| 463 | |||
| 420 | defineExpose({ | 464 | defineExpose({ |
| 421 | strategyData, | 465 | strategyData, |
| 422 | validateValue | 466 | validateValue | ... | ... |
| ... | @@ -822,7 +822,7 @@ onActivated(() => { | ... | @@ -822,7 +822,7 @@ onActivated(() => { |
| 822 | <Form ref="nodeInfoFormRef" formId="node-info-form" :itemList="nodeInfoFormItems" :rules="nodeInfoFormRules" | 822 | <Form ref="nodeInfoFormRef" formId="node-info-form" :itemList="nodeInfoFormItems" :rules="nodeInfoFormRules" |
| 823 | @select-change="handleNodeSelectChange" col="col3" /> | 823 | @select-change="handleNodeSelectChange" col="col3" /> |
| 824 | <StrategyTable ref="strategyTableRef" :show-title="true" :value="detailInfo.policys || []" | 824 | <StrategyTable ref="strategyTableRef" :show-title="true" :value="detailInfo.policys || []" |
| 825 | :operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" | 825 | :operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" :productFieldList="[]" |
| 826 | :constraintOptionsList="constraintOptionsList"></StrategyTable> | 826 | :constraintOptionsList="constraintOptionsList"></StrategyTable> |
| 827 | </ContentWrap> | 827 | </ContentWrap> |
| 828 | </div> | 828 | </div> | ... | ... |
-
Please register or sign in to post a comment