lb #12

Merged
g7hoo merged 5 commits from lb into test 2023-08-04 14:34:52 +08:00
2 changed files with 26 additions and 8 deletions
Showing only changes of commit 61a6e7dafb - Show all commits

View File

@ -130,10 +130,25 @@ export default {
const promiseList = []; const promiseList = [];
this.rows.forEach((cols) => { this.rows.forEach((cols) => {
cols.forEach(async (opt) => { cols.forEach(async (opt) => {
if (opt.onChange) {
this.$watch(`form.${opt.prop}`, {
handler: (val) => {
this.$emit(opt.onChange.emit, val);
},
immediate: true,
});
}
if (opt.listen) {
//
this.$on(opt.listen, (val) => {
alert(val);
});
}
if (opt.value) { if (opt.value) {
// //
this.form[opt.prop] = opt.value; this.form[opt.prop] = opt.value;
} }
if (opt.options) { if (opt.options) {
this.optionListOf[opt.prop] = opt.options; this.optionListOf[opt.prop] = opt.options;
} else if (opt.url) { } else if (opt.url) {

View File

@ -83,18 +83,21 @@
// }, // },
], ],
[ [
{ // listen线onChange
select: true,
label: '产线',
url: '/base/production-line/listAll',
prop: 'productionLineId',
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
{ {
select: true, select: true,
label: '工段', label: '工段',
url: '/base/workshop-section/listAll', url: '/base/workshop-section/listAll',
prop: 'sectionId', prop: 'sectionId',
listen: 'productionLineChange', // emit
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
},
{
select: true,
label: '产线',
url: '/base/production-line/listAll',
prop: 'productionLineId',
onChange: { emit: 'productionLineChange' },
rules: [{ required: true, message: '不能为空', trigger: 'blur' }], rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
}, },
], ],