组织机构、人员管理、角色管理新增

This commit is contained in:
hyt 2024-04-02 17:14:13 +08:00
parent 4607974884
commit 48987f9324
33 changed files with 4367 additions and 2729 deletions

View File

@ -4,7 +4,7 @@ import request from '@/utils/request'
// 动态模版请求 // 动态模版请求
export function getApiModuleApi(obj, data = {}) { export function getApiModuleApi(obj, data = {}) {
return request({ return request({
url: '/kangarooDataCenter/entranceController/option', url: 'kangarooDataCenter/entranceController/option',
method: 'post', method: 'post',
headers: obj, headers: obj,
data data
@ -12,7 +12,7 @@ export function getApiModuleApi(obj, data = {}) {
} }
export function getApiResultApi(data = {}) { export function getApiResultApi(data = {}) {
return request({ return request({
url: '/kangarooDataCenter/entranceController/option ', url: 'kangarooDataCenter/entranceController/option ',
method: 'post', method: 'post',
headers: { headers: {
tl: "appApiService", tl: "appApiService",
@ -24,10 +24,10 @@ export function getApiResultApi(data = {}) {
} }
export function getExcelApi(obj, data = {}) { export function getExcelApi(obj, data = {}) {
return request({ return request({
url: '/kangarooDataCenter/entranceController/option ', url: 'kangarooDataCenter/entranceController/option ',
method: 'post', method: 'post',
responseType: "blob", responseType: "blob",
headers: obj, headers: obj,
data data
}) })
} }

View File

@ -2,7 +2,7 @@ import request from "@/utils/request";
export function authApi(tl,as,dj,url = '',data){ export function authApi(tl,as,dj,url = '',data){
return request({ return request({
url: '/kangarooDataCenter/entranceController/option' + url, url: 'kangarooDataCenter/entranceController/option' + url,
headers: { headers: {
tl:tl, tl:tl,
as:as, as:as,

View File

@ -3,9 +3,9 @@ import request from '@/utils/request'
// 获取全部插件列表 // 获取全部插件列表
export function option(obj, data = {}) { export function option(obj, data = {}) {
return request({ return request({
url: '/kangarooDataCenter/entranceController/option', url: 'kangarooDataCenter/entranceController/option',
method: 'post', method: 'post',
headers: obj, headers: obj,
data data
}) })
} }

View File

@ -3,9 +3,9 @@ import request from '@/utils/request'
export function getUserModuleApi(obj, data = {}) { export function getUserModuleApi(obj, data = {}) {
return request({ return request({
url: '/kangarooDataCenter/entranceController/option', url: 'kangarooDataCenter/entranceController/option',
method: 'post', method: 'post',
headers: obj, headers: obj,
data data
}) })
} }

View File

@ -7,7 +7,7 @@ import request from '@/utils/request'
// 登录方法 // 登录方法
export function login(login_name, password) { export function login(login_name, password) {
const data = { const data = {
login_name, loginCode:login_name,
password, password,
} }
return request({ return request({
@ -61,4 +61,4 @@ export function getCodeImg() {
method: 'get', method: 'get',
timeout: 20000 timeout: 20000
}) })
} }

View File

@ -3,9 +3,9 @@ import request from '@/utils/request'
// 集成应用请求 // 集成应用请求
export function getPagesApi(obj, data = {}) { export function getPagesApi(obj, data = {}) {
return request({ return request({
url: '/kangarooDataCenter/entranceController/option', url: 'kangarooDataCenter/entranceController/option',
method: 'post', method: 'post',
headers: obj, headers: obj,
data data
}) })
} }

View File

@ -6,98 +6,20 @@
<template> <template>
<!-- 权限设置弹框 --> <!-- 权限设置弹框 -->
<!-- :style="{'margin':isCenter?'auto':''}"> --> <!-- :style="{'margin':isCenter?'auto':''}"> -->
<div style="padding: 0 0 16px 16px; height: 100%">
<div flex="cross:center" v-if="filterShow" style="margin-bottom: 5px"> <div v-loading="treeLoading" flex style="margin:auto;height: 100%;">
<el-input <div class="menu-i" flex="cross:center main:center">
placeholder="输入关键字进行过滤" <div class="menu-i-t" flex="cross:top main:justify">
v-model="filterText" <el-tree :data="menuData" :check-strictly="true" :default-checked-keys="selectData"
style="margin-right: 13px" @node-click="handleNodeClick" :expand-on-click-node="false" :default-expand-all="expandAll"
></el-input> :key="new Date().getTime()" :props="treeProps" style="width: 100%;background-color:white;height: 100%;"
<el-button @check-change="checkChange" node-key="id" ref="elTree" :show-checkbox="showCheckbox">
icon="el-icon-plus" </el-tree>
style="height: 32px; line-height: 32px; padding: 0 13px !important" <div @click="changePcAll" class="checkText" v-if="Allshow">全选</div>
@click="add" </div>
v-if="filterButtonShow"
>
</el-button>
</div> </div>
<div <div flex="cross:center main:center" style="width:100%" v-if="isSaveBtn">
flex="dir:top cross:center main:center" <el-button style="width:40%" type="primary" @click="saveMenuUser">保存</el-button>
style="margin: auto; overflow: auto"
:style="'height:' + treeBodyHeight + ';'"
class="treeBodyHeight"
>
<div class="menu-i" flex="cross:center main:center">
<div class="menu-i-t" flex="cross:top main:justify">
<el-tree
:data="menuData"
:check-strictly="true"
:default-checked-keys="selectData"
v-loading="treeLoading"
@node-click="handleNodeClick"
:expand-on-click-node="false"
:default-expand-all="expandAll"
:filter-node-method="filterNode"
:props="treeProps"
style="width: 100%; background-color: transparent"
@check-change="checkChange"
node-key="id"
ref="elTree"
:show-checkbox="showCheckbox"
>
<div
flex="cross:center main:justify"
style="width: calc(100% - 31px)"
slot-scope="{ node, data }"
>
<p
class="nowrap"
style="
flex: 1;
font-size: 12px;
height: 32px;
line-height: 32px;
"
@dblclick="dbTree"
>
{{ nodeLabel == "" ? node.label : node.label[nodeLabel] }}
</p>
<div style="width: 60px" v-if="treeButton">
<el-button
type="text"
size="mini"
icon="el-icon-plus"
v-if="appendButton"
@click.stop="() => append(node, data)"
>
</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-edit"
v-if="reviseButton"
@click.stop="() => revise(node, data)"
>
</el-button>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
v-if="removeButton"
@click.stop="() => remove(node, data)"
>
</el-button>
</div>
</div>
</el-tree>
<div @click="changePcAll" class="checkText" v-if="Allshow">全选</div>
</div>
</div>
<div flex="cross:center main:center" style="width: 100%" v-if="isSaveBtn">
<el-button style="width: 40%" type="primary" @click="saveMenuUser"
>保存</el-button
>
</div>
</div> </div>
</div> </div>
</template> </template>
@ -108,108 +30,45 @@ export default {
// //
expandAll: { expandAll: {
type: Boolean, type: Boolean,
default: true, default: true
},
//
treeButton: {
type: Boolean,
default: false,
},
//
filterButtonShow: {
type: Boolean,
default: false,
}, },
// //
isSaveBtn: { isSaveBtn: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// //
Allshow: { Allshow: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// //
showCheckbox: { showCheckbox: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// //
isCenter: { isCenter: {
type: Boolean, type: Boolean,
default: true, default: true
},
//
filterShow: {
type: Boolean,
default: false,
}, },
menuData: { menuData: {
type: Array, type: Array,
default: () => { default: () => {
return []; return []
}, }
}, },
setting: { setting: {
type: Boolean, type: Boolean,
default: false, default: false
},
treeLoading: {
type: Boolean,
default: false,
},
appendButton: {
type: Boolean,
default: true,
},
reviseButton: {
type: Boolean,
default: true,
},
removeButton: {
type: Boolean,
default: true,
},
nodeLabel: {
type: String,
default: "",
},
treeProps: {
type: Object,
default() {
return {
children: "children",
label: "label",
};
},
},
//
treeBodyHeight: {
type: [Number, String],
default: "calc(100% - 22px)",
},
},
watch: {
defaultTheme: {
handler: function (val, oldVal) {
this.theme = val;
// document.getElementsByTagName('body')[0].style.setProperty('--active', val)
// let arr = document.getElementsByClassName('.el-tree-node:focus>.el-tree-node__content')
// $('.el-tree-node:focus>.el-tree-node__content').css('color',val)
},
immediate: true,
},
filterText(val) {
this.$refs.elTree.filter(val);
}, },
}, },
data() { data() {
return { return {
filterText: "", theme: '',
theme: "",
powerDlog: false, powerDlog: false,
//
// menuData: [],
// ids // ids
selectData: [], selectData: [],
// //
@ -217,70 +76,52 @@ export default {
// label: 'menuName', // label: 'menuName',
// children: 'id', // children: 'id',
// }, // },
// treeProps: { treeProps: {
// children: 'children', children: 'children',
// label: 'label' label: 'label'
// }, },
// PC // PC
checkedAllPc: false, checkedAllPc: false,
// //
outing: false, outing: false,
}; treeLoading: false,
}
},
created() { },
mounted() {
}, },
created() {},
mounted() {},
computed: { computed: {
defaultTheme() { defaultTheme() {
return this.$store.state.settings.theme; return this.$store.state.settings.theme
},
},
watch: {
defaultTheme: {
handler: function (val, oldVal) {
this.theme = val
// document.getElementsByTagName('body')[0].style.setProperty('--active', val)
// let arr = document.getElementsByClassName('.el-tree-node:focus>.el-tree-node__content')
// $('.el-tree-node:focus>.el-tree-node__content').css('color',val)
},
immediate: true,
}, },
}, },
methods: { methods: {
setCurrentKey(selectId) {
this.$nextTick(() => {
this.$refs.elTree.setCurrentKey(selectId);
});
},
dbTree() {
this.setCurrentKey(null);
},
//
append(node, data) {
this.$emit("append", data);
},
//
revise(node, data) {
this.$emit("revise", data);
},
//
remove(node, data) {
this.$emit("remove", data);
},
add() {
this.$emit("add");
},
filterNode(value, data, node) {
if (!value) return true;
let nodeData =
this.nodeLabel == ""
? data[this.treeProps.label]
: data[this.treeProps.label][this.nodeLabel];
return nodeData.indexOf(value) !== -1;
},
buttonL(el) { buttonL(el) {
el.active = !el.active; el.active = !el.active
this.$forceUpdate(); this.$forceUpdate()
}, },
setData(id) { setData(id) {
this.selectData.push(id); this.selectData.push(id)
}, },
saveMenuUser() { saveMenuUser() {
let allKeys = this.getKey(); let allKeys = this.getKey();
this.$emit("onSaveMenu", allKeys); this.$emit('onSaveMenu', allKeys);
}, },
// key // key
getKey() { getKey() {
return this.$refs.elTree.getCheckedKeys(); return this.$refs.elTree.getCheckedKeys()
}, },
// //
initData() { initData() {
@ -292,15 +133,15 @@ export default {
}, },
// //
handleClose() { handleClose() {
this.powerDlog = false; this.powerDlog = false
this.initData(); this.initData()
}, },
// //
changePcAll() { changePcAll() {
this.checkedAllPc = !this.checkedAllPc; this.checkedAllPc = !this.checkedAllPc;
let selectData = []; let selectData = [];
if (this.checkedAllPc) { if (this.checkedAllPc) {
selectData = this.cycleData(this.menuData); selectData = this.cycleData(this.menuData)
} }
this.selectData = selectData; this.selectData = selectData;
}, },
@ -316,40 +157,39 @@ export default {
function cycle(data) { function cycle(data) {
if (!data || data.length == 0) { if (!data || data.length == 0) {
return false; return false
} else { } else {
for (var i = 0, len = data.length; i < len; i++) { for (var i = 0, len = data.length; i < len; i++) {
let item = data[i]; let item = data[i]
if (isSelect && item.selected == 1) { if (isSelect && item.selected == 1) {
newData.push(item.id); newData.push(item.id)
} }
if (!isSelect) { if (!isSelect) {
newData.push(item.id); newData.push(item.id)
} }
cycle(item.id); cycle(item.id)
} }
} }
} }
cycle(outData); cycle(outData)
return newData; return newData
}, },
getData(childIds) { getData(childIds) {
let newData = []; let newData = [];
function cycle(data) { function cycle(data) {
data.forEach((el) => { data.forEach(el => {
childIds.forEach((item) => { childIds.forEach(item => {
if (el.id == item) { if (el.id == item) {
newData.push(el); newData.push(el)
} }
}); })
if (el.children != null && el.children && el.children.length) { if (el.children != null && el.children && el.children.length) {
cycle(el.children, childIds); cycle(el.children, childIds)
} }
}); })
} }
cycle(this.menuData, childIds); cycle(this.menuData, childIds)
return newData; return newData
}, },
/** /**
* @description 节点选中状态发生变化时的回调 * @description 节点选中状态发生变化时的回调
@ -359,55 +199,48 @@ export default {
* @param { Boolean } checked 当前节点是否选中 * @param { Boolean } checked 当前节点是否选中
*/ */
checkChange(nodeDode, checked) { checkChange(nodeDode, checked) {
let getHalfCheckedKeys = this.$refs.elTree let getHalfCheckedKeys = this.$refs.elTree.getCheckedKeys().concat(this.$refs.elTree.getHalfCheckedKeys())
.getCheckedKeys()
.concat(this.$refs.elTree.getHalfCheckedKeys());
// let getHalfCheckedKeys = this.$refs.elTree.getHalfCheckedKeys() // let getHalfCheckedKeys = this.$refs.elTree.getHalfCheckedKeys()
let childIds = let childIds = getHalfCheckedKeys.length != 0 ? getHalfCheckedKeys : this.selectData
getHalfCheckedKeys.length != 0 ? getHalfCheckedKeys : this.selectData; let checkdata = this.getData(childIds)
let checkdata = this.getData(childIds); this.$emit('checkChange', childIds, checkdata)
this.$emit("checkChange", childIds, checkdata); return
return;
let id = nodeDode.id; let id = nodeDode.id;
// let childIds = this.cycleData(id) // let childIds = this.cycleData(id)
console.log(id)
// //
childIds.forEach((item) => { childIds.forEach(item => {
this.$refs.elTree.setChecked(item, checked); this.$refs.elTree.setChecked(item, checked)
}); })
}, },
// //
handleNodeClick(data) { handleNodeClick(data) {
this.$emit("handleNodeClick", data); this.$emit('handleNodeClick', data);
}, },
},
}; }
}
</script> </script>
<style lang="scss"> <style lang="scss">
// $activeColor:val(--activeColor, "#00aaff"); // $activeColor:val(--activeColor, "#00aaff");
.nowrap {
/*让长段文本不换行*/
white-space: nowrap;
/*设置文本超出元素宽度部分隐藏*/
overflow-x: hidden;
/*设置文本超出部分用省略号显示*/
text-overflow: ellipsis;
}
.el-tree-node__content { .el-tree-node__content {
height: 32px !important; height: 32px !important;
} }
.el-tree-node__label { .el-tree-node__label {
// font-size: 16px !important; font-size: 14px !important;
margin-left: 4px; margin-left: 4px;
} }
.el-tree-node__content > label.el-checkbox { .el-tree-node__content>label.el-checkbox {
transform: scale(1.3); transform: scale(1.3);
} }
.el-tree-node__content > .el-tree-node__expand-icon { .el-tree-node__content>.el-tree-node__expand-icon {
font-size: 18px; font-size: 18px;
} }
@ -420,14 +253,9 @@ export default {
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-tree-node.is-current > .el-tree-node__content .el-button--text {
color: white;
}
.menu-i { .menu-i {
width: 100%; width: 100%;
// margin-bottom: 24px; // margin-bottom: 24px;
height: 100%;
&-f { &-f {
color: #52575a; color: #52575a;
@ -438,10 +266,10 @@ export default {
&-t { &-t {
width: 100%; width: 100%;
height: 100%;
// height: 450px; // height: 450px;
// border: 1px solid #d8d8d8; // border: 1px solid #d8d8d8;
// overflow-y: auto; overflow-y: auto;
height: 100%;
} }
} }
@ -461,7 +289,7 @@ export default {
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
&:hover { &:hover {
color: #ecf5ff; color: #4570fc;
} }
} }
</style> </style>

View File

@ -5,142 +5,219 @@
--> -->
<!-- style="overflow: auto;" --> <!-- style="overflow: auto;" -->
<template> <template>
<div class="container" v-loading="loading" :style="'backgroundColor:' + <div
bgColor + class="container"
';paddingBottom:' + v-loading="loading"
paddingBottom + :style="
';height:' + 'backgroundColor:' +
bodyHight bgColor +
" ref="baseLayout"> ';paddingBottom:' +
paddingBottom +
';height:' +
bodyHight
"
>
<!-- 标题 --> <!-- 标题 -->
<div flex="cross:center" style="padding: 10px" :style="{ <div class="title" flex="cross:center" v-if="showTitle">
'justify-content': <span v-if="!$route.meta.back">{{ title }}</span>
searchShow || showTitle ? 'space-between' : 'flex-end', <span @click="goBack" class="back" v-else
}" v-if="showTitle"> ><i class="el-icon-arrow-left"></i>返回</span
<div class="title" v-if="showTitle"> >
<span v-if="showTitle">{{ title }}</span>
</div>
<div flex="cross:center" v-if="searchShow">
<i class="queryIcon" :class="queryShow ? 'el-icon-arrow-down' : 'el-icon-arrow-right'"
@click="queryShowChange"></i>
<el-dropdown trigger="click">
<span class="el-dropdown-link" style="cursor: pointer; color: #303133; font-size: 14px">
默认条件<i class="el-icon-arrow-down el-icon--right" style="margin-left: 8px"></i>
</span>
<el-dropdown-menu slot="dropdown" style="
padding: 7px 20px;
background-color: #f5f7fa;
border: 1px soild #dcdfe6;
">
<el-dropdown-item command="a" class="requirementList">默认查询
</el-dropdown-item>
<el-dropdown-item v-for="(item, index) in requirementList" :key="item.command" :command="item.command">
<div flex="cross:center main:justify">
<p>{{ item.title }}</p>
<div flex="cross:center ">
<i class="el-icon-edit" @click="edit(item)"></i>
<i class="el-icon-close" @click="del(item)"></i>
</div>
</div>
</el-dropdown-item>
<el-dropdown-item command="d">创建方案</el-dropdown-item>
<el-dropdown-item command="e">高级查询</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <p>高级查询</p> -->
</div>
<div flex="cross:centet" v-if="buttonList && buttonList.length > 0">
<el-dropdown v-for="(item, index) in buttonList" class="buttonList" :key="index" @command="dropClick">
<el-button :type="item.type ? item.type : 'primary'" size="small" class="iconfont" :icon="item.icon"
@keyup.prevent.native @keydown.enter.prevent.native @click="funNewClick(item)">
{{
item.menuName
}}<i v-if="item.dropList && item.dropList.length > 0" class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<!-- <i class="el-icon-arrow-down el-icon--right"> -->
<el-dropdown-item v-for="(dropItem, dropIndex) in item.dropList" :key="dropIndex" :icon="dropItem.icon"
:command="dropItem.dropFun">{{ dropItem.title }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div> </div>
<!-- <div class="main":style="'backgroundColor:'+ mainColor " > --> <!-- <div class="main":style="'backgroundColor:'+ mainColor " > -->
<!-- 搜索 --> <div
<div class="main" :style="'height:' + mainHight + ';backgroundColor:' + mainColor"> class="main"
:style="{
height: showTitle ? 'calc(100% - 38px)' : '100%',
backgroundColor: mainColor,
}"
>
<!-- 操作按钮 -->
<div
class="pushButton"
flex="cross:centet main:right cross:center"
v-if="operateButtonSwitch"
>
<div class="operationButton" flex="cross:center">
<div v-if="defaultButtonSwitch" style="margin-right: 5px">
<el-button
v-for="(item, index) in defaultButtonList"
:type="item.type ? item.type : 'primary'"
size="small"
class="iconfont buttonList"
:icon="item.icon"
@click="funNewClick(item)"
:key="index"
>
{{ item.menuName }}
</el-button>
</div>
<slot name="btn"></slot>
<el-button
v-for="(item, index) in buttonList"
:type="item.type ? item.type : 'primary'"
size="small"
class="iconfont buttonList"
:icon="item.icon"
@click="funNewClick(item)"
:key="index"
>
<span v-if="item.menuName">{{ item.menuName }}</span>
</el-button>
</div>
<div v-if="fixedButton" style="margin-left: 5px">
<el-tooltip
class="item"
effect="dark"
:content="item.title"
placement="top"
v-for="(item, index) in fixedButtonList"
:key="index"
trigger="hover"
>
<span>
<el-button
size="mini"
:icon="item.icon"
@click.stop="fixedClick(item)"
style="margin: 0"
></el-button>
</span>
</el-tooltip>
</div>
</div>
<!-- 搜索 --> <!-- 搜索 -->
<div v-show="queryShow" style="padding: 16px;" flex="cross:center" ref="serchRefs" class="searchContainer"> <div
<div v-for="(row, indexRow) in searchList" class="searchBox" :key="indexRow"> v-show="querySwitch"
<el-input v-model="ruleForm[row.prop]" clearable :type="row.type ? row.type : 'text'" style="width: 100%" style="padding: 5px; background-color: #fff"
:placeholder="!row.placeholder ? '请输入' : row.placeholder" v-if="row.tag === 'elInput'" min="1"> flex="cross:center"
ref="serchRefs"
class="searchForTable"
>
<div
v-for="(row, indexRow) in searchList"
class="searchBox"
:key="indexRow"
style="margin-right: 5px"
>
<el-input
v-model="ruleForm[row.columnNameEN]"
clearable
:type="row.type ? row.type : 'text'"
style="width: 100%"
:placeholder="!row.columnNameCN ? '请输入' : row.columnNameCN"
v-if="row.tag === 'elInput'"
min="1"
@keydown.enter.native="handerInputEnter()"
>
</el-input> </el-input>
<el-date-picker v-model="ruleForm[row.prop]" v-if="row.tag === 'elDatePicker'" <el-date-picker
:class="{ one: row.type ? 'date' : row.type }" style="width: 100%" v-model="ruleForm[row.columnNameEN]"
:value-format="!row.valueFormat ? 'yyyy-MM-dd' : row.valueFormat" range-separator="至" start-placeholder="开始日期" v-if="row.tag === 'elDatePicker'"
end-placeholder="结束日期" :type="!row.type ? 'date' : row.type" :class="{ one: row.type ? 'date' : row.type }"
:placeholder="!row.placeholder ? '请选择' : row.placeholder"> style="width: 100%"
:value-format="!row.valueFormat ? 'yyyy-MM-dd' : row.valueFormat"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:type="!row.type ? 'date' : row.type"
:placeholder="!row.columnNameCN ? '请选择' : row.columnNameCN"
>
</el-date-picker> </el-date-picker>
<el-radio-group v-model="ruleForm[row.prop]" v-if="row.tag === 'elRadio'"> <el-radio-group
<el-radio-button v-for="el in row.options" :label="el.value" :key="el.value">{{ el.label }} v-model="ruleForm[row.columnNameEN]"
v-if="row.tag === 'elRadio'"
>
<el-radio-button
v-for="el in row.options"
:label="el.value"
:key="el.value"
>{{ el.label }}
</el-radio-button> </el-radio-button>
</el-radio-group> </el-radio-group>
<div v-if="row.tag === 'elDialog'" class="elDialog" style="cursor: pointer; height: 32px; ine-height: 32px"> <div
<p :style="{ color: ruleForm[row.prop] ? '#000' : '#c0c4cc' }" style="width: 100%; margin: 0" v-if="row.tag === 'elDialog'"
@click="elDialogClick(row, indexRow, indexRow)"> class="elDialog"
style="cursor: pointer; height: 32px; ine-height: 32px"
>
<p
:style="{
color: ruleForm[row.columnNameEN] ? '#000' : '#c0c4cc',
}"
style="width: 100%; margin: 0"
@click="elDialogClick(row, index, indexRow)"
>
{{ {{
ruleForm[row.prop] ruleForm[row.columnNameEN]
? ruleForm[row.prop] ? ruleForm[row.columnNameEN]
: row.placeholder : row.columnNameCN
? row.placeholder ? row.columnNameCN
: "请点击选择" : "请点击选择"
}} }}
</p> </p>
<i class="el-icon-more" @click="elDialogClick(row, index, indexRow)" <i
v-if="!row.disabled && !ruleForm[row.prop]"></i> class="el-icon-more"
<i class="el-icon-circle-close" v-if="!row.disabled && ruleForm[row.prop]" @click="elDialogClear(row)" @click="elDialogClick(row, index, indexRow)"
style="margin-left: 10px"></i> v-if="!row.disabled && !ruleForm[row.columnNameEN]"
></i>
<i
class="el-icon-circle-close"
v-if="!row.disabled && ruleForm[row.columnNameEN]"
@click="elDialogClear(row)"
style="margin-left: 10px"
></i>
</div> </div>
<el-select v-model="ruleForm[row.prop]" filterable style="width: 100%" <el-select
@change="selectChange($event, indexRow, indexRow, row)" :clearable="row.clearable ? row.clearable : true" v-model="ruleForm[row.columnNameEN]"
:placeholder="!row.placeholder ? '请选择' : row.placeholder" v-if="row.tag === 'elSelect'"> filterable
<el-option v-for="(el, elIndex) in row.options" :key="!row.optionValue ? el['value'] : el[row.optionValue]" style="width: 100%"
@change="selectChange($event, indexRow)"
:clearable="row.clearable ? row.clearable : true"
:placeholder="!row.columnNameCN ? '请选择' : row.columnNameCN"
v-if="row.tag === 'elSelect'"
>
<el-option
v-for="(el, elIndex) in row.options"
:key="!row.optionValue ? el['value'] : el[row.optionValue]"
:label="!row.optionLabel ? el['label'] : el[row.optionLabel]" :label="!row.optionLabel ? el['label'] : el[row.optionLabel]"
:value="!row.optionValue ? el['value'] : el[row.optionValue]"> :value="!row.optionValue ? el['value'] : el[row.optionValue]"
>
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<!-- 搜索按钮 --> <!-- 搜索按钮 -->
<!-- <el-input <el-button
auto-complete="off" type="primary"
placeholder="验证码" size="small"
style="width: calc(100% - 130px)" icon="el-icon-search searchIcon"
v-show="false" @click="search"
clearable title="搜索"
@keyup.enter.native="testEnter" >
> 搜索
</el-input> -->
<el-button type="primary" icon="el-icon-search searchIcon" class="searchIcon" v-if="searchBtnShow" @click="search"
@keyup.enter="testEnter" style="margin-left: 15px">
</el-button> </el-button>
<el-button type="primary" icon="el-icon-refresh searchIcon" class="searchIcon" v-if="resetBtnShow" <el-button
@click="refresh"> v-if="searchList.length > 1"
</el-button> type="primary"
<el-button v-for="item in searchBtnList" :key="item.btnFunction" :type="item.type ? item.type : 'primary'" size="small"
size="small" class="searchIcon" :icon="item.icon" style="font-size:14px;" @click="funSearchBtnClick(item)"> icon="el-icon-refresh-left searchIcon"
{{ item.name }} class="searchIcon"
@click="refresh"
title="重置"
>重置
</el-button> </el-button>
<slot name="searchBtn"></slot>
</div> </div>
<div flex="cross:center" v-if="(searchModel.length != 0 && bottonShow) || nowBtns.length != 0"> <div :style="'height:' + getMainHeight()" class="tableHeight">
<el-button type="primary" icon="el-icon-search" size="small" @click="showSearch" v-if="searchModel.length != 0">检索 <slot name="main" :tableHeight="tableHeight"></slot>
</el-button>
<el-button type="primary" icon="el-icon-refresh" :plain="true" size="small" @click="refresh" v-if="false">刷新
</el-button>
</div> </div>
<!-- 主要内容 --> <!-- 主要内容 -->
<slot name="main" :tableHeight="tableHeight"></slot>
<!-- 分页 --> <!-- 分页 -->
<base-page v-if="isPage" :pageModel.sync="pageModel" @onPageChange="onPageChange"></base-page> <base-page
v-if="isPage"
:pageModel.sync="pageModel"
@onPageChange="onPageChange"
></base-page>
</div> </div>
</div> </div>
</template> </template>
@ -148,7 +225,6 @@
<script> <script>
// import heightTransition from '@/common/js/heightTransition' // import heightTransition from '@/common/js/heightTransition'
// import customCascader from "@/components/customCascader"; // import customCascader from "@/components/customCascader";
import elementResizeDetectorMaker from "element-resize-detector";
import { exportDown, wordDown, zipDown } from "@/utils/util.js"; import { exportDown, wordDown, zipDown } from "@/utils/util.js";
import basePage from "@/components/base/basePage"; import basePage from "@/components/base/basePage";
import { TokenKeys } from "@/utils/variable"; import { TokenKeys } from "@/utils/variable";
@ -162,59 +238,18 @@ export default {
// customCascader // customCascader
}, },
props: { props: {
//
searchBtnList: {
type: Array,
default: () => {
return [];
},
},
// //
showTitle: { showTitle: {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
//
searchBtnShow: {
type: Boolean,
default: true,
},
//
resetBtnShow: {
type: Boolean,
default: true,
},
// main
mainHight: {
type: [Number, String, Boolean],
default: "auto",
},
// //
title: { title: {
type: String, type: String,
default: "", default: "",
}, },
//
fixModel: {
type: String | Array,
default: () => {
return [];
},
},
//
requirementList: {
type: Array,
default: () => {
return [];
},
},
//
searchList: {
type: Array,
default: () => {
return [];
},
},
// //
bgColor: { bgColor: {
type: String, type: String,
@ -233,7 +268,12 @@ export default {
// //
bodyHight: { bodyHight: {
type: [Number, String], type: [Number, String],
default: "calc(100vh - 88px)", default: "100%",
},
// main
mainHight: {
type: [Number, String, Boolean],
default: "calc(100% - 38px)",
}, },
// //
searchModel: { searchModel: {
@ -242,25 +282,50 @@ export default {
return []; return [];
}, },
}, },
//
nowBtnTab: {
type: Array,
default: () => {
return [];
},
},
//
nowBtns: {
type: Array,
default: () => {
return [];
},
},
// //
buttonList: { buttonList: {
type: Array, type: Array,
default: () => { default: () => {
return []; return [];
// [{
// icon: 'el-icon-plus',
// menuName: ''
// }, {
// icon: 'el-icon-edit',
// menuName: ''
// }, {
// icon: 'el-icon-delete',
// menuName: '',
// type: 'danger'
// }, {
// icon: 'el-icon-refresh',
// menuName: ''
// },]
},
},
defaultButtonList: {
type: Array,
default: () => {
return [
{
icon: "el-icon-plus",
menuName: "新增",
},
{
icon: "el-icon-edit",
menuName: "编辑",
},
{
icon: "el-icon-delete",
menuName: "删除",
type: "danger",
},
// {
// icon: 'el-icon-refresh',
// menuName: ''
// },
];
}, },
}, },
// //
@ -268,24 +333,6 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
//
bottonShow: {
type: Boolean,
default: true,
},
//
searchShow: {
type: Boolean,
default: false,
},
queryShow: {
type: Boolean,
default: true,
},
enterClickType: {
type: Boolean,
default: true,
},
// //
exportUrl: { exportUrl: {
default: "", default: "",
@ -294,22 +341,61 @@ export default {
importUrl: { importUrl: {
default: "", default: "",
}, },
//
selectTable: {
default: "",
},
// //
only: { only: {
default: "", default: "",
}, },
//
fixedButton: {
type: Boolean,
default: false,
},
//
querySwitch: {
type: Boolean,
default: false,
},
//
searchList: {
type: Array,
default: () => {
return [];
},
},
//
operateButtonSwitch: {
type: Boolean,
default: true,
},
//
defaultButtonSwitch: {
type: Boolean,
default: true,
},
//
fixedButtonList: {
type: Array,
default: () => {
return [
{
icon: "el-icon-s-operation",
title: "筛选",
},
{
icon: "el-icon-printer",
title: "打印",
},
{
icon: "el-icon-folder",
title: "导出",
},
];
},
},
}, },
watch: {},
data() { data() {
return { return {
//
ruleForm: {}, ruleForm: {},
// queryShow: true,
onlyUrl: "", onlyUrl: "",
clientHeight: "", clientHeight: "",
// //
@ -323,26 +409,47 @@ export default {
// //
pageModel: { pageModel: {
total: 0, total: 0,
pageIndex: 1, page: 1,
pageSize: 10, limit: 20,
}, },
// //
clearState: 0, clearState: 0,
//
tableHeight: "calc(100vh - 218px)",
loading: false, loading: false,
// fixedButtonList: [{
// icon: 'el-icon-s-operation',
// title: ''
// },
// {
// icon: 'el-icon-printer',
// title: ''
// },
// {
// icon: 'el-icon-folder',
// title: ''
// }
// ],
// defaultButtonList: [
// {
// icon: 'el-icon-plus',
// menuName: ''
// }, {
// icon: 'el-icon-edit',
// menuName: ''
// }, {
// icon: 'el-icon-delete',
// menuName: '',
// type: 'danger'
// }, {
// icon: 'el-icon-refresh',
// menuName: ''
// },
// ],
tableHeight: "100%",
}; };
}, },
created() { created() {},
},
mounted() { mounted() {
this.watchSize(); // this.getTableHight()
document.addEventListener("keydown", (e) => {
let key = window.event.keyCode;
if (key == 13) {
this.testEnter();
}
});
// window.onresize = () => { // window.onresize = () => {
// this.clientHeight = document.documentElement.clientHeight; // this.clientHeight = document.documentElement.clientHeight;
// }, // },
@ -354,66 +461,40 @@ export default {
// } // }
}, },
methods: { methods: {
watchSize() { getTableHight() {
const _this = this; let height = "100%";
var erd = elementResizeDetectorMaker(); let heightReduce = 0;
if (!this.queryShow) { if (this.operateButtonSwitch) {
_this.getTableHight(); heightReduce = heightReduce + 53;
} else { }
erd.listenTo(this.$refs.serchRefs, (element) => { if (this.querySwitch) {
// this.$refs.fan<div ref=fan></div> heightReduce = heightReduce + 47;
var height = element.offsetHeight;
_this.$nextTick(() => {
_this.getTableHight(height);
});
});
} }
},
getTableHight(height = 0) {
// + 102 64 64 32 102 + 64 + 32
let reduceHight = 0;
let windowHeight = this.$refs.baseLayout.offsetHeight;
if (this.isPage) { if (this.isPage) {
reduceHight = reduceHight + 52; heightReduce = heightReduce + 53;
} }
if (this.queryShow) { height = "calc(100% - " + heightReduce + "px)";
let searchHeight = this.$refs.serchRefs.offsetHeight; this.tableHeight = height;
reduceHight = reduceHight + searchHeight; },
getMainHeight() {
// operateButtonSwitch querySwitch
let height = "100%";
let heightReduce = 0;
if (this.operateButtonSwitch) {
heightReduce = heightReduce + 56;
} }
if (this.buttonList && this.buttonList.length > 0) { if (this.querySwitch) {
reduceHight = reduceHight + 68; heightReduce = heightReduce + 33;
} }
this.tableHeight = windowHeight - reduceHight + "px"; if (this.isPage) {
}, heightReduce = heightReduce + 56;
//propLabel value
getField(propLabel, value) {
this.$set(this.ruleForm, propLabel, value);
},
setQueryShow(type) {
this.queryShow = type;
},
elDialogClick(row, index, indexRow) {
if (row.disabled) {
return;
} }
this.$emit("elDialogClick", row, index); height = "calc(100% - " + heightReduce + "px)";
}, // console.log(height, "height")
elDialogClear(row) { return height;
this.resetField(row.prop);
this.$emit("elDialogClear", row);
},
//
resetField(field) {
if (this.ruleForm[field]) {
this.$set(this.ruleForm, field, "");
}
},
edit(item) {
},
del(item) {
}, },
pageClear() { pageClear() {
this.pageModel.pageIndex = 1; this.pageModel.page = 1;
}, },
// importUpload() { // importUpload() {
// const timestamp = new Date().getTime() + ''; // const timestamp = new Date().getTime() + '';
@ -439,7 +520,6 @@ export default {
handleError() { handleError() {
this.$vmNews("上传失败", "error"); this.$vmNews("上传失败", "error");
}, },
//
// //
getCascader(value, field) { getCascader(value, field) {
this.$set(this.model, field, value); this.$set(this.model, field, value);
@ -451,9 +531,9 @@ export default {
setPageNum(pageNum) { setPageNum(pageNum) {
this.$set(this.pageModel, "page", pageNum); this.$set(this.pageModel, "page", pageNum);
}, },
// //propLabel value
funSearchBtnClick(item) { getField(propLabel, value) {
this.$emit("onFuncSearchBtn", item); this.$set(this.ruleForm, propLabel, value);
}, },
// //
goBack() { goBack() {
@ -461,30 +541,24 @@ export default {
}, },
// //
funNewClick(item) { funNewClick(item) {
if (item.menuName == "刷新") { if (item.menuName == "刷新" || item.btnFunction == "Refresh") {
this.$tab.refreshPage(this.$route); this.$tab.refreshPage(this.$route);
} else { } else {
this.$emit("onFuncBtn", item); this.$emit("onFuncBtn", item);
} }
}, },
dropClick(item) { //
this.$emit("dropClick", item); fixedClick(item) {
}, this.$emit("onFixedBtn", item);
//
queryShowChange() {
this.queryShow = !this.queryShow;
this.$nextTick(() => {
this.watchSize();
});
this.$emit("queryShowChange", this.queryShow);
}, },
// //
funcClick(btnItem) { funcClick(btnItem) {
// console.log(btnItem,"btnItem")
this.$emit("onFuncBtn", btnItem); this.$emit("onFuncBtn", btnItem);
}, },
// //
eventExport(params) { eventExport(params) {
// console.log(params, 'params')
// console.log(this.onlyUrl ? this.onlyUrl : this.exportUrl, 'this.onlyUrl?this.onlyUrl:this.exportUrl')
// return fetch.get(this.onlyUrl ? this.onlyUrl : this.exportUrl, { // return fetch.get(this.onlyUrl ? this.onlyUrl : this.exportUrl, {
// params, // params,
// responseType: 'blob' // responseType: 'blob'
@ -498,22 +572,22 @@ export default {
queryEvent(state) { queryEvent(state) {
this.$emit("onQuery", this.mergeParam(true)); this.$emit("onQuery", this.mergeParam(true));
}, },
// - //
selectChange(event, index, indexItem, row) { handerInputEnter() {
// if (typeof event == "number" && event < 3) { this.$emit("handerInputEnter", this.ruleForm);
// if (Number(event) == 2) {
// event = 0;
// } else {
// event = event - 1;
// }
// }
if (event !== "" && event != undefined) {
this.$emit("onElSelect", event, index, indexItem, this.model, row);
}
}, },
// // -
refresh() { selectChange(event, index, indexItem) {
this.$emit("onQuery", this.mergeParam(true)); if (typeof event == "number" && event < 3) {
if (Number(event) == 2) {
event = 0;
} else {
event = event - 1;
}
}
if (event !== "" && event != undefined) {
this.$emit("onElSelect", event, index, indexItem, this.model);
}
}, },
// //
onPageChange() { onPageChange() {
@ -522,11 +596,11 @@ export default {
// //
mergeParam(state) { mergeParam(state) {
if (state) { if (state) {
this.pageModel.pageIndex = 1; this.pageModel.page = 1;
} }
let page = { let page = {
pageIndex: this.pageModel.pageIndex, page: this.pageModel.page,
pageSize: this.pageModel.pageSize, limit: this.pageModel.limit,
}; };
for (let i in this.model) { for (let i in this.model) {
if (!this.model[i]) { if (!this.model[i]) {
@ -540,57 +614,41 @@ export default {
showSearch() { showSearch() {
this.isSearch = !this.isSearch; this.isSearch = !this.isSearch;
}, },
//
search() { search() {
this.$emit("search", this.ruleForm); this.$emit("search", this.ruleForm);
}, },
//
refresh() { refresh() {
this.ruleForm = Object.assign({}, ""); this.ruleForm = Object.assign({}, "");
}, this.search();
testEnter() {
if (this.enterClickType) {
this.search();
}
}, },
}, },
}; };
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
p { .pushButton {
margin: 0; /* margin: 12px 10px 10px 10px; */
padding: 10px;
} }
::v-deep .iconfont { ::v-deep .iconfont {
font-size: 12px; font-size: 12px;
text-align: center;
} }
.queryIcon { ::v-deep .el-tooltip {
font-size: 16px; padding: 0 3px;
color: #606266;
margin-right: 16px;
cursor: pointer;
} }
.searchIcon { ::v-deep .el-button--mini {
font-size: 18px; padding: 6px 8px;
/* padding: 0 12px; */ margin: 5px;
height: 32px;
/* line-height: 32px; */
margin-left: 8px;
display: flex;
justify-content: center;
align-items: center;
}
.requirementList {
width: 160px;
height: 30px;
line-height: 30px;
} }
.container { .container {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: auto;
.title { .title {
/* @include boxBase(100%, 48px, $base-color); */ /* @include boxBase(100%, 48px, $base-color); */
@ -599,16 +657,13 @@ p {
padding: 12px; padding: 12px;
} }
.buttonList {} .buttonList + .buttonList {
margin-left: 5px;
.buttonList+.buttonList {
margin-left: 8px;
} }
.main { .main {
/* height: auto !important; */ /* height: auto !important; */
overflow-y: auto; overflow-y: auto;
flex-wrap: wrap;
/* padding:0 12px; */ /* padding:0 12px; */
.search { .search {
@ -617,10 +672,6 @@ p {
border: 1px solid #d8d8d8; border: 1px solid #d8d8d8;
padding: 12px; padding: 12px;
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
.row {
/* @include fontBase(14px, #333) */
}
} }
.hide { .hide {
@ -651,32 +702,4 @@ p {
cursor: pointer; cursor: pointer;
} }
} }
.elDialog {
display: flex;
/* width: calc(100% - 14px);1 */
align-items: center;
justify-content: space-between;
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 0 15px;
cursor: pointer;
background-color: white;
i {
color: #c0c4cc;
}
}
.searchBox {
width: 200px;
}
.searchBox+.searchBox {
margin-left: 8px;
}
::v-deep.el-radio-button--medium .el-radio-button__inner {
padding: 8px !important;
}
</style> </style>

View File

@ -21,7 +21,7 @@
<div slot="main" style="padding: 10px;"> <div slot="main" style="padding: 10px;">
<div flex="cross:center" style="margin-bottom: 10px;"> <div flex="cross:center" style="margin-bottom: 10px;">
<label style="width: 35%;">机构编码</label> <label style="width: 35%;">机构编码</label>
<el-input style="flex:1;" v-model="organizationForm.code" disabled></el-input> <el-input style="flex:1;" v-model="organizationForm.id" disabled></el-input>
</div> </div>
<div flex="cross:center"> <div flex="cross:center">
<label style="width: 35%;">机构名称</label> <label style="width: 35%;">机构名称</label>
@ -100,6 +100,7 @@ export default {
}, },
// //
handleNodeClick(data) { handleNodeClick(data) {
console.log(data)
this.organizationForm = data this.organizationForm = data
}, },
// form // form
@ -126,4 +127,4 @@ export default {
border-radius: 5px; border-radius: 5px;
} }
} }
</style> </style>

View File

@ -29,6 +29,7 @@
</template> </template>
<script> <script>
import { authApi } from "@/api/apis/auth";
import baseDialog from "@/components/base/BaseNewDialog/index.vue" import baseDialog from "@/components/base/BaseNewDialog/index.vue"
import baseTree from "@/components/base/BaseMenuTree/index.vue" import baseTree from "@/components/base/BaseMenuTree/index.vue"
import baseLayout from "@/components/base/baseLayout" import baseLayout from "@/components/base/baseLayout"
@ -68,9 +69,9 @@ export default {
personTableHeight: '280px', // personTableHeight: '280px', //
personTableData: [], personTableData: [],
personModel: { personModel: {
page: 1, pageNum: 1,
limit: 999, pageSize: 999,
departmentID: '', organId: '',
Sequence: '', Sequence: '',
SequenceName: '' SequenceName: ''
}, },
@ -82,7 +83,7 @@ export default {
methods: { methods: {
// //
handleNodeClick(data) { handleNodeClick(data) {
this.personModel.departmentID = data.id this.personModel.organId = data.id
this.personData = {} this.personData = {}
this.$refs.personCustomtable.clearRadioIndex() this.$refs.personCustomtable.clearRadioIndex()
this.getPersonList() this.getPersonList()
@ -103,9 +104,10 @@ export default {
let params = { let params = {
...this.personModel ...this.personModel
} }
let res = await PersonList(params) let res = await authApi("sysPersonService","","queryEntity","",params)
if (res.code === 1) { if (res.status == 200) {
this.personTableData = res.data[1] console.log(res,'res')
this.personTableData = res.attribute
this.personLoading = false this.personLoading = false
} }
}, },
@ -123,4 +125,4 @@ export default {
background-color: #f2f3f4; background-color: #f2f3f4;
padding: 10px padding: 10px
} }
</style> </style>

View File

@ -133,7 +133,7 @@ export default {
mounted() { mounted() {
this.personInfo = JSON.parse(getInfo()); this.personInfo = JSON.parse(getInfo());
this.PersonName = JSON.parse(getInfo()).personName; this.PersonName = JSON.parse(getInfo()).personName;
this.getLagerScreenMenuData(); // this.getLagerScreenMenuData();
// this.getMessageData(); // this.getMessageData();
// this.getInfoDetail(JSON.parse(getInfo()).personID) // this.getInfoDetail(JSON.parse(getInfo()).personID)
}, },

View File

@ -1,289 +1,290 @@
import auth from "@/plugins/auth"; import auth from '@/plugins/auth'
import router, {constantRoutes, dynamicRoutes} from "@/router"; import router, { constantRoutes, dynamicRoutes } from '@/router'
import {GetMenu} from "@/api/apis/menuManage"; import { GetMenu } from '@/api/apis/menuManage'
import {authApi} from '@/api/apis/auth' import { authApi } from '@/api/apis/auth'
import {getInfo} from "@/utils/auth"; import { getInfo } from '@/utils/auth'
import Layout from "@/layout/index"; import Layout from '@/layout/index'
import ParentView from "@/components/ParentView"; import ParentView from '@/components/ParentView'
import InnerLink from "@/layout/components/InnerLink"; import InnerLink from '@/layout/components/InnerLink'
const permission = { const permission = {
state: { state: {
routes: [], routes: [],
addRoutes: [], addRoutes: [],
defaultRoutes: [], defaultRoutes: [],
topbarRouters: [], topbarRouters: [],
sidebarRouters: [], sidebarRouters: []
}, },
mutations: { mutations: {
SET_ROUTES: (state, routes) => { SET_ROUTES: (state, routes) => {
routes.forEach(item => { routes.forEach(item => {
if (item.path === "/applicationList") { if (item.path === '/applicationList') {
item.children.forEach(ele => { item.children.forEach(ele => {
if (ele.path === "settingMenu") { if (ele.path === 'settingMenu') {
ele.redirect = 'settingMenu/applicationEdit' ele.redirect = 'settingMenu/applicationEdit'
ele.children = [ ele.children = [
{ {
path: "applicationEdit", path: 'applicationEdit',
component: () => import("@/views/applicationList/applicationAdd.vue"), component: () => import('@/views/applicationList/applicationAdd.vue'),
name: "applicationEdit", name: 'applicationEdit',
hidden: true, hidden: true,
meta: { meta: {
title: "应用编辑", title: '应用编辑',
hidden: true, hidden: true
}, }
}, },
{ {
path: "exploit", path: 'exploit',
component: () => import("@/views/applicationList/exploit"), component: () => import('@/views/applicationList/exploit'),
name: "exploit", name: 'exploit',
hidden: true, hidden: true,
meta: { meta: {
title: "开发管理", title: '开发管理',
hidden: true, hidden: true
}, }
}, },
{ {
path: "authority", path: 'authority',
component: () => import("@/views/applicationList/authority"), component: () => import('@/views/applicationList/authority'),
name: "authority", name: 'authority',
hidden: true, hidden: true,
meta: { meta: {
title: "权限管理", title: '权限管理',
hidden: true, hidden: true
}, }
}, },
{ {
path: "appApiAdmin", path: 'appApiAdmin',
name: "appApiAdmin", name: 'appApiAdmin',
component: () => import("@/views/applicationList/apiList/apiAdmin"), component: () => import('@/views/applicationList/apiList/apiAdmin'),
meta: { meta: {
title: "API管理", title: 'API管理',
hidden: true hidden: true
} }
}, },
{ {
path: "inserterAdmin", path: 'inserterAdmin',
name: "inserterAdmin", name: 'inserterAdmin',
component: () => import("@/views/applicationList/inserterAdmin"), component: () => import('@/views/applicationList/inserterAdmin'),
meta: { meta: {
title: "插件管理", title: '插件管理',
hidden: true, hidden: true
} }
}, },
{ {
path: "appApiadd", path: 'appApiadd',
name: "appApiAdd", name: 'appApiAdd',
redirect: "", redirect: '',
hidden: "true", hidden: 'true',
component: () => import("@/views/applicationList/apiList/apiAdd"), component: () => import('@/views/applicationList/apiList/apiAdd'),
meta: { meta: {
title: "API新增", title: 'API新增'
}, }
}, },
{ {
path: "appApiview", path: 'appApiview',
name: "appApiView", name: 'appApiView',
hidden: "true", hidden: 'true',
component: () => import("@/views/applicationList/apiList/apiView"), component: () => import('@/views/applicationList/apiList/apiView'),
meta: { meta: {
title: "API查看" title: 'API查看'
} }
},
]
}
})
} else if (item.path === "/integrationOption") {
item.children.forEach(ele => {
if (ele.path === "settingMenu") {
ele.redirect = 'settingMenu/masterDataEdit'
ele.children = [
{
path: "masterDataEdit",
component: () => import("@/views/masterDataOptions/masterDataAdd.vue"),
name: "masterDataEdit",
hidden: true,
meta: {
title: "基本信息",
hidden: true,
},
},
{
path: "dataOrigin",
component: () => import("@/views/masterDataOptions/dataOrigin"),
name: "dataOrigin",
hidden: true,
meta: {
title: "数据源",
hidden: true,
},
},
{
path: "displayInfo",
component: () => import("@/views/masterDataOptions/displayInfo"),
name: "displayInfo",
hidden: true,
meta: {
title: "显示信息",
hidden: true,
},
},
{
path: "authorily",
name: "authorily",
component: () => import("@/views/masterDataOptions/authority"),
meta: {
title: "配置权限",
hidden: true
}
},
{
path: "distribute",
name: "distribute",
component: () => import("@/views/masterDataOptions/distribute"),
meta: {
title: "分发设置",
hidden: true,
}
},
]
}
})
} }
}) ]
state.addRoutes = routes; }
state.routes = constantRoutes.concat(routes); })
// state.routes = routes } else if (item.path === '/integrationOption') {
}, item.children.forEach(ele => {
SET_DEFAULT_ROUTES: (state, routes) => { if (ele.path === 'settingMenu') {
state.defaultRoutes = constantRoutes.concat(routes); ele.redirect = 'settingMenu/masterDataEdit'
}, ele.children = [
SET_TOPBAR_ROUTES: (state, routes) => { {
state.topbarRouters = routes; path: 'masterDataEdit',
}, component: () => import('@/views/masterDataOptions/masterDataAdd.vue'),
SET_SIDEBAR_ROUTERS: (state, routes) => { name: 'masterDataEdit',
state.sidebarRouters = routes; hidden: true,
}, meta: {
REMOVE_ROUTER: (state, routes) => { title: '基本信息',
state.routes = []; hidden: true
state.addRoutes = [] }
}, },
{
path: 'dataOrigin',
component: () => import('@/views/masterDataOptions/dataOrigin'),
name: 'dataOrigin',
hidden: true,
meta: {
title: '数据源',
hidden: true
}
},
{
path: 'displayInfo',
component: () => import('@/views/masterDataOptions/displayInfo'),
name: 'displayInfo',
hidden: true,
meta: {
title: '显示信息',
hidden: true
}
},
{
path: 'authorily',
name: 'authorily',
component: () => import('@/views/masterDataOptions/authority'),
meta: {
title: '配置权限',
hidden: true
}
},
{
path: 'distribute',
name: 'distribute',
component: () => import('@/views/masterDataOptions/distribute'),
meta: {
title: '分发设置',
hidden: true
}
}
]
}
})
}
})
state.addRoutes = routes
state.routes = constantRoutes.concat(routes)
// state.routes = routes
}, },
actions: { SET_DEFAULT_ROUTES: (state, routes) => {
// 生成路由 state.defaultRoutes = constantRoutes.concat(routes)
GenerateRoutes({commit}) {
return new Promise((resolve) => {
let params = {
UserID: JSON.parse(getInfo()).id,
};
authApi('moduleService', 'module', 'queryTreeById', '', params).then((res) => {
const sdata = JSON.parse(JSON.stringify(res.attribute))
const rdata = JSON.parse(JSON.stringify(res.attribute))
const sidebarRoutes = filterAsyncRouter(sdata);
const rewriteRoutes = filterAsyncRouter(rdata, false, true);
const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
rewriteRoutes.push({
path: "*",
redirect: "/notFound",
hidden: true,
});
router.addRoutes(asyncRoutes);
router.addRoutes(rewriteRoutes);
commit("SET_ROUTES", rewriteRoutes);
// commit("SET_SIDEBAR_ROUTERS", sidebarRoutes);
commit("SET_DEFAULT_ROUTES", sidebarRoutes);
commit("SET_TOPBAR_ROUTES", sidebarRoutes);
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
resolve(rewriteRoutes);
});
});
},
}, },
}; SET_TOPBAR_ROUTES: (state, routes) => {
state.topbarRouters = routes
},
SET_SIDEBAR_ROUTERS: (state, routes) => {
state.sidebarRouters = routes
},
REMOVE_ROUTER: (state, routes) => {
state.routes = []
state.addRoutes = []
}
},
actions: {
// 生成路由
GenerateRoutes({ commit }) {
return new Promise((resolve) => {
let params = {
id: JSON.parse(getInfo()).id
}
authApi('sysMenuConfigService', '', 'queryTreeById', '', params).then((res) => {
const sdata = JSON.parse(JSON.stringify(res.attribute))
const rdata = JSON.parse(JSON.stringify(res.attribute))
const sidebarRoutes = filterAsyncRouter(sdata)
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
rewriteRoutes.push({
path: '*',
redirect: '/notFound',
hidden: true
})
router.addRoutes(asyncRoutes)
router.addRoutes(rewriteRoutes)
console.log(rewriteRoutes,'rewriteRoutes')
commit('SET_ROUTES', rewriteRoutes)
// commit("SET_SIDEBAR_ROUTERS", sidebarRoutes);
commit('SET_DEFAULT_ROUTES', sidebarRoutes)
commit('SET_TOPBAR_ROUTES', sidebarRoutes)
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
resolve(rewriteRoutes)
})
})
}
}
}
// 遍历后台传来的路由字符串,转换为组件对象 // 遍历后台传来的路由字符串,转换为组件对象
function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
return asyncRouterMap.filter((route) => { return asyncRouterMap.filter((route) => {
if (type && route.children) { if (type && route.children) {
route.children = filterChildren(route.children); route.children = filterChildren(route.children)
} }
if (route.component) { if (route.component) {
// Layout ParentView 组件特殊处理 // Layout ParentView 组件特殊处理
if (route.component === "Layout") { if (route.component === 'Layout') {
route.component = Layout; route.component = Layout
} else if (route.component === "ParentView") { } else if (route.component === 'ParentView') {
route.component = ParentView; route.component = ParentView
} else if (route.component === "InnerLink") { } else if (route.component === 'InnerLink') {
route.component = InnerLink; route.component = InnerLink
} else { } else {
route.component = loadView(route.component); route.component = loadView(route.component)
} }
} }
if (route.children != null && route.children && route.children.length) { if (route.children != null && route.children && route.children.length) {
route.children = filterAsyncRouter(route.children, route, type); route.children = filterAsyncRouter(route.children, route, type)
} else { } else {
delete route["children"]; delete route['children']
delete route["redirect"]; delete route['redirect']
} }
return true; return true
}); })
} }
function filterChildren(childrenMap, lastRouter = false) { function filterChildren(childrenMap, lastRouter = false) {
var children = []; var children = []
childrenMap.forEach((el, index) => { childrenMap.forEach((el, index) => {
if (el.children && el.children.length) { if (el.children && el.children.length) {
if (el.component === "ParentView" && !lastRouter) { if (el.component === 'ParentView' && !lastRouter) {
el.children.forEach((c) => { el.children.forEach((c) => {
c.path = el.path + "/" + c.path; c.path = el.path + '/' + c.path
if (c.children && c.children.length) { if (c.children && c.children.length) {
children = children.concat(filterChildren(c.children, c)); children = children.concat(filterChildren(c.children, c))
return; return
} }
children.push(c); children.push(c)
}); })
return; return
} }
} }
if (lastRouter) { if (lastRouter) {
el.path = lastRouter.path + "/" + el.path; el.path = lastRouter.path + '/' + el.path
} }
children = children.concat(el); children = children.concat(el)
}); })
return children; return children
} }
// 动态路由遍历,验证是否具备权限 // 动态路由遍历,验证是否具备权限
export function filterDynamicRoutes(routes) { export function filterDynamicRoutes(routes) {
const res = []; const res = []
routes.forEach((route) => { routes.forEach((route) => {
// if (route.permissions) { // if (route.permissions) {
// if (auth.hasPermiOr(route.permissions)) { // if (auth.hasPermiOr(route.permissions)) {
// res.push(route) // res.push(route)
// } // }
// } else if (route.roles) { // } else if (route.roles) {
// if (auth.hasRoleOr(route.roles)) { // if (auth.hasRoleOr(route.roles)) {
// res.push(route) // res.push(route)
// } // }
// } // }
res.push(route); res.push(route)
}); })
return res; return res
} }
export const loadView = (view) => { export const loadView = (view) => {
// if (process.env.NODE_ENV === 'development') { // if (process.env.NODE_ENV === 'development') {
// return (resolve) => require([`@/views/${view}`], resolve) // return (resolve) => require([`@/views/${view}`], resolve)
// } else { // } else {
// // 使用 import 实现生产环境的路由懒加载 // // 使用 import 实现生产环境的路由懒加载
// // return () => import(`@/views/${view}`) // // return () => import(`@/views/${view}`)
// // return (resolve) => require([`@/views/${view}`], resolve) // // return (resolve) => require([`@/views/${view}`], resolve)
// return () => import(`@/views/${view}`) // return () => import(`@/views/${view}`)
// } // }
return (resolve) => require([`@/views/${view}`], resolve); return (resolve) => require([`@/views/${view}`], resolve)
}; }
export default permission; export default permission

View File

@ -0,0 +1,173 @@
<template>
<div
class="wrap"
:class="{ border: drop }"
@dragover.prevent
@drop="dropIn"
style="position: relative"
>
<VueDraggable
type="div"
class="flex"
v-if="elementList.length"
v-model="$store.state.dropIndex.elementList"
v-bind="{
sort: drop,
animation: 500,
}"
handle=".move"
group="componentsGroup"
>
<template v-for="(item, index) in elementList">
<div
class="chunk"
:style="{ width: `${item.width}%` }"
@click.stop="activeBox(item)"
@mouseenter="mouseenterBox(item)"
@mouseleave="mouseleaveBox"
:class="{
active:
(drop && item.id == activeInfo.id) ||
item.id === mouseenterInfo.id,
move: drop,
center: item.alignCenter,
}"
>
<i class="el-icon-delete" @click.stop="deleBox(item)" v-if="drop"></i>
<component :is="item.component" :key="item.key" />
</div>
</template>
</VueDraggable>
<span class="tip" v-else>从右侧拖入或点击组件进行表单设计..</span>
</div>
</template>
<script>
import VueDraggable from "vuedraggable";
import { v4 as uuidv4 } from "uuid";
import { mapActions, mapGetters, mapMutations } from "vuex";
export default {
props: {
drop: {
type: Boolean,
default: false,
},
},
methods: {
//
dropIn(event) {
const drop_element = event.dataTransfer.getData("drop_element");
if (!drop_element) return;
let tempFlag = this.elementList.some((item) => {
if (JSON.parse(drop_element).componentName === item.componentName) {
return true;
} else {
return false;
}
});
if (tempFlag) {
this.$message({
type: "warning",
message: "禁止加入相同组件",
});
return;
}
const dropElement = JSON.parse(drop_element);
dropElement.id = uuidv4();
dropElement.key = uuidv4();
dropElement.component =
this.$options.components[dropElement.componentName];
this.updateElementList(dropElement);
},
//
activeBox(item) {
if (!this.drop) return;
this.SET_ACTIONINFO(item);
},
//
mouseenterBox(item) {
if (!this.drop) return;
this.SET_MOUSEENTERINFO(item);
},
//
mouseleaveBox() {
if (!this.drop) return;
this.REMOVE_MOUSEENTERINFO();
},
//
deleBox(item) {
if (!this.drop) return;
//
if (item.id === this.activeInfo.id) {
this.REMOVE_ACTIONINFO({});
}
this.REMOVE_ELEMENT_LIST(item);
},
...mapActions("dropIndex", ["updateElementList"]),
...mapMutations("dropIndex", [
"SET_ACTIONINFO",
"SET_MOUSEENTERINFO",
"REMOVE_MOUSEENTERINFO",
"REMOVE_ELEMENT_LIST",
"REMOVE_ACTIONINFO",
]),
},
computed: {
...mapGetters(["elementList", "activeInfo", "mouseenterInfo"]),
},
components: {
VueDraggable,
},
};
</script>
<style scoped lang='scss'>
.wrap {
width: 100%;
height: 100%;
background-color: #fafafa;
overflow-y: auto;
position: relative;
> .tip {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #c8b2e6;
font-size: 24px;
letter-spacing: 5px;
}
> .flex {
display: flex;
flex-wrap: wrap;
> .chunk {
margin: 10px;
border: 1px solid transparent;
position: relative;
> i {
cursor: pointer;
position: absolute;
top: 0px;
right: 0px;
color: red;
display: none;
}
}
.center {
margin: 10px auto;
}
}
.active {
border: 1px dashed #5a9cf8 !important;
> i {
display: block !important;
}
}
}
.border {
border: 1px dashed #ccc;
}
.move {
cursor: move !important;
}
</style>

View File

@ -0,0 +1,78 @@
<template>
<div class="wrap">
<div class="chunk">
<div class="title">
<i class="el-icon-monitor"></i>
<div class="text">首页组件模块</div>
</div>
<div class="content">
<div
class="item"
v-for="(item, index) in dropElement"
:key="index"
draggable="true"
@dragstart="dragstart($event, item)"
>
<i :class="item.icon"></i>
{{ item.name }}
</div>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
props: {
dropElement: {
type: Array,
default: () => {
return [];
},
},
},
computed: {
...mapGetters(["elementList"]),
},
methods: {
dragstart(e, item) {
e.dataTransfer.setData("drop_element", JSON.stringify(item));
},
},
};
</script>
<style scoped lang='scss'>
.wrap {
width: 100%;
height: 100%;
background-color: #fff;
padding: 5px;
> .chunk {
> .title {
display: flex;
align-content: center;
font-size: 14px;
> .text {
margin-left: 10px;
}
}
> .content {
display: flex;
margin-top: 10px;
align-items: center;
flex-wrap: wrap;
> .item {
cursor: pointer;
margin-top: 5px;
width: 45%;
font-size: 12px;
margin-right: 5%;
padding: 15px 10px;
background-color: #f6f7fe;
}
}
}
}
</style>

View File

@ -0,0 +1,120 @@
<template>
<div class="wrap">
<div class="chunk">
<div class="title">
<i class="el-icon-monitor"></i>
<div class="text">首页组件模块</div>
</div>
<div class="content">
<div
class="item"
v-for="(item, index) in dropElement"
:key="index"
draggable="true"
@click="dropIn(item)"
@dragstart="dragstart($event, item)"
>
<i :class="item.icon"></i>
{{ item.name }}
</div>
</div>
</div>
</div>
</template>
<script>
import _ from "lodash";
import { mapGetters, mapActions } from "vuex";
import { v4 as uuidv4 } from "uuid";
export default {
props: {
dropElement: {
type: Array,
default: () => {
return [];
},
},
littleModule: {
type: Array,
default: () => {
return [];
},
},
},
computed: {
...mapGetters(["elementList"]),
},
methods: {
//
dropIn(item) {
const drop_element = _.cloneDeep(item);
if (!drop_element) return;
let tempFlag = this.elementList.some((item) => {
if (drop_element.componentName === item.componentName) {
return true;
} else {
return false;
}
});
if (tempFlag) {
this.$message({
type: "warning",
message: "禁止加入相同组件",
});
return;
}
const dropElement = drop_element;
dropElement.id = uuidv4();
dropElement.key = uuidv4();
dropElement.component =
this.$options.components[dropElement.componentName];
this.updateElementList(dropElement);
},
//
dragstart(e, item) {
e.dataTransfer.setData("drop_element", JSON.stringify(_.cloneDeep(item)));
},
...mapActions("dropIndex", ["updateElementList", "=-"]),
},
};
</script>
<style scoped lang='scss'>
.wrap {
width: 100%;
height: 100%;
background-color: #fff;
padding: 5px;
> .chunk {
> .title {
margin-top: 10px;
display: flex;
align-content: center;
font-size: 14px;
> .text {
margin-left: 10px;
}
}
> .content {
display: flex;
margin-top: 10px;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
> .item {
cursor: pointer;
margin-top: 5px;
width: 49%;
font-size: 12px;
padding: 15px 10px;
background-color: #f6f7fe;
border: 1px transparent dashed;
&:hover {
color: #797be1;
border: 1px #797be1 dashed;
}
}
}
}
}
</style>

View File

@ -0,0 +1,169 @@
<template>
<div class="wrap">
<div class="title" v-if="activeInfo.id">
<i class="el-icon-setting"></i>
<div class="text">{{ activeInfo.name }}-配置项</div>
</div>
<div class="content" v-if="activeInfo.id">
<template>
<div class="chunk">
<div class="chunkTitle">宽度设置: {{ activeInfo.width }}%</div>
<div class="btn">
<el-slider
v-model="activeInfo.width"
:max="100"
:min="10"
></el-slider>
</div>
</div>
<div class="chunk">
<div class="chunkTitle">
是否居中:
<el-checkbox v-model="activeInfo.alignCenter"></el-checkbox>
</div>
</div>
<div class="chunk">
<div class="btn resize">
<el-button
type="primary"
icon="el-icon-refresh-left"
@click="resizeActiveWidth"
size="mini"
>还原默认</el-button
>
</div>
</div>
</template>
</div>
<!-- <div class="chunk">
{{ elementList }}
</div> -->
<div class="lookView" v-if="elementList.length">
<div class="btnChunk">
<el-button
type="primary"
icon="el-icon-view"
@click="viewHanlde"
size="mini"
>预览</el-button
>
</div>
<div class="btnChunk">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
@click="cleanHanlde"
>清空</el-button
>
</div>
<div class="btnChunk">
<el-button
:loading="submitLoading"
type="success"
icon="el-icon-plus"
size="mini"
@click="submitHanlde"
>提交</el-button
>
</div>
</div>
</div>
</template>
<script>
import { mapActions, mapGetters, mapMutations } from "vuex";
import _ from "lodash";
// import { SaveMyWidgetAPI } from "@/api/apis/layOutAuth.js";
export default {
data() {
return {
submitLoading: false,
};
},
computed: {
...mapGetters(["elementList", "activeInfo", "mouseenterInfo"]),
},
methods: {
//
async submitHanlde() {
this.submitLoading = true;
let tempArr = _.cloneDeep(this.elementList).map((item) => {
this.$delete(item, "component");
return item;
});
const res = await SaveMyWidgetAPI(JSON.stringify(tempArr));
this.submitLoading = false;
if (res.code == 1) {
this.$message({
type: "success",
message: "保存成功!",
});
this.$router.push({ name: "Index" });
}
},
//
cleanHanlde() {
this.$confirm("确定清空组件?")
.then((_) => {
this.CLEAN_ELEMENT_LIST();
})
.catch((_) => {});
},
//
resizeActiveWidth() {
this.RESIZE_ACTIVE_WIDTH();
},
...mapMutations("dropIndex", ["RESIZE_ACTIVE_WIDTH", "CLEAN_ELEMENT_LIST"]),
//
viewHanlde() {
this.$emit("viewHanlde");
},
},
};
</script>
<style scoped lang='scss'>
.wrap {
background-color: #fff;
padding: 10px;
width: 100%;
height: 100%;
position: relative;
> .title {
display: flex;
align-items: center;
.text {
font-size: 14px;
margin-left: 10px;
}
}
> .content {
margin-top: 20px;
> .chunk {
margin: 10px 0;
width: 100%;
> .chunkTitle {
font-size: 14px;
}
> .btn {
width: 90%;
margin: 0 auto;
}
> .resize {
display: flex;
justify-content: flex-end;
}
}
}
> .lookView {
position: absolute;
bottom: 10px;
display: flex;
.btnChunk {
flex: 1;
margin-right: 2px;
}
}
}
</style>

View File

@ -0,0 +1,206 @@
/**
* huyitong 2023-09-05
* tag:"layOutChunk"首页模块
* name:"左侧拖拽菜单显示名"
* icon:左侧拖拽菜单显示icon
* min最小宽度
* width:初始宽度
* defaultWidth:默认宽度还原默认用
* componentName:组件名需去@/components/index.js提前注册
* alignCenter:是否居中
*/
const config = [
// {
// name: "今日数据概览-普通员工",
// componentName: "employeeTodayData",
// width: 60,
// defaultWidth: 60,
// min: 10,
// icon: "el-icon-picture-outline-round",
// tag: "layOutChunk",
// alignCenter: false,
// },
{
name: "任务预警",
componentName: "taskWarning",
width: 32,
defaultWidth: 32,
min: 10,
icon: "el-icon-picture-outline-round",
tag: "layOutChunk",
alignCenter: false,
},
{
name: "合同预警",
componentName: "contractWarning",
width: 32,
defaultWidth: 32,
min: 10,
icon: "el-icon-picture-outline-round",
tag: "layOutChunk",
alignCenter: false,
},
{
name: "待审工作",
componentName: "agencyReviewWork",
width: 32,
defaultWidth: 32,
min: 10,
icon: "el-icon-picture-outline-round",
tag: "layOutChunk",
alignCenter: false,
},
{
name: "项目预警",
componentName: "projectWarning",
width: 32,
defaultWidth: 32,
min: 10,
icon: "el-icon-picture-outline-round",
tag: "layOutChunk",
alignCenter: false,
},
{
name: "交接单未立项",
componentName: "contractHandover",
width: 16,
defaultWidth: 16,
min: 10,
icon: "el-icon-picture-outline-round",
tag: "layOutChunk",
alignCenter: false,
},
{
name: "本月任务数",
componentName: "employeeMonthTask",
width: 35,
min: 10,
defaultWidth: 35,
icon: "el-icon-menu",
tag: "layOutChunk",
alignCenter: false,
},
{
name: "本周任务",
componentName: "employeeWeekTask",
width: 60,
min: 10,
defaultWidth: 60,
icon: "el-icon-s-cooperation",
tag: "layOutChunk",
alignCenter: false,
},
{
name: "快捷操作区",
componentName: "quickOperation",
width: 35,
min: 10,
defaultWidth: 35,
icon: "el-icon-s-cooperation",
tag: "layOutChunk",
alignCenter: false,
},
{
name: "我的周计划",
componentName: "weekPlan",
width: 35,
min: 10,
defaultWidth: 35,
icon: "el-icon-s-release",
tag: "layOutChunk",
alignCenter: false,
},
{
name: "我的审批",
componentName: "approval",
width: 35,
min: 10,
defaultWidth: 35,
icon: "el-icon-date",
tag: "layOutChunk",
alignCenter: false,
},
// {
// name: "今日数据概览-项目经理",
// componentName: "projectManagerTodayData",
// width: 60,
// defaultWidth: 60,
// min: 10,
// icon: "el-icon-s-check",
// tag: "layOutChunk",
// alignCenter: false,
// },
{
name: "未处理问题",
componentName: "projectManagerProblem",
width: 35,
min: 10,
defaultWidth: 35,
icon: "el-icon-s-claim",
tag: "layOutChunk",
alignCenter: false,
},
{
name: "项目阶段预警",
componentName: "projectManagerProjectWarning",
width: 60,
defaultWidth: 60,
min: 10,
icon: "el-icon-picture-outline-round",
tag: "littleModule",
alignCenter: false,
},
{
name: "重点项目跟进",
componentName: "keyProject",
width: 60,
defaultWidth: 60,
min: 10,
icon: "el-icon-picture-outline-round",
tag: "littleModule",
alignCenter: false,
},
// {
// name: "今日数据概览-业务员",
// componentName: "salesManTodayData",
// width: 60,
// defaultWidth: 60,
// min: 10,
// icon: "el-icon-picture-outline-round",
// tag: "littleModule",
// alignCenter: false,
// },
{
name: "回款认领",
componentName: "salesMamRefundClaim",
width: 60,
defaultWidth: 60,
min: 10,
icon: "el-icon-picture-outline-round",
tag: "littleModule",
alignCenter: false,
},
{
name: "合同收款预警",
componentName: "salesManCollectionWarning",
width: 60,
defaultWidth: 60,
min: 10,
icon: "el-icon-picture-outline-round",
tag: "littleModule",
alignCenter: false,
},
{
name: "今日天气",
componentName: "weatherChunk",
width: 35,
defaultWidth: 35,
min: 10,
icon: "el-icon-picture-outline-round",
tag: "littleModule",
alignCenter: false,
},
];
export default {
config,
};

View File

@ -0,0 +1,6 @@
const config = [
]
export default {
config,
};

View File

@ -0,0 +1,137 @@
<template>
<div class="warp">
<div class="dropMain">
<div class="left" v-if="!full">
<menuChunk
:dropElement="dropElement"
:littleModule="littleModule"
></menuChunk>
</div>
<div class="center">
<contentChunk :drop="drop"></contentChunk>
</div>
<div class="right" v-if="!full">
<optionsChunk @viewHanlde="viewHanlde"></optionsChunk>
</div>
</div>
<div class="exitView" v-if="viewFLag">
<el-button @click="openDrap">{{
drop ? "关闭拖拽" : "开启拖拽"
}}</el-button>
<el-button @click="exitViewHanlde">退出预览</el-button>
</div>
</div>
</template>
<script>
import dropData from "./config/indexChunkConfig";
import menuChunk from "./components/menuChunk/index.vue";
import contentChunk from "./components/contentChunk/index.vue";
import optionsChunk from "./components/optionsChunk/index.vue";
import { GetPppedomSet } from "@/api/apis/jurisdiction";
import { getInfo } from "@/utils/auth";
// import {
// GeWidgetPepedomLoginUserAPI,
// GetMyWidgetAPI,
// } from "@/api/apis/layOutAuth.js";
import { mapMutations } from "vuex";
import littleModule from "./config/littleModule";
export default {
props: {},
data() {
return {
dropElement: [], //()
littleModule: littleModule.config, //
viewFLag: false, //
drop: true, //
full: false, //
};
},
components: {
menuChunk,
contentChunk,
optionsChunk,
},
created() {
this.GetMyWidgetHanlde();
},
activated() {
this.GetMyWidgetHanlde();
},
methods: {
//
async GetMyWidgetHanlde() {
const authRes = await GeWidgetPepedomLoginUserAPI();
let tempAuthStr = authRes.data[0];
let tempArr = [];
dropData.config.forEach((item) => {
if (tempAuthStr.includes(item.componentName)) {
this.dropElement.push(item);
}
});
const res = await GetMyWidgetAPI();
if (res.code === 1) {
if (res.data.length && res.data[0]) {
tempArr = JSON.parse(res.data[0]).filter((item) => {
if (tempAuthStr.includes(item.componentName)) {
item.component = this.$options.components[item.componentName];
return item;
}
});
this.SET_ELEMENT_LIST(tempArr);
} else {
//
}
}
},
async initAuth() {},
//$emit
viewHanlde() {
// this.drop = false;
this.viewFLag = true;
this.full = true;
},
//退
exitViewHanlde() {
this.drop = true; //
this.viewFLag = false; //
this.full = false; //
},
//
openDrap() {
this.drop = !this.drop;
},
...mapMutations("dropIndex", ["SET_ELEMENT_LIST"]),
},
};
</script>
<style lang='scss' scoped>
.warp {
width: 100%;
position: relative;
overflow-x: auto;
> .dropMain {
padding: 10px;
display: flex;
height: 90vh;
.left {
flex: 1;
}
.center {
margin: 0 10px;
flex: 4.5;
background-color: #fff;
}
.right {
flex: 1;
background-color: #fff;
}
}
.exitView {
position: absolute;
top: 10px;
right: 25px;
}
}
</style>

View File

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

View File

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

View File

@ -0,0 +1,121 @@
<template>
<div>
<el-table ref="multipleTable" :data="tableData" style="width: 100%" :show-header="false">
<el-table-column prop="billName" label="单据" width="120">
</el-table-column>
<el-table-column prop="dataList" label="字段">
<template slot-scope="scope">
<i
class="el-icon-star-on"
style="
height: 30px;
line-height: 30px;
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)"
></i>
<i
class="el-icon-star-on"
style="
height: 30px;
line-height: 30px;
font-size: 25px;
margin-right: 7px;
color: #808080;
"
v-show="
scope.row.dataList.length != 0 &&
scope.row.dataList.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.dataList"
:label="item.id"
:key="item.id"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { GetAllBilldata, GetAllBillDataPepedom } from "@/api/apis/jurisdiction";
export default {
data() {
return {
tableData: [],
selectedList: []
};
},
created() {
this.init();
},
components: {},
computed: {},
mounted() {},
beforeUpdate() {
this.handleTabClick()
},
methods: {
selectAllButton(item) {
let data = [];
item.dataList.forEach((el) => {
data.push(el.id);
});
item.buttonList = data;
},
cancellation(item) {
item.buttonList = [];
},
handleTabClick() {
this.$nextTick(() => {
this.$refs.multipleTable && this.$refs.multipleTable.doLayout()
})
},
async init() {
let data = [];
const res = await GetAllBilldata({});
if (res.code == 1) {
data = res.data[0];
data.forEach((el) => {
el.dataList = [];
el.buttonList = []
});
}
const item = await GetAllBillDataPepedom({});
if (item.code == 1) {
data.forEach((el) => {
item.data[0].forEach((e) => {
if (el.billKindID == e.billKindID) {
el.dataList.push(e);
}
})
this.selectedList.forEach(add => {
if (el.billKindID == add.dp_billKindID) {
el.buttonList = add.dp_popeList.split("\,")
}
})
});
}
this.tableData = data;
},
},
};
</script>
<style scoped lang="scss"></style>

View File

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

View File

@ -1,445 +1,476 @@
<template> <template>
<div> <div>
<div style="display: flex;height: 100%;"> <div style="display: flex; height: 100%">
<!-- <base-layout title="组织机构" ref="organLayout" style="width: 20%;" :bottonShow="false" :isPage="false " <!-- <base-layout title="组织机构" ref="organLayout" style="width: 20%;" :bottonShow="false" :isPage="false "
:mainColor="mainColor" :bodyHight="orangTreeHight"> :mainColor="mainColor" :bodyHight="orangTreeHight">
<div slot="main"> <div slot="main">
<base-tree ref="baseTree" :isCenter="false" :isSaveBtn="false" :Allshow="false" <base-tree ref="baseTree" :isCenter="false" :isSaveBtn="false" :Allshow="false"
:showCheckbox="false" :menuData="orangData" @handleNodeClick="orangClick"></base-tree> :showCheckbox="false" :menuData="orangData" @handleNodeClick="orangClick"></base-tree>
</div> </div>
</base-layout> --> </base-layout> -->
<base-layout ref="userLayout" @pageChange="pageChange" :showTitle="false" :buttonList="buttonList" <base-layout ref="userLayout" @pageChange="pageChange" :showTitle="false" :buttonList="buttonList" :defaultButtonSwitch="false" @onFuncBtn="getFuncBtn" :isPage="true">
:defaultButtonSwitch="false" @onFuncBtn="getFuncBtn" :isPage="true"> <div slot="main" slot-scope="{ tableHeight }" style="height: 100%">
<div slot="main" slot-scope="{ tableHeight }" style="height: 100%;"> <base-table ref="userCustomtable" :border="true" :showIndex="false" :tabLoading.sync="tabLoading" @radioChange="userRadioChange" :slotrow="true" :tableHeight="tableHeight" :tableData="tableData" :tableColumn="tableColumn">
<base-table ref="userCustomtable" :border="true" :showIndex="false" :tabLoading.sync="tabLoading" </base-table>
@radioChange="userRadioChange" :slotrow="true" :tableHeight="tableHeight" :tableData="tableData" </div>
:tableColumn="tableColumn"> </base-layout>
</div>
</base-table> <base-dialog :closeEscape="true" :showClose="true" :closeModal="false" :dialogVisible.sync="settingDialog" class="userDialog" title="权限设置" width="50vw" top="5vh" :footerShow="true" @handleConfirmClick="settingConfirmClick">
</div> <base-layout :bodyHight="settingTreeHight" :showTitle="false" :operateButtonSwitch="false">
</base-layout> <div slot="main">
</div> <el-tabs v-model="activeName" type="card" @tab-click="handleClick" :before-leave="beforeLeave">
<base-dialog :closeEscape="true" :showClose="true" :closeModal="false" :dialogVisible.sync="settingDialog" <el-tab-pane label="菜单权限" name="jurisdictionSetting">
class="userDialog" title="权限设置" width="50vw" top="5vh" :footerShow="true" <jurisdiction-Setting ref="jurisdictionSetting" :menuData="menuData"></jurisdiction-Setting>
@handleConfirmClick="settingConfirmClick"> </el-tab-pane>
<base-layout :bodyHight="settingTreeHight" :showTitle="false" :operateButtonSwitch="false"> <el-tab-pane label="按钮权限" name="buttonSetting">
<div slot="main"> <button-setting ref="buttonSetting"></button-setting>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick" :before-leave="beforeLeave"> </el-tab-pane>
<el-tab-pane label="菜单权限" name="jurisdictionSetting"> <el-tab-pane label="数据权限" name="dataSetting">
<jurisdiction-Setting ref="jurisdictionSetting" :menuData="menuData"></jurisdiction-Setting> <data-setting ref="dataSetting"></data-setting>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="按钮权限" name="buttonSetting"> </el-tabs>
<button-setting ref="buttonSetting"></button-setting> </div>
</el-tab-pane> </base-layout>
<el-tab-pane label="数据权限" name="dataSetting"> </base-dialog>
<data-setting ref="dataSetting"></data-setting> <right-dialog ref="rightDialog" :menuData="menuData" v-if="permissionPopup"></right-dialog>
</el-tab-pane> </div>
</el-tabs> </template>
</div>
</base-layout> <script>
</base-dialog> import baseLayout from "@/components/base/baseLayout";
</div> import baseTable from "@/components/base/baseTable";
</template> import baseDialog from "@/components/base/BaseNewDialog/index.vue";
import baseForm from "@/components/base/baseNewForm/index.vue";
<script> import baseTree from "@/components/base/BaseMenuTree/index.vue";
import baseLayout from "@/components/base/baseLayout"; import jurisdictionSetting from "./jurisdictionSetting.vue";
import baseTable from "@/components/base/baseTable"; import buttonSetting from "./buttonSetting.vue";
import baseDialog from "@/components/base/BaseNewDialog/index.vue"; import dataSetting from "./dataSetting.vue";
import baseForm from "@/components/base/baseNewForm/index.vue"; import configData from "./configData";
import baseTree from "@/components/base/BaseMenuTree/index.vue"; import rightDialog from "./rightDialog";
import jurisdictionSetting from "./jurisdictionSetting.vue"; import { getCompanyId } from "@/utils/auth";
import buttonSetting from "./buttonSetting.vue"; import { GetMenuTree } from "@/api/apis/menuManage";
import dataSetting from "./dataSetting.vue" import { RoleGetBillList } from "@/api/apis/roleManagement";
import configData from "./configData"; import { GetOrganTree } from "@/api/apis/organization";
import { getCompanyId } from '@/utils/auth' import {
import { GetPppedomSet,
GetMenuTree, GetMenuButton,
} from '@/api/apis/menuManage' GetAllButton,
import { GetAllBillDataPepedom,
RoleGetBillList, GetAllBilldata,
} from '@/api/apis/roleManagement' PopedomSaveData,
import { } from "@/api/apis/jurisdiction";
GetOrganTree, export default {
} from '@/api/apis/organization' name: "review",
import { components: {
GetPppedomSet, buttonSetting,
GetAllButton, dataSetting,
GetAllBillDataPepedom, baseLayout,
GetAllBilldata, baseTable,
PopedomSaveData baseDialog,
} from '@/api/apis/jurisdiction' baseForm,
export default { baseTree,
name: "review", jurisdictionSetting,
components: { rightDialog,
buttonSetting, },
dataSetting, data() {
baseLayout, return {
baseTable, activeName: "jurisdictionSetting",
baseDialog, settingTreeHight: "500px",
baseForm, radioIndex: false,
baseTree, userRadioId: false,
jurisdictionSetting settingDialog: false,
}, // orangTreeHight: 'calc(100vh - 119px)',
data() { // tableHeight: 'calc(100vh - 189px)',
return { mainColor: "#f8f8f8",
activeName: 'jurisdictionSetting', tabLoading: false,
settingTreeHight: '500px', tableData: [],
radioIndex: false, //
userRadioId: false, menuData: [],
settingDialog: false, orangData: [],
// orangTreeHight: 'calc(100vh - 119px)', buttonList: [
// tableHeight: 'calc(100vh - 189px)', {
mainColor: '#f8f8f8', icon: "el-icon-plus",
tabLoading: false, menuName: "权限设置",
tableData: [], btnFunciton: "setting",
// },
menuData: [], ],
orangData: [], pageModel: {
buttonList: [{ page: 1,
'icon': 'el-icon-plus', limit: 20,
'menuName': '权限设置', departmentID: "",
btnFunciton: 'setting' Sequence: "",
},], SequenceName: "",
pageModel: { },
page: 1, defaultProps: {
limit: 20, children: "children",
departmentID: '', label: "label",
Sequence: '', },
SequenceName: '' buttonArray: [],
}, allButtonList: [],
defaultProps: { menuIDs: [],
children: 'children', menuList: [],
label: 'label' menuPopedom: [],
}, permissionPopup: false,
buttonArray: [], };
allButtonList: [], },
menuIDs: [], computed: {
menuList: [], //
menuPopedom: [] tableColumn() {
} return configData.tableColumnJson;
}, },
computed: { },
// watch: {
tableColumn() { settingDialog: {
return configData.tableColumnJson deep: true,
}, handler(newValue, oldValue) {
}, if (newValue == false) {
watch: { this.$refs.dataSetting.dataList = [];
settingDialog: { this.$refs.jurisdictionSetting.$refs.menuTree.$refs.elTree.setCheckedKeys(
deep: true, []
handler(newValue, oldValue) { );
if (newValue == false) { // this.$refs.elTree.getCheckedKeys()
this.$refs.dataSetting.dataList = [] // this.$refs.jurisdictionSetting.$refs.menuTree.checkChange([])
this.$refs.jurisdictionSetting.$refs.menuTree.$refs.elTree.setCheckedKeys([]) this.$refs.buttonSetting.classifyButtonList = [];
// this.$refs.elTree.getCheckedKeys() }
// this.$refs.jurisdictionSetting.$refs.menuTree.checkChange([]) },
this.$refs.buttonSetting.classifyButtonList = [] },
} },
} created() { },
} onShow() { },
}, mounted() {
created() { }, this.initPage();
onShow() { }, this.getMenuData();
mounted() { },
this.initPage() filters: {},
}, methods: {
filters: { beforeLeave(activeName, oldActiveName) {
if (
}, oldActiveName == "jurisdictionSetting" &&
methods: { activeName == "buttonSetting"
beforeLeave(activeName, oldActiveName) { ) {
if (oldActiveName == 'jurisdictionSetting' && activeName == "buttonSetting") { this.menuPopedom = this.$refs.jurisdictionSetting.menuPopedom;
this.menuPopedom = this.$refs.jurisdictionSetting.menuPopedom if (this.menuPopedom.length == 0) {
if (this.menuPopedom.length == 0) { this.$vmNews("请选择菜单");
this.$vmNews("请选择菜单") return false;
return false }
} }
} if (oldActiveName == "dataSetting" && activeName == "buttonSetting") {
if (oldActiveName == 'dataSetting' && activeName == "buttonSetting") { return false;
return false }
} },
}, // tab
// tab handleClick(tab, event) {
handleClick(tab, event) { if (this.activeName == "buttonSetting") {
if (this.activeName == 'buttonSetting') { let checkdata = this.$refs.jurisdictionSetting.checkdata;
let checkdata = this.$refs.jurisdictionSetting.checkdata this.$refs.buttonSetting.GetAllButtonList(this.menuPopedom, checkdata);
this.$refs.buttonSetting.GetAllButtonList(this.menuPopedom, checkdata) }
} if (this.activeName == "dataSetting") {
if (this.activeName == 'dataSetting') { this.$refs.dataSetting.inPage();
this.$refs.dataSetting.inPage() }
} },
}, //
// getMenuIDs(menuData) {
getMenuIDs(menuData) { menuData.forEach((el) => {
menuData.forEach(el => { if (el.type) {
if (el.type) { this.menuList.push(el);
this.menuList.push(el) this.menuIDs.push(el.id);
this.menuIDs.push(el.id) }
} if (el.children != null && el.children && el.children.length) {
if (el.children != null && el.children && el.children.length) { this.getMenuIDs(el.children);
this.getMenuIDs(el.children) }
} });
}) },
}, //
// initPage() {
initPage() { this.getTableList();
this.getTableList() this.getOrganList();
this.getOrganList() this.$refs.userCustomtable.clearRadioIndex();
},
this.$refs.userCustomtable.clearRadioIndex() //
}, async getMenuData() {
// let res = await GetMenuButton({});
async getMenuData() { if (res.code == 1) {
let res = await GetMenuTree({}) let arr = JSON.parse(res.data[0]);
if (res.code == 1) { this.menuData = JSON.parse(res.data[0]);
let arr = JSON.parse(res.data[0]) this.changeMenu(this.menuData, 0);
this.menuData = JSON.parse(res.data[0]) // this.getButtonArray(this.menuData)
this.changeMenu(this.menuData, 0) }
// this.getButtonArray(this.menuData) },
} //
}, changeMenu(data, num) {
// let level = num;
changeMenu(data, num) { level = level + 1;
let level = num data.forEach((el) => {
level = level + 1 el.buttonList = [];
data.forEach(el => { el.type = false;
el.buttonList = [] // el.level = level
el.type = false if (el.children != null && el.children && el.children.length) {
// el.level = level this.changeMenu(el.children, level);
if (el.children != null && el.children && el.children.length) { }
this.changeMenu(el.children, level) });
} },
}) //
}, async getTableList() {
// this.tabLoading = true;
async getTableList() { this.tableData = [];
this.tabLoading = true let params = {
this.tableData = [] ...this.pageModel,
let params = { };
...this.pageModel let res = await RoleGetBillList(params);
} if (res.code === 1) {
let res = await RoleGetBillList(params) this.tableData = res.data[1];
if (res.code === 1) { this.$nextTick(() => {
this.tableData = res.data[1] // this.$refs.customtable.clearRadioIndex()
this.$nextTick(() => {
this.$refs.customtable.clearRadioIndex() this.$refs.userLayout.setPageTotal(res.data[0]);
});
this.$refs.userLayout.setPageTotal(res.data[0]) this.tabLoading = false;
}) }
this.tabLoading = false },
}
}, getButtonArray(menuData) {
menuData.forEach((el, index) => {
getButtonArray(menuData) { this.allButtonList.forEach((item) => {
menuData.forEach((el, index) => { if (el.id == item.MenuID) {
this.allButtonList.forEach(item => { item.active = false;
if (el.id == item.MenuID) { el.buttonList.push(item);
item.active = false }
el.buttonList.push(item) });
} if (el.children != null && el.children && el.children.length) {
}) this.getButtonArray(el.children);
if (el.children != null && el.children && el.children.length) { }
this.getButtonArray(el.children) });
} },
}) //
}, userRadioChange(val) {
// this.radioIndex = val.index;
userRadioChange(val) { this.userRadioId = val.r_RoleID;
this.radioIndex = val.index },
this.userRadioId = val.r_RoleID //
}, async getOrganList() {
// let params = {
async getOrganList() { // CompanyID: "43"
let params = { CompanyID: this.$store.state.user.companyID
// CompanyID: "43" ? this.$store.state.user.companyID
CompanyID: this.$store.state.user.companyID ? this.$store.state.user.companyID : getCompanyId() : getCompanyId(),
} };
let res = await GetOrganTree(params) let res = await GetOrganTree(params);
this.orangData = JSON.parse(res.data[0]) this.orangData = JSON.parse(res.data[0]);
}, },
// //
orangClick(data) { orangClick(data) {
this.pageModel.departmentID = data.id this.pageModel.departmentID = data.id;
this.resetTable() this.resetTable();
// this.result() // this.result()
}, },
resetTable() { resetTable() {
this.pageModel.page = 1 this.pageModel.page = 1;
this.userRadioId = false this.userRadioId = false;
this.radioIndex = false this.radioIndex = false;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.userCustomtable.clearRadioIndex() this.$refs.userCustomtable.clearRadioIndex();
this.$refs.userLayout.pageClear() this.$refs.userLayout.pageClear();
}) });
this.getTableList() this.getTableList();
}, },
// //
getFuncBtn(btnEven) { getFuncBtn(btnEven) {
if (this.radioIndex === false) { if (this.radioIndex === false) {
this.$vmNews("请选择一条数据") this.$vmNews("请选择一条数据");
return return;
} }
this[btnEven.btnFunciton]() this[btnEven.btnFunciton]();
}, },
setting() { async setting() {
this.getMenuData() this.getMenuData();
if (this.radioIndex === false) {
this.$vmNews("请选择一条数据") this.permissionPopup = true;
return this.$nextTick(() => {
} this.$refs.rightDialog.drawer = true;
this.settingDialog = true this.$refs.rightDialog.buttonLoading = true;
this.activeName = "jurisdictionSetting" let params = {
this.GetPppedomData() objectID: this.userRadioId,
kindid: 2,
}, };
async GetPppedomData() { GetPppedomSet(params).then((res) => {
let params = { if (res.code == 1) {
objectID: this.userRadioId, const data = res.data;
kindid: 2 let menuIDs =
} data[0].length > 0 ? data[0][0].fp_MenuIdList.split(",") : [];
let res = await GetPppedomSet(params) let echo = data[1].length > 0 ? data[1] : [];
if (res.code == 1) { this.$refs.rightDialog.exhibitList(menuIDs, echo, this.userRadioId);
const data = res.data let dataPermissions = data[2].length > 0 ? data[2] : [];
let menuIDs = data[0].length > 0 ? data[0][0].fp_MenuIdList.split(',') : [] this.$refs.rightDialog.$refs.dataPermissions.selectedList =
this.$refs.jurisdictionSetting.$refs.menuTree.selectData = menuIDs dataPermissions;
this.$refs.jurisdictionSetting.$refs.menuTree.checkChange(menuIDs) this.$refs.rightDialog.$refs.layOutPermissions.selectedList = res
let buttonPopedom = this.getbuttonPopedomList(res.data[1]) .data[3][0]
this.$refs.buttonSetting.buttonPopedom = buttonPopedom ? res.data[3][0].widgetList
let activeList = this.getActiveList(res.data[2]) : "";
this.$refs.dataSetting.activeList = activeList // this.menuData = this.addToButtonList(this.menuData,echo)
// selectData }
} });
}, });
getActiveList(data) { },
let array = [] // setting() {
data.forEach(el => { // if (this.radioIndex === false) {
el.dp_popeList.split(',').forEach(item => { // this.$vmNews("")
array.push(item) // return
}) // }
}) // this.settingDialog = true
return array // this.activeName = "jurisdictionSetting"
}, // this.GetPppedomData()
getbuttonPopedomList(data) { // },
let array = [] async GetPppedomData() {
data.forEach(el => { let params = {
el.op_OperateKindList.split(',').forEach(item => { objectID: this.userRadioId,
array.push(item) kindid: 2,
}) };
}) let res = await GetPppedomSet(params);
return array if (res.code == 1) {
}, const data = res.data;
pageChange(model) { let menuIDs =
this.pageModel.page = model.page data[0].length > 0 ? data[0][0].fp_MenuIdList.split(",") : [];
this.pageModel.limit = model.limit this.$refs.jurisdictionSetting.$refs.menuTree.selectData = menuIDs;
this.getTableList() this.$refs.jurisdictionSetting.$refs.menuTree.checkChange(menuIDs);
}, let buttonPopedom = this.getbuttonPopedomList(res.data[1]);
settingConfirmClick() { this.$refs.buttonSetting.buttonPopedom = buttonPopedom;
let menuPopedom = this.$refs.jurisdictionSetting.menuPopedom.join(",") let activeList = this.getActiveList(res.data[2]);
let buttonPopedom = this.getButtonPopedom(this.$refs.buttonSetting.classifyButtonList) this.$refs.dataSetting.activeList = activeList;
let dataPopedom = this.getDataPopedom(this.$refs.dataSetting.dataList) // selectData
let params = { }
kindid: 2, },
objectID: this.userRadioId, getActiveList(data) {
menuPopedom: menuPopedom, let array = [];
buttonPopedom: buttonPopedom, data.forEach((el) => {
dataPopedom: dataPopedom, el.dp_popeList.split(",").forEach((item) => {
} array.push(item);
this.saveData(params) });
}, });
async saveData(params) { return array;
let res = await PopedomSaveData(params) },
if (res.code == 1) { getbuttonPopedomList(data) {
this.$vmNews("保存成功", 'success') let array = [];
this.activeName = "jurisdictionSetting" data.forEach((el) => {
this.settingDialog = false el.op_OperateKindList.split(",").forEach((item) => {
} array.push(item);
}, });
getDataPopedom(dataPopedom) { });
let array = [] return array;
dataPopedom.forEach(el => { },
el.dp_popeList = [] pageChange(model) {
el.buttonList.forEach(item => { this.pageModel.page = model.page;
if (item.type) { this.pageModel.limit = model.limit;
el.dp_popeList.push(item.id) this.getTableList();
} },
}) settingConfirmClick() {
}) let menuPopedom = this.$refs.jurisdictionSetting.menuPopedom.join(",");
dataPopedom.forEach(el => { let buttonPopedom = this.getButtonPopedom(
if (el.dp_popeList.length > 0) { this.$refs.buttonSetting.classifyButtonList
let params = { );
dp_billKindID: el.billKindID, let dataPopedom = this.getDataPopedom(this.$refs.dataSetting.dataList);
dp_popeList: el.dp_popeList.join(',') let params = {
} kindid: 2,
array.push(params) objectID: this.userRadioId,
} menuPopedom: menuPopedom,
}) buttonPopedom: buttonPopedom,
return array dataPopedom: dataPopedom,
}, };
getButtonPopedom(buttonPopedom) { this.saveData(params);
let array = [] },
// let op_OperateKindList = [] async saveData(params) {
buttonPopedom.forEach(el => { let res = await PopedomSaveData(params);
el.op_MenuID = el.id if (res.code == 1) {
el.op_OperateKindList = [] this.$vmNews("保存成功", "success");
el.buttonList.forEach(item => { this.activeName = "jurisdictionSetting";
if (item.type) { this.settingDialog = false;
el.op_OperateKindList.push(item.id) }
} },
}) getDataPopedom(dataPopedom) {
}) let array = [];
buttonPopedom.forEach(el => { dataPopedom.forEach((el) => {
if (el.op_OperateKindList.length > 0) { el.dp_popeList = [];
let params = { el.buttonList.forEach((item) => {
op_MenuID: el.op_MenuID, if (item.type) {
op_OperateKindList: el.op_OperateKindList.join(',') el.dp_popeList.push(item.id);
} }
array.push(params) });
} });
}) dataPopedom.forEach((el) => {
return array if (el.dp_popeList.length > 0) {
}, let params = {
}, dp_billKindID: el.billKindID,
} dp_popeList: el.dp_popeList.join(","),
</script> };
<style scoped> array.push(params);
>>>.el-dialog__body { }
padding: 0 25px; });
} return array;
</style> },
<style scoped lang='scss'> getButtonPopedom(buttonPopedom) {
.roleName { let array = [];
padding: 10px 0; // let op_OperateKindList = []
width: 90px; buttonPopedom.forEach((el) => {
border: 2px solid #f2f2f2; el.op_MenuID = el.id;
background-color: #f2f2f2; el.op_OperateKindList = [];
margin: 0px 10px 10px 0px; el.buttonList.forEach((item) => {
text-align: center; if (item.type) {
cursor: pointer; el.op_OperateKindList.push(item.id);
box-shadow: 0 0 0 2px #f2f2f2; }
border-radius: 5px; });
} });
buttonPopedom.forEach((el) => {
.active { if (el.op_OperateKindList.length > 0) {
background-color: #00a490; let params = {
border: 2px solid #ffffff; op_MenuID: el.op_MenuID,
color: white; op_OperateKindList: el.op_OperateKindList.join(","),
box-shadow: 0 0 0 2px #00a490; };
} array.push(params);
}
.bigTitle { });
padding-bottom: 10px; return array;
margin: 10px 0; },
font-size: 16px; },
font-weight: bold; };
border-bottom: 1px solid #ccc; </script>
} <style scoped lang='scss'>
>>> .el-dialog__body {
.organizationBody { padding: 0 25px;
display: flex; }
justify-content: space-evenly; </style>
background-color: #f2f3f4; <style scoped lang='scss'>
padding: 10px .roleName {
} padding: 10px 0;
</style> width: 90px;
border: 2px solid #f2f2f2;
background-color: #f2f2f2;
margin: 0px 10px 10px 0px;
text-align: center;
cursor: pointer;
box-shadow: 0 0 0 2px #f2f2f2;
border-radius: 5px;
}
.active {
background-color: #00a490;
border: 2px solid #ffffff;
color: white;
box-shadow: 0 0 0 2px #00a490;
}
.bigTitle {
padding-bottom: 10px;
margin: 10px 0;
font-size: 16px;
font-weight: bold;
border-bottom: 1px solid #ccc;
}
.organizationBody {
display: flex;
justify-content: space-evenly;
background-color: #f2f3f4;
padding: 10px;
}
</style>

View File

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

View File

@ -0,0 +1,116 @@
<template>
<div>
<el-table
ref="multipleTable"
:data="tableData"
style="width: 100%"
:show-header="false"
>
<el-table-column prop="billName" label="模块" width="120">
</el-table-column>
<el-table-column prop="dataList" label="字段">
<template slot-scope="scope">
<i
class="el-icon-star-on"
style="
height: 30px;
line-height: 30px;
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)"
></i>
<i
class="el-icon-star-on"
style="
height: 30px;
line-height: 30px;
font-size: 25px;
margin-right: 7px;
color: #808080;
"
v-show="
scope.row.dataList.length != 0 &&
scope.row.dataList.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.dataList"
:label="item.id"
:key="item.id"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import config from "@/views/doraChunk/config/indexChunkConfig.js";
import { mapMutations } from "vuex";
export default {
data() {
return {
tableData: [
{
billName: "首页拖拽模块",
dataList: config.config.map((item) => {
let obj = {
id: item.componentName,
name: item.name,
};
return obj;
}),
buttonList: [],
},
],
selectedList: "",
};
},
created() {},
components: {},
computed: {},
mounted() {},
beforeUpdate() {
this.handleTabClick();
},
methods: {
selectAllButton(item) {
let data = [];
item.dataList.forEach((el) => {
data.push(el.id);
});
item.buttonList = data;
},
cancellation(item) {
item.buttonList = [];
},
handleTabClick() {
this.$nextTick(() => {
this.$refs.multipleTable && this.$refs.multipleTable.doLayout();
});
},
},
watch: {
selectedList(newV, oldV) {
let tempArr = newV.split(",");
this.tableData[0].buttonList = tempArr;
},
},
};
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,396 @@
<template>
<div>
<base-right-dialog
ref="baseRightDialog"
:footerShow="true"
:appendBody="true"
:dialogVisible.sync="drawer"
:withHeader="false"
title="权限分配"
@handleClose="handleDialogClose"
@handleConfirmClick="handleConfirmClick"
:size="'60%'"
>
<el-tabs v-model="activeName">
<el-tab-pane label="功能权限" name="first">
<el-table
border
ref="multipleTable"
:data="menuDatas"
row-key="id"
tooltip-effect="dark"
style="width: 100%"
:default-expand-all="true"
:default-checked-keys="keys"
@select-all="selectAll"
@select="handleSelectionChange"
v-loading="buttonLoading"
>
<el-table-column
type="selection"
width="45"
:reserve-selection="true"
></el-table-column>
<el-table-column
prop="name"
label="菜单名称"
width="200"
></el-table-column>
<el-table-column prop="buttonSelection" label="按钮">
<template slot-scope="scope">
<i
class="el-icon-star-on"
style="
height: 30px;
line-height: 30px;
font-size: 25px;
margin-right: 7px;
"
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="
height: 30px;
line-height: 30px;
font-size: 25px;
margin-right: 7px;
color: #808080;
"
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>
</template>
</el-table-column>
</el-table></el-tab-pane
>
<el-tab-pane label="数据权限" name="second">
<data-permissions ref="dataPermissions"></data-permissions>
</el-tab-pane>
<el-tab-pane label="首页拖拽权限" name="layOutAuth">
<layOutPermissions ref="layOutPermissions"></layOutPermissions>
</el-tab-pane>
</el-tabs>
</base-right-dialog>
</div>
</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";
export default {
data() {
return {
drawer: false,
multipleSelection: [],
keys: [],
isAllSelect: false,
selected: false,
childNode: false,
build: "",
activeName: "first",
dataPermissions: [],
buttonLoading: false,
};
},
props: {
menuData: {
type: Array,
default: () => {
return [];
},
},
},
components: {
baseRightDialog,
dataPermissions,
layOutPermissions,
},
beforeUpdate() {
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));
},
},
},
methods: {
// tab
handleTabClick() {
this.$nextTick(() => {
this.$refs.multipleTable && this.$refs.multipleTable.doLayout();
});
},
selectAllButton(item) {
let data = [];
item.buttons.forEach((el) => {
data.push(el.id);
});
item.buttonList = data;
},
cancellation(item) {
item.buttonList = [];
},
// /
selectAll() {
let data = this.treeToArray(this.menuDatas);
this.selected = !this.selected;
data.forEach((el, index) => {
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);
});
}
},
//
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);
}
});
this.menuDatas = this.addToButtonList(this.menuDatas, echo);
this.buttonLoading = false;
},
//
treeToArray(items) {
let children = [];
items.forEach((item) => {
children.push(item);
if (item.children) {
children = children.concat(this.treeToArray(item.children));
}
});
return children;
},
handleDialogClose() {
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;
},
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") {
this.handleDialogClose();
this.$message({
message: "保存成功",
type: "success",
});
}
},
//
addToButtonList(arr, newArr) {
newArr.forEach((newItem) => {
this.addToButtonListRecursive(
arr,
newItem.op_MenuID,
newItem.op_OperateKindList
);
});
return arr;
},
addToButtonListRecursive(arr, targetId, operateKindList) {
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
if (item.id == targetId) {
let lists = operateKindList.split(",");
lists.forEach((el) => {
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;
data.forEach((el) => {
el.buttonList = [];
el.type = false;
if (el.children != null && el.children && el.children.length) {
this.changeMenu(el.children, level);
}
});
},
toFlatArray(tree, parentId) {
return tree.reduce((t, _) => {
const child = _[children];
return [
...t,
parentId ? { ..._, parentId } : _,
...(child && child.length ? toFlatArray(child, _[id]) : []),
];
}, []);
},
getIds(flatArray) {
let ids = [nodeId];
let child = flatArray.find((_) => _[id] === nodeId);
while (child && child.parentId) {
ids = [child.parentId, ...ids];
child = flatArray.find((_) => _[id] === child.parentId);
}
return ids;
},
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;
if (data.children) {
const findChildren = this.treeFindPath(
data.children,
func,
field,
path
);
if (findChildren.length) return findChildren;
}
path.pop();
}
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;
}
</style>

View File

@ -1,120 +1,184 @@
// 表头配置 // 表头配置
const tableColumnJson = [{ const tableColumnJson = [
label: '所属部门', {
prop: 'o_OrganName', label: '所属部门',
tooltip: true, prop: 'organName',
}, tooltip: true,
{ },
label: '工号', {
prop: 'p_PersonCode', label: '工号',
tooltip: true, prop: 'personCode',
}, tooltip: true,
{ },
label: '姓名', {
prop: 'p_PersonName', label: '姓名',
tooltip: true, prop: 'personName',
}, tooltip: true,
{ },
label: '入职时间', {
prop: 'EntryTime', label: '入职时间',
tooltip: true, prop: 'entryTime',
}, tooltip: true,
},
// { // {
// label: '固定电话 ', // label: '固定电话 ',
// prop: 'p_MoiblePhone', // prop: 'p_MoiblePhone',
// tooltip: true, // tooltip: true,
// }, // },
// { // {
// label: '电子邮箱', // label: '电子邮箱',
// prop: 'p_Email', // prop: 'p_Email',
// tooltip: true, // tooltip: true,
// }, // },
{ {
label: '出生年月', label: '出生年月',
prop: 'p_BirthDay', prop: 'p_BirthDay',
tooltip: true, tooltip: true,
}, },
{ {
label: '是否用户分配', label: '是否用户分配',
prop: 'isuser', prop: 'isuser',
tooltip: true, tooltip: true,
width: 150 width:150
}, },
] ]
// 详情页面结构JSON // 详情页面结构JSON
const formRow = [{ const formRow = [{
elCol: [{ elCol: [{
label: '上级机构', label: '上级机构',
prop: 'upId', prop: 'parentOrganName',
tag: 'elTreeSelect', tag: 'elDialog',
options:[] disabled:true,
}] }
}, ]
{ },
elCol: [{ {
label: '机构名称', elCol: [{
prop: 'orgName', label: '机构名称',
tag: 'elInput', prop: 'organName',
}] tag: 'elInput',
}, }
{ ]
elCol: [{ },
label: '部门编码', {
prop: 'orgCode', elCol: [{
tag: 'elInput', label: '部门编码',
}] prop: 'organCode',
}, tag: 'elInput',
{ }
elCol: [{ ]
label: '类型', },
prop: 'orgType', {
tag: 'elRadio', elCol: [{
options: [{ label: '负责人',
label: '集团', prop: 'managerName',
value: '1' tag: 'elDialog',
}, { }
label: '公司', ]
value: '2' },
}, { {
label: '部门', elCol: [{
value: '3' label: '是否公司',
}] prop: 'company',
}] tag: 'elRadio',
}, options: [{
{ label: '是',
elCol: [{ value: "1"
label: '机构顺序', },{
prop: 'sorts', label: '否',
tag: 'elInputNumber', value: "0"
rules: true }
}] ]
}
]
},
{
elCol: [{
label: '是否启用',
prop: 'state',
tag: 'elRadio',
options: [{
label: '是',
value: "1"
},{
label: '否',
value: "0"
}
]
}
]
},
{
elCol: [{
label: '备注',
prop: 'remark',
tag: 'elInput',
type:'textarea',
span:24
}]
}, },
{ ]
elCol: [{ const roleOptions = [{
label: '等级', label: '超级管理员',
prop: 'lvl', value: 1
tag: 'elInput', },
disabled: true {
}] label: '业务员',
value: 2
}, },
{
label: '管理员',
value: 3
},
{
label: '开发成员',
value: 4
},
{
label: '项目经理',
value: 5
},
{
label: '实施人员',
value: 6
},
{
label: '财务',
value: 7
},
{
label: '总经理',
value: 8
},
{
label: '副总',
value: 9
}
] ]
const rules = { const rules = {
orgName: [{ villageId: [{
required: true, required: true,
message: '请输入机构名称', message: '请选择村/社区名称',
trigger: 'change' trigger: 'change'
}], }],
orgCode: [{ registerTime: [{
required: true, required: true,
message: '请输入机构编码', message: '请选择登记时间',
trigger: 'change' trigger: 'change'
}], }],
};
// 详情显示图片配置
const showImgJson = {
span: 24,
text: '现场照片',
field: 'photoUrls',
}; };
export default { export default {
formRow, showImgJson,
rules, formRow,
tableColumnJson rules,
tableColumnJson
} }

View File

@ -2,243 +2,310 @@
* @name: 组织机构 * @name: 组织机构
--> -->
<template> <template>
<div flex style="height: 100%"> <div style="height: 100%;">
<base-layout <div flex v-loading="windowLoading" style="height: 100%;">
:title="'组织机构'" <base-layout title="组织机构" style="width:260px;overflow: auto;" :bottonShow="false" :isPage="false"
style="width: 260px;" :operateButtonSwitch="false" :mainColor="mainColor">
:queryShow="false" <div slot="main" style="height: 100%;border-right: 1px solid #dfe6ec;overflow-y: auto;">
:searchShow="false" <base-tree ref="baseTree" :isCenter="false" :isSaveBtn="false" :Allshow="false" :showCheckbox="false"
:mainHight="`calc(100% - 58px)`" :menuData="menuData" @handleNodeClick="treeNodeClick"></base-tree>
>
<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"
:treeLoading="treeLoading"
:menuData="menuData"
@handleNodeClick="treeNodeClick"
:treeProps="treeProps"
></base-tree>
</div> </div>
</base-layout> </base-layout>
<base-layout <base-layout title="机构编辑区" :bottonShow="false" :isPage="false" :buttonList="buttonList" style="flex:1; "
title="机构编辑区" :defaultButtonSwitch="false" @onFuncBtn="getFuncBtn">
:bottonShow="false" <div slot="main" style="width: 100%;height: 100%; padding: 0 20px;">
:isPage="false" <base-form ref="customForm" :formRow="orangformRow" :isFunBtn="isFunBtn" @elDialogClick="elDialogClick"
:queryShow="false" class="form-control" @onSubmit="getSubmit" v-loading="formLoading">
:searchShow="false"
:buttonList="buttonList"
style="flex: 1"
:defaultButtonSwitch="false"
@onFuncBtn="getFuncBtn"
>
<div
slot="main"
style="width: 100%; height: auto !important; padding: 0 20px"
>
<base-form
ref="customForm"
:formRow="formRow"
:isFunBtn="isFunBtn"
:rules="rules"
class="form-control"
@onSubmit="getSubmit"
@resetForm="clearPage"
>
</base-form> </base-form>
</div> </div>
</base-layout> </base-layout>
</div> </div>
<!-- 机构选择 -->
<base-organization ref="baseOrganization" :dialogVisible="organizationDialog" :menuData="menuData"
@handleConfirmClick="handleConfirmClick"></base-organization>
<!-- 负责人 -->
<base-person ref="basePerson" :menuData="menuData" :tableColumn="tableColumn"
@personConfirmClick="personConfirmClick"></base-person>
</div>
</template> </template>
<script> <script>
import { authApi } from "@/api/apis/auth";
import baseLayout from "@/components/base/baseLayout"; import baseLayout from "@/components/base/baseLayout";
import baseTable from "@/components/base/baseTable"; import baseTable from "@/components/base/baseTable";
import baseForm from "@/components/base/baseNewForm/index.vue"; import baseForm from "@/components/base/baseNewForm/index.vue";
import baseDialog from "@/components/base/BaseNewDialog/index.vue";
import baseTree from "@/components/base/BaseMenuTree/index.vue"; import baseTree from "@/components/base/BaseMenuTree/index.vue";
import baseOrganization from "@/components/base/baseOrganization/index.vue";
import basePerson from "@/components/base/basePerson/index.vue";
import configData from "./configData"; import configData from "./configData";
import { authApi } from "@/api/apis/auth"; import { getCompanyId } from '@/utils/auth'
import {
GetOrganTree,
OrganGetBillData,
OrganSaveData,
OrganDelData
} from '@/api/apis/organization'
import {
PersonList
} from '@/api/apis/personnelSettings'
export default { export default {
name: "organization", name: 'organization',
components: { components: {
baseLayout, baseLayout,
baseTree, baseTree,
baseForm, baseForm,
baseDialog,
baseTable, baseTable,
baseOrganization,
basePerson
}, },
data() { data() {
return { return {
treeProps: { radioIndex: false,
children: "children", windowLoading: false,
label: "orgName", formLoading: false,
selectForm: {
P_PersonName: '',
P_PersonID: ''
}, },
buttonList: [ theme: '',
{ personLoading: false, //
icon: "el-icon-plus", // topmainHight: 'calc(100% - 41px)', //
menuName: "新增子节点", orangMainHight: 'calc(100% - 38px)', //
}, orangHight: 'calc(100% - 38px)', //
{ organizationDialog: false, //
type: "danger", mainColor: '#f8f8f8 ', //
menuName: "删除", buttonList: [{
icon: "el-icon-delete", 'icon': 'el-icon-plus',
}, 'menuName': '新增根节点'
], // }, {
'icon': 'el-icon-plus',
'menuName': '新增子节点'
}, {
'type': 'danger',
'menuName': '删除',
'icon': 'el-icon-delete'
},], //
menuData: [], // menuData: [], //
formRow: configData.formRow, // ruleForm: {}, //
orangformRow: configData.formRow, //
isFunBtn: true, isFunBtn: true,
organizationForm: {},
// //
delId: null, delId: '',
orgForm: "", delData: []
rules: configData.rules, }
treeLoading: false, },
}; watch: {
}, },
watch: {},
computed: { computed: {
// //
tableColumn() { tableColumn() {
return configData.tableColumnJson; return configData.tableColumnJson
}, },
}, },
mounted() { mounted() {
this.initPage(); this.initPage()
}, },
methods: { methods: {
//
radioChange(val) {
this.radioIndex = val.index
this.selectForm.P_PersonName = val.P_PersonName
this.selectForm.P_PersonID = val.P_PersonID
},
// //
initPage() { initPage() {
this.delId = null; this.delId = ""
this.getMenuData(); this.windowLoading = true
this.$nextTick(() => {
this.resetForm();
});
},
resetForm() {
this.$refs.customForm.resetFields();
this.$refs.customForm.getField("lvl", 0);
this.$refs.customForm.getField("sorts", 0);
this.$refs.customForm.getField("upId", null);
this.$refs.customForm.getField("orgType", "1");
},
clearPage() {
this.$nextTick(() => {
this.delId = null;
this.orgForm = "";
this.$refs.baseTree.setCurrentKey(null);
this.$refs.customForm.resetFields();
this.$refs.customForm.getField("lvl", 0);
this.$refs.customForm.getField("sorts", 0);
this.$refs.customForm.getField("upId", null);
this.$refs.customForm.getField("orgType", "1");
});
},
//
async getMenuData() {
this.treeLoading = true;
setTimeout(() => { setTimeout(() => {
this.treeLoading = false; this.windowLoading = false
}, 10000); }, 3000)
let res = await authApi("orgService", "org", "queryTree"); // this.$nextTick(() => {
if (res.status == "200") { // this.$refs.customForm.resetForm('ruleForm')
this.treeLoading = false; // })
this.menuData = res.attribute; this.getMenuData()
this.formRow[0].elCol[0].options = res.attribute;
}
}, },
// //
async getDetail(id) { treeClick(data) {
this.openLoading("detail"); this.pageModel.departmentID = data.id
this.radioIndex = false
},
async getMenuData() {
this.$refs.baseTree.treeLoading = true
setTimeout(() => {
this.$refs.baseTree.treeLoading = false
}, 3000)
let params = { let params = {
id: id, // CompanyID: "46"
}; // CompanyID: this.$store.state.user.companyID ? this.$store.state.user.companyID : getCompanyId()
let res = await authApi("orgService", "org", "queryEntity", "", params); }
let res = await authApi("sysOrganService","","queryEntityTree","",{})
console.log(res,'res')
this.menuData = res.attribute
this.$refs.baseTree.treeLoading = false
this.windowLoading = false
},
async getInfo(id) {
this.formLoading = true
setTimeout(() => {
this.formLoading = false
}, 3000)
let params = {
id: id
}
let res = await authApi("sysOrganService","","getEntity","",params)
this.ruleForm = res.attribute
this.ruleForm.parentOrganName = res.attribute.parentOrganName
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.customForm.choiceAssignment(res.attribute); this.$refs.customForm.choiceAssignment(this.ruleForm)
this.orgForm = res.attribute; this.formLoading = false
}); })
},
//
elDialogClick(row, index, indexRow) {
this.organizationForm = {
// o_OrganCode: '',
// O_OrganID: '',
// ParentOrganName: '',
// O_ParentOrganID: '',
// ParentOrgainName: '',
}
if (row.label == '上级机构') {
// this.organizationDialog = true
this.$refs.baseOrganization.dialogVisible = true
}
if (row.label == '负责人') {
this.$refs.basePerson.personDialog = true
}
}, },
// //
treeNodeClick(data) { treeNodeClick(data) {
this.delId = data.id; this.getInfo(data.id)
this.orgForm = data; this.delId = data.id
this.getDetail(data.id); // this.$refs.customForm.getField(data)
}, },
getSubmit(data) { getSubmit(data) {
async function submitForm(delId) { let params = {
let params = { ...data
...data,
label: data.orgName,
};
let res = await authApi(
"orgService",
"org",
delId ? "updateEntity" : "addEntity",
"",
params
);
return res;
} }
this.$refs.customForm.$refs["ruleForm"].validate((valid) => { params.o_OrganID = params.o_OrganID ? params.o_OrganID : 0
if (!valid) { params.o_ParentOrganID = params.o_ParentOrganID ? params.o_ParentOrganID : 0
return; this.savaData(params)
} else { },
submitForm(this.delId).then((res) => { async savaData(params) {
if (res.status == "200") { let res
this.$vmNews("保存成功", "success"); console.log(params)
this.getMenuData(); if(params.id){
this.clearPage(); res = await authApi("sysOrganService","","updateEntity","",params)
} }else{
}); res = await authApi("sysOrganService","","saveEntity","",params)
}
if (res.status == 200) {
this.$vmNews('保存成功!', 'success')
this.$nextTick(() => {
this.$refs.customForm.resetForm('ruleForm')
})
this.initPage()
}
},
personConfirmClick(val) {
if (JSON.stringify(val) == "{}") {
this.$vmNews('请选择人员信息!')
return
}
this.$refs.customForm.getField('managerName', val.personName)
this.$refs.customForm.getField('managerId', val.id)
this.$refs.basePerson.personDialog = false
},
handleConfirmClick(val) {
this.$nextTick(() => {
this.$refs.customForm.getField('parentOrgainName', val.label)
this.$refs.customForm.getField('o_ParentOrganID', val.id)
})
this.$refs.baseOrganization.dialogVisible = false
},
getDelData(data) {
let delD = []
data.forEach(el => {
if (this.delId == el.id) {
this.delData = el
} }
}); if (el.children != null && el.children && el.children.length) {
this.getDelData(el.children)
}
})
return this.delData
}, },
async OrganDel() { async OrganDel() {
let params = { let params = {
id: this.delId, id: this.delId
}; }
let res = await authApi("orgService", "org", "delectEntity", "", params); this.delData = []
if (res.status == "200") { this.getDelData(this.menuData)
this.$vmNews("删除成功", "success"); if (this.delData.children != null && this.delData.children && this.delData.children.length > 0) {
this.getMenuData(); this.$vmNews('存在子节点,不可以删除', 'error')
this.clearPage(); return
}
let res = await authApi("sysOrganService","","deleteEntity","",params)
if (res.status == 200) {
this.$vmNews('删除成功', 'success')
this.initPage()
this.$nextTick(() => {
this.$refs.customForm.resetForm('ruleForm')
})
} }
}, },
// //
getFuncBtn(btnEven) { getFuncBtn(btnEven) {
if (!this.delId || this.orgForm == "") { if (!this.delId && btnEven.menuName != '新增根节点') {
this.$vmNews("请选择组织机构!"); this.$vmNews('请选择需要处理的信息!')
return; return
} }
if (btnEven.menuName === "新增子节点") { if (btnEven.menuName === '新增根节点') { //
// let newRuleForm = {
parentOrganName: "",
parentOrganId: 0
}
this.$nextTick(() => { this.$nextTick(() => {
this.resetForm(); this.$refs.customForm.resetForm('ruleForm')
this.$refs.customForm.getField("upId", this.orgForm.id); this.$refs.customForm.choiceAssignment(newRuleForm)
this.$refs.customForm.getField( })
"lvl", }
JSON.parse(this.orgForm.lvl) + 1 if (btnEven.menuName === '新增子节点') { //
); let newRuleForm = {
this.delId = null; parentOrganName: this.ruleForm.organName,
parentOrganId: this.ruleForm.id,
}
this.$nextTick(() => {
this.$refs.customForm.resetForm('ruleForm')
this.$refs.customForm.choiceAssignment(newRuleForm)
})
}
if (btnEven.menuName === '删除') { //
this.$confirm('确认删除该组织吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.OrganDel()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
}); });
} }
if (btnEven.menuName === "删除") { }
//
this.$delConfirm().then(() => {
this.OrganDel();
});
}
},
}, },
}; }
</script> </script>
<style lang="scss"> <style lang="scss">
$activeColor: var(--bg-color, yellow); $activeColor: var(--bg-color, yellow);
@ -249,19 +316,21 @@ $activeColor: var(--bg-color, yellow);
background-color: $activeColor !important; background-color: $activeColor !important;
} }
.el-tree-node:focus > .el-tree-node__content { .el-tree-node:focus>.el-tree-node__content {
color: white; color: white;
background-color: $activeColor !important; background-color: $activeColor !important;
} }
.el-tree-node.is-current > .el-tree-node__content { .el-tree-node.is-current>.el-tree-node__content {
color: white; color: white;
background-color: $activeColor !important; background-color: $activeColor !important;
} }
</style> </style>
<style scoped lang="scss"> <style scoped lang="scss">
$activeColor: var(--bg-color, yellow); $activeColor: var(--bg-color, yellow);
::v-deep .baseNewFormBox{
border:0px !important;
}
.content { .content {
--font-color: red; --font-color: red;
width: 100%; width: 100%;
@ -272,6 +341,7 @@ $activeColor: var(--bg-color, yellow);
background-color: white; background-color: white;
color: var(--font-color); color: var(--font-color);
} }
} }
.form-control { .form-control {

View File

@ -12,31 +12,26 @@ const fucDataJson = [{
] ]
// 表头配置 // 表头配置
const tableColumnJson = [ const tableColumnJson = [
{ {
label: '所属部门', label: '所属部门',
prop: 'o_OrganName', prop: 'organName',
tooltip: true, tooltip: true,
}, },
{ {
label: '工号', label: '工号',
prop: 'p_PersonCode', prop: 'personCode',
tooltip: true, tooltip: true,
// other: { },
// color: '#4C9CFF', {
// isClick: true label: '姓名',
// } prop: 'personName',
}, tooltip: true,
{ },
label: '姓名', {
prop: 'p_PersonName', label: '入职时间',
prop: 'entryTime',
tooltip: true, tooltip: true,
}, },
{
label: '入职时间',
prop: 'p_EntryTime',
tooltip: true,
},
// { // {
// label: '离职时间', // label: '离职时间',
// prop: 'number', // prop: 'number',
@ -69,7 +64,7 @@ const tableColumnJson = [
// }, // },
{ {
label: '固定电话 ', label: '固定电话 ',
prop: 'p_MoiblePhone', prop: 'telPhone',
tooltip: true, tooltip: true,
}, },
// { // {
@ -84,17 +79,12 @@ const tableColumnJson = [
// }, // },
{ {
label: '电子邮箱', label: '电子邮箱',
prop: 'p_Email', prop: 'email',
tooltip: true, tooltip: true,
}, },
{ {
label: '出生年月', label: '出生年月',
prop: 'p_BirthDay', prop: 'birthDay',
tooltip: true,
},
{
label: '是否用户分配',
prop: 'isuser',
tooltip: true, tooltip: true,
}, },
@ -103,12 +93,12 @@ const tableColumnJson = [
const formRow = [{ const formRow = [{
elCol: [{ elCol: [{
label: '工号', label: '工号',
prop: 'p_PersonCode', prop: 'personCode',
tag: 'elInput', tag: 'elInput',
}, },
{ {
label: '姓名', label: '姓名',
prop: 'p_PersonName', prop: 'personName',
tag: 'elInput', tag: 'elInput',
}, },
] ]
@ -116,12 +106,12 @@ const formRow = [{
{ {
elCol: [{ elCol: [{
label: '部门', label: '部门',
prop: 'o_OrganName', prop: 'organName',
tag: 'elDialog' tag: 'elDialog'
}, },
{ {
label: '手机号', label: '手机号',
prop: 'p_Telphone', prop: 'mobilePhone',
tag: 'elInput', tag: 'elInput',
rules:true, rules:true,
rulesName:'phone' rulesName:'phone'
@ -131,7 +121,7 @@ const formRow = [{
{ {
elCol: [{ elCol: [{
label: '性别', label: '性别',
prop: 'p_Sex', prop: 'sex',
tag: 'elRadio', tag: 'elRadio',
options: [{ options: [{
label: '男', label: '男',
@ -144,7 +134,7 @@ const formRow = [{
}, },
{ {
label: '学历', label: '学历',
prop: 'p_DegreeID', prop: '`degreeId`',
tag: 'elSelect', tag: 'elSelect',
options: [] options: []
}, },
@ -153,14 +143,15 @@ const formRow = [{
{ {
elCol: [{ elCol: [{
label: '职务', label: '职务',
prop: 'p_PostID', prop: '`postId`',
tag: 'elSelect', tag: 'elSelect',
options: [ options: [
] ]
}, },
{ {
label: '级别', label: '级别',
prop: 'p_LevelID', prop: '`levelId`',
tag: 'elSelect', tag: 'elSelect',
options: [], options: [],
}, },
@ -169,13 +160,13 @@ const formRow = [{
{ {
elCol: [{ elCol: [{
label: '生日', label: '生日',
prop: 'p_BirthDay', prop: 'birthDay',
tag: 'elDatePicker', tag: 'elDatePicker',
placeholder:'请点击选择', placeholder:'请点击选择',
// type:'date' // type:'date'
},{ },{
label: '入职时间', label: '入职时间',
prop: 'p_EntryTime', prop: '`entryTime`',
tag: 'elDatePicker', tag: 'elDatePicker',
placeholder:'请点击选择', placeholder:'请点击选择',
// type:'date' // type:'date'
@ -186,7 +177,7 @@ const formRow = [{
elCol: [ elCol: [
{ {
label: '固定电话', label: '固定电话',
prop: 'p_MoiblePhone', prop: '`telPhone`',
tag: 'elInput' tag: 'elInput'
}, },
// { // {
@ -199,23 +190,17 @@ const formRow = [{
{ {
elCol: [{ elCol: [{
label: '电子邮箱', label: '电子邮箱',
prop: 'p_Email', prop: 'email',
tag: 'elInput', tag: 'elInput',
// rules:true, // rules:true,
// rulesName:'eMail' // rulesName:'eMail'
}, },
{
label: '序号',
prop: 'p_Sort',
tag: 'elInput',
type:'number'
},
] ]
}, },
{ {
elCol: [{ elCol: [{
label: '备注', label: '备注',
prop: 'p_Remark', prop: 'remark',
tag: 'elInput', tag: 'elInput',
type: 'textarea', type: 'textarea',
span:24 span:24
@ -262,32 +247,32 @@ const roleOptions = [{
} }
] ]
const userRules = { const userRules = {
p_PersonCode: [{ personCode: [{
required: true, required: true,
message: '请输入工号', message: '请输入工号',
trigger: 'change' trigger: 'change'
}], }],
p_PersonName: [{ personName: [{
required: true, required: true,
message: '请输入姓名', message: '请输入姓名',
trigger: 'change' trigger: 'change'
}], }],
orgainName: [{ organName: [{
required: true, required: true,
message: '请选择组织', message: '请选择组织',
trigger: 'change' trigger: 'change'
}], }],
p_Telphone: [{ mobilePhone: [{
required: true, required: true,
message: '请输入手机号码', message: '请输入手机号码',
trigger: 'change' trigger: 'change'
}], }],
p_Sex: [{ sex: [{
required: true, required: true,
message: '请选择性别', message: '请选择性别',
trigger: 'change' trigger: 'change'
}], }],
p_Email: [{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }], email: [{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }],
}; };
export default { export default {

View File

@ -4,67 +4,67 @@
--> -->
<template> <template>
<div> <div>
<!-- 人员弹窗 --> <!-- 人员弹窗 -->
<base-dialog :closeEscape="true" :showClose="true" :closeModal="false" :dialogVisible.sync="addDialog" <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" <base-form ref="customForm" :formRow="formRow" :isFunBtn="isFunBtn" @elDialogClick="organClick"
:rules="userRules" @onSubmit="getSubmit"> :rules="userRules" @onSubmit="getSubmit">
</base-form> </base-form>
</base-dialog> </base-dialog>
<div flex style="height: 100%;"> <div flex style="height: 100%;">
<base-layout title="组织机构" style="width:260px;" :defaultButtonSwitch="false" :isPage="false" <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;"> <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" <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> </div>
</base-layout> </base-layout>
<base-layout title="人员信息" ref="personLayout" @pageChange="pageChange" :buttonList="buttonList" <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%;"> <div slot="main" slot-scope="{ tableHeight }" style="height: 100%;">
<base-table ref="personCustomtable" :border="true" :showIndex="false" :tabLoading.sync="tabLoading" <base-table ref="personCustomtable" :border="true" :showIndex="false" :tabLoading.sync="tabLoading"
@radioChange="radioChange" :tableHeight="tableHeight" :tableData="tableData" @radioChange="radioChange" :tableHeight="tableHeight" :tableData="tableData"
:tableColumn="tableColumn" :slotrow="true"> :tableColumn="tableColumn" :slotrow="true">
<!-- 入职时间 --> <!-- 入职时间 -->
<template v-slot:p_EntryTime="{ row }"> <template v-slot:p_EntryTime="{ row }">
<span>{{ row.row.p_EntryTime | timeDate }}</span> <span>{{ row.row.p_EntryTime | timeDate }}</span>
</template> </template>
<!-- 生日 --> <!-- 生日 -->
<template v-slot:p_BirthDay="{ row }"> <template v-slot:p_BirthDay="{ row }">
<span>{{ row.row.p_BirthDay | timeDate }}</span> <span>{{ row.row.p_BirthDay | timeDate }}</span>
</template> </template>
</base-table> </base-table>
</div> </div>
</base-layout> </base-layout>
</div> </div>
<!-- 部门+对外签订弹窗 --> <!-- 部门+对外签订弹窗 -->
<base-organization ref="baseOrganization" :menuData="menuData" <base-organization ref="baseOrganization" :menuData="menuData"
@handleConfirmClick="organizationHandleConfirm"></base-organization> @handleConfirmClick="organizationHandleConfirm"></base-organization>
<!-- <base-dialog :closeEscape="true" :showClose="true" :closeModal="false" <!-- <base-dialog :closeEscape="true" :showClose="true" :closeModal="false"
@handleConfirmClick="organizationHandleConfirm" :dialogVisible.sync="organizationDialog" class="userDialog" @handleConfirmClick="organizationHandleConfirm" :dialogVisible.sync="organizationDialog" class="userDialog"
title="选择组织机构" width="700px" top="10vh" :footerShow="true"> title="选择组织机构" width="700px" top="10vh" :footerShow="true">
<div class="organizationBody"> <div class="organizationBody">
<base-layout title="组织机构" style="width: 45%;border-radius: 5px;height: 350px;overflow: auto;" <base-layout title="组织机构" style="width: 45%;border-radius: 5px;height: 350px;overflow: auto;"
:bottonShow="false" :isPage="false" :mainColor="mainColor" :mainHight='orangHight'> :bottonShow="false" :isPage="false" :mainColor="mainColor" :mainHight='orangHight'>
<div slot="main"> <div slot="main">
<base-tree ref="baseTree" :isCenter="false" :isSaveBtn="false" :Allshow="false" <base-tree ref="baseTree" :isCenter="false" :isSaveBtn="false" :Allshow="false"
:showCheckbox="false" :menuData="menuData" @handleNodeClick="orangNodeClick"> :showCheckbox="false" :menuData="menuData" @handleNodeClick="orangNodeClick">
</base-tree> </base-tree>
</div> </div>
</base-layout> </base-layout>
<base-layout title="选中机构" style="width: 45%;border-radius: 5px;height: 350px;" :bottonShow="false" <base-layout title="选中机构" style="width: 45%;border-radius: 5px;height: 350px;" :bottonShow="false"
:isPage="false" :bodyHight="treeHight"> :isPage="false" :bodyHight="treeHight">
<div slot="main" style="padding: 10px;"> <div slot="main" style="padding: 10px;">
<div flex="cross:center" style="margin-bottom: 10px;"> <div flex="cross:center" style="margin-bottom: 10px;">
<label style="width: 35%;">机构编码</label> <label style="width: 35%;">机构编码</label>
<el-input style="flex:1" v-model="organizationForm.code"></el-input> <el-input style="flex:1" v-model="organizationForm.code"></el-input>
</div> </div>
<div flex="cross:center"> <div flex="cross:center">
<label style="width: 35%;">机构名称</label> <label style="width: 35%;">机构名称</label>
<el-input style="flex:1" v-model="organizationForm.ParentOrganName"></el-input></div></div></base-layout></div></base-dialog> --> <el-input style="flex:1" v-model="organizationForm.ParentOrganName"></el-input></div></div></base-layout></div></base-dialog> -->
</div> </div>
</template> </template>
<script> <script>
@ -77,428 +77,430 @@ import baseTree from "@/components/base/BaseMenuTree/index.vue";
import baseOrganization from "@/components/base/baseOrganization/index.vue"; import baseOrganization from "@/components/base/baseOrganization/index.vue";
import { getCompanyId } from '@/utils/auth' import { getCompanyId } from '@/utils/auth'
import { import {
PersonList, PersonList,
PersonDetail, PersonDetail,
PersonSaveData, PersonSaveData,
PersonDelData, PersonDelData,
PersonOpen, PersonOpen,
PersonClose PersonClose
} from '@/api/apis/personnelSettings' } from '@/api/apis/personnelSettings'
import { import {
GetOrganTree GetOrganTree
} from '@/api/apis/organization' } from '@/api/apis/organization'
import { import {
dataDictionaryGetBillList dataDictionaryGetBillList
} from '@/api/apis/dataDictionary' } from '@/api/apis/dataDictionary'
import configData from "./configData"; import configData from "./configData";
import { authApi } from '@/api/apis/auth'
export default { export default {
name: "review", name: "review",
components: { components: {
baseLayout, baseLayout,
baseTable, baseTable,
baseDialog, baseDialog,
baseForm, baseForm,
baseTree, baseTree,
baseOrganization baseOrganization
}, },
data() { data() {
return { return {
treeLoading: false, treeLoading: false,
radioIndex: false, radioIndex: false,
radioId: false, radioId: false,
treeHight: '350px', treeHight: '350px',
orangHight: 'calc(100% - 39px)', orangHight: 'calc(100% - 39px)',
mainColor: '#f8f8f8 ', mainColor: '#f8f8f8 ',
organizationDialog: false, // organizationDialog: false, //
menuData: [], menuData: [],
buttonList: [ buttonList: [
{ {
icon: 'button_reset', icon: 'button_reset',
menuName: '启用', menuName: '启用',
}, },
{ {
icon: 'button_reset', icon: 'button_reset',
menuName: '停用', menuName: '停用',
type: 'danger' type: 'danger'
}, },
], ],
tabLoading: false, tabLoading: false,
tableData: [], tableData: [],
// //
searchModel: configData.searchModelJson, searchModel: configData.searchModelJson,
// //
param: {}, param: {},
addDialog: false, addDialog: false,
ruleForm: { ruleForm: {
roleName: null, // roleName: null, //
roleNumber: null, // roleNumber: null, //
order: null, // order: null, //
describe: null, // describe: null, //
}, },
roleOptions: configData.roleOptions, roleOptions: configData.roleOptions,
formRow: configData.formRow, formRow: configData.formRow,
userRules: configData.userRules, userRules: configData.userRules,
isFunBtn: true, isFunBtn: true,
pageModel: { pageModel: {
page: 1, pageNum: 1,
limit: 20, pageSize: 999,
departmentID: "", organId: '',
Sequence: '', Sequence: '',
SequenceName: '' SequenceName: ''
}, },
P_PersonID: 0, P_PersonID: 0,
organizationForm: {} organizationForm: {}
} }
}, },
computed: { computed: {
// //
tableColumn() { tableColumn() {
return configData.tableColumnJson return configData.tableColumnJson
}, },
}, },
watch: { watch: {
addDialog: { addDialog: {
deep: true, deep: true,
handler(newValue, oldValue) { handler(newValue, oldValue) {
if (newValue == false) { if (newValue == false) {
this.$refs.customForm.choiceAssignment({}) this.$refs.customForm.choiceAssignment({})
} else { } else {
this.getLevelnList() this.getLevelnList()
this.getEducationList() this.getEducationList()
this.getPostList() this.getPostList()
} }
} }
} }
}, },
created() { }, created() { },
onShow() { }, onShow() { },
mounted() { mounted() {
this.initPage() this.initPage()
}, },
filters: { filters: {
timeDate(row) { timeDate(row) {
if (!row) { if (!row) {
return return
} }
return row.split('T')[0] return row.split('T')[0]
} }
}, },
methods: { methods: {
// //
radioChange(val) { radioChange(val) {
this.radioIndex = val.index this.radioIndex = val.index
this.radioId = val.p_PersonID this.radioId = val.id
}, },
// //
treeClick(data) { treeClick(data) {
this.pageModel.departmentID = data.id this.pageModel.organId = data.id
this.radioIndex = false this.radioIndex = false
this.radioId = false this.radioId = false
this.resetTable() this.resetTable()
}, },
// //
initPage() { initPage() {
// this.getTableList() // this.getTableList()
this.getTreeList() this.getTreeList()
}, },
// //
async getTreeList() { async getTreeList() {
this.treeLoading = true this.treeLoading = true
setTimeout(() => { setTimeout(() => {
this.treeLoading = false this.treeLoading = false
}, 180000) }, 180000)
let params = { let params = {
CompanyID: "" state: 0,
// CompanyID: this.$store.state.user.companyID?this.$store.state.user.companyID:getCompanyId() // CompanyID: this.$store.state.user.companyID?this.$store.state.user.companyID:getCompanyId()
} }
let res = await GetOrganTree(params) let res = await authApi("sysOrganService","","queryEntityTree","",{})
if (res.success === 'true') { if (res.status == 200) {
this.menuData = JSON.parse(res.data[0]) this.menuData = res.attribute
this.treeLoading = false this.treeLoading = false
} }
}, },
// //
async tableDelData(id) { async tableDelData(id) {
let params = { let params = {
id: id id: id
} }
let res = await PersonDelData(params) let res = await PersonDelData(params)
if (res.code == 1) { if (res.code == 1) {
this.$vmNews('删除成功', 'success') this.$vmNews('删除成功', 'success')
this.resetTable() this.resetTable()
// this.pageModel.page = 1 // this.pageModel.page = 1
// this.$refs.personLayout.setPageNum(1) // this.$refs.personLayout.setPageNum(1)
} }
}, },
// //
async getDetail(id) { async getDetail(id) {
let params = { let params = {
id: id id: id
} }
let res = await PersonDetail(params) let res = await authApi('sysPersonService',"","getEntity","",params)
res.data[0].o_OrganName = res.data[0].orgainName console.log(res,'res')
this.addDialog = true // res.data[0].o_OrganName = res.data[0].orgainName
this.$nextTick(() => { this.addDialog = true
this.$refs.customForm.choiceAssignment(res.data[0]) this.$nextTick(() => {
}) this.$refs.customForm.choiceAssignment(res.attribute)
}, })
// },
async getEducationList() { //
let params = { async getEducationList() {
KindId: 3, let params = {
page: 1, KindId: 3,
limit: 999, page: 1,
Sequence: '', limit: 999,
SequenceName: '' Sequence: '',
} SequenceName: ''
let res = await dataDictionaryGetBillList(params) }
if (res.code == 1) { let res = await dataDictionaryGetBillList(params)
let arrList = [] if (res.code == 1) {
if (res.data[0] > 0) { let arrList = []
res.data[1].forEach(el => { if (res.data[0] > 0) {
let arr = { res.data[1].forEach(el => {
label: el.ddd_DicDetailsName, let arr = {
value: el.ddd_DicDetailsID label: el.ddd_DicDetailsName,
} value: el.ddd_DicDetailsID
arrList.push(arr) }
}) arrList.push(arr)
} })
configData.formRow[2].elCol[1].options = arrList }
} configData.formRow[2].elCol[1].options = arrList
}, }
// },
async getPostList() { //
let params = { async getPostList() {
KindId: 1, let params = {
page: 1, KindId: 1,
limit: 999, page: 1,
Sequence: '', limit: 999,
SequenceName: '' Sequence: '',
} SequenceName: ''
let res = await dataDictionaryGetBillList(params) }
if (res.code == 1) { let res = await dataDictionaryGetBillList(params)
let arrList = [] if (res.code == 1) {
if (res.data[0] > 0) { let arrList = []
res.data[1].forEach(el => { if (res.data[0] > 0) {
let arr = { res.data[1].forEach(el => {
label: el.ddd_DicDetailsName, let arr = {
value: el.ddd_DicDetailsID label: el.ddd_DicDetailsName,
} value: el.ddd_DicDetailsID
arrList.push(arr) }
}) arrList.push(arr)
} })
configData.formRow[3].elCol[0].options = arrList }
} configData.formRow[3].elCol[0].options = arrList
}, }
// },
async getLevelnList() { //
let params = { async getLevelnList() {
KindId: 2, let params = {
page: 1, KindId: 2,
limit: 999, page: 1,
Sequence: '', limit: 999,
SequenceName: '' Sequence: '',
} SequenceName: ''
let res = await dataDictionaryGetBillList(params) }
if (res.code == 1) { let res = await dataDictionaryGetBillList(params)
let arrList = [] if (res.code == 1) {
if (res.data[0] > 0) { let arrList = []
res.data[1].forEach(el => { if (res.data[0] > 0) {
let arr = { res.data[1].forEach(el => {
label: el.ddd_DicDetailsName, let arr = {
value: el.ddd_DicDetailsID label: el.ddd_DicDetailsName,
} value: el.ddd_DicDetailsID
arrList.push(arr) }
}) arrList.push(arr)
} })
configData.formRow[3].elCol[1].options = arrList }
} configData.formRow[3].elCol[1].options = arrList
}, }
// },
async getTableList() { //
this.tabLoading = true async getTableList() {
this.tableData = [] this.tabLoading = true
this.$refs.personCustomtable.clearRadioIndex() this.tableData = []
let params = { this.$refs.personCustomtable.clearRadioIndex()
...this.pageModel let params = {
} ...this.pageModel
let res = await PersonList(params) }
if (res.code === 1) { let res = await authApi("sysPersonService","","queryEntityPage","",params)
this.tableData = res.data[1] if (res.status == 200) {
this.$refs.personCustomtable.clearRadioIndex() console.log(res.attribute,'res.attribute',res)
this.tableData = res.attribute.list;
this.$refs.personCustomtable.clearRadioIndex()
this.$refs.personLayout.setPageTotal(res.data[0]) this.$refs.personLayout.setPageTotal(res.attribute.total)
} }
this.tabLoading = false this.tabLoading = false
}, },
// //
async closeDelData(id) { async closeDelData(id) {
let params = { let params = {
id: id id: id,
} "state": "1"
let res = await PersonClose(params) }
if (res.code == 1) { let res = await authApi("sysPersonService","","enableDisableEntity","",params)
this.$vmNews('已停用', 'success') if (res.status == 200) {
this.resetTable() this.$vmNews('已停用', 'success')
} this.resetTable()
}, }
// },
async openDelData(id) { //
let params = { async openDelData(id) {
id: id let params = {
} id: id,
let res = await PersonOpen(params) "state": "0"
if (res.code == 1) { }
this.$vmNews('已启用', 'success') let res = await authApi("sysPersonService","","enableDisableEntity","",params)
this.resetTable() if (res.status == 200) {
} this.$vmNews('已启用', 'success')
}, this.resetTable()
// }
getFuncBtn(btnEven) { },
if (btnEven.menuName === '新增') { // //
this.addDialog = true getFuncBtn(btnEven) {
this.P_PersonID = 0 if (btnEven.menuName === '新增') { //
// this.$nextTick(()=>{ this.addDialog = true
// this.$refs.customForm.resetForm('ruleForm') this.P_PersonID = 0
// }) // this.$nextTick(()=>{
} else { // this.$refs.customForm.resetForm('ruleForm')
if (!this.judgeCheckbox()) { // })
return } else {
} if (!this.judgeCheckbox()) {
} return
if (btnEven.menuName === '编辑') { // }
// if (!this.judgeCheckbox()) { }
// return if (btnEven.menuName === '编辑') { //
// } // if (!this.judgeCheckbox()) {
this.P_PersonID = this.radioId // return
this.getDetail(this.radioId) // }
} this.P_PersonID = this.radioId
if (btnEven.menuName === '删除') { // this.getDetail(this.radioId)
// if (!this.judgeCheckbox()) { }
// return if (btnEven.menuName === '删除') { //
// } // if (!this.judgeCheckbox()) {
this.$confirm('确认删除吗?', '提示', { // return
confirmButtonText: '确定', // }
cancelButtonText: '取消', this.$confirm('确认删除吗?', '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.tableDelData(this.radioId) type: 'warning'
}).catch(() => { }).then(() => {
this.$message({ this.tableDelData(this.radioId)
type: 'info', }).catch(() => {
message: '已取消删除' this.$message({
}); type: 'info',
}); message: '已取消删除'
} });
if (btnEven.menuName === '停用') { // });
// if (!this.judgeCheckbox()) { }
// return if (btnEven.menuName === '停用') { //
// } // if (!this.judgeCheckbox()) {
this.$confirm('确认停用吗?', '提示', { // return
confirmButtonText: '确定', // }
cancelButtonText: '取消', this.$confirm('确认停用吗?', '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.closeDelData(this.radioId) type: 'warning'
}).catch(() => { }).then(() => {
this.$message({ this.closeDelData(this.radioId)
type: 'info', }).catch(() => {
message: '已取消删除' this.$message({
}); type: 'info',
}); message: '已取消删除'
} });
if (btnEven.menuName === '启用') { // });
}
if (btnEven.menuName === '启用') { //
// if (!this.judgeCheckbox()) { // if (!this.judgeCheckbox()) {
// return // return
// } // }
this.$confirm('确认启用吗?', '提示', { this.$confirm('确认启用吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.openDelData(this.radioId) this.openDelData(this.radioId)
}).catch(() => { }).catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消删除' message: '已取消删除'
}); });
}); });
} }
}, },
judgeCheckbox() { judgeCheckbox() {
if (this.radioIndex === false) { if (this.radioIndex === false) {
this.$vmNews('请勾选需要处理的信息!') this.$vmNews('请勾选需要处理的信息!')
return false return false
} }
return true return true
}, },
// //
pageChange(model) { pageChange(model) {
this.pageModel.limit = model.limit this.pageModel.pageSize = model.limit
this.pageModel.page = model.page this.pageModel.pageNum = model.page
this.getTableList() this.getTableList()
}, },
async getSubmit(data) { async getSubmit(data) {
let params = { let params = {
...data, ...data,
P_PersonID: this.P_PersonID, }
} let res = await authApi("sysPersonService","","saveEntity","",params)
let res = await PersonSaveData({ if (res.status == 200) {
dataMain: params this.$vmNews('保存成功', 'success')
}) this.addDialog = false
if (res.code == 1) { this.resetTable()
this.$vmNews('保存成功', 'success') }
this.addDialog = false },
this.resetTable() resetTable() {
} this.pageModel.pageNum = 1
}, this.radioIndex = false
resetTable() { this.radioId = false
this.pageModel.page = 1 this.$nextTick(() => {
this.radioIndex = false this.$refs.personCustomtable.clearSelect();
this.radioId = false this.$refs.personLayout.pageClear()
this.$nextTick(() => { })
this.$refs.personCustomtable.clearSelect(); this.getTableList()
this.$refs.personLayout.pageClear() },
})
this.getTableList()
},
handleClose() { handleClose() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.customForm.resetForm('ruleForm') this.$refs.customForm.resetForm('ruleForm')
}) })
}, },
organClick(row) { organClick(row) {
// this.organizationDialog = true // this.organizationDialog = true
this.$refs.baseOrganization.dialogVisible = true this.$refs.baseOrganization.dialogVisible = true
}, },
organizationHandleConfirm() { organizationHandleConfirm() {
// this.$refs.customForm.getField(this.propLabel, this.propvalue) // this.$refs.customForm.getField(this.propLabel, this.propvalue)
let organizationForm = this.$refs.baseOrganization.organizationForm let organizationForm = this.$refs.baseOrganization.organizationForm
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.customForm.getField('o_OrganName', organizationForm.label) this.$refs.customForm.getField('organId', organizationForm.id)
this.$refs.customForm.getField('P_OrganID', organizationForm.id) this.$refs.customForm.getField('organName', organizationForm.label)
}) })
// this.organizationDialog = false // this.organizationDialog = false
this.$refs.baseOrganization.dialogVisible = false this.$refs.baseOrganization.dialogVisible = false
}, },
orangNodeClick(data) { orangNodeClick(data) {
this.organizationForm = { this.organizationForm = {
code: data.code, code: data.code,
O_OrganID: data.id, O_OrganID: data.id,
ParentOrganName: data.label, ParentOrganName: data.label,
} }
} }
}, },
} }
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
@ -512,23 +514,23 @@ export default {
} */ } */
.el-form-item { .el-form-item {
color: red !important color: red !important
} }
.organizationBody { .organizationBody {
display: flex; display: flex;
justify-content: space-evenly; justify-content: space-evenly;
background-color: #f2f3f4; background-color: #f2f3f4;
padding: 10px padding: 10px
} }
</style> </style>
<style> <style>
input::-webkit-outer-spin-button, input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { input::-webkit-inner-spin-button {
-webkit-appearance: none; -webkit-appearance: none;
} }
input[type="number"] { input[type="number"] {
-moz-appearance: textfield; -moz-appearance: textfield;
} }
</style> </style>

View File

@ -1,207 +1,315 @@
<template> <template>
<div > <div flex>
<right-dialog ref="rightDialog" @handleDialogClose="tableResult"></right-dialog> <base-layout title="人员信息" ref="layout" @pageChange="pageChange" :isPage="true" :showTitle="false"
<base-layout title="人员信息" ref="layout" @pageChange="pageChange" :isPage="true" :showTitle="false" @onFuncBtn="getFuncBtn">
@onFuncBtn="getFuncBtn"> <div slot="main" style="height: 100%;" slot-scope="{ tableHeight }">
<div slot="main" style="height: 100%;" slot-scope="{ tableHeight }"> <base-table ref="customtable" :border="true" :showIndex="false" :slotrow="true"
<base-table ref="customtable" :border="true" :showIndex="false" :slotrow="true" :tabLoading.sync="tabLoading" :tableHeight="tableHeight" :tableData="tableData"
:tabLoading.sync="tabLoading" :tableHeight="tableHeight" :tableData="tableData" :tableColumn="tableColumn" @sortChange="sortChange" @radioChange="radioChange">
:tableColumn="tableColumn" @radioChange="radioChange"> <!-- 单选 -->
<!-- 所属分类 --> <!-- <template v-slot:option="{row}">
<template v-slot:category="{row}"> <el-radio v-model="radioIndex" :label="row.$index"><span></span></el-radio>
<p>{{row.row.category == '1'?'超级管理员':row.row.category == '2'?'管理员':'业务员'}}</p> </template> -->
</template> </base-table>
<!-- 角色分类 --> </div>
<template v-slot:roleType="{row}"> </base-layout>
<p>{{row.row.roleType | roleType}}</p>
</template> <base-right-dialog :closeEscape="false" :showClose="false" :closeModal="false" :dialogVisible.sync="RoleAdd"
<!-- 所属分类 --> :title="frameTitle + '角色信息'" width="520px" @handleConfirmClick="confirmBtn" @handleClose="handleClose">
<template v-slot:roleBond="{row}"> <el-form validate-on-rule-change :model="ruleForm" :rules="rules" class="formMain" ref="ruleForm"
<p>{{row.row.roleBond | roleBond}}</p> label-width="100px">
</template> <el-form-item prop="r_RoleCode">
<template v-slot:isBenchmark="{row}"> <span class="label" slot="label">角色编码</span>
<p>{{row.row.isBenchmark =='1'?'是':'否'}}</p> <el-input placeholder="请输入角色编码" clearable v-model="ruleForm.roleCode">
</template> </el-input>
<template v-slot:externalType="{row}"> </el-form-item>
<p>{{row.row.externalType =='1'?'外部':'内部'}}</p> <el-form-item prop="r_RoleName">
</template> <span class="label" slot="label">角色名称</span>
<template v-slot:isEnable="{row}"> <el-input clearable placeholder="请输入角色名称" v-model="ruleForm.roleName">
<p>{{row.row.isEnable =='1'?'显示':'隐藏'}}</p> </el-input>
</template> </el-form-item>
</base-table> <el-form-item prop="r_Sort">
</div> <span class="label" slot="label">状态</span>
</base-layout> <el-radio-group v-model="ruleForm.enableState">
</div> <el-radio label="0">启用</el-radio>
<el-radio label="1">停用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="r_Description">
<span class="label" slot="label">描述</span>
<el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="ruleForm.r_Description">
</el-input>
</el-form-item>
</el-form>
<!-- <div flex="cross:center main:right">-->
<!-- <el-button type="primary" @click="confirmBtn">确认</el-button>-->
<!-- <el-button @click="cancelBtn">取消</el-button>-->
<!-- </div>-->
</base-right-dialog>
</div>
</template> </template>
<script> <script>
import baseRightDialog from "@/components/base/baseRightDialog";
import baseLayout from "@/components/base/baseLayout"; import baseLayout from "@/components/base/baseLayout";
import BaseTable from '@/components/base/baseTable/index.vue' import BaseTable from '@/components/base/baseTable/index.vue'
import baseDialog from "@/components/base/BaseNewDialog/index.vue"; import baseDialog from "@/components/base/BaseNewDialog/index.vue";
import BaseSelect from '@/components/base/BaseSelect' import BaseSelect from '@/components/base/BaseSelect'
import baseTree from "@/components/base/BaseMenuTree/index.vue"; import baseTree from "@/components/base/BaseMenuTree/index.vue";
import rightDialog from "./rightDialog"; import {
import configData from "./configData"; RoleGetBillList,
import { RoleDelData,
authApi RoleSaveData
} from '@/api/apis/auth' } from '@/api/apis/roleManagement'
import { authApi } from "@/api/apis/auth";
export default { export default {
name: 'RoleSettings', name: 'RoleSettings',
components: { components: {
baseLayout, baseLayout,
BaseTable, BaseTable,
BaseSelect, BaseSelect,
baseDialog, baseDialog,
baseTree, baseTree,
rightDialog baseRightDialog
}, },
data() { data() {
return { return {
radioIndex: false, radioIndex: false,
radioId: false, radioId: false,
radioForm: {}, radioForm: {},
tabLoading: false,
tableData: [],
pageModel: {
pageNum: 1,
pageSize: 20,
},
tableColumn: configData.tableColumn,
}
},
filters:{ mainColor: '#f8f8f8 ',
roleType(val){ tabLoading: false,
let roleTypeName = '' tableData: [],
switch (val) { total: "",
case '1': pageModel: {
roleTypeName = '固定角色' pageNum: 1,
break; pageSize: 20,
case '2': roleCode: '',
roleTypeName = '相对角色' roleName: ''
break; },
case '3': //
roleTypeName = '自建角色' tableColumn: [
break; {
} label: '角色编号',
return roleTypeName prop: 'roleCode',
}, tooltip: true,
roleBond(val){ sortable: true,
let roleBondName = '' },
switch (val) { {
case '0': label: '角色名称',
roleBondName = '集团角色' prop: 'roleName',
break; tooltip: true,
case '1': sortable: true,
roleBondName = '单位角色' },
break; {
case '2': label: '角色描述 ',
roleBondName = '部门角色' prop: 'description',
break; tooltip: true,
case '3': },
roleBondName = '不使用' ],
break; RoleAdd: false,
case '4': ruleForm: {
roleBondName = '不使用' R_RoleID: "", //id
break; r_RoleCode: null, //
case '5': r_RoleName: null, //
roleBondName = '业务生成器' r_Sort: null, //
break; r_Description: null, //
case '6': },
roleBondName = 'sso' rules: {
break; roleCode: [{
} required: true,
return roleBondName message: '请输入角色编码',
} trigger: 'blur'
}, }],
mounted() { roleName: [{
// this.$refs.baseTree.getMenuList() required: true,
this.getTableList() message: '请输入角色名称',
}, trigger: 'blur'
methods: { }],
// enableState: [{
radioChange(val) { required: true,
this.radioIndex = val.index message: '请选择状态',
this.radioId = val.id trigger: 'blur'
this.radioForm = val }],
}, },
// menuData: [],
async getTableList() { frameTitle: '',
this.radioIndex = false }
this.tabLoading = true },
setTimeout(()=>{ watch: {
this.tabLoading = false pageModel: {
},100000) deep: true, // true
let params = { handler: function (newV, oldV) {
...this.pageModel this.getTableList()
} }
let res = await authApi('roleService','role','queryList','',params) },
if (res.status == '200') { RoleAdd: {
this.$refs.layout.setPageTotal(res.attribute.total) deep: true, // true
this.$refs.customtable.clearRadioIndex() handler: function (newV, oldV) {
this.tableData = res.attribute.list if (this.RoleAdd == true) {
} this.$nextTick(() => {
this.tabLoading = false this.$refs.ruleForm.clearValidate();
}, })
async delData(id) { }
let params = { }
id: id }
} },
let res = await authApi('roleService','role','delectEntity','',params) mounted() {
if(res.status == '200'){ this.getTableList()
this.$vmNews("删除成功",'success') },
this.tableResult() methods: {
} handleClose(){
}, this.RoleAdd=false
getFuncBtn(btnEven) { },
if (btnEven.menuName == '新增') { //
this.frameTitle = '添加' radioChange(val) {
this.$refs.rightDialog.openDialog('新增') this.radioIndex = val.index
} this.radioId = val.id
if (btnEven.menuName == '编辑') { this.radioForm = val
if (this.radioIndex === false) { },
this.$vmNews('请选择一条记录') //
} else { async getTableList() {
this.$refs.rightDialog.openDialog('编辑',this.radioForm.id) this.radioIndex = false
} this.tabLoading = true
let params = {
...this.pageModel
}
// let res = await RoleGetBillList(params)
const res = await authApi("sysRoleService","","queryEntityPage","",params)
if (res.status == 200) {
this.$refs.layout.setPageTotal(res.attribute.total)
this.$refs.customtable.clearRadioIndex()
this.tableData = res.attribute.list
}
this.tabLoading = false
},
async delData(id) {
let params = {
id: id
}
let res = await authApi("sysRoleService","","deleteEntity","",params)
if (res.status == 200) {
this.$vmNews('删除成功', 'success')
this.getTableList()
// this.tableResult()
} else {
this.$vmNews('删除失败', 'error')
}
},
getFuncBtn(btnEven) {
if (btnEven.menuName == '新增') {
this.ruleForm = {}
this.frameTitle = '添加'
this.RoleAdd = true
}
if (btnEven.menuName == '编辑') {
// this.ruleForm = row
if (this.radioIndex === false) {
this.$vmNews('请选择一条记录')
} else {
this.ruleForm = Object.assign({}, this.radioForm)
this.frameTitle = '编辑'
this.RoleAdd = true
}
} }
if (btnEven.menuName == '删除') { if (btnEven.menuName == '删除') {
if (this.radioIndex === false) { if (this.radioIndex === false) {
this.$vmNews('请选择一条记录') this.$vmNews('请选择一条记录')
} else { } else {
this.$delConfirm().then(()=>{ this.$confirm('确认删除吗?', '提示', {
this.delData(this.radioId) confirmButtonText: '确定',
}) cancelButtonText: '取消',
} type: 'warning'
} }).then(() => {
console.log(this.radioId,'this.radioId')
this.delData(this.radioId)
this.getTableList()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
});
});
}
// this.tableData.splice(,1)
}
}, },
tableResult() { //
this.radioForm = {} async confirmBtn() {
this.radioId = false let params = {
this.radioIndex = false ...this.ruleForm
this.$refs.customtable.clearRadioIndex() }
this.pageModel.pageNum = 1 let pass
this.$nextTick(() => { this.$refs.ruleForm.validate((valid) => {
this.$refs.layout.pageClear(1) if (valid) {
this.$refs.customtable.clearSelect(); pass = true
}) } else {
this.getTableList() pass = false
},
// }
pageChange(model) { });
this.pageModel = model if (pass) {
this.getTableList() let res
}, if(this.frameTitle === '添加'){
}, res = await authApi("sysRoleService","","saveEntity","",this.ruleForm)
}else if (this.frameTitle === '编辑'){
console.log(this.ruleForm,'this.ruleForm')
res = await authApi("sysRoleService","","updateEntity","",this.ruleForm)
}
if (res.status == 200) {
this.$vmNews('保存成功', 'success')
this.tableResult()
this.RoleAdd = false
}
this.getTableList()
} else {
return
}
},
tableResult() {
this.ruleForm = {}
this.radioForm = {}
this.radioId = false
this.radioIndex = false
this.$refs.customtable.clearRadioIndex()
this.pageModel.page = 1
this.$nextTick(() => {
this.$refs.layout.pageClear(1)
this.$refs.customtable.clearSelect();
})
// this.getTableList()
},
//
cancelBtn() {
this.RoleAdd = false
},
//
pageChange(model) {
this.pageModel.pageNum = model.page
this.pageModel.pageSize = model.limit
},
//
sortChange(prop, type) {
this.pageModel.SequenceName = prop
this.pageModel.Sequence = type
this.pageModel.pageNum = 1
this.radioForm = {}
this.radioId = false
this.$nextTick(() => {
this.$refs.layout.pageClear()
})
}
},
} }
</script> </script>
<style> <style>
textarea { textarea {
resize: none; resize: none;
} }
</style> </style>

View File

@ -39,9 +39,9 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://hzya.ufyct.com:9067/`, // target: `http://hzya.ufyct.com:9067/`,
// target: `http://127.0.0.1:9081/`, // target: `http://127.0.0.1:9081/`,
// target: `http://192.168.2.78:9999`, target: `http://192.168.2.78:9999`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "", ["^" + process.env.VUE_APP_BASE_API]: "",