7b4a8015 by lihua

合约添加逻辑空间接口联调

1 parent 2c31b6ac
...@@ -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("已取消");
......
...@@ -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,
...@@ -969,6 +970,9 @@ const constraintOptionsList: any = ref([]); ...@@ -969,6 +970,9 @@ const constraintOptionsList: any = ref([]);
969 /** 策略操作行为下拉列表 */ 970 /** 策略操作行为下拉列表 */
970 const actionOptionsList: any = ref([]); 971 const actionOptionsList: any = ref([]);
971 972
973 /** 逻辑空间的策略模板信息,若是逻辑空间不存在,则值为null,若是逻辑空间中未设置模板,则值为[] */
974 const templateJson: any = ref(null);
975
972 /** 限定状态字典下拉列表 */ 976 /** 限定状态字典下拉列表 */
973 const limitedStateOptionsList: any = ref([]); 977 const limitedStateOptionsList: any = ref([]);
974 978
...@@ -1112,6 +1116,19 @@ onBeforeMount(() => { ...@@ -1112,6 +1116,19 @@ onBeforeMount(() => {
1112 res?.msg && proxy.$ElMessage.error(res?.msg) 1116 res?.msg && proxy.$ElMessage.error(res?.msg)
1113 } 1117 }
1114 }) 1118 })
1119 let logicSpaceGuid = productTableInfo.value.data?.[0]?.logicSpaceGuid;
1120 if (logicSpaceGuid) {
1121 getContractPolicyTemplateListBySpaceGuid(logicSpaceGuid).then((res: any) => {
1122 if (res?.code == proxy.$passCode) {
1123 templateJson.value = res.data || [];
1124 } else {
1125 templateJson.value = [];
1126 res?.msg && proxy.$ElMessage.error(res?.msg)
1127 }
1128 })
1129 } else {
1130 templateJson.value = null;
1131 }
1115 } else { 1132 } else {
1116 productFieldList.value = initProductFieldValue.value; 1133 productFieldList.value = initProductFieldValue.value;
1117 annonFieldsList.value = initProductFieldValue.value; 1134 annonFieldsList.value = initProductFieldValue.value;
...@@ -1359,7 +1376,7 @@ onActivated(() => { ...@@ -1359,7 +1376,7 @@ onActivated(() => {
1359 <ContentWrap v-show="detailType == 'consult' && currentStep != 1" id="policy-info-consult" title="合约策略" 1376 <ContentWrap v-show="detailType == 'consult' && currentStep != 1" id="policy-info-consult" title="合约策略"
1360 expandSwicth style="margin-top: 15px" :isExpand="expandPolicyConsult" @expand="(v) => (expandPolicyConsult = v)" 1377 expandSwicth style="margin-top: 15px" :isExpand="expandPolicyConsult" @expand="(v) => (expandPolicyConsult = v)"
1361 description=""> 1378 description="">
1362 <StrategyTable ref="strategyTableEditRef" :show-title="true" :value="consultDetailInfo?.policys" 1379 <StrategyTable ref="strategyTableEditRef" :show-title="true" :value="consultDetailInfo?.policys" :template-json="templateJson"
1363 :operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" :productFieldList="productFieldList" :annonFieldsList="annonFieldsList" 1380 :operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" :productFieldList="productFieldList" :annonFieldsList="annonFieldsList"
1364 :limit-state-option-list="limitedStateOptionsList" :constraintOptionsList="constraintOptionsList"></StrategyTable> 1381 :limit-state-option-list="limitedStateOptionsList" :constraintOptionsList="constraintOptionsList"></StrategyTable>
1365 </ContentWrap> 1382 </ContentWrap>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!