装备类型管理
This commit is contained in:
parent
cd65de7a9e
commit
0d686ed0c9
|
|
@ -24,6 +24,7 @@
|
|||
noChildrenText="没有数据了" noOptionsText="没有数据" noResultsText="没有搜索结果"
|
||||
placeholder="请选择所属上级"
|
||||
style="width: 100%"
|
||||
@select="handleSelect"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
@ -84,16 +85,19 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
currentLevel: null,
|
||||
selectLevel: null,
|
||||
form: {
|
||||
name: '',
|
||||
isStateGrid: null
|
||||
},
|
||||
rules: {
|
||||
parentId: [{ required: true, message: '请选择所属上级', trigger: 'change' }],
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
{ min: 2, max: 20, message: '长度在2到20个字符', trigger: 'blur' }
|
||||
],
|
||||
isStateGrid: [{ required: true, message: '请选择是否显示', trigger: 'change' }]
|
||||
isStateGrid: [{ required: true, message: '请选择是否显示国网单位', trigger: 'change' }]
|
||||
},
|
||||
deptOptions: []
|
||||
}
|
||||
|
|
@ -117,6 +121,8 @@ export default {
|
|||
this.form.name = newVal?.label || newVal?.name || ''
|
||||
this.form.isStateGrid = newVal?.isStateGrid || null
|
||||
this.form.parentId = newVal?.parentId || null
|
||||
this.currentLevel = newVal.level
|
||||
console.log('🚀 ~ handler ~ this.currentLevel:', this.currentLevel)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -153,9 +159,19 @@ export default {
|
|||
children: node.children,
|
||||
};
|
||||
},
|
||||
handleSelect(e) {
|
||||
console.log('🚀 ~ handleSelect ~ e:', e)
|
||||
this.selectLevel = e.level
|
||||
},
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate(valid => {
|
||||
if (valid) {
|
||||
let level = this.currentLevel - this.selectLevel
|
||||
if (level != 1 ) {
|
||||
// 提示 只能变更至相同的层级
|
||||
this.$message.warning('只能变更至相同的层级')
|
||||
return
|
||||
}
|
||||
const formData = {
|
||||
typeName: this.form.name || null,
|
||||
typeId: this.parentNode?.id || null,
|
||||
|
|
|
|||
Loading…
Reference in New Issue