master
xy 3 years ago
parent cfc467f00c
commit 8d3e1ae1d4

@ -119,6 +119,9 @@ export default {
"uploaded-a":
file.status === "success",
},
style: {
'padding': '0 4px'
},
},
file.name
),
@ -216,7 +219,7 @@ export default {
? info._params.map((i) =>
h("el-option", {
props: {
label: i.key || i.name || i.no || i.value || i.id,
label: i.key || i.value || i.name || i.no || i.mingcheng || i.id,
value: info._relations ? i[info._relations.foreign_key] : i.value,
},
})
@ -337,14 +340,21 @@ export default {
this.form = Object.assign({}, this.form);
this.formInfo.forEach((i) => {
if (i && i.edit_input === "file") {
this.file[i.field] = [
{
name: res[i.link_with_name]?.original_name,
url: res[i.link_with_name]?.url,
response: res[i.link_with_name],
},
];
if (i && (i.edit_input === "file" || i.edit_input === 'files')) {
res[i._relations.link_with_name] ? (
this.file[i.field] = res[i._relations.link_with_name] instanceof Array ? res[i._relations.link_with_name].map(i => {
return {
name: i?.original_name,
url: i?.url,
response: i
}
}) : [{
name: res[i._relations.link_with_name]?.original_name,
url: res[i._relations.link_with_name]?.url,
response: res[i._relations.link_with_name]
}]
) : this.file[i.field] = []
}
});
},
@ -367,7 +377,7 @@ export default {
if (validate) {
this.formInfo.forEach((info) => {
if (info.edit_input === "files") {
this.form[info.field] = info._fileList.map(
this.form[info.field] = this.file[info.field].map(
(i) => i?.response?.id
);
}

@ -65,7 +65,7 @@
:key="item.id"
:value="getColumnField(select.filter[0].key)._relations ? item[getColumnField(select.filter[0].key)._relations.foreign_key] : item.value"
>{{
item.key || item.value || item.name || item.no || item.id
item.key || item.value || item.name || item.no || item.mingcheng || item.id
}}</Option
>
</Select>
@ -162,7 +162,7 @@
:key="item.id"
:value="getColumnField(item.key)._relations ? item[getColumnField(item.key)._relations.foreign_key] : item.value"
>{{
item.key || item.value || item.name || item.no || item.id
item.key || item.value || item.name || item.no || item.mingcheng || item.id
}}</Option
>
</Select>
@ -293,6 +293,7 @@ import { getparameter } from "@/api/system/dictionary";
import { show } from "@/api/system/customForm";
import * as XLSX from "xlsx";
import { saveAs } from "file-saver";
import { listdept } from "@/api/system/department"
import dialoger from "./dialog.vue";
import LxHeader from "@/components/LxHeader/index.vue";
@ -403,6 +404,14 @@ export default {
this.title = res.name;
//
//
let baseTable = new Map([
['departments', async () => {
const res = await listdept()
return res
}],
['admins',[]]
])
let { fields, relation } = res;
if (
!fields ||
@ -423,18 +432,25 @@ export default {
}
})
}
if (i.edit_input === 'file' || i.edit_input === 'files') {
return
}
if (i._relations) {
i._params = i._relations.parameter_id
? getparameter({ id: i._relations.parameter_id },false).then((res) => {
i._params = res.detail;
})
: this.index({
table_name: i._relations.link_table_name,
page: 1,
page_size: 9999,
}).then((res) => {
i._params = res.data;
});
if (baseTable.get(i._relations.link_table_name)) {
baseTable.get(i._relations.link_table_name)().then(res => i._params = res)
} else {
i._params = i._relations.parameter_id
? getparameter({ id: i._relations.parameter_id },false).then((res) => {
i._params = res.detail;
})
: this.index({
table_name: i._relations.link_table_name,
page: 1,
page_size: 9999,
}).then((res) => {
i._params = res.data;
});
}
}
});
this.form = fields;

Loading…
Cancel
Save