From 79d9fc857559982b00b68b2d709807bdc4cd286f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 11 Apr 2022 10:58:17 +0800
Subject: [PATCH] minio 地址修改
---
src/views/system/tenant.vue | 360 +++++++++++++++++++++++++++++++++++------------------------
1 files changed, 215 insertions(+), 145 deletions(-)
diff --git a/src/views/system/tenant.vue b/src/views/system/tenant.vue
index ceb9a52..13d3c6f 100644
--- a/src/views/system/tenant.vue
+++ b/src/views/system/tenant.vue
@@ -1,71 +1,105 @@
<template>
- <basic-container>
- <avue-crud :option="option"
- :table-loading="loading"
- :data="data"
- ref="crud"
- 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">
+ <basic-container
+ :class="[
+ $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
+ $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : ''
+ ]"
+ >
+ <avue-crud
+ class="tablesss"
+ :option="option"
+ :table-loading="loading"
+ :data="data"
+ ref="crud"
+ 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">
- <el-button type="danger"
- size="small"
- icon="el-icon-delete"
- v-if="permission.tenant_delete"
- plain
- @click="handleDelete">删 除
+ <el-button
+ type="danger"
+ size="small"
+ icon="el-icon-delete"
+ v-if="permission.tenant_delete"
+ plain
+ @click="handleDelete"
+ >删 除
</el-button>
- <el-button size="small"
- plain
- v-if="userInfo.role_name.includes('administrator')"
- icon="el-icon-setting"
- @click="handleSetting">授权配置
+ <el-button
+ size="small"
+ plain
+ v-if="userInfo.role_name.includes('administrator')"
+ icon="el-icon-setting"
+ @click="handleSetting"
+ >授权配置
</el-button>
- <el-button size="small"
- plain
- v-if="userInfo.role_name.includes('administrator')"
- icon="el-icon-coin"
- @click="handleDatasource">数据源配置
+ <el-button
+ size="small"
+ plain
+ v-if="userInfo.role_name.includes('administrator')"
+ icon="el-icon-coin"
+ @click="handleDatasource"
+ >数据源配置
</el-button>
</template>
- <template slot-scope="{row}"
- slot="accountNumber">
- <el-tag>{{ row.accountNumber > 0 ? row.accountNumber : '不限制' }}</el-tag>
+ <template slot-scope="{ row }" slot="accountNumber">
+ <el-tag>{{
+ row.accountNumber > 0 ? row.accountNumber : "不限制"
+ }}</el-tag>
</template>
- <template slot-scope="{row}"
- slot="expireTime">
- <el-tag>{{ row.expireTime ? row.expireTime : '不限制' }}</el-tag>
+ <template slot-scope="{ row }" slot="expireTime">
+ <el-tag>{{ row.expireTime ? row.expireTime : "不限制" }}</el-tag>
</template>
</avue-crud>
- <el-dialog title="租户授权配置"
- append-to-body
- :visible.sync="box"
- width="450px">
- <avue-form :option="settingOption" v-model="settingForm" @submit="handleSubmit"/>
+ <el-dialog
+ title="保安单位授权配置"
+ append-to-body
+ :visible.sync="box"
+ width="450px"
+ >
+ <avue-form
+ :option="settingOption"
+ v-model="settingForm"
+ @submit="handleSubmit"
+ />
</el-dialog>
- <el-dialog title="租户数据源配置"
- append-to-body
- :visible.sync="datasourceBox"
- width="450px">
- <avue-form :option="datasourceOption" v-model="datasourceForm" @submit="handleDatasourceSubmit"/>
+ <el-dialog
+ title="保安单位数据源配置"
+ append-to-body
+ :visible.sync="datasourceBox"
+ width="450px"
+ >
+ <avue-form
+ :option="datasourceOption"
+ v-model="datasourceForm"
+ @submit="handleDatasourceSubmit"
+ />
</el-dialog>
</basic-container>
</template>
<script>
-import {getList, getDetail, remove, update, add, setting, datasource} from "@/api/system/tenant";
-import {mapGetters} from "vuex";
+import {
+ getList,
+ getDetail,
+ remove,
+ update,
+ add,
+ setting,
+ datasource
+} from "@/api/system/tenant";
+import { mapGetters } from "vuex";
export default {
data() {
@@ -79,11 +113,13 @@
page: {
pageSize: 10,
currentPage: 1,
- total: 0
+ total: 0,
+ ...this.$store.state.control.changePageSize
},
option: {
- height: 'auto',
+ height: "auto",
calcHeight: 30,
+ labelWidth: "125",
tip: false,
searchShow: true,
searchMenuSpan: 6,
@@ -93,48 +129,61 @@
viewBtn: true,
dialogWidth: 900,
dialogClickModal: false,
+ ...this.$store.state.control.clearOtherBut,
column: [
{
- label: "租户ID",
+ label: "保安单位ID",
prop: "tenantId",
- width: 100,
+ width: 130,
+ searchLabelWidth: "150",
+ searchSpan: 5,
search: true,
addDisplay: false,
editDisplay: false,
span: 24,
- rules: [{
- required: true,
- message: "请输入租户ID",
- trigger: "blur"
- }]
+ rules: [
+ {
+ required: true,
+ message: "请输入保安单位ID",
+ trigger: "blur"
+ }
+ ]
},
{
- label: "租户名称",
+ label: "保安企业名称",
+ searchLabelWidth: "150",
prop: "tenantName",
+ searchSpan: 5,
search: true,
- width: 180,
+ width: 280,
span: 24,
- rules: [{
- required: true,
- message: "请输入参数名称",
- trigger: "blur"
- }]
+ rules: [
+ {
+ required: true,
+ message: "请输入参数名称",
+ trigger: "blur"
+ }
+ ]
},
{
label: "联系人",
+ searchLabelWidth: "100",
prop: "linkman",
- width: 100,
+ width: 200,
search: true,
- rules: [{
- required: true,
- message: "请输入联系人",
- trigger: "blur"
- }]
+ searchSpan: 5,
+ rules: [
+ {
+ required: true,
+ message: "请输入联系人",
+ trigger: "blur"
+ }
+ ]
},
{
label: "联系电话",
prop: "contactNumber",
- width: 150,
+ width: 150
},
{
label: "联系地址",
@@ -142,7 +191,7 @@
span: 24,
minRows: 2,
type: "textarea",
- hide: true,
+ hide: true
},
{
label: "账号额度",
@@ -150,7 +199,7 @@
width: 90,
slot: true,
addDisplay: false,
- editDisplay: false,
+ editDisplay: false
},
{
label: "过期时间",
@@ -158,26 +207,26 @@
width: 180,
slot: true,
addDisplay: false,
- editDisplay: false,
+ editDisplay: false
},
{
label: "绑定域名",
prop: "domain",
- span: 24,
+ span: 24
},
{
label: "系统背景",
prop: "backgroundUrl",
- type: 'upload',
- listType: 'picture-img',
- action: '/api/blade-resource/oss/endpoint/put-file',
+ type: "upload",
+ listType: "picture-img",
+ action: "/api/blade-resource/oss/endpoint/put-file",
propsHttp: {
- res: 'data',
- url: 'link',
+ res: "data",
+ url: "link"
},
hide: true,
- span: 24,
- },
+ span: 24
+ }
]
},
data: [],
@@ -188,7 +237,7 @@
label: "账号额度",
prop: "accountNumber",
type: "number",
- span: 24,
+ span: 24
},
{
label: "过期时间",
@@ -196,8 +245,8 @@
type: "date",
format: "yyyy-MM-dd hh:mm:ss",
valueFormat: "yyyy-MM-dd hh:mm:ss",
- span: 24,
- },
+ span: 24
+ }
]
},
datasourceForm: {},
@@ -214,12 +263,14 @@
label: "name",
value: "id"
},
- rules: [{
- required: true,
- message: "请选择数据源",
- trigger: "blur"
- }]
- },
+ rules: [
+ {
+ required: true,
+ message: "请选择数据源",
+ trigger: "blur"
+ }
+ ]
+ }
]
}
};
@@ -245,32 +296,41 @@
return this.selectionList[0].tenantId;
}
},
+ mounted() {
+ this.$store.commit("setWindowSizeHeightAdd");
+ },
methods: {
rowSave(row, done, loading) {
- add(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- window.console.log(error);
- loading();
- });
+ add(row).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ done();
+ },
+ error => {
+ window.console.log(error);
+ loading();
+ }
+ );
},
rowUpdate(row, index, done, loading) {
- update(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- window.console.log(error);
- loading();
- });
+ update(row).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ done();
+ },
+ error => {
+ window.console.log(error);
+ loading();
+ }
+ );
},
rowDel(row) {
this.$confirm("确定将选择数据删除?", {
@@ -356,7 +416,7 @@
});
} else {
this.settingForm.accountNumber = -1;
- this.settingForm.expireTime = '';
+ this.settingForm.expireTime = "";
}
this.box = true;
},
@@ -376,31 +436,37 @@
this.datasourceBox = true;
},
handleSubmit(form, done, loading) {
- setting(this.ids, form).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "配置成功!"
- });
- done();
- this.box = false;
- }, error => {
- window.console.log(error);
- loading();
- });
+ setting(this.ids, form).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "配置成功!"
+ });
+ done();
+ this.box = false;
+ },
+ error => {
+ window.console.log(error);
+ loading();
+ }
+ );
},
handleDatasourceSubmit(form, done, loading) {
- datasource(this.tenantId, form.datasourceId).then(() => {
- this.$message({
- type: "success",
- message: "配置成功!"
- });
- done();
- this.datasourceBox = false;
- }, error => {
- window.console.log(error);
- loading();
- });
+ datasource(this.tenantId, form.datasourceId).then(
+ () => {
+ this.$message({
+ type: "success",
+ message: "配置成功!"
+ });
+ done();
+ this.datasourceBox = false;
+ },
+ error => {
+ window.console.log(error);
+ loading();
+ }
+ );
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
@@ -413,11 +479,16 @@
},
onLoad(page, params = {}) {
this.loading = true;
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+ getList(
+ page.currentPage,
+ page.pageSize,
+ Object.assign(params, this.query)
+ ).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
this.loading = false;
+ this.$store.commit("setWindowSizeHeightAdd");
this.selectionClear();
});
}
@@ -425,5 +496,4 @@
};
</script>
-<style>
-</style>
+<style></style>
--
Gitblit v1.9.3