|
|
|
|
@ -76,6 +76,17 @@
|
|
|
|
|
<el-option v-for="item in originzeList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="授权目录" prop="catalogs_ids">
|
|
|
|
|
<div style="height:150px;overflow: scroll;">
|
|
|
|
|
<el-tree :default-checked-keys="checkArr" @check="getSelectedNodes"
|
|
|
|
|
:data="catalogList" node-key="id" ref="tree" highlight-current
|
|
|
|
|
:check-strictly="true"
|
|
|
|
|
:show-checkbox="true"
|
|
|
|
|
:props="defaultProps">
|
|
|
|
|
</el-tree>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="resetForm('form')">取 消</el-button>
|
|
|
|
|
@ -98,6 +109,9 @@
|
|
|
|
|
list
|
|
|
|
|
} from "../../api/system/role.js";
|
|
|
|
|
import {listdept} from "@/api/system/department"
|
|
|
|
|
import {
|
|
|
|
|
index as listCatalog
|
|
|
|
|
} from "@/api/system/baseForm.js"
|
|
|
|
|
import {
|
|
|
|
|
index
|
|
|
|
|
} from "@/api/system/baseForm.js"
|
|
|
|
|
@ -110,6 +124,7 @@
|
|
|
|
|
var that = this;
|
|
|
|
|
this.getDepartmentList();
|
|
|
|
|
this.getOrganizeList()
|
|
|
|
|
this.getCatalogList()
|
|
|
|
|
this.loadRole(function() {
|
|
|
|
|
that.load();
|
|
|
|
|
});
|
|
|
|
|
@ -121,18 +136,26 @@
|
|
|
|
|
roleList: [],
|
|
|
|
|
departmentList: [],
|
|
|
|
|
originzeList:[],
|
|
|
|
|
catalogList: [],
|
|
|
|
|
checkArr: [],
|
|
|
|
|
defaultProps: {
|
|
|
|
|
children: 'children',
|
|
|
|
|
label: 'name'
|
|
|
|
|
},
|
|
|
|
|
checkAll: false,
|
|
|
|
|
isIndeterminate: true,
|
|
|
|
|
dialogFormVisible: false,
|
|
|
|
|
formLabelWidth: "120px",
|
|
|
|
|
userNameStatus: true,
|
|
|
|
|
|
|
|
|
|
form: {
|
|
|
|
|
name: "",
|
|
|
|
|
username: "",
|
|
|
|
|
password: "",
|
|
|
|
|
department_id: "",
|
|
|
|
|
originze_id:'',
|
|
|
|
|
originze_name:''
|
|
|
|
|
originze_name:'',
|
|
|
|
|
catalogs_ids:[]
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
name: [{
|
|
|
|
|
@ -167,6 +190,33 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
isLeaf(node) {
|
|
|
|
|
// 判断是否为叶子节点(没有子节点)
|
|
|
|
|
return !node.children || node.children.length === 0;
|
|
|
|
|
},
|
|
|
|
|
async getCatalogList() {
|
|
|
|
|
const res = await index({
|
|
|
|
|
page_size: 999,
|
|
|
|
|
page: 1,
|
|
|
|
|
sort_type: 'ASC',
|
|
|
|
|
sort_name: 'sort',
|
|
|
|
|
table_name: 'catalogs',
|
|
|
|
|
// is_auth: 1
|
|
|
|
|
})
|
|
|
|
|
if (res.data.length > 0) {
|
|
|
|
|
this.catalogList = this.base.buildTree(res.data)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getSelectedNodes(data, node) {
|
|
|
|
|
console.log("data", data,node)
|
|
|
|
|
// this.$refs.tree.setCheckedKeys([]); // 删除所有选中节点
|
|
|
|
|
// this.$refs.tree.setCheckedNodes([data]); // 选中已选中节点
|
|
|
|
|
// this.form.pName = data.name
|
|
|
|
|
// this.form.pid = data.id
|
|
|
|
|
this.form.catalogs_ids = node.checkedKeys
|
|
|
|
|
console.log("this.form.catalogs_ids",this.form.catalogs_ids)
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
},
|
|
|
|
|
initLoad() {
|
|
|
|
|
var that = this;
|
|
|
|
|
var clientHeight = document.documentElement.clientHeight
|
|
|
|
|
@ -284,7 +334,10 @@
|
|
|
|
|
}
|
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
save(that.form).then(response => {
|
|
|
|
|
save({
|
|
|
|
|
...that.form,
|
|
|
|
|
catalogs_ids:that.form.catalogs_ids
|
|
|
|
|
}).then(response => {
|
|
|
|
|
//console.log(response)
|
|
|
|
|
this.$Message.success('操作成功');
|
|
|
|
|
that.load();
|
|
|
|
|
|