lb #9

Merged
g7hoo merged 18 commits from lb into test 2023-08-03 15:15:37 +08:00
2 changed files with 42 additions and 17 deletions
Showing only changes of commit 7c665484a7 - Show all commits

View File

@ -52,7 +52,14 @@
// }
},
],
[{ input: true, label: '检测类型编码', prop: 'code' }],
[
{
input: true,
label: '检测类型编码',
prop: 'code',
url: '/base/quality-inspection-type/getCode',
},
],
[{ input: true, label: '备注', prop: 'remark' }],
]" />
</base-dialog>

View File

@ -97,6 +97,9 @@ export default {
get() {
return this.dataForm;
},
set(val) {
console.log('set form', val);
},
},
},
mounted() {
@ -111,7 +114,11 @@ export default {
resetFields(args) {
return this.$refs.form.resetFields(args);
},
// getCode
async getCode(url) {
const response = await this.$axios(url);
return response.data;
},
handleOptions() {
// console.log("[dialogForm:handleOptions]")
const promiseList = [];
@ -120,13 +127,19 @@ export default {
if (opt.options) {
this.optionListOf[opt.prop] = opt.options;
} else if (opt.url) {
//
if (opt.select || (opt.input && !this.form?.id)) {
promiseList.push(async () => {
const response = await this.$axios(opt.url, {
method: opt.method ?? 'get',
});
console.log('[dialogForm:handleOptions:response]', response);
if (opt.select) {
//
const list =
'list' in response.data ? response.data.list : response.data;
'list' in response.data
? response.data.list
: response.data;
this.$set(
this.optionListOf,
opt.prop,
@ -135,7 +148,12 @@ export default {
value: item[opt.valueKey ?? 'id'],
}))
);
} else if (opt.input) {
//
this.form[opt.prop] = response.data;
}
});
}
try {
// this.formLoading = true;
// console.log("[dialogForm:handleOptions:promiseList]", promiseList)