合约添加逻辑空间接口联调
Showing
5 changed files
with
47 additions
and
5 deletions
| ... | @@ -222,6 +222,18 @@ export const getContractTenantList = (tenantName = '') => request({ | ... | @@ -222,6 +222,18 @@ export const getContractTenantList = (tenantName = '') => request({ |
| 222 | method: 'get' | 222 | method: 'get' |
| 223 | }) | 223 | }) |
| 224 | 224 | ||
| 225 | /** 根据逻辑空间guid获取可选的企业下拉列表,认证过后带标识的 */ | ||
| 226 | export const getContractTenantListBySpaceGuid = (spaceGuid) => request({ | ||
| 227 | url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/logic/user-member-by-space-guid?spaceGuid=${spaceGuid}`, | ||
| 228 | method: 'get' | ||
| 229 | }) | ||
| 230 | |||
| 231 | /** 根据逻辑空间guid获取策略模板 */ | ||
| 232 | export const getContractPolicyTemplateListBySpaceGuid = (spaceGuid) => request({ | ||
| 233 | url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/logic/policy-by-space-guid?spaceGuid=${spaceGuid}`, | ||
| 234 | method: 'get' | ||
| 235 | }) | ||
| 236 | |||
| 225 | /** 撤回合约 */ | 237 | /** 撤回合约 */ |
| 226 | export const cancelContract = (guid) => request({ | 238 | export const cancelContract = (guid) => request({ |
| 227 | url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract/canal?guid=${guid}`, | 239 | url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract/canal?guid=${guid}`, | ... | ... |
| ... | @@ -40,6 +40,7 @@ const userStore = useUserStore() | ... | @@ -40,6 +40,7 @@ const userStore = useUserStore() |
| 40 | const emits = defineEmits([ | 40 | const emits = defineEmits([ |
| 41 | "radioGroupChange", | 41 | "radioGroupChange", |
| 42 | "selectChange", | 42 | "selectChange", |
| 43 | "selectFocus", | ||
| 43 | "inputChange", | 44 | "inputChange", |
| 44 | "treeSelectLoad", | 45 | "treeSelectLoad", |
| 45 | "treeSelectNodeChange", | 46 | "treeSelectNodeChange", |
| ... | @@ -134,6 +135,10 @@ const richTextChange = (val, item) => { | ... | @@ -134,6 +135,10 @@ const richTextChange = (val, item) => { |
| 134 | formInline.value[item.field] = val; | 135 | formInline.value[item.field] = val; |
| 135 | ruleFormRef.value?.validateField([item.field]); | 136 | ruleFormRef.value?.validateField([item.field]); |
| 136 | } | 137 | } |
| 138 | /** 下拉选择框聚焦事件 */ | ||
| 139 | const selectFocus = (item) => { | ||
| 140 | emits("selectFocus", item); | ||
| 141 | } | ||
| 137 | 142 | ||
| 138 | const selectChange = (val, row) => { | 143 | const selectChange = (val, row) => { |
| 139 | const info = formInline.value; | 144 | const info = formInline.value; |
| ... | @@ -938,7 +943,7 @@ const panelChange = (scope, row) => { | ... | @@ -938,7 +943,7 @@ const panelChange = (scope, row) => { |
| 938 | :collapse-tags="item.collapse ?? false" :collapse-tags-tooltip="item.tagsTooltip ?? false" | 943 | :collapse-tags="item.collapse ?? false" :collapse-tags-tooltip="item.tagsTooltip ?? false" |
| 939 | :max-collapse-tags="item.maxTags ?? 1" :teleported="item.teleported ?? true" | 944 | :max-collapse-tags="item.maxTags ?? 1" :teleported="item.teleported ?? true" |
| 940 | :allow-create="item.allowCreate ?? false" :default-first-option="item.allowCreate ?? false" | 945 | :allow-create="item.allowCreate ?? false" :default-first-option="item.allowCreate ?? false" |
| 941 | :maxlength="item.maxlength ?? 50" @change="(val) => selectChange(val, item)"> | 946 | :maxlength="item.maxlength ?? 50" @change="(val) => selectChange(val, item)" @focus="selectFocus(item)"> |
| 942 | <el-option v-for="opt in item.options" :label="item.props?.label ? opt[item.props.label] : opt.label" | 947 | <el-option v-for="opt in item.options" :label="item.props?.label ? opt[item.props.label] : opt.label" |
| 943 | :value="item.props?.value ? opt[item.props.value] : opt.value" :disabled="opt.disabled" /> | 948 | :value="item.props?.value ? opt[item.props.value] : opt.value" :disabled="opt.disabled" /> |
| 944 | </el-select> | 949 | </el-select> | ... | ... |
| ... | @@ -646,8 +646,16 @@ const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => { | ... | @@ -646,8 +646,16 @@ const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => { |
| 646 | /** 弹出模板选择对话框 */ | 646 | /** 弹出模板选择对话框 */ |
| 647 | const invokeTemplate = () => { | 647 | const invokeTemplate = () => { |
| 648 | // TODO,判断是否有策略模板信息。 | 648 | // TODO,判断是否有策略模板信息。 |
| 649 | if (props.templateJson?.length) { | 649 | if (props.templateJson) { |
| 650 | proxy.$openMessageBox("使用模板会覆盖现有策略信息,确定要使用产品所在逻辑空间的模板配置吗?", () => { | 650 | if (!props.templateJson?.length) { |
| 651 | proxy.$ElMessage.warning('当前逻辑空间中未设置策略配置信息'); | ||
| 652 | return; | ||
| 653 | } | ||
| 654 | if (!strategyValueInfo.value?.length) { | ||
| 655 | strategyValueInfo.value = transferValueToNew(props.templateJson, true); | ||
| 656 | return; | ||
| 657 | } | ||
| 658 | proxy.$openMessageBox("该操作会覆盖现有策略信息,确定要使用产品所在逻辑空间的策略配置吗?", () => { | ||
| 651 | strategyValueInfo.value = transferValueToNew(props.templateJson, true); | 659 | strategyValueInfo.value = transferValueToNew(props.templateJson, true); |
| 652 | }, () => { | 660 | }, () => { |
| 653 | proxy.$ElMessage.info("已取消"); | 661 | proxy.$ElMessage.info("已取消"); | ... | ... |
This diff is collapsed.
Click to expand it.
| ... | @@ -18,7 +18,8 @@ import { | ... | @@ -18,7 +18,8 @@ import { |
| 18 | terminateContract, | 18 | terminateContract, |
| 19 | getTerminateDetailInfo, | 19 | getTerminateDetailInfo, |
| 20 | getSignatureFile, | 20 | getSignatureFile, |
| 21 | getDamFieldsByProductGuid | 21 | getDamFieldsByProductGuid, |
| 22 | getContractPolicyTemplateListBySpaceGuid | ||
| 22 | } from "@/api/modules/dataSmartContract"; | 23 | } from "@/api/modules/dataSmartContract"; |
| 23 | import { | 24 | import { |
| 24 | tagMethod, | 25 | tagMethod, |
| ... | @@ -973,6 +974,9 @@ const constraintOptionsList: any = ref([]); | ... | @@ -973,6 +974,9 @@ const constraintOptionsList: any = ref([]); |
| 973 | /** 策略操作行为下拉列表 */ | 974 | /** 策略操作行为下拉列表 */ |
| 974 | const actionOptionsList: any = ref([]); | 975 | const actionOptionsList: any = ref([]); |
| 975 | 976 | ||
| 977 | /** 逻辑空间的策略模板信息,若是逻辑空间不存在,则值为null,若是逻辑空间中未设置模板,则值为[] */ | ||
| 978 | const templateJson: any = ref(null); | ||
| 979 | |||
| 976 | /** 限定状态字典下拉列表 */ | 980 | /** 限定状态字典下拉列表 */ |
| 977 | const limitedStateOptionsList: any = ref([]); | 981 | const limitedStateOptionsList: any = ref([]); |
| 978 | 982 | ||
| ... | @@ -1117,6 +1121,19 @@ onBeforeMount(() => { | ... | @@ -1117,6 +1121,19 @@ onBeforeMount(() => { |
| 1117 | res?.msg && proxy.$ElMessage.error(res?.msg) | 1121 | res?.msg && proxy.$ElMessage.error(res?.msg) |
| 1118 | } | 1122 | } |
| 1119 | }) | 1123 | }) |
| 1124 | let logicSpaceGuid = productTableInfo.value.data?.[0]?.logicSpaceGuid; | ||
| 1125 | if (logicSpaceGuid) { | ||
| 1126 | getContractPolicyTemplateListBySpaceGuid(logicSpaceGuid).then((res: any) => { | ||
| 1127 | if (res?.code == proxy.$passCode) { | ||
| 1128 | templateJson.value = res.data || []; | ||
| 1129 | } else { | ||
| 1130 | templateJson.value = []; | ||
| 1131 | res?.msg && proxy.$ElMessage.error(res?.msg) | ||
| 1132 | } | ||
| 1133 | }) | ||
| 1134 | } else { | ||
| 1135 | templateJson.value = null; | ||
| 1136 | } | ||
| 1120 | } else { | 1137 | } else { |
| 1121 | productFieldList.value = initProductFieldValue.value; | 1138 | productFieldList.value = initProductFieldValue.value; |
| 1122 | annonFieldsList.value = initProductFieldValue.value; | 1139 | annonFieldsList.value = initProductFieldValue.value; |
| ... | @@ -1364,7 +1381,7 @@ onActivated(() => { | ... | @@ -1364,7 +1381,7 @@ onActivated(() => { |
| 1364 | <ContentWrap v-show="detailType == 'consult' && currentStep != 1" id="policy-info-consult" title="合约策略" | 1381 | <ContentWrap v-show="detailType == 'consult' && currentStep != 1" id="policy-info-consult" title="合约策略" |
| 1365 | expandSwicth style="margin-top: 15px" :isExpand="expandPolicyConsult" @expand="(v) => (expandPolicyConsult = v)" | 1382 | expandSwicth style="margin-top: 15px" :isExpand="expandPolicyConsult" @expand="(v) => (expandPolicyConsult = v)" |
| 1366 | description=""> | 1383 | description=""> |
| 1367 | <StrategyTable ref="strategyTableEditRef" :show-title="true" :value="consultDetailInfo?.policys" | 1384 | <StrategyTable ref="strategyTableEditRef" :show-title="true" :value="consultDetailInfo?.policys" :template-json="templateJson" |
| 1368 | :operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" :productFieldList="productFieldList" :annonFieldsList="annonFieldsList" | 1385 | :operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" :productFieldList="productFieldList" :annonFieldsList="annonFieldsList" |
| 1369 | :limit-state-option-list="limitedStateOptionsList" :constraintOptionsList="constraintOptionsList"></StrategyTable> | 1386 | :limit-state-option-list="limitedStateOptionsList" :constraintOptionsList="constraintOptionsList"></StrategyTable> |
| 1370 | </ContentWrap> | 1387 | </ContentWrap> | ... | ... |
-
Please register or sign in to post a comment