角色权限功能新增、新增用户级别、学历、职务下拉修改。

This commit is contained in:
hyt 2024-04-07 10:31:09 +08:00
parent 6594e53ec5
commit 216989412f
12 changed files with 661 additions and 676 deletions

View File

@ -71,10 +71,10 @@ const formRow = [{
tag: 'elRadio',
options: [{
label: '是',
value: "1"
value: "0"
},{
label: '否',
value: "0",
value: "1",
}
]
},

View File

@ -1,98 +1,98 @@
<template>
<div >
<div flex="cross:center cross:baseline" flex-wrap v-for="(el,elIndex) in classifyButtonList"
class="buttonSetting">
<p style="width:100px;text-align: right;">{{el.label}}</p>
<div flex="cross:center" flex-wrap style="width: calc(100% - 200px);">
<p class="recordText" v-for="(item,index) in el.buttonList" @click="typeChange(item)" :key="index"
:class="{'active':item.type}">{{item.NameCN}}</p>
<p v-if="el.buttonList.length == 0" class="recordText">暂无按钮</p>
</div>
</div>
</div>
<div >
<div flex="cross:center cross:baseline" flex-wrap v-for="(el,elIndex) in classifyButtonList"
class="buttonSetting">
<p style="width:100px;text-align: right;">{{el.label}}</p>
<div flex="cross:center" flex-wrap style="width: calc(100% - 200px);">
<p class="recordText" v-for="(item,index) in el.buttonList" @click="typeChange(item)" :key="index"
:class="{'active':item.type}">{{item.NameCN}}</p>
<p v-if="el.buttonList.length == 0" class="recordText">暂无按钮</p>
</div>
</div>
</div>
</template>
<script>
import {
GetAllButton,
} from '@/api/apis/jurisdiction'
export default {
// props:{
// ButtonList: {
// type: Array,
// default: () => {
// return []
// }
// },
// }
data(){
return{
// ButtonList:[],
classifyButtonList: [],
buttonPopedom:[],
}
},
methods:{
async GetAllButtonList(ids, checkdata) {
this.classifyButtonList = []
let params = {
menuIDs: ids.join(",")
}
let res = await GetAllButton(params)
if (res.code == 1) {
let allButtonList = res.data[0]
checkdata.forEach(el => {
el.buttonList = []
allButtonList.forEach(item => {
if (el.id == item.MenuID) {
el.buttonList.push(item)
}
})
})
this.classifyButtonList = checkdata
}
if(this.buttonPopedom.length > 0){
this.classifyButtonList.forEach(item=>{
item.buttonList.forEach(bItem=>{
this.buttonPopedom.forEach(el=>{
if(el == bItem.id){
bItem.type = true
}
})
})
})
}
},
typeChange(item) {
item.type = !item.type
this.$forceUpdate()
},
}
}
import {
GetAllButton,
} from '@/api/apis/jurisdiction'
export default {
// props:{
// ButtonList: {
// type: Array,
// default: () => {
// return []
// }
// },
// }
data(){
return{
// ButtonList:[],
classifyButtonList: [],
buttonPopedom:[],
}
},
methods:{
async GetAllButtonList(ids, checkdata) {
this.classifyButtonList = []
let params = {
menuIDs: ids.join(",")
}
let res = await GetAllButton(params)
if (res.code == 1) {
let allButtonList = res.data[0]
checkdata.forEach(el => {
el.buttonList = []
allButtonList.forEach(item => {
if (el.id == item.MenuID) {
el.buttonList.push(item)
}
})
})
this.classifyButtonList = checkdata
}
if(this.buttonPopedom.length > 0){
this.classifyButtonList.forEach(item=>{
item.buttonList.forEach(bItem=>{
this.buttonPopedom.forEach(el=>{
if(el == bItem.id){
bItem.type = true
}
})
})
})
}
},
typeChange(item) {
item.type = !item.type
this.$forceUpdate()
},
}
}
</script>
<style lang="scss">
$activeColor: var(--bg-color, "#00aaff");
.buttonSetting{
margin-bottom: 5px;
.recordText {
border: 1px solid #fff;
width: 80px;
padding: 8px 0;
text-align: center;
font-size: 12px;
cursor: pointer;
background: #f2f2f2;
color: #e0e0e0;
margin:3px;
}
.recordText.active {
background: $activeColor;
color: #fff;
}
}
$activeColor: var(--bg-color, "#00aaff");
.buttonSetting{
margin-bottom: 5px;
.recordText {
border: 1px solid #fff;
width: 80px;
padding: 8px 0;
text-align: center;
font-size: 12px;
cursor: pointer;
background: #f2f2f2;
color: #e0e0e0;
margin:3px;
}
</style>
.recordText.active {
background: $activeColor;
color: #fff;
}
}
</style>

View File

@ -4,41 +4,37 @@ const searchModelJson = [
]
// 页面操作按钮配置
const fucDataJson = [{
name: '导出',
type: 'danger',
icon: 'el-icon-position'
},
name: '导出',
type: 'danger',
icon: 'el-icon-position'
},
]
// 表头配置
const tableColumnJson = [
{
label: '角色编码',
prop: 'r_RoleCode',
tooltip: true,
// sortable:true
},
{
label: '角色名称',
prop: 'r_RoleName',
tooltip: true,
},
{
label: '顺序',
prop: 'r_Sort',
tooltip: true,
},
{
label: '角色描述',
prop: 'r_Description',
tooltip: true,
},
{
label: '角色编号',
prop: 'roleCode',
tooltip: true,
sortable: true,
},
{
label: '角色名称',
prop: 'roleName',
tooltip: true,
sortable: true,
},
{
label: '角色描述 ',
prop: 'description',
tooltip: true,
},
]
export default {
searchModelJson,
fucDataJson,
tableColumnJson,
searchModelJson,
fucDataJson,
tableColumnJson,
}

View File

@ -39,7 +39,7 @@
v-for="item in scope.row.dataList"
:label="item.id"
:key="item.id"
>{{ item.name }}</el-checkbox
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
</template>
@ -89,6 +89,7 @@ export default {
})
},
async init() {
return
let data = [];
const res = await GetAllBilldata({});
if (res.code == 1) {

View File

@ -1,87 +1,87 @@
<template>
<div>
<div v-for="(item, index) in dataList" :key="index" class="dataSetting" flex>
<p style="width: 100px;text-align: right;">{{ item.billName }}</p>
<div flex flex-wrap style="margin-left: 10px;width: calc(100% - 150px);">
<p class="recordText" v-for="el in item.buttonList" :class="{ 'active': el.type }" @click="typeChange(el)">
{{ el.name }}</p>
</div>
</div>
</div>
<div>
<div v-for="(item, index) in dataList" :key="index" class="dataSetting" flex>
<p style="width: 100px;text-align: right;">{{ item.billName }}</p>
<div flex flex-wrap style="margin-left: 10px;width: calc(100% - 150px);">
<p class="recordText" v-for="el in item.buttonList" :class="{ 'active': el.type }" @click="typeChange(el)">
{{ el.name }}</p>
</div>
</div>
</div>
</template>
<script>
import {
GetAllBillDataPepedom,
GetAllBilldata
GetAllBillDataPepedom,
GetAllBilldata
} from '@/api/apis/jurisdiction.js'
export default {
name: "dataSetting",
data() {
return {
dataList: [],
dataPepedom: [],
dataSet: [],
activeList: [],
}
},
created() {
// this.inPage()
},
name: "dataSetting",
data() {
return {
dataList: [],
dataPepedom: [],
dataSet: [],
activeList: [],
}
},
created() {
// this.inPage()
},
methods: {
inPage() {
let dataPepedom = this.getDataPepedom()
let dataSet = this.getDataSet()
Promise.all([dataSet, dataPepedom]).then((value) => {
this.getDataList(value[0], value[1])
})
},
methods: {
inPage() {
let dataPepedom = this.getDataPepedom()
let dataSet = this.getDataSet()
Promise.all([dataSet, dataPepedom]).then((value) => {
this.getDataList(value[0], value[1])
})
},
async getDataPepedom() {
let res = await GetAllBillDataPepedom()
if (res.code == 1) {
return res.data[0]
}
},
async getDataSet() {
let res = await GetAllBilldata()
if (res.code == 1) {
res.data[0].forEach(el => {
el.buttonList = []
})
return res.data[0]
}
},
getDataList(dataSet, dataPepedom) {
console.log(dataSet, dataPepedom);
this.dataList = []
let arr = []
dataSet.forEach((el, index) => {
dataPepedom.forEach((item) => {
if (el.billKindID == item.billKindID) {
el.buttonList.push(item)
}
})
})
this.dataList = dataSet
if (this.activeList.length > 0) {
this.dataList.forEach(item => {
item.buttonList.forEach(bItem => {
this.activeList.forEach(el => {
if (el == bItem.id) {
bItem.type = true
}
})
})
})
}
},
typeChange(item) {
item.type = !item.type
this.$forceUpdate()
},
}
async getDataPepedom() {
let res = await GetAllBillDataPepedom()
if (res.code == 1) {
return res.data[0]
}
},
async getDataSet() {
let res = await GetAllBilldata()
if (res.code == 1) {
res.data[0].forEach(el => {
el.buttonList = []
})
return res.data[0]
}
},
getDataList(dataSet, dataPepedom) {
console.log(dataSet, dataPepedom);
this.dataList = []
let arr = []
dataSet.forEach((el, index) => {
dataPepedom.forEach((item) => {
if (el.billKindID == item.billKindID) {
el.buttonList.push(item)
}
})
})
this.dataList = dataSet
if (this.activeList.length > 0) {
this.dataList.forEach(item => {
item.buttonList.forEach(bItem => {
this.activeList.forEach(el => {
if (el == bItem.id) {
bItem.type = true
}
})
})
})
}
},
typeChange(item) {
item.type = !item.type
this.$forceUpdate()
},
}
}
</script>
@ -89,28 +89,28 @@ export default {
$activeColor: var(--bg-color, "#00aaff");
.el-icon-star-on {
/* color: #00aa00; */
color: $activeColor;
/* color: #00aa00; */
color: $activeColor;
}
.dataSetting {
color: #000;
color: #000;
.recordText {
border: 1px solid #fff;
width: 80px;
padding: 8px 0;
text-align: center;
font-size: 12px;
cursor: pointer;
background: #f2f2f2;
color: #e0e0e0;
margin: 3px;
}
.recordText {
border: 1px solid #fff;
width: 80px;
padding: 8px 0;
text-align: center;
font-size: 12px;
cursor: pointer;
background: #f2f2f2;
color: #e0e0e0;
margin: 3px;
}
.recordText.active {
background: $activeColor;
color: #fff;
}
.recordText.active {
background: $activeColor;
color: #fff;
}
}
</style>

View File

@ -59,6 +59,7 @@ import {
GetAllBilldata,
PopedomSaveData,
} from "@/api/apis/jurisdiction";
import { authApi } from '@/api/apis/auth'
export default {
name: "review",
components: {
@ -95,8 +96,8 @@ export default {
},
],
pageModel: {
page: 1,
limit: 20,
pageNum: 1,
pageSize: 20,
departmentID: "",
Sequence: "",
SequenceName: "",
@ -139,7 +140,7 @@ export default {
onShow() { },
mounted() {
this.initPage();
this.getMenuData();
// this.getMenuData();
},
filters: {},
methods: {
@ -183,16 +184,17 @@ export default {
//
initPage() {
this.getTableList();
this.getOrganList();
// this.getOrganList();
this.$refs.userCustomtable.clearRadioIndex();
},
//
async getMenuData() {
let res = await GetMenuButton({});
if (res.code == 1) {
let arr = JSON.parse(res.data[0]);
this.menuData = JSON.parse(res.data[0]);
this.changeMenu(this.menuData, 0);
// let res = await GetMenuButton({});
let res = await authApi('sysMenuConfigService', '', 'queryEntityTree', '', { state: 0 })
if (res.status == 200) {
let arr = res.attribute
this.menuData = res.attribute
this.changeMenu(this.menuData, 0)
// this.getButtonArray(this.menuData)
}
},
@ -216,13 +218,14 @@ export default {
let params = {
...this.pageModel,
};
let res = await RoleGetBillList(params);
if (res.code === 1) {
this.tableData = res.data[1];
const res = await authApi("sysRoleService","","queryEntityPage","",params)
if (res.status == 200) {
console.log(res,'res')
this.tableData = res.attribute.list;
this.$nextTick(() => {
// this.$refs.customtable.clearRadioIndex()
this.$refs.userLayout.setPageTotal(res.data[0]);
this.$refs.userLayout.setPageTotal(res.attribute.total);
});
this.tabLoading = false;
}
@ -244,7 +247,7 @@ export default {
//
userRadioChange(val) {
this.radioIndex = val.index;
this.userRadioId = val.r_RoleID;
this.userRadioId = val.id;
},
//
async getOrganList() {
@ -266,7 +269,7 @@ export default {
},
resetTable() {
this.pageModel.page = 1;
this.pageModel.pageNum = 1;
this.userRadioId = false;
this.radioIndex = false;
this.$nextTick(() => {
@ -283,35 +286,23 @@ export default {
}
this[btnEven.btnFunciton]();
},
//
async setting() {
this.getMenuData();
this.permissionPopup = true;
this.$nextTick(() => {
this.$refs.rightDialog.drawer = true;
this.$refs.rightDialog.buttonLoading = true;
this.getMenuData()
this.permissionPopup = true
this.$nextTick(async() => {
this.$refs.rightDialog.drawer = true
this.$refs.rightDialog.buttonLoading = true
let params = {
objectID: this.userRadioId,
kindid: 2,
};
GetPppedomSet(params).then((res) => {
if (res.code == 1) {
const data = res.data;
let menuIDs =
data[0].length > 0 ? data[0][0].fp_MenuIdList.split(",") : [];
let echo = data[1].length > 0 ? data[1] : [];
this.$refs.rightDialog.exhibitList(menuIDs, echo, this.userRadioId);
let dataPermissions = data[2].length > 0 ? data[2] : [];
this.$refs.rightDialog.$refs.dataPermissions.selectedList =
dataPermissions;
this.$refs.rightDialog.$refs.layOutPermissions.selectedList = res
.data[3][0]
? res.data[3][0].widgetList
: "";
// this.menuData = this.addToButtonList(this.menuData,echo)
}
});
});
id: this.userRadioId,
kindId: 2
}
const res = await authApi('sysUserService', '', 'jurisdiction', '',params)
if (res.status == 200) {
const data = res.attribute
this.$refs.rightDialog.exhibitList(res.attribute.menvVoList,res.attribute.homeList,this.userRadioId)
}
})
},
// setting() {
// if (this.radioIndex === false) {
@ -325,7 +316,7 @@ export default {
async GetPppedomData() {
let params = {
objectID: this.userRadioId,
kindid: 2,
kindId: 2,
};
let res = await GetPppedomSet(params);
if (res.code == 1) {
@ -360,8 +351,8 @@ export default {
return array;
},
pageChange(model) {
this.pageModel.page = model.page;
this.pageModel.limit = model.limit;
this.pageModel.pageNum = model.page;
this.pageModel.pageSize = model.limit;
this.getTableList();
},
settingConfirmClick() {

View File

@ -1,13 +1,13 @@
<template>
<div flex>
<base-layout title="菜单权限" ref="layout" :bodyHight="treeHight" :mainHight="mainHight" :operateButtonSwitch="false">
<div slot="main">
<base-tree ref="menuTree" :isCenter="false" :showCheckbox="true" :menuData="menuData" :setting="true"
@checkChange="checkChange">
</base-tree>
</div>
</base-layout>
</div>
<div flex>
<base-layout title="菜单权限" ref="layout" :bodyHight="treeHight" :mainHight="mainHight" :operateButtonSwitch="false">
<div slot="main">
<base-tree ref="menuTree" :isCenter="false" :showCheckbox="true" :menuData="menuData" :setting="true"
@checkChange="checkChange">
</base-tree>
</div>
</base-layout>
</div>
</template>
<script>
@ -16,101 +16,101 @@ import baseTable from "@/components/base/baseTable";
import baseTree from "@/components/base/BaseMenuTree/index.vue";
import configData from "./configData";
import {
GetPppedomSet,
GetAllButton,
GetPppedomSet,
GetAllButton,
} from '@/api/apis/jurisdiction'
export default {
name: "jurisdictionSetting",
components: {
baseLayout,
baseTable,
baseTree
},
props: {
objectID: {
type: [Number, String, Boolean],
default: false
},
menuData: {
type: Array,
default: []
},
name: "jurisdictionSetting",
components: {
baseLayout,
baseTable,
baseTree
},
props: {
objectID: {
type: [Number, String, Boolean],
default: false
},
menuData: {
type: Array,
default: []
},
},
data() {
return {
treeHight: '444px',
mainHight: 'calc(100% - 80px)',
classifyButtonList: [],
buttonArray: [],
colorsKey: false,
menuPopedom: [],
buttonPopedom: []
}
},
computed: {
},
data() {
return {
treeHight: '444px',
mainHight: 'calc(100% - 80px)',
classifyButtonList: [],
buttonArray: [],
colorsKey: false,
menuPopedom: [],
buttonPopedom: []
}
},
computed: {
},
watch: {
},
watch: {
},
created() {
},
created() {
},
onShow() { },
mounted() {
this.initPage()
},
filters: {
},
onShow() { },
mounted() {
this.initPage()
},
filters: {
},
methods: {
//
initPage() {
},
checkChange(ids, checkdata) {
this.menuPopedom = ids
this.checkdata = checkdata
},
},
methods: {
//
initPage() {
},
checkChange(ids, checkdata) {
this.menuPopedom = ids
this.checkdata = checkdata
},
typeChange(item) {
item.type = !item.type
this.$forceUpdate()
},
typeChange(item) {
item.type = !item.type
this.$forceUpdate()
},
},
},
}
</script>
<style scoped lang='scss'>
.buttonSetting {
margin: 10px 0;
margin: 10px 0;
}
</style>
<style lang="scss">
$activeColor: var(--bg-color, "#00aaff");
.el-icon-star-on {
/* color: #00aa00; */
color: $activeColor;
/* color: #00aa00; */
color: $activeColor;
}
.buttonSetting {
.recordText {
border: 1px solid #fff;
width: 100px;
padding: 10px 0;
text-align: center;
font-size: 12px;
cursor: pointer;
background: #f2f2f2;
color: #e0e0e0;
margin: 0px 3px;
}
.recordText {
border: 1px solid #fff;
width: 100px;
padding: 10px 0;
text-align: center;
font-size: 12px;
cursor: pointer;
background: #f2f2f2;
color: #e0e0e0;
margin: 0px 3px;
}
.recordText.active {
background: $activeColor;
color: #fff;
}
.recordText.active {
background: $activeColor;
color: #fff;
}
}
</style>

View File

@ -18,11 +18,8 @@
font-size: 25px;
margin-right: 7px;
"
v-show="
scope.row.dataList.length != 0 &&
scope.row.dataList.length == scope.row.buttonList.length
"
@click="cancellation(scope.row)"
v-show="btnShowHandle(homeList,true)"
@click="cancellation(homeList)"
></i>
<i
class="el-icon-star-on"
@ -33,20 +30,10 @@
margin-right: 7px;
color: #808080;
"
v-show="
scope.row.dataList.length != 0 &&
scope.row.dataList.length != scope.row.buttonList.length
"
@click="selectAllButton(scope.row)"
v-show="btnShowHandle(homeList,false)"
@click="selectAllButton(homeList)"
></i>
<el-checkbox-group v-model="scope.row.buttonList" size="small">
<el-checkbox
v-for="item in scope.row.dataList"
:label="item.id"
:key="item.id"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
<el-checkbox v-model="item.check" v-for="item in homeList">{{ item.name }}</el-checkbox>
</template>
</el-table-column>
</el-table>
@ -54,63 +41,81 @@
</template>
<script>
import config from "@/views/doraChunk/config/indexChunkConfig.js";
import { mapMutations } from "vuex";
import config from '@/views/doraChunk/config/indexChunkConfig.js'
import { mapMutations } from 'vuex'
export default {
data() {
return {
tableData: [
{
billName: "首页拖拽模块",
billName: '首页拖拽模块',
dataList: config.config.map((item) => {
let obj = {
id: item.componentName,
name: item.name,
};
return obj;
name: item.name
}
return obj
}),
buttonList: [],
},
buttonList: []
}
],
selectedList: "",
};
selectedList: '',
homeList: []
}
},
created() {},
created() {
},
components: {},
computed: {},
mounted() {},
mounted() {
},
beforeUpdate() {
this.handleTabClick();
this.handleTabClick()
},
methods: {
//
btnShowHandle(list, flag = false) {
if (!list.length) return false
let flagResult = list.every(item => {
return item.check
})
if (flag) {
return flagResult
} else {
return !flagResult
}
},
selectAllButton(item) {
let data = [];
item.dataList.forEach((el) => {
data.push(el.id);
});
item.buttonList = data;
console.log(item)
item.forEach(item => {
item.check = true
})
},
cancellation(item) {
item.buttonList = [];
item.forEach(item => {
item.check = false
})
},
handleTabClick() {
this.$nextTick(() => {
this.$refs.multipleTable && this.$refs.multipleTable.doLayout();
});
},
this.$refs.multipleTable && this.$refs.multipleTable.doLayout()
})
}
},
watch: {
selectedList(newV, oldV) {
let tempArr = newV.split(",");
this.tableData[0].buttonList = tempArr;
},
},
};
let tempArr = newV.split(',')
this.tableData[0].buttonList = tempArr
}
}
}
</script>
<style scoped lang="scss"></style>

View File

@ -38,46 +38,40 @@
></el-table-column>
<el-table-column prop="buttonSelection" label="按钮">
<template slot-scope="scope">
<i
class="el-icon-star-on"
style="
<div style="display: flex;align-items: center">
<i
class="el-icon-star-on"
style="
height: 30px;
line-height: 30px;
font-size: 25px;
margin-right: 7px;
cursor: pointer;
"
v-show="
scope.row.buttons.length != 0 &&
scope.row.buttons.length == scope.row.buttonList.length
"
@click="cancellation(scope.row)"
></i>
<i
class="el-icon-star-on"
style="
v-show="btnShowHandle(scope.row.buttonList,true)"
@click="cancellation(scope.row.buttonList)"
></i>
<i
class="el-icon-star-on"
style="
height: 30px;
line-height: 30px;
font-size: 25px;
margin-right: 7px;
color: #808080;
cursor: pointer;
"
v-show="
scope.row.buttons.length != 0 &&
scope.row.buttons.length != scope.row.buttonList.length
"
@click="selectAllButton(scope.row)"
></i>
<el-checkbox-group v-model="scope.row.buttonList" size="small">
<el-checkbox
v-for="item in scope.row.buttons"
:label="item.id"
:key="item.id"
>{{ item.NameCN }}</el-checkbox
>
</el-checkbox-group>
@click="selectAllButton(scope.row.buttonList)"
v-show="btnShowHandle(scope.row.buttonList,false)"
></i>
<el-checkbox v-model="item.check" v-for="item in scope.row.buttonList">{{ item.nameCh }}</el-checkbox>
</div>
</template>
</el-table-column>
</el-table></el-tab-pane
</el-table>
</el-tab-pane
>
<el-tab-pane label="数据权限" name="second">
<data-permissions ref="dataPermissions"></data-permissions>
@ -91,11 +85,13 @@
</template>
<script>
import baseRightDialog from "@/components/base/baseRightDialog";
import { PopedomSaveData, GetAllBilldata } from "@/api/apis/jurisdiction";
import dataPermissions from "./dataPermissions.vue";
import layOutPermissions from "./layOutPermissions.vue";
import loginVue from "../../../login.vue";
import baseRightDialog from '@/components/base/baseRightDialog'
import { PopedomSaveData, GetAllBilldata } from '@/api/apis/jurisdiction'
import dataPermissions from './dataPermissions.vue'
import layOutPermissions from './layOutPermissions.vue'
import loginVue from '../../../login.vue'
import { authApi } from '@/api/apis/auth'
export default {
data() {
return {
@ -105,186 +101,146 @@ export default {
isAllSelect: false,
selected: false,
childNode: false,
build: "",
activeName: "first",
build: '',
activeName: 'first',
dataPermissions: [],
buttonLoading: false,
};
menuDatas: []
}
},
props: {
menuData: {
type: Array,
default: () => {
return [];
},
},
return []
}
}
},
components: {
baseRightDialog,
dataPermissions,
layOutPermissions,
layOutPermissions
},
beforeUpdate() {
this.handleTabClick();
this.handleTabClick()
},
computed: {
menuDatas: {
// return JSON.parse(JSON.stringify(this.menuData));
get: function () {
return JSON.parse(JSON.stringify(this.menuData));
},
set: function (item) {
return JSON.parse(JSON.stringify(item));
},
},
// menuDatas: {
// // return JSON.parse(JSON.stringify(this.menuData));
// get: function () {
// return JSON.parse(JSON.stringify(this.menuData));
// },
// set: function (item) {
// return JSON.parse(JSON.stringify(item));
// },
// },
},
methods: {
//
btnShowHandle(list, flag = false) {
if (!list.length) return false
let flagResult = list.every(item => {
return item.check
})
if (flag) {
return flagResult
} else {
return !flagResult
}
},
// tab
handleTabClick() {
this.$nextTick(() => {
this.$refs.multipleTable && this.$refs.multipleTable.doLayout();
});
this.$refs.multipleTable && this.$refs.multipleTable.doLayout()
})
},
selectAllButton(item) {
let data = [];
item.buttons.forEach((el) => {
data.push(el.id);
});
item.buttonList = data;
item.forEach(item => {
item.check = true
})
},
cancellation(item) {
item.buttonList = [];
item.forEach(item => {
item.check = false
})
},
// /
selectAll() {
let data = this.treeToArray(this.menuDatas);
this.selected = !this.selected;
let data = this.treeToArray(this.menuDatas)
this.selected = !this.selected
data.forEach((el, index) => {
this.$refs.multipleTable.toggleRowSelection(el, this.selected);
});
el.check = this.selected
this.$refs.multipleTable.toggleRowSelection(el, this.selected)
})
},
handleSelectionChange(val, row) {
this.multipleSelection = val;
let data = this.treeToArray([row]);
this.childNode = !this.childNode;
if (data.length > 1) {
data.forEach((el, index) => {
this.$refs.multipleTable.toggleRowSelection(el, this.childNode);
});
let ids = data[0].id;
let arr = this.treeFindPath(
this.menuDatas,
(data) => data.id == ids,
"id"
);
arr = arr.splice(0, arr.length - 1);
let dataList = [];
let allList = this.treeToArray(this.menuDatas);
allList.forEach((el, index) => {
if (arr.includes(el.id)) {
dataList.push(el);
}
});
dataList.forEach((el, index) => {
this.$refs.multipleTable.toggleRowSelection(el, true);
});
} else {
let ids = data[0].id;
let arr = this.treeFindPath(
this.menuDatas,
(data) => data.id == ids,
"id"
);
arr = arr.splice(0, arr.length - 1);
let dataList = [];
let allList = this.treeToArray(this.menuDatas);
allList.forEach((el, index) => {
if (arr.includes(el.id)) {
dataList.push(el);
}
});
dataList.forEach((el, index) => {
this.$refs.multipleTable.toggleRowSelection(el, true);
});
}
row.check = !row.check
},
//
exhibitList(id, echo, build) {
let data = this.treeToArray(this.menuDatas);
this.build = build;
data.forEach((el, index) => {
if (id.includes(el.id)) {
this.$refs.multipleTable.toggleRowSelection(el, true);
exhibitList(menu, homeList, id) {
this.$refs.layOutPermissions.homeList = homeList
console.log(menu, 'menu')
// let data = this.treeToArray(this.menuDatas);
this.build = id
// data.forEach((el, index) => {
// if (id.includes(el.id)) {
// this.$refs.multipleTable.toggleRowSelection(el, true);
// }
// });
this.menuCheckHandle(menu)
this.menuDatas = menu
console.log(this.menuDatas, 'this.menuDatas')
this.buttonLoading = false
},
//
menuCheckHandle(arr) {
arr.forEach(item => {
if (item.check) {
this.$refs.multipleTable.toggleRowSelection(item, true)
}
});
this.menuDatas = this.addToButtonList(this.menuDatas, echo);
this.buttonLoading = false;
if (item.children.length) {
this.menuCheckHandle(item.children)
}
})
},
//
treeToArray(items) {
let children = [];
let children = []
items.forEach((item) => {
children.push(item);
children.push(item)
if (item.children) {
children = children.concat(this.treeToArray(item.children));
children = children.concat(this.treeToArray(item.children))
}
});
return children;
})
return children
},
handleDialogClose() {
let data = this.treeToArray(this.menuDatas);
let data = this.treeToArray(this.menuDatas)
data.forEach((el, index) => {
this.$refs.multipleTable.toggleRowSelection(el, false);
});
this.changeMenu(this.menuDatas, 0);
this.drawer = false;
this.$parent.permissionPopup = false;
this.$refs.multipleTable.toggleRowSelection(el, false)
})
this.changeMenu(this.menuDatas, 0)
this.drawer = false
this.$parent.permissionPopup = false
},
async handleConfirmClick() {
let data = {
objectID: this.build,
kindid: 2,
menuPopedom: "",
buttonPopedom: [],
dataPopedom: [],
widgetPopedom: "",
};
this.$refs.multipleTable.selection.forEach((el, index) => {
let dataLength = this.$refs.multipleTable.selection.length;
if (index == dataLength - 1) {
data.menuPopedom = data.menuPopedom.concat(`${el.id}`);
} else {
data.menuPopedom = data.menuPopedom.concat(`${el.id},`);
}
if (el.buttonList.length != 0) {
data.buttonPopedom.push({
op_MenuID: el.id,
op_OperateKindList: el.buttonList + [],
});
}
});
let dataPopedom = [];
this.$refs.dataPermissions.tableData.forEach((el) => {
dataPopedom.push({
dp_billKindID: el.billKindID,
dp_popeList: el.buttonList.length > 0 ? el.buttonList + [] : "",
});
});
let tempStr = "";
this.$refs.layOutPermissions.tableData.forEach((item) => {
item.buttonList.forEach((ele) => {
tempStr += ele + ",";
});
});
data.widgetPopedom = tempStr.length ? tempStr.slice(0, -1) : "none";
data.dataPopedom = dataPopedom;
const res = await PopedomSaveData(data);
if (res.success == "true") {
let params = {
id: this.build,
kindId: 2,
sysPopedomHomeEntities: [],
sysPopedomMenuEntities: [],
sysPopedomOperateEntities: []
}
this.homeListHandle(params.sysPopedomHomeEntities)
this.menuListHandle(this.menuDatas, params.sysPopedomMenuEntities, params.sysPopedomOperateEntities)
const res = await authApi("sysUserService","","saveJurisdiction","",params)
if(res.status == '200'){
this.handleDialogClose();
this.$message({
message: "保存成功",
@ -292,6 +248,42 @@ export default {
});
}
},
//
homeListHandle(arr) {
this.$refs.layOutPermissions.homeList.forEach(item => {
if (item.check) {
arr.push({ homeId: item.id })
}
})
},
//
menuListHandle(list, result, btnResult) {
list.forEach(item => {
if (item.check) {
result.push({
menuId: item.id
})
}
if (item.children.length) {
this.menuListHandle(item.children, result,btnResult)
}
if (item.buttonList.length) {
this.btnListHandle(item.buttonList, btnResult, item.id)
}
})
},
//
btnListHandle(list, btnResult, menuId) {
list.forEach(item => {
if (item.check) {
console.log(btnResult,'btnResult')
btnResult.push({
menuId,
operate: item.id
})
}
})
},
//
addToButtonList(arr, newArr) {
newArr.forEach((newItem) => {
@ -299,97 +291,101 @@ export default {
arr,
newItem.op_MenuID,
newItem.op_OperateKindList
);
});
return arr;
)
})
return arr
},
addToButtonListRecursive(arr, targetId, operateKindList) {
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
const item = arr[i]
if (item.id == targetId) {
let lists = operateKindList.split(",");
let lists = operateKindList.split(',')
lists.forEach((el) => {
item.buttonList.push(parseInt(el));
});
return item;
item.buttonList.push(parseInt(el))
})
return item
}
if (item.children && item.children.length > 0) {
this.addToButtonListRecursive(
item.children,
targetId,
operateKindList
);
)
}
}
},
changeMenu(data, num) {
let level = num;
level = level + 1;
let level = num
level = level + 1
data.forEach((el) => {
el.buttonList = [];
el.type = false;
el.buttonList = []
el.type = false
if (el.children != null && el.children && el.children.length) {
this.changeMenu(el.children, level);
this.changeMenu(el.children, level)
}
});
})
},
toFlatArray(tree, parentId) {
return tree.reduce((t, _) => {
const child = _[children];
const child = _[children]
return [
...t,
parentId ? { ..._, parentId } : _,
...(child && child.length ? toFlatArray(child, _[id]) : []),
];
}, []);
...(child && child.length ? toFlatArray(child, _[id]) : [])
]
}, [])
},
getIds(flatArray) {
let ids = [nodeId];
let child = flatArray.find((_) => _[id] === nodeId);
let ids = [nodeId]
let child = flatArray.find((_) => _[id] === nodeId)
while (child && child.parentId) {
ids = [child.parentId, ...ids];
child = flatArray.find((_) => _[id] === child.parentId);
ids = [child.parentId, ...ids]
child = flatArray.find((_) => _[id] === child.parentId)
}
return ids;
return ids
},
treeFindPath(tree, func, field = "", path = []) {
if (!tree) return [];
treeFindPath(tree, func, field = '', path = []) {
if (!tree) return []
for (const data of tree) {
field === "" ? path.push(data) : path.push(data[field]);
if (func(data)) return path;
field === '' ? path.push(data) : path.push(data[field])
if (func(data)) return path
if (data.children) {
const findChildren = this.treeFindPath(
data.children,
func,
field,
path
);
if (findChildren.length) return findChildren;
)
if (findChildren.length) return findChildren
}
path.pop();
path.pop()
}
return [];
},
},
};
return []
}
}
}
</script>
<style scoped lang="scss">
.rightDialog {
height: 100%;
padding: 0 16px;
}
::v-deep .cell {
display: flex;
}
::v-deep .el-checkbox-group {
display: flex;
align-items: center;
flex-wrap: wrap;
}
::v-deep .el-checkbox {
margin-right: 15px;
}
::v-deep .el-tabs__nav {
transform: translateX(22px) !important;
}

View File

@ -94,6 +94,7 @@ export default {
});
},
async init() {
return
let data = [];
const res = await GetAllBilldata({});
if (res.code == 1) {

View File

@ -335,19 +335,7 @@ export default {
}
const res = await authApi('sysUserService', '', 'jurisdiction', '',params)
if (res.status == 200) {
console.log(res,'进来了')
const data = res.attribute
// let menuIDs =
// data[0].length > 0 ? data[0][0].fp_MenuIdList.split(',') : []
// let echo = data[1].length > 0 ? data[1] : []
// let dataPermissions = data[2].length > 0 ? data[2] : []
// this.$refs.rightDialog.$refs.dataPermissions.selectedList =
// dataPermissions
// this.$refs.rightDialog.$refs.layOutPermissions.selectedList = res
// .data[3][0]
// ? res.data[3][0].widgetList
// : ''
// this.$refs.rightDialog.exhibitList(menuIDs, echo, this.userRadioId)
this.$refs.rightDialog.exhibitList(res.attribute.menvVoList,res.attribute.homeList,this.userRadioId)
}
})

View File

@ -7,25 +7,31 @@
<div>
<!-- 人员弹窗 -->
<base-dialog :closeEscape="true" :showClose="true" :closeModal="false" :dialogVisible.sync="addDialog"
@handleClose="handleClose" class="userDialog" title="新增人员" width="700px" top="10vh">
@handleClose="handleClose" class="userDialog" title="新增人员" width="700px" top="10vh"
>
<base-form ref="customForm" :formRow="formRow" :isFunBtn="isFunBtn" @elDialogClick="organClick"
:rules="userRules" @onSubmit="getSubmit">
:rules="userRules" @onSubmit="getSubmit"
>
</base-form>
</base-dialog>
<div flex style="height: 100%;">
<base-layout title="组织机构" style="width:260px;" :defaultButtonSwitch="false" :isPage="false"
:mainColor="mainColor" :operateButtonSwitch="false" v-loading="treeLoading">
:mainColor="mainColor" :operateButtonSwitch="false" v-loading="treeLoading"
>
<div slot="main" style="height: 100%;border-right: 1px solid #dfe6ec;overflow-y: auto;">
<base-tree ref="baseTree" :isCenter="false" :isSaveBtn="false" :Allshow="false" :showCheckbox="false"
:menuData="menuData" @handleNodeClick="treeClick"></base-tree>
:menuData="menuData" @handleNodeClick="treeClick"
></base-tree>
</div>
</base-layout>
<base-layout title="人员信息" ref="personLayout" @pageChange="pageChange" :buttonList="buttonList"
@onFuncBtn="getFuncBtn" :isPage="true" style="flex:1;">
@onFuncBtn="getFuncBtn" :isPage="true" style="flex:1;"
>
<div slot="main" slot-scope="{ tableHeight }" style="height: 100%;">
<base-table ref="personCustomtable" :border="true" :showIndex="false" :tabLoading.sync="tabLoading"
@radioChange="radioChange" :tableHeight="tableHeight" :tableData="tableData"
:tableColumn="tableColumn" :slotrow="true">
:tableColumn="tableColumn" :slotrow="true"
>
<!-- 入职时间 -->
<template v-slot:p_EntryTime="{ row }">
<span>{{ row.row.p_EntryTime | timeDate }}</span>
@ -41,7 +47,8 @@
<!-- 部门+对外签订弹窗 -->
<base-organization ref="baseOrganization" :menuData="menuData"
@handleConfirmClick="organizationHandleConfirm"></base-organization>
@handleConfirmClick="organizationHandleConfirm"
></base-organization>
<!-- <base-dialog :closeEscape="true" :showClose="true" :closeModal="false"
@handleConfirmClick="organizationHandleConfirm" :dialogVisible.sync="organizationDialog" class="userDialog"
title="选择组织机构" width="700px" top="10vh" :footerShow="true">
@ -68,13 +75,13 @@
</template>
<script>
import baseLayout from "@/components/base/baseLayout";
import baseTable from "@/components/base/baseTable";
import baseLayout from '@/components/base/baseLayout'
import baseTable from '@/components/base/baseTable'
// import baseDialog from "@/components/base/BaseNewDialog";
import baseDialog from "@/components/base/BaseNewDialog/index.vue";
import baseForm from "@/components/base/baseNewForm/index.vue";
import baseTree from "@/components/base/BaseMenuTree/index.vue";
import baseOrganization from "@/components/base/baseOrganization/index.vue";
import baseDialog from '@/components/base/BaseNewDialog/index.vue'
import baseForm from '@/components/base/baseNewForm/index.vue'
import baseTree from '@/components/base/BaseMenuTree/index.vue'
import baseOrganization from '@/components/base/baseOrganization/index.vue'
import { getCompanyId } from '@/utils/auth'
import {
PersonList,
@ -90,11 +97,11 @@ import {
import {
dataDictionaryGetBillList
} from '@/api/apis/dataDictionary'
import configData from "./configData";
import configData from './configData'
import { authApi } from '@/api/apis/auth'
export default {
name: "review",
name: 'review',
components: {
baseLayout,
baseTable,
@ -116,13 +123,13 @@ export default {
buttonList: [
{
icon: 'button_reset',
menuName: '启用',
menuName: '启用'
},
{
icon: 'button_reset',
menuName: '停用',
type: 'danger'
},
}
],
tabLoading: false,
tableData: [],
@ -135,7 +142,7 @@ export default {
roleName: null, //
roleNumber: null, //
order: null, //
describe: null, //
describe: null //
},
roleOptions: configData.roleOptions,
formRow: configData.formRow,
@ -156,7 +163,7 @@ export default {
//
tableColumn() {
return configData.tableColumnJson
},
}
},
watch: {
@ -173,8 +180,10 @@ export default {
}
}
},
created() { },
onShow() { },
created() {
},
onShow() {
},
mounted() {
this.initPage()
@ -213,10 +222,10 @@ export default {
this.treeLoading = false
}, 180000)
let params = {
state: 0,
state: 0
// CompanyID: this.$store.state.user.companyID?this.$store.state.user.companyID:getCompanyId()
}
let res = await authApi("sysOrganService","","queryEntityTree","",{})
let res = await authApi('sysOrganService', '', 'queryEntityTree', '', {})
if (res.status == 200) {
this.menuData = res.attribute
this.treeLoading = false
@ -227,7 +236,7 @@ export default {
let params = {
id: id
}
let res = await authApi('sysPersonService','','deleteEntity','',params)
let res = await authApi('sysPersonService', '', 'deleteEntity', '', params)
if (res.status == 200) {
this.$vmNews('删除成功', 'success')
this.resetTable()
@ -241,8 +250,8 @@ export default {
let params = {
id: id
}
let res = await authApi('sysPersonService',"","getEntity","",params)
console.log(res,'res')
let res = await authApi('sysPersonService', '', 'getEntity', '', params)
console.log(res, 'res')
// res.data[0].o_OrganName = res.data[0].orgainName
this.addDialog = true
this.$nextTick(() => {
@ -252,72 +261,70 @@ export default {
//
async getEducationList() {
let params = {
KindId: 3,
page: 1,
limit: 999,
Sequence: '',
SequenceName: ''
'usedSts': '1',//1 使2 使
tabName: 'sys_person',
columnName: 'degree_id'
}
let res = await dataDictionaryGetBillList(params)
if (res.code == 1) {
let res = await authApi('sysDictionaryshopService', '', 'queryEntity', '', params)
if (res.status == 200) {
console.log(res.attribute,'res')
let arrList = []
if (res.data[0] > 0) {
res.data[1].forEach(el => {
if (res.attribute.length) {
res.attribute.forEach(el => {
let arr = {
label: el.ddd_DicDetailsName,
value: el.ddd_DicDetailsID
label: el.columnContent,
value: el.id
}
arrList.push(arr)
})
}
console.log(arrList,'arrList')
configData.formRow[2].elCol[1].options = arrList
}
},
//
async getPostList() {
let params = {
KindId: 1,
page: 1,
limit: 999,
Sequence: '',
SequenceName: ''
'usedSts': '1',//1 使2 使
tabName: 'sys_person',
columnName: 'post_id'
}
let res = await dataDictionaryGetBillList(params)
if (res.code == 1) {
let res = await authApi('sysDictionaryshopService', '', 'queryEntity', '', params)
if (res.status == 200) {
let arrList = []
if (res.data[0] > 0) {
res.data[1].forEach(el => {
if (res.attribute.length) {
res.attribute.forEach(el => {
let arr = {
label: el.ddd_DicDetailsName,
value: el.ddd_DicDetailsID
label: el.columnContent,
value: el.id
}
arrList.push(arr)
})
}
console.log(arrList,'arrList222')
configData.formRow[3].elCol[0].options = arrList
}
},
//
async getLevelnList() {
let params = {
KindId: 2,
page: 1,
limit: 999,
Sequence: '',
SequenceName: ''
'usedSts': '1',//1 使2 使
tabName: 'sys_person',
columnName: 'level_id'
}
let res = await dataDictionaryGetBillList(params)
if (res.code == 1) {
let res = await authApi('sysDictionaryshopService', '', 'queryEntity', '', params)
if (res.status == 200) {
let arrList = []
if (res.data[0] > 0) {
res.data[1].forEach(el => {
if (res.attribute.length) {
res.attribute.forEach(el => {
let arr = {
label: el.ddd_DicDetailsName,
value: el.ddd_DicDetailsID
label: el.columnContent,
value: el.id
}
arrList.push(arr)
})
}
console.log(arrList,'arrList222')
configData.formRow[3].elCol[1].options = arrList
}
},
@ -329,10 +336,10 @@ export default {
let params = {
...this.pageModel
}
let res = await authApi("sysPersonService","","queryEntityPage","",params)
let res = await authApi('sysPersonService', '', 'queryEntityPage', '', params)
if (res.status == 200) {
console.log(res.attribute,'res.attribute',res)
this.tableData = res.attribute.list;
console.log(res.attribute, 'res.attribute', res)
this.tableData = res.attribute.list
this.$refs.personCustomtable.clearRadioIndex()
this.$refs.personLayout.setPageTotal(res.attribute.total)
@ -344,9 +351,9 @@ export default {
async closeDelData(id) {
let params = {
id: id,
"state": "1"
'state': '1'
}
let res = await authApi("sysPersonService","","enableDisableEntity","",params)
let res = await authApi('sysPersonService', '', 'enableDisableEntity', '', params)
if (res.status == 200) {
this.$vmNews('已停用', 'success')
this.resetTable()
@ -356,9 +363,9 @@ export default {
async openDelData(id) {
let params = {
id: id,
"state": "0"
'state': '0'
}
let res = await authApi("sysPersonService","","enableDisableEntity","",params)
let res = await authApi('sysPersonService', '', 'enableDisableEntity', '', params)
if (res.status == 200) {
this.$vmNews('已启用', 'success')
this.resetTable()
@ -398,8 +405,8 @@ export default {
this.$message({
type: 'info',
message: '已取消删除'
});
});
})
})
}
if (btnEven.menuName === '停用') { //
// if (!this.judgeCheckbox()) {
@ -415,8 +422,8 @@ export default {
this.$message({
type: 'info',
message: '已取消删除'
});
});
})
})
}
if (btnEven.menuName === '启用') { //
@ -433,8 +440,8 @@ export default {
this.$message({
type: 'info',
message: '已取消删除'
});
});
})
})
}
},
judgeCheckbox() {
@ -454,14 +461,14 @@ export default {
async getSubmit(data) {
let params = {
...data,
...data
}
let res
console.log(params,'params')
if(params.id){
res = await authApi("sysPersonService","","updateEntity","",params)
}else{
res = await authApi("sysPersonService","","saveEntity","",params)
console.log(params, 'params')
if (params.id) {
res = await authApi('sysPersonService', '', 'updateEntity', '', params)
} else {
res = await authApi('sysPersonService', '', 'saveEntity', '', params)
}
if (res.status == 200) {
@ -475,7 +482,7 @@ export default {
this.radioIndex = false
this.radioId = false
this.$nextTick(() => {
this.$refs.personCustomtable.clearSelect();
this.$refs.personCustomtable.clearSelect()
this.$refs.personLayout.pageClear()
})
this.getTableList()
@ -504,13 +511,13 @@ export default {
this.organizationForm = {
code: data.code,
O_OrganID: data.id,
ParentOrganName: data.label,
ParentOrganName: data.label
}
}
},
}
}
</script>
<style scoped lang='scss'>
<style scoped lang="scss">
/* .userDialog {
margin-top: 10vh;
width: 700px;