Commit f45f0382 by Lin

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

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