Commit ac72865c authored by 何小勇's avatar 何小勇

组织管理

parents 35254706 170380ff
...@@ -243,6 +243,7 @@ div { ...@@ -243,6 +243,7 @@ div {
.el-dialog__header { .el-dialog__header {
border-bottom: 1px solid #edf0ff; border-bottom: 1px solid #edf0ff;
padding: 16px; padding: 16px;
margin-right: 0;
} }
.el-dialog__title { .el-dialog__title {
...@@ -1518,10 +1519,6 @@ border-radius:8px; ...@@ -1518,10 +1519,6 @@ border-radius:8px;
color: #404a62; color: #404a62;
padding-left: 20px; padding-left: 20px;
} }
.name_btn {
color: #3759be;
cursor: pointer;
}
.fr { .fr {
float: right; float: right;
} }
...@@ -1539,6 +1536,17 @@ border-radius:8px; ...@@ -1539,6 +1536,17 @@ border-radius:8px;
vertical-align: baseline; vertical-align: baseline;
cursor: pointer; cursor: pointer;
} }
/* 可点击文字颜色、指针样式 */
.can_click_text {
cursor: pointer;
color: #3759be;
}
.can_click_text:hover {
color: #738bd2;
}
.can_click_text:active {
color: #2c4798;
}
.warning_info { .warning_info {
background-color: #f7f7f9; background-color: #f7f7f9;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
> >
<span v-if="item.state" :style="{color: stateColor[item.state]}"> <span class="state-dot" :style="{backgroundColor: stateColor[item.state]}"></span>{{item.value}}</span> <span v-if="item.state" :style="{color: stateColor[item.state]}"> <span class="state-dot" :style="{backgroundColor: stateColor[item.state]}"></span>{{item.value}}</span>
<span v-else-if="item.secret">{{secret(item.value)}}</span> <span v-else-if="item.secret">{{secret(item.value)}}</span>
<span v-else-if="item.callback" @click.stop="item.callback && item.callback()" class="can_click_text">{{item.value}}</span>
<span v-else>{{ item.value }}</span> <span v-else>{{ item.value }}</span>
</span> </span>
<a <a
......
<template> <template>
<div class="bg-table-btns"> <div class="bg-table-btns">
<bg-table-btn <bg-table-btn
class="can_click_text"
v-for="(item, index) in curOperations" v-for="(item, index) in curOperations"
:key="index" :key="index"
:disabled="isDisabled(item)" :disabled="isDisabled(item)"
......
...@@ -808,6 +808,10 @@ a { ...@@ -808,6 +808,10 @@ a {
&.disabled { &.disabled {
cursor: not-allowed; cursor: not-allowed;
color: #a9b1c7; color: #a9b1c7;
&:hover,
&:active {
color: #a9b1c7;
}
} }
& + .bg-table-btn { & + .bg-table-btn {
...@@ -1805,6 +1809,7 @@ a { ...@@ -1805,6 +1809,7 @@ a {
.el-upload__tip { .el-upload__tip {
// display: none; // display: none;
cursor: not-allowed; cursor: not-allowed;
line-height: 18px;
} }
} }
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
</template> </template>
<template v-slot:action="{ row,index }"> <template v-slot:action="{ row,index }">
<bg-table-btn :disabled="disabled||acDisable" :click="()=>{addParam(index)}">增加</bg-table-btn> <bg-table-btn class="can_click_btn" :disabled="disabled||acDisable" :click="()=>{addParam(index)}">增加</bg-table-btn>
<bg-table-btn :disabled="disabled||acDisable" :click="()=>{removeParam(row, index)}"> <bg-table-btn class="can_click_btn" :disabled="disabled||acDisable" :click="()=>{removeParam(row, index)}">
删除 删除
</bg-table-btn> </bg-table-btn>
</template> </template>
......
...@@ -94,8 +94,8 @@ ...@@ -94,8 +94,8 @@
</template> </template>
<template v-slot:action="{ row }"> <template v-slot:action="{ row }">
<bg-table-btn :disabled="disabled" :click="()=>{addInputConf(row)}"> 增加 </bg-table-btn> <bg-table-btn class="can_click_btn" :disabled="disabled" :click="()=>{addInputConf(row)}"> 增加 </bg-table-btn>
<bg-table-btn :disabled="disabled" :click="()=>{removeInputConf(row)}"> 删除 </bg-table-btn> <bg-table-btn class="can_click_btn" :disabled="disabled" :click="()=>{removeInputConf(row)}"> 删除 </bg-table-btn>
</template> </template>
</bg-table-pro> </bg-table-pro>
</el-form> </el-form>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<div class="flex_row"> <div class="flex_row">
<div class="flex_left"> <div class="flex_left">
<div class="box"> <div class="box">
<el-input class="type-input" v-model="typeKeyword" @input="searchType" placeholder="请输入内容"></el-input> <el-input class="type-input" v-model="typeKeyword" @input="searchType" :prefix-icon="Search" placeholder="请输入搜索内容"></el-input>
<div class="type_station bg-scroll"> <div class="type_station bg-scroll">
<div class="type-box" :class="{'current-type':nodeClassifyId==item.classify_id}" @click="nodeClick(item)" v-for="(item,index) in typeList" :key="'type'+index+200"> <div class="type-box" :class="{'current-type':nodeClassifyId==item.classify_id}" @click="nodeClick(item)" v-for="(item,index) in typeList" :key="'type'+index+200">
...@@ -164,6 +164,7 @@ import { reactive, ref,onBeforeMount,toRefs,computed, watch, nextTick } from 'vu ...@@ -164,6 +164,7 @@ import { reactive, ref,onBeforeMount,toRefs,computed, watch, nextTick } from 'vu
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import axios from '../../../../request/http.js' import axios from '../../../../request/http.js'
import { Search } from '@element-plus/icons-vue'
const bgForm = ref(null) const bgForm = ref(null)
const state = reactive({ const state = reactive({
bgForm, bgForm,
......
...@@ -57,14 +57,14 @@ ...@@ -57,14 +57,14 @@
重置密码 重置密码
</el-button> </el-button>
<span class="header_info">已选择<span style="color: #202531;font-weight: bold">{{selected.length}}</span></span> <span class="header_info">已选择<span style="color: #202531;font-weight: bold">{{selected.length}}</span></span>
<span class="header_info name_btn" @click="clearSelected">清空</span> <span class="header_info can_click_text" @click="clearSelected">清空</span>
</div> </div>
</template> </template>
</bg-filter-group> </bg-filter-group>
<div class="table_container apaas_scroll"> <div class="table_container apaas_scroll">
<bg-table ref="dataTable" :headers="headers" :rows="tableRows" :isIndex="true" :stripe="true" :select="true" @selectAc="selectRows"> <bg-table ref="dataTable" :headers="headers" :rows="tableRows" :isIndex="true" :stripe="true" :select="true" @selectAc="selectRows">
<template v-slot:business_name="{ row }"> <template v-slot:business_name="{ row }">
<span @click="goDetail(row)" class="name_btn"> <span @click="goDetail(row)" class="can_click_text">
{{ row.business_name }} {{ row.business_name }}
</span> </span>
</template> </template>
...@@ -72,13 +72,13 @@ ...@@ -72,13 +72,13 @@
<bg-switch @click="stateChange(row)" :labels="['否','是']" :values="[0,1]" v-model="row.state"></bg-switch> <bg-switch @click="stateChange(row)" :labels="['否','是']" :values="[0,1]" v-model="row.state"></bg-switch>
</template> </template>
<template v-slot:action="{ row }"> <template v-slot:action="{ row }">
<bg-table-btn class="btn" @click="editAccount(row.id)"> <bg-table-btn class="can_click_text" @click="editAccount(row.id)">
编辑 编辑
</bg-table-btn> </bg-table-btn>
<bg-table-btn class="btn" @click="editPsdAccount(row)"> <bg-table-btn class="can_click_text" @click="editPsdAccount(row)">
修改密码 修改密码
</bg-table-btn> </bg-table-btn>
<bg-table-btn class="btn" @click="deleteAccount(row)"> <bg-table-btn class="can_click_text" @click="deleteAccount(row)">
删除 删除
</bg-table-btn> </bg-table-btn>
</template> </template>
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<div class="action" @click="fileAction(1,selectData,selectParentData)"> <div class="action" @click="fileAction(1,selectData,selectParentData)">
新建本级 新建本级
</div> </div>
<div class="action" :class="{'disable':selectData && selectData.menu_type == 2}" @click="fileAction(2,selectData,selectParentData,selectData.menu_type == 2)"> <div class="action" @click="fileAction(2,selectData,selectParentData)">
新建下级 新建下级
</div> </div>
<div class="action" @click="fileAction(3,selectData,selectParentData)"> <div class="action" @click="fileAction(3,selectData,selectParentData)">
...@@ -217,6 +217,15 @@ const handleNodeClick = (data) => { ...@@ -217,6 +217,15 @@ const handleNodeClick = (data) => {
state.selectData = data state.selectData = data
menuFormRef.value.setForm(state.selectData) menuFormRef.value.setForm(state.selectData)
closeAction() closeAction()
if (menuFormRef) {
nextTick().then(() => {
menuFormRef.value.menuRef.validate(valid => {
if (!valid) {
menuFormRef.value.menuRef.clearValidate()
}
})
})
} // 清除表单验证
} // 菜单树节点点击 } // 菜单树节点点击
const filterNode = (val,data) => { const filterNode = (val,data) => {
...@@ -237,6 +246,7 @@ const fileAction = (val,data,parent,disabled=false) => { ...@@ -237,6 +246,7 @@ const fileAction = (val,data,parent,disabled=false) => {
state: 1, state: 1,
menu_url: "", menu_url: "",
menu_logo: "", menu_logo: "",
level: data.level
} }
state.menuTree.insertAfter(newChild,parent? parent.Child[parent.Child.length-1] : state.data[state.data.length -1]) state.menuTree.insertAfter(newChild,parent? parent.Child[parent.Child.length-1] : state.data[state.data.length -1])
state.menuTree && state.menuTree.setCurrentKey(newChild.menu_id); state.menuTree && state.menuTree.setCurrentKey(newChild.menu_id);
...@@ -250,11 +260,12 @@ const fileAction = (val,data,parent,disabled=false) => { ...@@ -250,11 +260,12 @@ const fileAction = (val,data,parent,disabled=false) => {
let newChild = { let newChild = {
menu_name: "新菜单", menu_name: "新菜单",
menu_id: 'new' + state.newMenuId, menu_id: 'new' + state.newMenuId,
menu_type: 0, menu_type: data.menu_type == 0 ? 0 : data.menu_type == 1 ? 1 : 2,
dict_group_id: "", dict_group_id: "",
state: 1, state: 1,
menu_url: "", menu_url: "",
menu_logo: "", menu_logo: "",
p_menu_type: data.menu_type
} }
state.menuTree.append(newChild,data) state.menuTree.append(newChild,data)
state.menuTree && state.menuTree.setCurrentKey(newChild.menu_id); state.menuTree && state.menuTree.setCurrentKey(newChild.menu_id);
......
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
<el-form-item label="菜单名称" prop="menu_name"> <el-form-item label="菜单名称" prop="menu_name">
<el-input v-model="menuForm.menu_name" show-word-limit maxlength="8" placeholder="请输入菜单名称" /> <el-input v-model="menuForm.menu_name" show-word-limit maxlength="8" placeholder="请输入菜单名称" />
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="menu_type"> <el-form-item label="类型" prop="menu_type" v-if="!topLevel">
<el-radio-group v-model="menuForm.menu_type" :disabled="radioDisabled"> <el-radio-group v-model="menuForm.menu_type" :disabled="radioDisabled">
<el-radio :label="0">目录</el-radio> <el-radio :label="0" :disabled="typeDisFlag != 0">目录</el-radio>
<el-radio :label="1">菜单</el-radio> <el-radio :label="1" :disabled="typeDisFlag == 2">菜单</el-radio>
<el-radio :label="2">子页面</el-radio> <el-radio :label="2">子页面</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="分组" prop="dict_group_id" v-if="menuForm.menu_type == 0"> <el-form-item label="分组" prop="dict_group_id" v-if="menuForm.menu_type == 0 && !topLevel">
<el-select v-model="menuForm.dict_group_id" placeholder="请选择分组"> <el-select v-model="menuForm.dict_group_id" placeholder="请选择分组">
<el-option <el-option
v-for="item in groupList" v-for="item in groupList"
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
inactive-text="否" inactive-text="否"
/> />
</el-form-item> </el-form-item>
<el-form-item label="菜单路径" prop="menu_url"> <el-form-item label="菜单路径" :prop="topLevel ? '' : 'menu_url'">
<el-input v-model="menuForm.menu_url" placeholder="请输入菜单路径" /> <el-input v-model="menuForm.menu_url" placeholder="请输入菜单路径" />
</el-form-item> </el-form-item>
<el-form-item label="菜单图标" prop="menu_logo" v-if="menuForm.menu_type !== 2"> <el-form-item label="菜单图标" prop="menu_logo">
<div class="iconBox" :style="iconFlag ? {'border-color':'#2b4695'} : {} " @click="openIconbox"> <div class="iconBox" :style="iconFlag ? {'border-color':'#2b4695'} : {} " @click="openIconbox">
<div> <div>
<span> <span>
...@@ -129,7 +129,7 @@ const state = reactive({ ...@@ -129,7 +129,7 @@ const state = reactive({
{ required: true, message: '请选择菜单分组', trigger: 'change' }, { required: true, message: '请选择菜单分组', trigger: 'change' },
], ],
menu_url: [ menu_url: [
{ required: true, message: '请输入菜单路径', trigger: 'blur' }, { required: true, message: '请输入菜单路径', trigger: 'blur' },
] ]
}, },
groupList: [], groupList: [],
...@@ -139,6 +139,8 @@ const state = reactive({ ...@@ -139,6 +139,8 @@ const state = reactive({
showIconArr: [], // 展示的图标 showIconArr: [], // 展示的图标
timer: null, timer: null,
radioDisabled: false, radioDisabled: false,
topLevel: false,
typeDisFlag: null,
}) })
const getGroupList = () => { const getGroupList = () => {
...@@ -180,6 +182,13 @@ const searchIcon = () => { ...@@ -180,6 +182,13 @@ const searchIcon = () => {
const setForm = (data) => { const setForm = (data) => {
console.log(data) console.log(data)
if (data.level && data.level == 1) {
state.topLevel = true
}else {
state.topLevel = false
}
state.typeDisFlag = data.p_menu_type
console.log(state.topLevel)
if (data.id) { // 编辑状态 if (data.id) { // 编辑状态
state.radioDisabled = true state.radioDisabled = true
}else { }else {
...@@ -217,6 +226,8 @@ const { ...@@ -217,6 +226,8 @@ const {
showIconArr, showIconArr,
icon_search, icon_search,
radioDisabled, radioDisabled,
topLevel,
typeDisFlag,
} = toRefs(state) } = toRefs(state)
defineExpose({ setForm , menuForm, menuRef }) defineExpose({ setForm , menuForm, menuRef })
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<div class="table_container apaas_scroll"> <div class="table_container apaas_scroll">
<bg-table ref="dataTable" :headers="headers" :rows="tableRows" :isIndex="true" :stripe="true" :select="true" @selectAc="selectRows"> <bg-table ref="dataTable" :headers="headers" :rows="tableRows" :isIndex="true" :stripe="true" :select="true" @selectAc="selectRows">
<template v-slot:system_account="{ row }"> <template v-slot:system_account="{ row }">
<span @click="goDetail(row)" class="name_btn"> <span @click="goDetail(row)" class="can_click_text">
{{ row.system_account }} {{ row.system_account }}
</span> </span>
</template> </template>
...@@ -85,13 +85,13 @@ ...@@ -85,13 +85,13 @@
<bg-switch @click="stateChange(row)" :labels="['否','是']" :values="[0,1]" v-model="row.state"></bg-switch> <bg-switch @click="stateChange(row)" :labels="['否','是']" :values="[0,1]" v-model="row.state"></bg-switch>
</template> </template>
<template v-slot:action="{ row }"> <template v-slot:action="{ row }">
<bg-table-btn @click="editAccount(row)" class="btn"> <bg-table-btn @click="editAccount(row)" class="can_click_text">
编辑 编辑
</bg-table-btn> </bg-table-btn>
<bg-table-btn @click="editPsdAccount(row)" class="btn"> <bg-table-btn @click="editPsdAccount(row)" class="can_click_text">
修改密码 修改密码
</bg-table-btn> </bg-table-btn>
<bg-table-btn @click="deleteAccount(row)" class="btn"> <bg-table-btn @click="deleteAccount(row)" class="can_click_text">
删除 删除
</bg-table-btn> </bg-table-btn>
</template> </template>
...@@ -271,11 +271,21 @@ import tree from './tree.vue'; ...@@ -271,11 +271,21 @@ import tree from './tree.vue';
import directoryForm from './directory-form.vue'; import directoryForm from './directory-form.vue';
import orgForm from './org-form.vue'; import orgForm from './org-form.vue';
import CryptoJS from "crypto-js"; import CryptoJS from "crypto-js";
import { downloadFileFormatNew } from '@/services/helper'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const { $axios,$message } = proxy const { $axios,$message } = proxy
const dataTable = ref(null); const dataTable = ref(null);
const toOrgDetail = () => {
router.push({
path: "/system/organization/org-detail",
query: {
id: selectTreeData.value.organization_id
}
})
}
const baseInfo = reactive( const baseInfo = reactive(
[ [
{ {
...@@ -291,6 +301,7 @@ import CryptoJS from "crypto-js"; ...@@ -291,6 +301,7 @@ import CryptoJS from "crypto-js";
{ {
name: "机构名称", name: "机构名称",
value: "", value: "",
callback: toOrgDetail,
nameWidth: 130 nameWidth: 130
}, },
{ {
...@@ -536,7 +547,7 @@ import CryptoJS from "crypto-js"; ...@@ -536,7 +547,7 @@ import CryptoJS from "crypto-js";
name: data.name, name: data.name,
organization_code: data.organization_code, organization_code: data.organization_code,
description: data.description, description: data.description,
attachment: data.attachment && data.attachment.length > 0 ? data.attachment[0].url : '', attachment: data.attachment && data.attachment.length > 0 ? data.attachment.map(item => item.url).join(',') : '',
data_type: 1 data_type: 1
} }
$axios.post(`/apaas/system/v5/org/add`, params) $axios.post(`/apaas/system/v5/org/add`, params)
...@@ -555,7 +566,7 @@ import CryptoJS from "crypto-js"; ...@@ -555,7 +566,7 @@ import CryptoJS from "crypto-js";
name: data.name, name: data.name,
organization_code: data.organization_code, organization_code: data.organization_code,
description: data.description, description: data.description,
attachment: data.attachment && data.attachment.length > 0 ? data.attachment[0].url : '', attachment: data.attachment && data.attachment.length > 0 ? data.attachment.map(item => item.url).join(',') : '',
data_type: 1 data_type: 1
} }
$axios.put(`/apaas/system/v5/org/${selectTreeData.value.id}`, params) $axios.put(`/apaas/system/v5/org/${selectTreeData.value.id}`, params)
...@@ -618,7 +629,7 @@ import CryptoJS from "crypto-js"; ...@@ -618,7 +629,7 @@ import CryptoJS from "crypto-js";
level: data.data.value.p_organization_id ? false : true, level: data.data.value.p_organization_id ? false : true,
organization_code: data.data.value.organization_code, organization_code: data.data.value.organization_code,
description: data.data.value.description, description: data.data.value.description,
attachment: [{url: data.data.value.attachment}] attachment: data.data.value.attachment.split(',').map(i => {return {name: downloadFileFormatNew(i),url: i}})
}); });
}else if(data.action === 'create') { }else if(data.action === 'create') {
orgFormRef.value.setForm({p_organization_id: data.data.value.organization_id}); orgFormRef.value.setForm({p_organization_id: data.data.value.organization_id});
...@@ -867,6 +878,8 @@ import CryptoJS from "crypto-js"; ...@@ -867,6 +878,8 @@ import CryptoJS from "crypto-js";
dataTable.value.clearSelection(); dataTable.value.clearSelection();
} }
onBeforeMount(() => { onBeforeMount(() => {
}) })
...@@ -896,7 +909,7 @@ import CryptoJS from "crypto-js"; ...@@ -896,7 +909,7 @@ import CryptoJS from "crypto-js";
.tree { .tree {
overflow: auto; overflow: auto;
height: calc(100% - 65px); height: calc(100% - 65px);
padding: 5px; /* padding: 5px; */
} }
.tree :deep() .el-tree-node>.el-tree-node__children { .tree :deep() .el-tree-node>.el-tree-node__children {
overflow: unset; overflow: unset;
......
...@@ -21,25 +21,11 @@ ...@@ -21,25 +21,11 @@
<div class="org_file info_box"> <div class="org_file info_box">
<div class="pl-1">组织附件</div> <div class="pl-1">组织附件</div>
<div> <div>
<div class="file_item pl-1"> <div class="file_item pl-1" v-for="(item, index) in fileList" :key="'file_'+index">
<span><bg-icon style="font-size: 24px" icon="#bg-ic-c-file-doc"></bg-icon></span> <span><bg-icon style="font-size: 24px" :icon="'#bg-ic-'+formatFile(item)"></bg-icon></span>
<span class="file_name">xxxxxxx协议.doc</span> <span class="file_name">{{downloadFileFormatNew(item)}}</span>
<span class="fr download_btn"> <span class="fr download_btn">
<el-button type="primary" @click="downloadFile"><bg-icon icon="#bg-ic-to-bottom"></bg-icon>下载</el-button> <el-button type="primary" @click="downloadFile(item)"><bg-icon icon="#bg-ic-to-bottom"></bg-icon>下载</el-button>
</span>
</div>
<div class="file_item pl-1">
<span><bg-icon style="font-size: 24px" icon="#bg-ic-c-file-zip"></bg-icon></span>
<span class="file_name">xxxxxxx协议.zip</span>
<span class="fr download_btn">
<el-button type="primary"><bg-icon icon="#bg-ic-to-bottom"></bg-icon>下载</el-button>
</span>
</div>
<div class="file_item pl-1">
<span><bg-icon style="font-size: 24px" icon="#bg-ic-c-file-image"></bg-icon></span>
<span class="file_name">xxxxxxx协议.jpg</span>
<span class="fr download_btn">
<el-button type="primary"><bg-icon icon="#bg-ic-to-bottom"></bg-icon>下载</el-button>
</span> </span>
</div> </div>
</div> </div>
...@@ -58,9 +44,9 @@ ...@@ -58,9 +44,9 @@
</bg-table> </bg-table>
<div class="pagination_box"> <div class="pagination_box">
<bg-pagination <bg-pagination
:page="1" :page="filter.page"
:size="10" :size="filter.limit"
:total="100" :total="tableTotal"
@change-page="changePage" @change-page="changePage"
@change-size="changeSize" @change-size="changeSize"
> >
...@@ -76,33 +62,37 @@ ...@@ -76,33 +62,37 @@
import { reactive, toRefs, ref, } from '@vue/reactivity' import { reactive, toRefs, ref, } from '@vue/reactivity'
import { getCurrentInstance } from 'vue' import { getCurrentInstance } from 'vue'
import { computed, onBeforeMount } from '@vue/runtime-core' import { computed, onBeforeMount } from '@vue/runtime-core'
import { useRouter } from 'vue-router'; import { useRoute } from 'vue-router';
import { downloadFileFormatNew } from '@/services/helper'
const { proxy } = getCurrentInstance()
const { $axios,$message } = proxy
const route = useRoute();
const baseInfo = reactive( const baseInfo = reactive(
[ [
{ {
name: "机构名称", name: "机构名称",
value: "大数据局", value: "",
nameWidth: 130 nameWidth: 130
}, },
{ {
name: "组织机构代码", name: "组织机构代码",
value: "00000001", value: "",
nameWidth: 130 nameWidth: 130
}, },
{ {
name: "组织管理员数量", name: "组织管理员数量",
value: "15", value: "",
nameWidth: 130 nameWidth: 130
}, },
{ {
name: "业务系统数量", name: "业务系统数量",
value: "10", value: "",
nameWidth: 130 nameWidth: 130
}, },
{ {
name: "组织描述", name: "组织描述",
value: "组织描述组织描述组织描述组织描述组织描述组织描述组织描述组织描述组织描述组织描述组织描述组织描述组织描述组织描述组织描述组织描述", value: "",
nameWidth: 130 nameWidth: 130
}, },
]) ])
...@@ -110,48 +100,100 @@ const baseInfo = reactive( ...@@ -110,48 +100,100 @@ const baseInfo = reactive(
const headers = reactive([ const headers = reactive([
{ {
label: "业务系统名称", label: "业务系统名称",
prop: "name", prop: "business_name",
}, },
{ {
label: "是否启用", label: "是否启用",
prop: "is_use", prop: "state",
}, },
{ {
label: "业务系统账号", label: "业务系统账号",
prop: "account", prop: "system_account",
}, },
]) ])
const tableRows = reactive([ const tableRows = ref([])
{name: '大数据处理系统',is_use: "",account: "admin"}, const fileList = ref([])
{name: '大数据处理系统',is_use: "",account: "admin"}, const filter = reactive({
// {name: '大数据处理系统',is_use: "是",account: "admin"}, page: 1,
// {name: '大数据处理系统',is_use: "是",account: "admin"}, limit: 10,
// {name: '大数据处理系统',is_use: "是",account: "admin"}, });
// {name: '大数据处理系统',is_use: "是",account: "admin"}, const tableTotal = ref(0);
// {name: '大数据处理系统',is_use: "是",account: "admin"},
// {name: '大数据处理系统',is_use: "是",account: "admin"},
// {name: '大数据处理系统',is_use: "是",account: "admin"},
// {name: '大数据处理系统',is_use: "是",account: "admin"},
// {name: '大数据处理系统',is_use: "是",account: "admin"},
// {name: '大数据处理系统',is_use: "是",account: "admin"},
])
const changeSize = (size) => { const changeSize = (size) => {
filter.limit = size;
changePage(1)
}
const changePage = (page) => {
filter.page = page;
getSystemInfo();
} }
const changePage = (size) => { const downloadFile = (data) => {
const a = document.createElement("a"); // 创建a标签
a.setAttribute("download", ""); // download属性
a.setAttribute("href", data); // href链接
a.click(); // 自执行点击事件
}
const formatFile = (url) => {
const file = url.split('.')[1];
let icon = ''
if(('docx').indexOf(file) !== -1) {
icon = 'c-file-doc'
}else if(('xlsx').indexOf(file) !== -1) {
icon = 'c-file-xlsx'
}else if(('pdf').indexOf(file) !== -1) {
icon = 'c-file-pdf'
}else if(('txt').indexOf(file) !== -1) {
icon = 'c-file-txt'
}else if(('zip').indexOf(file) !== -1) {
icon = 'c-file-zip'
}else if(('jpg,png').indexOf(file) !== -1) {
icon = 'c-file-image'
}else {
icon = 'txt'
}
return icon;
} }
const downloadFile = (data) => { const getDetail = () => {
$axios.get(`/apaas/system/v5/org/detail?organization_id=${route.query.id}&key_word=&state=&limit=&page=&data_type=1`)
.then((res) => {
if (res.data.code == 200) {
const detail = res.data.data.org_info;
baseInfo[0].value = detail.name;
baseInfo[1].value = detail.organization_code;
baseInfo[2].value = detail.org_admin_number;
baseInfo[3].value = detail.business_system_number;
baseInfo[4].value = detail.description;
fileList.value = detail.attachment ? detail.attachment.split(',') : [];
}else {
$message.error(res.data.msg)
}
})
}
const getSystemInfo = () => {
console.log(11111111)
const params = {...filter,organization_id: route.query.id}
$axios.get(`/apaas/system/v5/org/business/msg`,{params})
.then((res) => {
if (res.data.code == 200) {
tableRows.value = res.data.data || [];
tableTotal.value = res.data.total;
}else {
$message.error(res.data.msg)
}
})
} }
onBeforeMount(() => { onBeforeMount(() => {
if(route.query.id) {
getDetail()
getSystemInfo()
}
}) })
</script> </script>
...@@ -187,7 +229,7 @@ const baseInfo = reactive( ...@@ -187,7 +229,7 @@ const baseInfo = reactive(
margin-bottom: 40px; margin-bottom: 40px;
} }
.img_box { .img_box {
width: 120px; width: 120px\;
} }
.info_box { .info_box {
width: 60%; width: 60%;
...@@ -228,5 +270,12 @@ const baseInfo = reactive( ...@@ -228,5 +270,12 @@ const baseInfo = reactive(
line-height: 40px; line-height: 40px;
padding-top: 5px; padding-top: 5px;
} }
.bg-pagination {
margin-top: 0px;
}
.info_content :deep() .bg-table .empty_container {
height: 160px;
padding-top: 25px;
}
</style> </style>
\ No newline at end of file
...@@ -23,7 +23,9 @@ ...@@ -23,7 +23,9 @@
<el-input type="textarea" :rows="3" v-model="orgForm.description" /> <el-input type="textarea" :rows="3" v-model="orgForm.description" />
</el-form-item> </el-form-item>
<el-form-item label="组织附件" prop="logo"> <el-form-item label="组织附件" prop="logo">
<bg-upload v-model="orgForm.attachment" customTips> <bg-upload v-model="orgForm.attachment" customTips :limit="3"
:fileTypes="['doc','docx','xls','xlsx','pdf','jpg','jpeg','png','zip','rar']"
:otherInfo="'最多可上传三个附件,可上传zip,rar,doc,docx,xlsx,xls,png,jpg,可上传营业执照和相关协议文件等'">
<span>将文件拖到此处,或 点击上传</span> <span>将文件拖到此处,或 点击上传</span>
</bg-upload> </bg-upload>
</el-form-item> </el-form-item>
......
...@@ -239,13 +239,14 @@ import { useRouter } from 'vue-router'; ...@@ -239,13 +239,14 @@ import { useRouter } from 'vue-router';
padding: 8px 0; padding: 8px 0;
background-color: var(--el-tree-node-hover-bg-color); background-color: var(--el-tree-node-hover-bg-color);
} }
.label-text:hover { .label-text:hover {
padding: 8px 0; padding: 8px 0;
background-color: var(--el-tree-node-hover-bg-color); background-color: var(--el-tree-node-hover-bg-color);
} }
.is_active { .is_active {
padding: 8px 0; padding: 8px 0;
background-color: var(--el-tree-node-hover-bg-color); background-color: var(--el-color-primary-light-9);
} }
.custom_tree_node { .custom_tree_node {
...@@ -296,4 +297,8 @@ import { useRouter } from 'vue-router'; ...@@ -296,4 +297,8 @@ import { useRouter } from 'vue-router';
z-index: 9; z-index: 9;
} }
.file-tree :deep().el-tree-node__content{
height: 36px!important;
}
</style> </style>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item> 系统管理 </el-breadcrumb-item> <el-breadcrumb-item> 系统管理 </el-breadcrumb-item>
<el-breadcrumb-item to="/system/role"> 角色管理 </el-breadcrumb-item> <el-breadcrumb-item to="/system/role"> 角色管理 </el-breadcrumb-item>
<el-breadcrumb-item> 新建 </el-breadcrumb-item> <el-breadcrumb-item> {{route.query.id ? "编辑" : "新建"}} </el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div class="main_container"> <div class="main_container">
...@@ -95,7 +95,7 @@ const roleState = reactive({ ...@@ -95,7 +95,7 @@ const roleState = reactive({
data_purview: 3, data_purview: 3,
state: 1, state: 1,
permission_arr: [], permission_arr: [],
}, }, // 表单项
rules: { rules: {
role_name: [ role_name: [
{ required: true, message: "请输入角色名称", trigger: "blur" }, { required: true, message: "请输入角色名称", trigger: "blur" },
...@@ -112,13 +112,13 @@ const roleState = reactive({ ...@@ -112,13 +112,13 @@ const roleState = reactive({
permission_arr: [ permission_arr: [
{ required: true, type: "array", validator: checkMenuLength, trigger: "change" } { required: true, type: "array", validator: checkMenuLength, trigger: "change" }
] ]
}, }, // 表单校验规则
defaultProps: { defaultProps: {
name: 'menu_name', name: 'menu_name',
value: 'id', value: 'id',
children: 'Child', children: 'Child',
}, }, // 菜单框默认配置
permissionData: [], permissionData: [], // 菜单数据
}) })
const getMenuTree = () => { const getMenuTree = () => {
axios axios
...@@ -130,22 +130,37 @@ const getMenuTree = () => { ...@@ -130,22 +130,37 @@ const getMenuTree = () => {
ElMessage.error(res.data.data) ElMessage.error(res.data.data)
} }
}) })
} } // 获取菜单数据
const changeMenu = (val) => { const changeMenu = (val) => {
roleState.formData.permission_arr = val roleState.formData.permission_arr = val
} } // 修改选中的菜单
const getRoleDetail = () => { const getRoleDetail = () => {
axios axios
.get(`/apaas/system/v5/role/detail/${route.query.id}`) .get(`/apaas/system/v5/role/detail/${route.query.id}`)
.then((res) => { .then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
console.log(res.data.data) let { role_name, role_desc, data_purview, state, menus } = res.data.data
let permission_arr = []
if (menus && menus.length > 0) {
menus.forEach(e => {
permission_arr.push(e.id)
})
}
roleState.formData = {
role_name,
role_desc,
data_purview,
state,
permission_arr:[...permission_arr]
}
console.log(roleState.formData.permission_arr)
}else { }else {
ElMessage.error(res.data.data) ElMessage.error(res.data.data)
} }
}) })
} } // 获取角色详情
const saveRole = () => { const saveRole = () => {
roleState.form.validate(valid => { roleState.form.validate(valid => {
...@@ -169,7 +184,7 @@ const saveRole = () => { ...@@ -169,7 +184,7 @@ const saveRole = () => {
} }
}) })
}else { // 编辑 }else { // 编辑
params.id = route.query.id params.id = +route.query.id
axios axios
.post(`/apaas/system/v5/role/update`,params) .post(`/apaas/system/v5/role/update`,params)
.then((res) => { .then((res) => {
...@@ -183,10 +198,12 @@ const saveRole = () => { ...@@ -183,10 +198,12 @@ const saveRole = () => {
} }
} }
}) })
} } // 新增或编辑角色的保存
onBeforeMount(() => { onBeforeMount(() => {
getMenuTree() getMenuTree()
if (route.query.id) { if (route.query.id) {
// 有id表示是编辑,请求详情,回显
getRoleDetail() getRoleDetail()
} }
}) })
......
...@@ -22,20 +22,26 @@ ...@@ -22,20 +22,26 @@
<el-button class="register_btn" type="primary" @click="deleteRows"> <el-button class="register_btn" type="primary" @click="deleteRows">
批量删除 批量删除
</el-button> </el-button>
<div class="select_text">
<span>已选择</span>
<span class="num">{{selection.length}}</span>
<span></span>
<span class="can_click_text" @click="clearSelection">清空</span>
</div>
</div> </div>
</template> </template>
</bg-filter-group> </bg-filter-group>
<div class="table_container"> <div class="table_container">
<div class="table bg-scroll"> <div class="table bg-scroll">
<bg-table <bg-table
ref="bgTable" ref="Bgtable"
:headers="headers" :headers="headers"
:rows="tableRows" :rows="tableRows"
:select="true" :select="true"
:stripe="true" :stripe="true"
canEdit canEdit
canEditFlag='state' canEditFlag='state'
@select="selectRows" @selectAc="selectRows"
> >
<template v-slot:state="{ row }"> <template v-slot:state="{ row }">
<bg-switch <bg-switch
...@@ -50,13 +56,13 @@ ...@@ -50,13 +56,13 @@
{{ row.created_time.split("+")[0].replace("T", " ").replace("Z", " ") }} {{ row.created_time.split("+")[0].replace("T", " ").replace("Z", " ") }}
</template> </template>
<template v-slot:action="{ row }"> <template v-slot:action="{ row }">
<bg-table-btn class="btn" :click="()=>{edit_row(row)}" :disabled="row.state == 1 || row.role_type == 1"> <bg-table-btn class="can_click_text" :click="()=>{edit_row(row)}" :disabled="row.state == 1 || row.role_type == 1">
编辑 编辑
</bg-table-btn> </bg-table-btn>
<bg-table-btn class="btn" :click="()=>{edit_row(row)}" :disabled="row.role_type == 1"> <bg-table-btn class="can_click_text" :click="()=>{distribute_user(row)}" :disabled="row.role_type == 1">
分配用户 分配用户
</bg-table-btn> </bg-table-btn>
<bg-table-btn class="btn" :click="()=>{delete_row(row)}" :disabled="row.state == 1 || row.role_type == 1"> <bg-table-btn class="can_click_text" :click="()=>{delete_row(row)}" :disabled="row.state == 1 || row.role_type == 1">
删除 删除
</bg-table-btn> </bg-table-btn>
</template> </template>
...@@ -72,7 +78,7 @@ ...@@ -72,7 +78,7 @@
</bg-pagination> </bg-pagination>
</div> </div>
</div> </div>
<!-- 删除弹窗 --> <!-- 删除弹窗 -->
<el-dialog <el-dialog
custom-class="dialog_box" custom-class="dialog_box"
title="提示" title="提示"
...@@ -84,7 +90,7 @@ ...@@ -84,7 +90,7 @@
} }
" "
> >
<div>确定要选中的数据吗?</div> <div>确定要删除选中的数据吗?</div>
<template v-slot:footer> <template v-slot:footer>
<div class="apaas_button"> <div class="apaas_button">
<el-button type="default" @click="delDialog = false">取 消</el-button> <el-button type="default" @click="delDialog = false">取 消</el-button>
...@@ -92,22 +98,91 @@ ...@@ -92,22 +98,91 @@
</div> </div>
</template> </template>
</el-dialog> </el-dialog>
<!-- 分配用户 -->
<el-dialog
custom-class="distribute_dialog"
title="分配用户"
v-model="distributeDialog"
width="1062px"
:before-close="
() => {
distributeDialog = false;
}
"
>
<div class="distribute_box">
<div class="topFilter">
<div class="left">
<span>已选择</span>
<span class="num">0</span>
<span></span>
<span class="can_click_text" @click="clearSelection">清空</span>
</div>
<div class="right">
<el-select
v-model="userFilter.type"
placeholder="请选择"
style="width: 200px"
>
<el-option
v-for="(item, index) in userTypeList"
:key="'pushOptions' + index"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
<el-select
v-model="userFilter.org"
placeholder="请选择"
style="width: 200px"
>
<el-option
v-for="(item, index) in orgList"
:key="'pushOptions' + index"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
<el-input
v-model="userFilter.search"
placeholder="请输入内容"
style="width: 200px"
:prefix-icon="Search"
/>
<el-button type="primary" @click="distribute">查询</el-button>
<el-button type="default" @click="distributeDialog = false">重置</el-button>
</div>
</div>
<div class="table_box">
</div>
</div>
<template v-slot:footer>
<div class="apaas_button">
<el-button type="default" @click="distributeDialog = false">取 消</el-button>
<el-button type="primary" @click="distribute">确 定</el-button>
</div>
</template>
</el-dialog>
</div> </div>
</template> </template>
<script setup> <script setup>
import { Search } from '@element-plus/icons-vue'
import { reactive, toRefs, ref, onBeforeMount, nextTick } from 'vue' import { reactive, toRefs, ref, onBeforeMount, nextTick } from 'vue'
import axios from '../../../../request/http.js' import axios from '../../../../request/http.js'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
const router = useRouter() const router = useRouter()
const Bgtable = ref(null)
const state = reactive({ const state = reactive({
filter: { filter: {
page: 1, page: 1,
limit: 10, limit: 10,
search: "", search: "",
}, },
headers: [ headers: [
{ {
label: "角色名", label: "角色名",
...@@ -153,6 +228,35 @@ const state = reactive({ ...@@ -153,6 +228,35 @@ const state = reactive({
selection: [], selection: [],
delDialog: false, delDialog: false,
delType: 1, // 删除类型 1-单条删除 2-批量删除 delType: 1, // 删除类型 1-单条删除 2-批量删除
distributeDialog: false, // 分配用户弹窗
})
const userState = reactive({
userFilter: {
type: "",
org: "",
search: "",
},
userTypeList: [
{
name: "全部类型",
value: ""
},
{
name: "业务系统账号",
value: 1
},
{
name: "组织管理员账号",
value: 2
},
{
name: "平台用户账号",
value: 3
},
],
orgList: [
]
}) })
const getRoleRows = () => { const getRoleRows = () => {
let params = {...state.filter} let params = {...state.filter}
...@@ -196,8 +300,12 @@ const changeUseRow = (row) => { ...@@ -196,8 +300,12 @@ const changeUseRow = (row) => {
}) })
} // 更改启用禁用状态 } // 更改启用禁用状态
const selectRows = (rows) => { const selectRows = (data) => {
state.selection = rows state.selection = data.selection
} // 表格多选
const clearSelection = () => {
Bgtable.value.clearSelection()
} }
const register = () => { const register = () => {
...@@ -215,6 +323,14 @@ const edit_row = (row) => { ...@@ -215,6 +323,14 @@ const edit_row = (row) => {
}) })
} // 编辑角色 } // 编辑角色
const distribute_user = (row) => {
state.distributeDialog = true
}
const distribute = () => {
state.distributeDialog = false
}
const delete_row = (row) => { const delete_row = (row) => {
state.actionRow = row state.actionRow = row
state.delType = 1 state.delType = 1
...@@ -242,7 +358,6 @@ const deleteData = () => { ...@@ -242,7 +358,6 @@ const deleteData = () => {
let params = { let params = {
ids: [...ids] ids: [...ids]
} }
console.log(params)
axios axios
.delete(`/apaas/system/v5/role/delete`,{data: {ids:[...ids]}}) .delete(`/apaas/system/v5/role/delete`,{data: {ids:[...ids]}})
.then((res) => { .then((res) => {
...@@ -265,7 +380,15 @@ const { ...@@ -265,7 +380,15 @@ const {
tableRows, tableRows,
tableTotal, tableTotal,
delDialog, delDialog,
selection,
distributeDialog,
} = toRefs(state) } = toRefs(state)
const {
userFilter,
userTypeList,
orgList,
} =toRefs(userState)
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -297,7 +420,66 @@ const { ...@@ -297,7 +420,66 @@ const {
max-height: calc(100% - 64px); max-height: calc(100% - 64px);
} }
} }
.select_text {
display: inline-block;
margin-left: 40px;
font-size: 14px;
color: #404a62;
.num {
color: #202531;
font-weight: 700;
margin: 0 3px;
}
.can_click_text {
margin-left: 24px;
}
}
}
.distribute_dialog {
.distribute_box {
width: 100%;
height: 626px;
.topFilter {
height: 68px;
padding: 16px;
border-bottom: 1px solid #e6e9ef;
display: flex;
text-align: left;
font-size: 14px;
align-items: center;
.left {
width: 240px;
padding-left: 15px;
color: #404a62;
.num {
color: #202531;
font-weight: 700;
margin: 0 3px;
}
.can_click_text {
margin-left: 24px;
}
}
.right {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
.el-button {
margin: 0;
width: 64px;
}
}
}
}
} }
} }
</style>
<style>
.distribute_dialog .el-dialog__footer {
padding: 16px!important;
}
.distribute_dialog .el-dialog__body {
padding: 0px!important;
}
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment