<template>
|
<zt-dialog ref="dialog" @confirm="formSubmit" append-to-body>
|
<el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px">
|
<el-form-item prop="hasSystemTree" label="展示组织结构树">
|
<el-checkbox v-model="dataForm.hasSystemTree"></el-checkbox>
|
</el-form-item>
|
<el-form-item v-if="dataForm.hasSystemTree" prop="hasSystemTree" label="显示级别">
|
<zt-dict v-model="dataForm.showLevel" dict="node_type" placeholder="组织结构节点级别"></zt-dict>
|
</el-form-item>
|
<el-col :span="6">
|
<el-form-item v-if="dataForm.hasSystemTree" prop="hasSystemTree" label="型号">
|
<el-checkbox v-model="dataForm.hasOne"></el-checkbox>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item v-if="dataForm.hasSystemTree" prop="hasSystemTree" :label="$store.state.word.xian+'号'">
|
<el-checkbox v-model="dataForm.hasTwo"></el-checkbox>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item v-if="dataForm.hasSystemTree" prop="hasSystemTree" label="系统">
|
<el-checkbox v-model="dataForm.hasThree"></el-checkbox>
|
</el-form-item>
|
</el-col>
|
<el-col :span="6">
|
<el-form-item v-if="dataForm.hasSystemTree" prop="hasSystemTree" label="设备">
|
<el-checkbox v-model="dataForm.hasFour"></el-checkbox>
|
</el-form-item>
|
</el-col>
|
</el-form>
|
</zt-dialog>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
word: {},
|
dataForm: {
|
menuId: '',
|
hasSystemTree: false,
|
showLevel: 'L1',
|
hasOne: false,
|
hasTwo: false,
|
hasThree: false,
|
hasFour: false
|
}
|
}
|
},
|
mounted() {
|
// this.kwReplacement()
|
},
|
methods: {
|
// async kwReplacement() {
|
// let res = await this.$http.get(`/sys/keyword/replacement`)
|
// if (res.data != null) {
|
// this.word = res.data
|
// }
|
// },
|
init(id) {
|
this.dataForm.menuId = id
|
},
|
// 获取信息
|
async getInfo() {
|
let res = await this.$http.get(`/sys/menuConfig/${this.dataForm.menuId}`)
|
if (res.success && res.data.hasSystemTree) {
|
this.dataForm = {
|
...this.dataForm,
|
...res.data
|
}
|
}
|
},
|
// 表单提交
|
async formSubmit() {
|
let res = await this.$http['post']('/sys/menuConfig', this.dataForm)
|
if (res.success) {
|
this.$refs.dialog.close()
|
await this.$tip.success()
|
this.$emit('refreshDataList')
|
}
|
}
|
}
|
}
|
</script>
|