mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 14:10:27 +08:00
解决ai编码options空的问题
This commit is contained in:
parent
f3b3bd7e8d
commit
3ada755dcc
@ -226,7 +226,7 @@ export function useCode() {
|
||||
// 字典
|
||||
const dict = item.component?.options || column.dict;
|
||||
|
||||
if (dict) {
|
||||
if (!isEmpty(dict)) {
|
||||
options[item.prop] = dict;
|
||||
|
||||
const str = `$$options.${item.prop}$$`;
|
||||
@ -326,13 +326,17 @@ export function useCode() {
|
||||
// 筛选
|
||||
const clFilter = fieldEq
|
||||
.map((field) => {
|
||||
const item = upsert.items.find((e) => e.prop == field);
|
||||
|
||||
if (item) {
|
||||
return `<!-- 筛选${item.label} -->\n<cl-filter label="${item.label}">\n<cl-select prop="${field}" :options="options.${field}" />\n</cl-filter>`;
|
||||
} else {
|
||||
if (isEmpty(options[field])) {
|
||||
return "";
|
||||
}
|
||||
|
||||
const item = upsert.items.find((e) => e.prop == field);
|
||||
|
||||
if (!item) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return `<!-- 筛选${item.label} -->\n<cl-filter label="${item.label}">\n<cl-select prop="${field}" :options="options.${field}" />\n</cl-filter>`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
|
Loading…
Reference in New Issue
Block a user