增加部门、用户、角色、日志按钮权限配置

This commit is contained in:
龙运模 2024-07-24 10:38:45 +08:00
parent c58386c1e4
commit babaf8f430
9 changed files with 75 additions and 24 deletions

View File

@ -1,5 +1,6 @@
<template> <template>
<el-button v-auths="['organizationImport','userImport']" type="primary" :size="size" plain @click="importFile">批量导入</el-button> <slot name="header"></slot>
<!--<el-button v-auths="['organizationImport','userImport']" type="primary" :size="size" plain @click="importFile">批量导入</el-button>-->
<el-dialog v-bind="$attrs" :title="title" v-model="visible" :width="560" destroy-on-close draggable @closed="visible=false"> <el-dialog v-bind="$attrs" :title="title" v-model="visible" :width="560" destroy-on-close draggable @closed="visible=false">
<div class="importBody"> <div class="importBody">
@ -38,7 +39,7 @@
<!--如果数据导入中途业务出错请不要刷新页面修改后继续点击导入--> <!--如果数据导入中途业务出错请不要刷新页面修改后继续点击导入-->
</span> </span>
<span class="btn"> <span class="btn">
<slot></slot> <slot name="download"></slot>
</span> </span>
</div> </div>
<div class="importBox" v-if="progressShow"> <div class="importBox" v-if="progressShow">

View File

@ -3,8 +3,13 @@
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button> <el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button>
<scImport :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess"> <scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
<div @click="importTemplate">下载导入模版</div> <template #header>
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
</template>
<template #download>
<div v-auth="'companyImportTemplate'" @click="importTemplate">下载导入模版</div>
</template>
</scImport> </scImport>
</div> </div>
<div class="right-panel"> <div class="right-panel">
@ -157,6 +162,11 @@ export default {
}, },
// //
importFile(){
this.$nextTick(()=>{
this.$refs.scImport.importFile();
})
},
async importTemplate() { async importTemplate() {
const res = await this.$API.orders.order.maintenance.template.post(); const res = await this.$API.orders.order.maintenance.template.post();
const blob = new Blob([res]); const blob = new Blob([res]);

View File

@ -3,8 +3,13 @@
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button> <el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button>
<scImport :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess"> <scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
<div @click="importTemplate">下载导入模版</div> <template #header>
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
</template>
<template #download>
<div v-auth="'companyImportTemplate'" @click="importTemplate">下载导入模版</div>
</template>
</scImport> </scImport>
</div> </div>
<div class="right-panel"> <div class="right-panel">
@ -156,6 +161,11 @@ export default {
}, },
// //
importFile(){
this.$nextTick(()=>{
this.$refs.scImport.importFile();
})
},
async importTemplate() { async importTemplate() {
const res = await this.$API.orders.order.maintenance.template.post(); const res = await this.$API.orders.order.maintenance.template.post();
const blob = new Blob([res]); const blob = new Blob([res]);

View File

@ -3,8 +3,13 @@
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button> <el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button>
<scImport :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess"> <scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
<div @click="importTemplate">下载导入模版</div> <template #header>
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
</template>
<template #download>
<div v-auth="'companyImportTemplate'" @click="importTemplate">下载导入模版</div>
</template>
</scImport> </scImport>
</div> </div>
<div class="right-panel"> <div class="right-panel">
@ -156,6 +161,11 @@ export default {
}, },
// //
importFile(){
this.$nextTick(()=>{
this.$refs.scImport.importFile();
})
},
async importTemplate() { async importTemplate() {
const res = await this.$API.orders.order.maintenance.template.post(); const res = await this.$API.orders.order.maintenance.template.post();
const blob = new Blob([res]); const blob = new Blob([res]);

View File

@ -3,8 +3,13 @@
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" v-auth="'addCompany'" :size="size" icon="el-icon-plus" @click="add">新增公司</el-button> <el-button type="primary" v-auth="'addCompany'" :size="size" icon="el-icon-plus" @click="add">新增公司</el-button>
<scImport :size="size" title="批量导入公司组织" @parentParams="importUpload" @importSuccess="importSuccess"> <scImport ref="scImport" :size="size" title="批量导入公司组织" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header>
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
</template>
<template #download>
<div v-auth="'companyImportTemplate'" @click="importTemplate">下载导入模版</div> <div v-auth="'companyImportTemplate'" @click="importTemplate">下载导入模版</div>
</template>
</scImport> </scImport>
</div> </div>
<div class="right-panel"> <div class="right-panel">
@ -162,6 +167,11 @@ export default {
}, },
// //
importFile(){
this.$nextTick(()=>{
this.$refs.scImport.importFile();
})
},
async importTemplate() { async importTemplate() {
const res = await this.$API.system.company.template.post(); const res = await this.$API.system.company.template.post();
const blob = new Blob([res]); const blob = new Blob([res]);

View File

@ -8,7 +8,7 @@
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="8"> <scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="8">
<el-button :size="size" icon="sc-icon-Download" @click="exportData">下载</el-button> <el-button v-auth="'sysLogExport'" :size="size" icon="sc-icon-Download" @click="exportData">下载</el-button>
</scExport> </scExport>
</div> </div>
</div> </div>

View File

@ -2,7 +2,7 @@
<el-container class="mainBox"> <el-container class="mainBox">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增角色</el-button> <el-button type="primary" v-auth="'addRoles'" :size="size" icon="el-icon-plus" @click="add">新增角色</el-button>
<!--<el-button type="danger" :size="size" plain icon="el-icon-delete" :disabled="roleCheckList.length==0" @click="batch_del"></el-button>--> <!--<el-button type="danger" :size="size" plain icon="el-icon-delete" :disabled="roleCheckList.length==0" @click="batch_del"></el-button>-->
<!--<el-button type="primary" :size="size" plain :disabled="roleCheckList.length!=1" @click="permission">权限设置</el-button>--> <!--<el-button type="primary" :size="size" plain :disabled="roleCheckList.length!=1" @click="permission">权限设置</el-button>-->
</div> </div>
@ -22,8 +22,8 @@
<span class="custom-tree-node"> <span class="custom-tree-node">
<span>{{ node.label }}</span> <span>{{ node.label }}</span>
<span class="btnBox"> <span class="btnBox">
<el-icon class="btn" @click="table_edit(data)"><sc-icon-Edit/></el-icon> <el-icon class="btn" v-auth="'disableRoles'" @click="table_edit(data)"><sc-icon-Edit/></el-icon>
<el-icon class="btn" @click="table_del(data)"><sc-icon-Delete/></el-icon> <el-icon class="btn" v-auth="'delRoles'" @click="table_del(data)"><sc-icon-Delete/></el-icon>
</span> </span>
</span> </span>
</template> </template>
@ -34,11 +34,11 @@
<el-container> <el-container>
<el-main class="nopadding"> <el-main class="nopadding">
<div class="btnPot" v-if="activeNum==0"> <div class="btnPot" v-if="activeNum==0">
<el-button type="primary" plain :size="size" :loading="isSave" @click="submit">保存权限</el-button> <el-button type="primary" v-auth="'addRoleAuth'" plain :size="size" :loading="isSave" @click="submit">保存权限</el-button>
</div> </div>
<div class="btnPot" v-if="activeNum==2"> <div class="btnPot" v-if="activeNum==2">
<el-button type="danger" plain :size="size" @click="deleteMember">移除成员</el-button> <el-button type="danger" v-auth="'roleRemovedUsers'" plain :size="size" @click="deleteMember">移除成员</el-button>
<el-button type="primary" plain :size="size" @click="getDeptTree">添加成员</el-button> <el-button type="primary" v-auth="'roleAddedUsers'" plain :size="size" @click="getDeptTree">添加成员</el-button>
</div> </div>
<el-tabs class="role_tabs" tab-position="top" @tab-change="activeClick"> <el-tabs class="role_tabs" tab-position="top" @tab-change="activeClick">
<el-tab-pane label="功能权限"> <el-tab-pane label="功能权限">

View File

@ -17,14 +17,19 @@
<el-button type="danger" v-auth="'delUser'" plain :size="size" icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button> <el-button type="danger" v-auth="'delUser'" plain :size="size" icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button>
<el-button type="primary" v-auth="'addUserRoles'" plain :size="size" :disabled="selection.length==0" @click="role">分配角色</el-button> <el-button type="primary" v-auth="'addUserRoles'" plain :size="size" :disabled="selection.length==0" @click="role">分配角色</el-button>
<el-button type="primary" plain :size="size" :disabled="selection.length==0" @click="rePwd">密码重置</el-button> <el-button type="primary" plain :size="size" :disabled="selection.length==0" @click="rePwd">密码重置</el-button>
<scImport :size="size" title="批量导入用户" @parentParams="importUpload" @importSuccess="importSuccess"> <scImport ref="scImport" :size="size" title="批量导入用户" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header>
<el-button v-auth="'userImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
</template>
<template #download>
<div v-auth="'userImportTemplate'" @click="importTemplate">下载导入模版</div> <div v-auth="'userImportTemplate'" @click="importTemplate">下载导入模版</div>
</template>
</scImport> </scImport>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <div class="right-panel-search">
<scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="7"> <scExport :size="size" @exportData="exportData" @updateShow="exportChangeShow" :show="exportShow" type="7">
<el-button :size="size" v-auths="'userExport'" icon="sc-icon-Download" @click="exportData">下载</el-button> <el-button :size="size" v-auth="'userExport'" icon="sc-icon-Download" @click="exportData">下载</el-button>
</scExport> </scExport>
</div> </div>
</div> </div>
@ -197,6 +202,11 @@
}, },
// //
importFile(){
this.$nextTick(()=>{
this.$refs.scImport.importFile();
})
},
async importTemplate() { async importTemplate() {
const res = await this.$API.system.user.template.post(); const res = await this.$API.system.user.template.post();
const blob = new Blob([res]); const blob = new Blob([res]);