14fbd030 by lihua

产品地域回显和添加服务包不能添加重复

1 parent 8ea54e1e
......@@ -417,6 +417,7 @@ onMounted(() => {
v-for="opt in editForm[item.field].getOptions ? editForm[item.field].getOptions(scope) : editForm[item.field].options"
:label="editForm[item.field]?.props?.label ? opt[editForm[item.field].props.label] : opt.label"
:value="editForm[item.field]?.props?.value ? opt[editForm[item.field].props.value] : opt.value"
:disabled="editForm[item.field]?.props?.disabled ? opt[editForm[item.field].props.disabled] : opt.disabled"
:key="editForm[item.field]?.props?.value ? opt[editForm[item.field].props.value] : opt.value" />
</el-select>
<el-input v-else-if="
......
......@@ -695,6 +695,17 @@ const productData: any = ref([]);
const apiList: any = ref([]);
const getAPIOptions = (scope) => {
apiList.value.forEach(a => {
if (a.guid != scope.row.guid && productData.value.some(p => p.apiGuid == a.guid)) {
a.disabled = true;
} else {
a.disabled = false;
}
})
return apiList.value;
}
/** 基本信息的入参定义表格配置 */
const productTableInfo = ref({
id: "input-product-table",
......@@ -702,9 +713,11 @@ const productTableInfo = ref({
fields: [
{ label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
{ label: "服务名称", field: "apiGuid", width: 180, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "API类型", field: "apiType", width: 100, getName: (scope) => {
{
label: "API类型", field: "apiType", width: 100, getName: (scope) => {
return scope.row.apiType && apiTypes.find(a => a.value == scope.row.apiType)?.label || '--';
} },
}
},
{ label: "API地址", field: "requestUrl", minWidth: 240 },
{ label: "描述", field: "apiDescription", width: 300 },
],
......@@ -714,14 +727,14 @@ const productTableInfo = ref({
type: 'select',
field: 'apiGuid',
default: '',
options: apiList.value,
getOptions: (scope) => getAPIOptions(scope),
props: {
label: 'apiName',
value: 'guid',
disabled: 'disabled'
},
placeholder: '请选择',
clearable: false,
clearable: true,
filterable: true
},
},
......@@ -792,7 +805,7 @@ onActivated(() => {
getValidApi().then((res: any) => {
if (res.code == proxy.$passCode) {
apiList.value = res.data || [];
productTableInfo.value.editInfo.apiGuid.options = apiList.value;
// productTableInfo.value.editInfo.apiGuid.getOptions = (scope) => getAPIOptions(scope);
} else {
proxy.$ElMessage.error(res.msg);
}
......@@ -838,7 +851,7 @@ onBeforeMount(() => {
item.default = '';
if (item.children?.length) {
item.children[0].visible = true;
item.children[0].default = [detailInfo.value.coverageArea[0]] as any;
// item.children[0].default = [detailInfo.value.coverageArea[0]] as any;
let p: any = [];
detailInfo.value.coverageArea?.forEach(area => {
if (p.includes(area[0])) {
......@@ -881,7 +894,7 @@ onBeforeMount(() => {
baseInfoFormRules.value.damName[1] = checkExistName(checkedInfo.value, existDamName, detailInfo.value, 'damName');
})
setTimeout(() => {
baseInfoFormRef.value.ruleFormRef.clearValidate(['sceneDescription', 'subjectDomain', 'coverageAreas', 'isPublicData', 'dataSources', 'propertyDescription', 'sceneLimit']);
baseInfoFormRef.value.ruleFormRef?.clearValidate(['sceneDescription', 'subjectDomain', 'coverageAreas', 'isPublicData', 'dataSources', 'propertyDescription', 'sceneLimit']);
}, 0);
assetDataTableInfo.value.data = detailInfo.value.damCatalogTableInfo;
productData.value = detailInfo.value.associationApiInfo?.map(d => {
......@@ -1224,16 +1237,17 @@ const handleImportSave = (val) => {
<Form ref="baseInfoFormRef" :itemList="baseInfoFormItems" formId="base-info-form" :rules="baseInfoFormRules"
@selectChange="baseSelectChange" @checkboxChange="handleBaseInfoCheckboxChange" col="col3" />
</ContentWrap>
<ContentWrap v-if="baseInfoFormRef?.formInline?.damType == '2'" id="product-info" title="服务包信息" expandSwicth style="margin-top: 15px" :isExpand="expandServiceInfo"
@expand="(v) => (expandServiceInfo = v)" description="" class="mb16">
<ContentWrap v-if="baseInfoFormRef?.formInline?.damType == '2'" id="product-info" title="服务包信息" expandSwicth
style="margin-top: 15px" :isExpand="expandServiceInfo" @expand="(v) => (expandServiceInfo = v)" description=""
class="mb16">
<Table ref="productTableRef" :tableInfo="productTableInfo" class="fiveRow-table"
@table-select-change="hanldeTableSelectChange" />
<div class="row-add-btn">
<el-button link @click="addProduct" :icon="CirclePlus" v-preReClick>添加服务</el-button>
<el-button :disabled="productData.length >= apiList.length" link @click="addProduct" :icon="CirclePlus" v-preReClick>添加服务</el-button>
</div>
</ContentWrap>
<ContentWrap v-if="baseInfoFormRef?.formInline?.damType != '2'" id="id-tableInfo" title="资源表" description="" :expand-swicth="true" :isExpand="assetTableInfoExpand"
@expand="(v) => assetTableInfoExpand = v">
<ContentWrap v-if="baseInfoFormRef?.formInline?.damType != '2'" id="id-tableInfo" title="资源表" description=""
:expand-swicth="true" :isExpand="assetTableInfoExpand" @expand="(v) => assetTableInfoExpand = v">
<div v-show="assetDataTableInfo.data.length" class="tools_btns">
<el-button type="primary" @click="handleCreateTable" v-preReClick>添加</el-button>
</div>
......@@ -1319,5 +1333,4 @@ const handleImportSave = (val) => {
}
}
}
</style>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!