|
@@ -1,481 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="container">
|
|
|
- <div class="top">
|
|
|
- <ul class="tab-ul">
|
|
|
- <li :class="['tab-li',{act: default_tab===item.key}]" v-for="item in authTabs" :key="item.key" @click="changeTab(item)">{{item.label}}</li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="top">
|
|
|
- <div v-if="authTabs.length">
|
|
|
- <el-input
|
|
|
- v-model="searchForm.key_word"
|
|
|
- :placeholder="default_tab === 5 ? this.$t('SystemManage.OperateAuth.placeholder01') : this.$t('SystemManage.OperateAuth.placeholder02')"
|
|
|
- style="width: 300px;margin-right:20px;"
|
|
|
- @change="changeUser"
|
|
|
- clearable
|
|
|
- >
|
|
|
- <i slot="prefix" class="el-input__icon el-icon-search"/>
|
|
|
- </el-input>
|
|
|
- </div>
|
|
|
- <div v-if="authTabs.length" style="margin-right:auto;">
|
|
|
- <el-cascader
|
|
|
- v-model="searchForm.classification"
|
|
|
- :options="classificationList"
|
|
|
- :props="{
|
|
|
- value: 'ClassifyId',
|
|
|
- label: 'ClassifyName',
|
|
|
- children: 'Child',
|
|
|
- emitPath: false,
|
|
|
- multiple:true
|
|
|
- }"
|
|
|
- collapse-tags
|
|
|
- :show-all-levels="false"
|
|
|
- :key="default_tab"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- @change="changeUser"
|
|
|
- :placeholder="this.$t('SystemManage.OperateAuth.placeholder03')"
|
|
|
- style="width: 250px;"
|
|
|
- />
|
|
|
- <el-cascader
|
|
|
- v-model="searchForm.user"
|
|
|
- :options="userList"
|
|
|
- :props="{
|
|
|
- value: 'AdminId',
|
|
|
- label: 'RealName',
|
|
|
- children: 'ChildrenList',
|
|
|
- emitPath: false
|
|
|
- }"
|
|
|
- collapse-tags
|
|
|
- :show-all-levels="false"
|
|
|
- clearable
|
|
|
- @change="changeUser"
|
|
|
- filterable
|
|
|
- :placeholder="this.$t('SystemManage.OperateAuth.placeholder04')"
|
|
|
- style="margin: 0 20px"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <el-button type="primary" @click="editAuthHandle({},'multiple')"
|
|
|
- v-if="[3,4].includes(default_tab)?authBtn('edit'):authTabs.length">{{$t('SystemManage.OperateAuth.btn_text01')}}</el-button>
|
|
|
- <el-button type="primary" @click="edbAuthSetHandle({},'multiple')" v-if="[3,4].includes(default_tab
|
|
|
- )&&authBtn('auth')">{{$t('SystemManage.OperateAuth.btn_text02')}}</el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <el-table
|
|
|
- :data="tableData"
|
|
|
- ref="table"
|
|
|
- element-loading-text="加载中..."
|
|
|
- v-loading="tableLoading"
|
|
|
- border
|
|
|
- style="margin:30px 0"
|
|
|
- @selection-change="selectionChange"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- width="55"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- v-for="item in tableColums"
|
|
|
- :key="item.label"
|
|
|
- :label="item.label"
|
|
|
- :prop="item.key"
|
|
|
- :width="item.widthsty"
|
|
|
- :min-width="item.minwidthsty"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot-scope="{row}">
|
|
|
- <template v-if="item.key==='handle'">
|
|
|
- <span class="editsty" @click="edbAuthSetHandle(row)" v-if="[3,4].includes(default_tab
|
|
|
- )&&authBtn('auth')">{{$t('SystemManage.OperateAuth.btn_text02')}}</span>
|
|
|
- <span class="editsty" @click="editAuthHandle(row)" v-if="[3,4].includes(default_tab)?authBtn('edit'):authTabs.length">{{$t('Dialog.title_prefix_edit')}}</span>
|
|
|
- </template>
|
|
|
-
|
|
|
- <span v-else>{{ row[item.key] }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <div slot="empty" style="padding: 100px 0">
|
|
|
- <tableNoData :text="$t('Table.prompt_slogan')" size="mini"/>
|
|
|
- </div>
|
|
|
- </el-table>
|
|
|
- <el-col :span="24" style="height:35px;text-align: right;float: none;">
|
|
|
- <m-page
|
|
|
- :page_no="page_no"
|
|
|
- :pageSize="pageSize"
|
|
|
- :total="total"
|
|
|
- @handleCurrentChange="pageChange"
|
|
|
- />
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <!-- 编辑弹窗 -->
|
|
|
- <m-dialog
|
|
|
- :show.sync="isOpenDialog"
|
|
|
- width="650px"
|
|
|
- :title="dialogForm.title"
|
|
|
- @close="isOpenDialog = false"
|
|
|
- >
|
|
|
- <div class="dialog-cont operateauth-dialog-cont">
|
|
|
- <el-form
|
|
|
- ref="formRef"
|
|
|
- label-position="left"
|
|
|
- hide-required-asterisk
|
|
|
- label-width="80px"
|
|
|
- :model="dialogForm"
|
|
|
- :rules="dialogFormRules"
|
|
|
- @close="cancelDialogHandle"
|
|
|
- >
|
|
|
- <el-form-item :label="$t('SystemManage.OperateAuth.original_creator')">
|
|
|
- <span>{{ dialogForm.old_user_name }}</span>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item :label="$t('SystemManage.OperateAuth.new_creator')" prop="new_user">
|
|
|
- <el-cascader
|
|
|
- v-model="dialogForm.new_user"
|
|
|
- :options="userList"
|
|
|
- :props="{
|
|
|
- value: 'AdminId',
|
|
|
- label: 'RealName',
|
|
|
- children: 'ChildrenList',
|
|
|
- emitPath: false
|
|
|
- }"
|
|
|
- collapse-tags
|
|
|
- :show-all-levels="false"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- :placeholder="$t('SystemManage.OperateAuth.placeholder04')"
|
|
|
- style="width: 250px"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
- <div class="dia-bot">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- style="margin-right: 60px"
|
|
|
- @click="saveHandle"
|
|
|
- >{{$t('Dialog.confirm_save_btn')}}</el-button
|
|
|
- >
|
|
|
- <el-button type="primary" plain @click="cancelDialogHandle"
|
|
|
- >{{$t('Dialog.cancel_btn')}}</el-button
|
|
|
- >
|
|
|
- </div>
|
|
|
- </m-dialog>
|
|
|
-
|
|
|
- <!-- 指标权限弹窗 -->
|
|
|
- <edbSetDialog
|
|
|
- :isShow.sync="isEdbSetDialog"
|
|
|
- :edbForm="edbForm"
|
|
|
- :users="userList"
|
|
|
- @setSuccess="()=>{$refs.table.clearSelection();selectedArr=[]}"
|
|
|
- />
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import { operateAuthInterface } from '@/api/modules/setApi';
|
|
|
-// import { customInterence } from '@/api/modules/crmApi';
|
|
|
-import {dataBaseInterface} from '@/api/modules/chartApi'
|
|
|
-import mPage from '@/components/mPage';
|
|
|
-import mDialog from '@/components/mDialog';
|
|
|
-import edbSetDialog from './components/authSetDialog.vue';
|
|
|
-export default {
|
|
|
- components: { mPage,mDialog,edbSetDialog },
|
|
|
- computed: {
|
|
|
- tableColums() {
|
|
|
- return this.default_tab === 5 ? [
|
|
|
- { label: this.$t('SystemManage.OperateAuth.table_col_name01'),key: 'Name' },
|
|
|
- { label: this.$t('SystemManage.OperateAuth.table_col_name02'),key: 'ClassifyName' },
|
|
|
- { label: this.$t('SystemManage.OperateAuth.table_col_name03'),key: 'CreateUserName' },
|
|
|
- { label: this.$t('Table.column_operations'),key: 'handle' },
|
|
|
- ] : [
|
|
|
- { label: this.$t('SystemManage.OperateAuth.table_col_name04'),key: 'Code' },
|
|
|
- { label: this.$t('SystemManage.OperateAuth.table_col_name05'),key: 'Name' },
|
|
|
- { label: this.$t('SystemManage.OperateAuth.table_col_name03'),key: 'CreateUserName' },
|
|
|
- { label: this.$t('Table.column_operations'),key: 'handle' },
|
|
|
- ]
|
|
|
- },
|
|
|
- //权限配置化后的tabs
|
|
|
- authTabs(){
|
|
|
- const {operateAuthPermission,checkPermissionBtn} = this.permissionBtn
|
|
|
- const operaMap = {
|
|
|
- 1:checkPermissionBtn(operateAuthPermission.operateAuth_manual),
|
|
|
- 2:checkPermissionBtn(operateAuthPermission.operateAuth_mysteel),
|
|
|
- 3:checkPermissionBtn(operateAuthPermission.operateAuth_etaLib),
|
|
|
- 4:checkPermissionBtn(operateAuthPermission.operateAuth_etaPredictLib),
|
|
|
- 5:checkPermissionBtn(operateAuthPermission.operateAuth_chartLib),
|
|
|
- }
|
|
|
- let temp = []
|
|
|
- for(const k in operaMap){
|
|
|
- console.log('k',k,operaMap[k])
|
|
|
- if(operaMap[k]){
|
|
|
- temp.push(this.tabs[k-1])
|
|
|
- }
|
|
|
- }
|
|
|
- return temp
|
|
|
- },
|
|
|
- tabs(){
|
|
|
- return [
|
|
|
- { label: this.$t('SystemManage.OperateAuth.tab01'), key: 1 },
|
|
|
- { label: this.$t('SystemManage.OperateAuth.tab02'), key: 2 },
|
|
|
- { label: this.$t('SystemManage.OperateAuth.tab03'), key: 3 },
|
|
|
- { label: this.$t('SystemManage.OperateAuth.tab04'), key: 4 },
|
|
|
- { label: this.$t('SystemManage.OperateAuth.tab05'), key: 5 }
|
|
|
- ]
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- default_tab: 1,
|
|
|
- // tabs:[
|
|
|
- // { label: '手工数据指标', key: 1 },
|
|
|
- // { label: '钢联化工数据库', key: 2 },
|
|
|
- // { label: 'ETA指标库', key: 3 },
|
|
|
- // { label: 'ETA预测指标', key: 4 },
|
|
|
- // { label: '图库', key: 5 }
|
|
|
- // ],
|
|
|
- selectedArr: [],//多选数组
|
|
|
- tableLoading: false,
|
|
|
- tableData:[],
|
|
|
- page_no: 1,
|
|
|
- total: 0,
|
|
|
- pageSize: 10,
|
|
|
-
|
|
|
- userList: [],
|
|
|
- classificationList:[],
|
|
|
- searchForm: {
|
|
|
- classification:[],
|
|
|
- user: '',
|
|
|
- key_word: ''
|
|
|
- },
|
|
|
-
|
|
|
- isOpenDialog: false,
|
|
|
- dialogForm: {
|
|
|
- title: '',
|
|
|
- old_user_name: '',
|
|
|
- ids:'',
|
|
|
- new_user: '',
|
|
|
- },
|
|
|
- dialogFormRules: {
|
|
|
- new_user: [
|
|
|
- { required: true, message: this.$t('SystemManage.OperateAuth.placeholder05'), trigger: 'change' }
|
|
|
- ]
|
|
|
- },
|
|
|
-
|
|
|
- /* 指标权限设置 */
|
|
|
- isEdbSetDialog: false,
|
|
|
- edbForm: {}
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
-
|
|
|
- getTableData() {
|
|
|
- this.tableLoading = true;
|
|
|
- let params = {
|
|
|
- Source: this.default_tab,
|
|
|
- UserId: this.searchForm.user || '',
|
|
|
- CurrentIndex: this.page_no,
|
|
|
- PageSize: this.pageSize,
|
|
|
- Keyword: this.searchForm.key_word,
|
|
|
- Classify:this.searchForm.classification.join(',')
|
|
|
- }
|
|
|
- operateAuthInterface.list(params).then(res => {
|
|
|
- this.tableLoading = false;
|
|
|
- if( res.Ret!==200 )return
|
|
|
-
|
|
|
- const { Data } = res;
|
|
|
- Data.List && Data.List.forEach(_ => {
|
|
|
- _.ModifyTime = _.ModifyTime ? this.$moment(_.ModifyTime).format('YYYY-MM-DD HH:mm:ss') : ''
|
|
|
- _.PublishTime = _.PublishTime ? this.$moment(_.PublishTime).format('YYYY-MM-DD HH:mm:ss') : ''
|
|
|
- })
|
|
|
- this.tableData = Data.List || [];
|
|
|
- this.total=parseInt(Data.Paging.Totals);
|
|
|
- });
|
|
|
- },
|
|
|
- /* 获取用户列表 */
|
|
|
- getUserList() {
|
|
|
- // customInterence.getSale({Status: 0,AllEnabled: true}).then(res => {
|
|
|
- dataBaseInterface.getEdbChartAdminList({Source: this.default_tab}).then(res=>{
|
|
|
- if(res.Ret !== 200) return
|
|
|
-
|
|
|
- this.userList = res.Data || [];
|
|
|
- })
|
|
|
- },
|
|
|
- /* 获取分类列表 */
|
|
|
- getClassificationList() {
|
|
|
- operateAuthInterface.getClassificationBySource({Source: this.default_tab}).then(res => {
|
|
|
- if(res.Ret == 200){
|
|
|
- this.classificationList = res.Data.List || []
|
|
|
- //如果是三级分类,去掉最后一级分类的child
|
|
|
- if([3,4,5].includes(this.default_tab)){
|
|
|
- this.filterNodes(this.classificationList)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- filterNodes(arr) {
|
|
|
- arr.length && arr.forEach(item => {
|
|
|
- item.Child && item.Child.length && this.filterNodes(item.Child)
|
|
|
- if(item.Child && !item.Child.length) {
|
|
|
- delete item.Child
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- changeTab({key}) {
|
|
|
- this.default_tab = key;
|
|
|
- this.searchForm.classification=[]
|
|
|
- this.searchForm.user=''
|
|
|
- this.page_no = 1;
|
|
|
- this.getClassificationList()
|
|
|
- this.getUserList()
|
|
|
- this.getTableData();
|
|
|
- },
|
|
|
-
|
|
|
- pageChange(page) {
|
|
|
- this.page_no = page;
|
|
|
- this.getTableData()
|
|
|
- },
|
|
|
-
|
|
|
- changeUser() {
|
|
|
- this.page_no = 1;
|
|
|
- this.getTableData();
|
|
|
- },
|
|
|
-
|
|
|
- /* 复选框选择 */
|
|
|
- selectionChange(val) {
|
|
|
- console.log(val)
|
|
|
- this.selectedArr = val || [];
|
|
|
- },
|
|
|
-
|
|
|
- /* 编辑 */
|
|
|
- editAuthHandle({DataId,CreateUserName,},type='single') {
|
|
|
- if(type === 'multiple' && !this.selectedArr.length) return this.$message.warning(this.$t('SystemManage.OperateAuth.msg01'))
|
|
|
-
|
|
|
- this.dialogForm = {
|
|
|
- title: type === 'multiple' ? this.$t('SystemManage.OperateAuth.edit_title02') : this.$t('SystemManage.OperateAuth.edit_title01'),
|
|
|
- old_user_name: type === 'multiple' ? this.selectedArr[0].CreateUserName : CreateUserName,
|
|
|
- ids: type === 'multiple' ? this.selectedArr.map(_ => _.DataId) : [DataId],
|
|
|
- new_user: ''
|
|
|
- }
|
|
|
- this.isOpenDialog = true;
|
|
|
- },
|
|
|
-
|
|
|
- async saveHandle() {
|
|
|
- await this.$refs.formRef.validate()
|
|
|
-
|
|
|
- const res = await operateAuthInterface.authEdit({
|
|
|
- Source: this.default_tab,
|
|
|
- DataIdList: this.dialogForm.ids,
|
|
|
- NewUserId: Number(this.dialogForm.new_user)
|
|
|
- })
|
|
|
-
|
|
|
- if(res.Ret !== 200) return
|
|
|
- this.$message.success(res.Msg);
|
|
|
- this.cancelDialogHandle();
|
|
|
- this.getTableData();
|
|
|
- },
|
|
|
-
|
|
|
- /* 指标权限配置 */
|
|
|
- edbAuthSetHandle({DataId,CreateUserId},type='') {
|
|
|
- if(type === 'multiple' && !this.selectedArr.length) return this.$message.warning(this.$t('SystemManage.OperateAuth.msg01'))
|
|
|
- if(type === 'multiple' && this.selectedArr.some(_ => this.selectedArr[0].CreateUserId!==_.CreateUserId)) return this.$message.warning('所选指标创建人不是同一用户,请重新选择!')
|
|
|
-
|
|
|
- this.edbForm = {
|
|
|
- title: type === 'multiple' ? this.$t('SystemManage.OperateAuth.permission_title02') : this.$t('SystemManage.OperateAuth.permission_title01'),
|
|
|
- createId: type === 'multiple' ? this.selectedArr[0].CreateUserId : CreateUserId,
|
|
|
- ids: type === 'multiple' ? this.selectedArr.map(_ => _.DataId) : [DataId],
|
|
|
- }
|
|
|
- this.isEdbSetDialog = true;
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- cancelDialogHandle() {
|
|
|
- this.$refs.formRef.resetFields();
|
|
|
- this.isOpenDialog = false
|
|
|
- },
|
|
|
- authBtn(type){
|
|
|
- const {operateAuthPermission,checkPermissionBtn} = this.permissionBtn
|
|
|
- const authMap = {
|
|
|
- 3:operateAuthPermission.operateAuth_etaLib_authSetting,
|
|
|
- 4:operateAuthPermission.operateAuth_etaPredictLib_authSetting,
|
|
|
- }
|
|
|
- const editMap = {
|
|
|
- 3:operateAuthPermission.operateAuth_etaLib_edit,
|
|
|
- 4:operateAuthPermission.operateAuth_etaPredictLib_edit,
|
|
|
- }
|
|
|
- if(type==='auth'){
|
|
|
- return checkPermissionBtn(authMap[this.default_tab])
|
|
|
- }else{
|
|
|
- return checkPermissionBtn(editMap[this.default_tab])
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- if(this.authTabs.length){
|
|
|
- this.getUserList();
|
|
|
- }
|
|
|
- },
|
|
|
- created(){
|
|
|
- if(this.authTabs.length){
|
|
|
- this.default_tab = this.authTabs[0].key
|
|
|
- this.getClassificationList()
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-@import "~@/styles/theme-vars.scss";
|
|
|
-.container {
|
|
|
- box-sizing: border-box;
|
|
|
- min-height: calc(100vh - 120px);
|
|
|
- padding: 20px 30px;
|
|
|
- background: #fff;
|
|
|
- position: relative;
|
|
|
- border: 1px solid #ECECEC;
|
|
|
- border-radius: 4px;
|
|
|
- box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
|
|
|
- .top {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- flex-wrap: wrap;
|
|
|
- margin-top: 15px;
|
|
|
- .tab-ul,.right-side {
|
|
|
- display: flex;
|
|
|
- margin: 5px 0;
|
|
|
- .tab-li {
|
|
|
- margin-right: 20px;
|
|
|
- min-width: 120px;
|
|
|
- padding: 12px 0;
|
|
|
- text-align: center;
|
|
|
- color: $theme-color;
|
|
|
- border: 1px solid $theme-color;
|
|
|
- background: #e6eefb;
|
|
|
- border-radius: 4px;
|
|
|
- cursor: pointer;
|
|
|
- &.act {
|
|
|
- color: #fff;
|
|
|
- border: 1px solid $theme-color;
|
|
|
- background: $theme-color;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-.dialog-cont {
|
|
|
- padding-left: 110px;
|
|
|
-}
|
|
|
-.dia-bot {
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- margin-top: 50px;
|
|
|
-}
|
|
|
-</style>
|
|
|
-<style lang="scss">
|
|
|
-.operateauth-dialog-cont .el-input {
|
|
|
- width: 100%;
|
|
|
-}
|
|
|
-</style>
|