Commit f45f0382 by Lin

feat(systemConfig): 更新场景管理功能以支持动态标签和选项列表

- 修改了场景标签的渲染逻辑,确保正确显示标签名称。
- 更新了表单字段名称,从 "merchantType" 更改为 "tagIds",以更好地反映数据结构。
- 优化了加载场景标签选项的逻辑,确保从 API 获取的数据格式一致。
- 调整了样式以改善用户体验,增加了标签之间的间距。
1 parent eb93be4d
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
:before-search-fn="beforeSearchFn"> :before-search-fn="beforeSearchFn">
<template #scene-tag="scope"> <template #scene-tag="scope">
<template v-if="scope.scope.tagNames && scope.scope.tagNames.length"> <template v-if="scope.scope.tagNames && scope.scope.tagNames.length">
<span v-for="item in scope.scope.tagNames" <span v-for="(item, index) in scope.scope.tagNames"
:key="item.tagId" :key="index"
class="scene-tag"> class="scene-tag">
{{ getSceneTagLabel(scope.scope) }} {{ item }}
</span> </span>
</template> </template>
<span v-else>-</span> <span v-else>-</span>
...@@ -79,15 +79,15 @@ export default { ...@@ -79,15 +79,15 @@ export default {
keyFn: this.keyDowmGetList, keyFn: this.keyDowmGetList,
}, { }, {
label: "标签", label: "标签",
name: "merchantType", name: "tagIds",
type: "select", type: "select",
multiple: true, multiple: true,
collapseTags: true, collapseTags: true,
isClear: true, isClear: true,
optionList: [], optionList: [],
optionId: "confId", optionId: "id",
optionLabel: "confLabel", optionLabel: "name",
optionsName: "merchantStoreServiceList", optionsName: "sceneTagList",
}], }],
getListApi: getList, getListApi: getList,
// 表格参数 // 表格参数
...@@ -143,22 +143,17 @@ export default { ...@@ -143,22 +143,17 @@ export default {
close: "d2admin/page/close", close: "d2admin/page/close",
}), }),
async loadSceneTagOptions() { async loadSceneTagOptions() {
const idx = this.showFormData.findIndex(i => i.name === "merchantType");
if (idx < 0) {
return;
}
try { try {
const res = await getSceneTags({}); const res = await getSceneTags({});
const list = res?.data?.list || res?.data || res?.result || []; const list = res || [];
const optionList = (Array.isArray(list) ? list : []) const optionList = (Array.isArray(list) ? list : [])
.map(it => ({ .map(it => ({
confId: it?.confId ?? it?.tagId ?? it?.id, id: it?.id,
confLabel: it?.confLabel ?? it?.tagName ?? it?.name ?? it?.label, name: it?.name,
})) }))
.filter(it => it.confId !== undefined && it.confLabel); .filter(it => it.id !== undefined && it.name);
this.$set(this.showFormData[idx], "optionList", optionList); this.showFormData[1].optionList = optionList;
} catch (e) { } catch (e) {
this.$set(this.showFormData[idx], "optionList", []);
} }
}, },
beforeSearchFn() { beforeSearchFn() {
...@@ -219,8 +214,7 @@ export default { ...@@ -219,8 +214,7 @@ export default {
} }
}, },
getSceneTagLabel(row) { getSceneTagLabel(row) {
const idx = Number(row?.procurementType) - 1; return row || "-";
return this.procureModeList?.[idx]?.confName || "-";
}, },
}, },
}; };
...@@ -266,6 +260,7 @@ export default { ...@@ -266,6 +260,7 @@ export default {
font-size: 14px; font-size: 14px;
padding: 1px 6px; padding: 1px 6px;
display: inline-block; display: inline-block;
margin-right: 1px;
} }
.taskStatus { .taskStatus {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!