Revert "产品地域回显和添加服务包不能添加重复"
This reverts commit c68dce9b.
Showing
2 changed files
with
15 additions
and
29 deletions
| ... | @@ -406,7 +406,6 @@ onMounted(() => { | ... | @@ -406,7 +406,6 @@ onMounted(() => { |
| 406 | v-for="opt in editForm[item.field].getOptions ? editForm[item.field].getOptions(scope) : editForm[item.field].options" | 406 | v-for="opt in editForm[item.field].getOptions ? editForm[item.field].getOptions(scope) : editForm[item.field].options" |
| 407 | :label="editForm[item.field]?.props?.label ? opt[editForm[item.field].props.label] : opt.label" | 407 | :label="editForm[item.field]?.props?.label ? opt[editForm[item.field].props.label] : opt.label" |
| 408 | :value="editForm[item.field]?.props?.value ? opt[editForm[item.field].props.value] : opt.value" | 408 | :value="editForm[item.field]?.props?.value ? opt[editForm[item.field].props.value] : opt.value" |
| 409 | :disabled="editForm[item.field]?.props?.disabled ? opt[editForm[item.field].props.disabled] : opt.disabled" | ||
| 410 | :key="editForm[item.field]?.props?.value ? opt[editForm[item.field].props.value] : opt.value" /> | 409 | :key="editForm[item.field]?.props?.value ? opt[editForm[item.field].props.value] : opt.value" /> |
| 411 | </el-select> | 410 | </el-select> |
| 412 | <el-input v-else-if=" | 411 | <el-input v-else-if=" | ... | ... |
| ... | @@ -695,17 +695,6 @@ const productData: any = ref([]); | ... | @@ -695,17 +695,6 @@ const productData: any = ref([]); |
| 695 | 695 | ||
| 696 | const apiList: any = ref([]); | 696 | const apiList: any = ref([]); |
| 697 | 697 | ||
| 698 | const getAPIOptions = (scope) => { | ||
| 699 | apiList.value.forEach(a => { | ||
| 700 | if (a.guid != scope.row.guid && productData.value.some(p => p.apiGuid == a.guid)) { | ||
| 701 | a.disabled = true; | ||
| 702 | } else { | ||
| 703 | a.disabled = false; | ||
| 704 | } | ||
| 705 | }) | ||
| 706 | return apiList.value; | ||
| 707 | } | ||
| 708 | |||
| 709 | /** 基本信息的入参定义表格配置 */ | 698 | /** 基本信息的入参定义表格配置 */ |
| 710 | const productTableInfo = ref({ | 699 | const productTableInfo = ref({ |
| 711 | id: "input-product-table", | 700 | id: "input-product-table", |
| ... | @@ -713,11 +702,9 @@ const productTableInfo = ref({ | ... | @@ -713,11 +702,9 @@ const productTableInfo = ref({ |
| 713 | fields: [ | 702 | fields: [ |
| 714 | { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, | 703 | { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, |
| 715 | { label: "服务名称", field: "apiGuid", width: 180, required: true, columClass: 'edit-colum', type: 'edit' }, | 704 | { label: "服务名称", field: "apiGuid", width: 180, required: true, columClass: 'edit-colum', type: 'edit' }, |
| 716 | { | 705 | { label: "API类型", field: "apiType", width: 100, getName: (scope) => { |
| 717 | label: "API类型", field: "apiType", width: 100, getName: (scope) => { | 706 | return scope.row.apiType && apiTypes.find(a => a.value == scope.row.apiType)?.label || '--'; |
| 718 | return scope.row.apiType && apiTypes.find(a => a.value == scope.row.apiType)?.label || '--'; | 707 | } }, |
| 719 | } | ||
| 720 | }, | ||
| 721 | { label: "API地址", field: "requestUrl", minWidth: 240 }, | 708 | { label: "API地址", field: "requestUrl", minWidth: 240 }, |
| 722 | { label: "描述", field: "apiDescription", width: 300 }, | 709 | { label: "描述", field: "apiDescription", width: 300 }, |
| 723 | ], | 710 | ], |
| ... | @@ -727,14 +714,14 @@ const productTableInfo = ref({ | ... | @@ -727,14 +714,14 @@ const productTableInfo = ref({ |
| 727 | type: 'select', | 714 | type: 'select', |
| 728 | field: 'apiGuid', | 715 | field: 'apiGuid', |
| 729 | default: '', | 716 | default: '', |
| 730 | getOptions: (scope) => getAPIOptions(scope), | 717 | options: apiList.value, |
| 731 | props: { | 718 | props: { |
| 732 | label: 'apiName', | 719 | label: 'apiName', |
| 733 | value: 'guid', | 720 | value: 'guid', |
| 734 | disabled: 'disabled' | 721 | disabled: 'disabled' |
| 735 | }, | 722 | }, |
| 736 | placeholder: '请选择', | 723 | placeholder: '请选择', |
| 737 | clearable: true, | 724 | clearable: false, |
| 738 | filterable: true | 725 | filterable: true |
| 739 | }, | 726 | }, |
| 740 | }, | 727 | }, |
| ... | @@ -805,7 +792,7 @@ onActivated(() => { | ... | @@ -805,7 +792,7 @@ onActivated(() => { |
| 805 | getValidApi().then((res: any) => { | 792 | getValidApi().then((res: any) => { |
| 806 | if (res.code == proxy.$passCode) { | 793 | if (res.code == proxy.$passCode) { |
| 807 | apiList.value = res.data || []; | 794 | apiList.value = res.data || []; |
| 808 | // productTableInfo.value.editInfo.apiGuid.getOptions = (scope) => getAPIOptions(scope); | 795 | productTableInfo.value.editInfo.apiGuid.options = apiList.value; |
| 809 | } else { | 796 | } else { |
| 810 | proxy.$ElMessage.error(res.msg); | 797 | proxy.$ElMessage.error(res.msg); |
| 811 | } | 798 | } |
| ... | @@ -851,7 +838,7 @@ onBeforeMount(() => { | ... | @@ -851,7 +838,7 @@ onBeforeMount(() => { |
| 851 | item.default = ''; | 838 | item.default = ''; |
| 852 | if (item.children?.length) { | 839 | if (item.children?.length) { |
| 853 | item.children[0].visible = true; | 840 | item.children[0].visible = true; |
| 854 | // item.children[0].default = [detailInfo.value.coverageArea[0]] as any; | 841 | item.children[0].default = [detailInfo.value.coverageArea[0]] as any; |
| 855 | let p: any = []; | 842 | let p: any = []; |
| 856 | detailInfo.value.coverageArea?.forEach(area => { | 843 | detailInfo.value.coverageArea?.forEach(area => { |
| 857 | if (p.includes(area[0])) { | 844 | if (p.includes(area[0])) { |
| ... | @@ -894,7 +881,7 @@ onBeforeMount(() => { | ... | @@ -894,7 +881,7 @@ onBeforeMount(() => { |
| 894 | baseInfoFormRules.value.damName[1] = checkExistName(checkedInfo.value, existDamName, detailInfo.value, 'damName'); | 881 | baseInfoFormRules.value.damName[1] = checkExistName(checkedInfo.value, existDamName, detailInfo.value, 'damName'); |
| 895 | }) | 882 | }) |
| 896 | setTimeout(() => { | 883 | setTimeout(() => { |
| 897 | baseInfoFormRef.value.ruleFormRef?.clearValidate(['sceneDescription', 'subjectDomain', 'coverageAreas', 'isPublicData', 'dataSources', 'propertyDescription', 'sceneLimit']); | 884 | baseInfoFormRef.value.ruleFormRef.clearValidate(['sceneDescription', 'subjectDomain', 'coverageAreas', 'isPublicData', 'dataSources', 'propertyDescription', 'sceneLimit']); |
| 898 | }, 0); | 885 | }, 0); |
| 899 | assetDataTableInfo.value.data = detailInfo.value.damCatalogTableInfo; | 886 | assetDataTableInfo.value.data = detailInfo.value.damCatalogTableInfo; |
| 900 | productData.value = detailInfo.value.associationApiInfo?.map(d => { | 887 | productData.value = detailInfo.value.associationApiInfo?.map(d => { |
| ... | @@ -942,7 +929,7 @@ onBeforeMount(() => { | ... | @@ -942,7 +929,7 @@ onBeforeMount(() => { |
| 942 | if (res.code == proxy.$passCode) { | 929 | if (res.code == proxy.$passCode) { |
| 943 | subjectDomainListData.value = res.data || []; | 930 | subjectDomainListData.value = res.data || []; |
| 944 | let item = baseInfoFormItems.value.find(item => item.field == 'subjectDomain'); | 931 | let item = baseInfoFormItems.value.find(item => item.field == 'subjectDomain'); |
| 945 | // item && (item.options = subjectDomainListData.value); | 932 | // item && (item.options = subjectDomainListData.value); |
| 946 | item && (item.options = subjectDomainListData.value?.find(d => d.value == '1')?.childDictList || []); | 933 | item && (item.options = subjectDomainListData.value?.find(d => d.value == '1')?.childDictList || []); |
| 947 | } else { | 934 | } else { |
| 948 | proxy.$ElMessage.error(res.msg); | 935 | proxy.$ElMessage.error(res.msg); |
| ... | @@ -1234,17 +1221,16 @@ const handleImportSave = (val) => { | ... | @@ -1234,17 +1221,16 @@ const handleImportSave = (val) => { |
| 1234 | <Form ref="baseInfoFormRef" :itemList="baseInfoFormItems" formId="base-info-form" :rules="baseInfoFormRules" | 1221 | <Form ref="baseInfoFormRef" :itemList="baseInfoFormItems" formId="base-info-form" :rules="baseInfoFormRules" |
| 1235 | @selectChange="baseSelectChange" @checkboxChange="handleBaseInfoCheckboxChange" col="col3" /> | 1222 | @selectChange="baseSelectChange" @checkboxChange="handleBaseInfoCheckboxChange" col="col3" /> |
| 1236 | </ContentWrap> | 1223 | </ContentWrap> |
| 1237 | <ContentWrap v-if="baseInfoFormRef?.formInline?.damType == '2'" id="product-info" title="服务包信息" expandSwicth | 1224 | <ContentWrap v-if="baseInfoFormRef?.formInline?.damType == '2'" id="product-info" title="服务包信息" expandSwicth style="margin-top: 15px" :isExpand="expandServiceInfo" |
| 1238 | style="margin-top: 15px" :isExpand="expandServiceInfo" @expand="(v) => (expandServiceInfo = v)" description="" | 1225 | @expand="(v) => (expandServiceInfo = v)" description="" class="mb16"> |
| 1239 | class="mb16"> | ||
| 1240 | <Table ref="productTableRef" :tableInfo="productTableInfo" class="fiveRow-table" | 1226 | <Table ref="productTableRef" :tableInfo="productTableInfo" class="fiveRow-table" |
| 1241 | @table-select-change="hanldeTableSelectChange" /> | 1227 | @table-select-change="hanldeTableSelectChange" /> |
| 1242 | <div class="row-add-btn"> | 1228 | <div class="row-add-btn"> |
| 1243 | <el-button :disabled="productData.length >= apiList.length" link @click="addProduct" :icon="CirclePlus" v-preReClick>添加服务</el-button> | 1229 | <el-button link @click="addProduct" :icon="CirclePlus" v-preReClick>添加服务</el-button> |
| 1244 | </div> | 1230 | </div> |
| 1245 | </ContentWrap> | 1231 | </ContentWrap> |
| 1246 | <ContentWrap v-if="baseInfoFormRef?.formInline?.damType != '2'" id="id-tableInfo" title="资源表" description="" | 1232 | <ContentWrap v-if="baseInfoFormRef?.formInline?.damType != '2'" id="id-tableInfo" title="资源表" description="" :expand-swicth="true" :isExpand="assetTableInfoExpand" |
| 1247 | :expand-swicth="true" :isExpand="assetTableInfoExpand" @expand="(v) => assetTableInfoExpand = v"> | 1233 | @expand="(v) => assetTableInfoExpand = v"> |
| 1248 | <div v-show="assetDataTableInfo.data.length" class="tools_btns"> | 1234 | <div v-show="assetDataTableInfo.data.length" class="tools_btns"> |
| 1249 | <el-button type="primary" @click="handleCreateTable" v-preReClick>添加</el-button> | 1235 | <el-button type="primary" @click="handleCreateTable" v-preReClick>添加</el-button> |
| 1250 | </div> | 1236 | </div> |
| ... | @@ -1330,4 +1316,5 @@ const handleImportSave = (val) => { | ... | @@ -1330,4 +1316,5 @@ const handleImportSave = (val) => { |
| 1330 | } | 1316 | } |
| 1331 | } | 1317 | } |
| 1332 | } | 1318 | } |
| 1319 | |||
| 1333 | </style> | 1320 | </style> | ... | ... |
-
Please register or sign in to post a comment