租户管理页面逻辑调整

master
zhangdi 11 months ago
parent b2497a01f1
commit e8679f6120
  1. 94
      src/views/system/tenant.vue

@ -1,25 +1,11 @@
<template> <template>
<basic-container> <basic-container>
<avue-crud :option="option" <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form" :page.sync="page"
:table-loading="loading" :permission="permissionList" :before-open="beforeOpen" @row-del="rowDel" @row-update="rowUpdate"
:data="data" @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
ref="crud" @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
v-model="form"
:page.sync="page"
:permission="permissionList"
:before-open="beforeOpen"
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
<template slot="menuLeft"> <template slot="menuLeft">
<el-button <!-- <el-button
v-if="permission.tenant_add && !recycleMode" v-if="permission.tenant_add && !recycleMode"
type="primary" type="primary"
size="small" size="small"
@ -69,8 +55,8 @@
v-if="userInfo.role_name.includes('administrator') && recycleMode" v-if="userInfo.role_name.includes('administrator') && recycleMode"
@click="handleRecycleBack" @click="handleRecycleBack"
> >
</el-button> </el-button> -->
<el-tooltip class="item" effect="dark" content="给租户配置账号额度、过期时间等授权信息" placement="top"> <!-- <el-tooltip class="item" effect="dark" content="给租户配置账号额度、过期时间等授权信息" placement="top">
<el-button size="small" <el-button size="small"
plain plain
type="info" type="info"
@ -78,10 +64,10 @@
icon="el-icon-setting" icon="el-icon-setting"
@click="handleSetting">批量授权配置 @click="handleSetting">批量授权配置
</el-button> </el-button>
</el-tooltip> </el-tooltip> -->
</template> </template>
<template slot="menuRight"> <template slot="menuRight">
<el-tooltip class="item" effect="dark" content="将自定义的数据源定制为租户绑定的独立数据源" placement="top"> <!-- <el-tooltip class="item" effect="dark" content="将自定义的数据源定制为租户绑定的独立数据源" placement="top">
<el-button size="small" <el-button size="small"
plain plain
v-if="userInfo.role_name.includes('administrator') && !recycleMode" v-if="userInfo.role_name.includes('administrator') && !recycleMode"
@ -96,10 +82,10 @@
icon="el-icon-set-up" icon="el-icon-set-up"
@click="handlePackageSetting">产品包管理 @click="handlePackageSetting">产品包管理
</el-button> </el-button>
</el-tooltip> </el-tooltip> -->
</template> </template>
<template #menu="scope"> <template #menu="scope">
<el-button <!-- <el-button
v-if="userInfo.role_name.includes('administrator') && !recycleMode" v-if="userInfo.role_name.includes('administrator') && !recycleMode"
type="text" type="text"
icon="el-icon-coin" icon="el-icon-coin"
@ -114,45 +100,29 @@
size="small" size="small"
@click.stop="handleRowPackage(scope.row)" @click.stop="handleRowPackage(scope.row)"
>产品包 >产品包
</el-button> </el-button> -->
</template> </template>
<template slot-scope="{row}" <template slot-scope="{row}" slot="accountNumber">
slot="accountNumber">
<el-tag>{{ row.accountNumber > 0 ? row.accountNumber : '不限制' }}</el-tag> <el-tag>{{ row.accountNumber > 0 ? row.accountNumber : '不限制' }}</el-tag>
</template> </template>
<template slot-scope="{row}" <template slot-scope="{row}" slot="expireTime">
slot="expireTime">
<el-tag>{{ row.expireTime ? row.expireTime : '不限制' }}</el-tag> <el-tag>{{ row.expireTime ? row.expireTime : '不限制' }}</el-tag>
</template> </template>
</avue-crud> </avue-crud>
<el-dialog title="租户授权配置" <el-dialog title="租户授权配置" append-to-body :visible.sync="box" width="450px" :close-on-click-modal="false">
append-to-body <avue-form :option="settingOption" v-model="settingForm" @submit="handleSubmit" />
:visible.sync="box"
width="450px" :close-on-click-modal="false">
<avue-form :option="settingOption" v-model="settingForm" @submit="handleSubmit"/>
</el-dialog> </el-dialog>
<el-dialog title="租户数据源配置" <el-dialog title="租户数据源配置" append-to-body :visible.sync="datasourceBox" width="450px" :close-on-click-modal="false">
append-to-body <avue-form :option="datasourceOption" v-model="datasourceForm" @submit="handleDatasourceSubmit" />
:visible.sync="datasourceBox"
width="450px" :close-on-click-modal="false">
<avue-form :option="datasourceOption" v-model="datasourceForm" @submit="handleDatasourceSubmit"/>
</el-dialog> </el-dialog>
<el-dialog title="租户产品包配置" <el-dialog title="租户产品包配置" append-to-body :visible.sync="packageBox" width="450px">
append-to-body <avue-form ref="formPackage" :option="packageOption" v-model="packageForm" @submit="handlePackageSubmit" />
:visible.sync="packageBox"
width="450px">
<avue-form ref="formPackage" :option="packageOption" v-model="packageForm" @submit="handlePackageSubmit"/>
</el-dialog> </el-dialog>
<el-drawer title="租户数据源管理" <el-drawer title="租户数据源管理" append-to-body :visible.sync="datasourceSettingBox" size="1000px"
append-to-body :close-on-click-modal="false">
:visible.sync="datasourceSettingBox"
size="1000px" :close-on-click-modal="false">
<tenant-datasource></tenant-datasource> <tenant-datasource></tenant-datasource>
</el-drawer> </el-drawer>
<el-drawer title="租户产品包管理" <el-drawer title="租户产品包管理" append-to-body :visible.sync="packageSettingBox" size="1000px">
append-to-body
:visible.sync="packageSettingBox"
size="1000px">
<tenant-package></tenant-package> <tenant-package></tenant-package>
</el-drawer> </el-drawer>
</basic-container> </basic-container>
@ -171,10 +141,10 @@ import {
packageSetting, packageSetting,
recycle, pass recycle, pass
} from "@/api/system/tenant"; } from "@/api/system/tenant";
import {getDetail as packageDetail} from "@/api/system/tenantpackage"; import { getDetail as packageDetail } from "@/api/system/tenantpackage";
import {mapGetters} from "vuex"; import { mapGetters } from "vuex";
import {getMenuTree} from "@/api/system/menu"; import { getMenuTree } from "@/api/system/menu";
import {validatenull} from "@/util/validate"; import { validatenull } from "@/util/validate";
export default { export default {
data() { data() {
@ -198,17 +168,20 @@ export default {
height: 'auto', height: 'auto',
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
searchShow: true, searchShow: false,
searchMenuSpan: 6, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
selection: true, selection: true,
editBtn: false,
addBtn: false, addBtn: false,
delBtn: false,
viewBtn: true, viewBtn: true,
menuWidth: 380, menuWidth: 380,
dialogWidth: 900, dialogWidth: 900,
dialogClickModal: false, dialogClickModal: false,
searchEnter:true, searchEnter: true,
columnBtn: false,
column: [ column: [
{ {
label: "租户ID", label: "租户ID",
@ -720,5 +693,4 @@ export default {
}; };
</script> </script>
<style> <style></style>
</style>

Loading…
Cancel
Save