7b4a8015 by lihua

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

1 parent 2c31b6ac
......@@ -222,6 +222,18 @@ export const getContractTenantList = (tenantName = '') => request({
method: 'get'
})
/** 根据逻辑空间guid获取可选的企业下拉列表,认证过后带标识的 */
export const getContractTenantListBySpaceGuid = (spaceGuid) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/logic/user-member-by-space-guid?spaceGuid=${spaceGuid}`,
method: 'get'
})
/** 根据逻辑空间guid获取策略模板 */
export const getContractPolicyTemplateListBySpaceGuid = (spaceGuid) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/connector-invoke/logic/policy-by-space-guid?spaceGuid=${spaceGuid}`,
method: 'get'
})
/** 撤回合约 */
export const cancelContract = (guid) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract/canal?guid=${guid}`,
......
......@@ -40,6 +40,7 @@ const userStore = useUserStore()
const emits = defineEmits([
"radioGroupChange",
"selectChange",
"selectFocus",
"inputChange",
"treeSelectLoad",
"treeSelectNodeChange",
......@@ -134,6 +135,10 @@ const richTextChange = (val, item) => {
formInline.value[item.field] = val;
ruleFormRef.value?.validateField([item.field]);
}
/** 下拉选择框聚焦事件 */
const selectFocus = (item) => {
emits("selectFocus", item);
}
const selectChange = (val, row) => {
const info = formInline.value;
......@@ -938,7 +943,7 @@ const panelChange = (scope, row) => {
:collapse-tags="item.collapse ?? false" :collapse-tags-tooltip="item.tagsTooltip ?? false"
:max-collapse-tags="item.maxTags ?? 1" :teleported="item.teleported ?? true"
:allow-create="item.allowCreate ?? false" :default-first-option="item.allowCreate ?? false"
:maxlength="item.maxlength ?? 50" @change="(val) => selectChange(val, item)">
:maxlength="item.maxlength ?? 50" @change="(val) => selectChange(val, item)" @focus="selectFocus(item)">
<el-option v-for="opt in item.options" :label="item.props?.label ? opt[item.props.label] : opt.label"
:value="item.props?.value ? opt[item.props.value] : opt.value" :disabled="opt.disabled" />
</el-select>
......
......@@ -646,8 +646,16 @@ const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
/** 弹出模板选择对话框 */
const invokeTemplate = () => {
// TODO,判断是否有策略模板信息。
if (props.templateJson?.length) {
proxy.$openMessageBox("使用模板会覆盖现有策略信息,确定要使用产品所在逻辑空间的模板配置吗?", () => {
if (props.templateJson) {
if (!props.templateJson?.length) {
proxy.$ElMessage.warning('当前逻辑空间中未设置策略配置信息');
return;
}
if (!strategyValueInfo.value?.length) {
strategyValueInfo.value = transferValueToNew(props.templateJson, true);
return;
}
proxy.$openMessageBox("该操作会覆盖现有策略信息,确定要使用产品所在逻辑空间的策略配置吗?", () => {
strategyValueInfo.value = transferValueToNew(props.templateJson, true);
}, () => {
proxy.$ElMessage.info("已取消");
......
......@@ -18,7 +18,8 @@ import {
terminateContract,
getTerminateDetailInfo,
getSignatureFile,
getDamFieldsByProductGuid
getDamFieldsByProductGuid,
getContractPolicyTemplateListBySpaceGuid
} from "@/api/modules/dataSmartContract";
import {
tagMethod,
......@@ -969,6 +970,9 @@ const constraintOptionsList: any = ref([]);
/** 策略操作行为下拉列表 */
const actionOptionsList: any = ref([]);
/** 逻辑空间的策略模板信息,若是逻辑空间不存在,则值为null,若是逻辑空间中未设置模板,则值为[] */
const templateJson: any = ref(null);
/** 限定状态字典下拉列表 */
const limitedStateOptionsList: any = ref([]);
......@@ -1112,6 +1116,19 @@ onBeforeMount(() => {
res?.msg && proxy.$ElMessage.error(res?.msg)
}
})
let logicSpaceGuid = productTableInfo.value.data?.[0]?.logicSpaceGuid;
if (logicSpaceGuid) {
getContractPolicyTemplateListBySpaceGuid(logicSpaceGuid).then((res: any) => {
if (res?.code == proxy.$passCode) {
templateJson.value = res.data || [];
} else {
templateJson.value = [];
res?.msg && proxy.$ElMessage.error(res?.msg)
}
})
} else {
templateJson.value = null;
}
} else {
productFieldList.value = initProductFieldValue.value;
annonFieldsList.value = initProductFieldValue.value;
......@@ -1359,7 +1376,7 @@ onActivated(() => {
<ContentWrap v-show="detailType == 'consult' && currentStep != 1" id="policy-info-consult" title="合约策略"
expandSwicth style="margin-top: 15px" :isExpand="expandPolicyConsult" @expand="(v) => (expandPolicyConsult = v)"
description="">
<StrategyTable ref="strategyTableEditRef" :show-title="true" :value="consultDetailInfo?.policys"
<StrategyTable ref="strategyTableEditRef" :show-title="true" :value="consultDetailInfo?.policys" :template-json="templateJson"
:operatorOptionList="operatorOptionList" :actionOptionsList="actionOptionsList" :productFieldList="productFieldList" :annonFieldsList="annonFieldsList"
:limit-state-option-list="limitedStateOptionsList" :constraintOptionsList="constraintOptionsList"></StrategyTable>
</ContentWrap>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!