master
lion 4 months ago
parent d743cf247c
commit 8df6f1b55b

@ -99,7 +99,7 @@ const actions = {
response["auth_type"] = response["area"]?response["area"]["auth_type"]:0
for(var k of response["role"]){
if(k.name==='系统管理员'){
if(k.name==='系统管理员'||k.name==='财务部'){
response["is_admin"] = true
}
}

@ -41,7 +41,24 @@
</el-select>
</div>
</div>
</template>
</template>
<!-- <template v-slot:user_ids>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>授权人员
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" @change="changeUser" v-model="form.user_ids" multiple collapse-tags placeholder="请选择">
<el-option
v-for="item in list_users"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</template> -->
<template v-slot:sort>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
@ -62,7 +79,10 @@
save,
show,
index
} from "@/api/system/baseForm.js"
} from "@/api/system/baseForm.js"
import {
listCommonuser
} from "@/api/common.js"
import {
deepCopy,
isNull
@ -76,7 +96,8 @@
isShow: false,
type: 'add',
id: '',
catalogList: [],
catalogList: [],
list_users:[],
checkArr: [],
defaultProps: {
children: 'children',
@ -86,7 +107,8 @@
form: {
pName: '根目录',
name: '',
auth_type: 0,
auth_type: 0,
// user_ids:[],
sort: 0,
pid: 0,
},
@ -99,9 +121,20 @@
}
},
created() {
// this.getUserList()
},
methods: {
methods: {
changeUser(e){
console.log("e",e)
this.form.user_ids = e
},
async getUserList() {
const res = await listCommonuser({
page_size: 999,
page: 1,
})
this.list_users = res.data
},
async getCatalogList() {
const res = await index({
page_size: 999,

@ -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();

Loading…
Cancel
Save