From 710c369c575b65c80174aaab4b04a2aa460e76c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=9C=E6=96=B9=E7=99=BD?= <457776125@qq.com>
Date: Wed, 15 Mar 2023 17:10:35 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=94=B9=E9=80=A0?=
=?UTF-8?q?=E5=AE=8C=E6=88=90=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/system/tenant/form.vue | 131 +++++++++
src/views/system/tenant/index.vue | 392 +++++++++++++++----------
src/views/system/tenant/tenant.data.ts | 153 ----------
3 files changed, 371 insertions(+), 305 deletions(-)
create mode 100644 src/views/system/tenant/form.vue
delete mode 100644 src/views/system/tenant/tenant.data.ts
diff --git a/src/views/system/tenant/form.vue b/src/views/system/tenant/form.vue
new file mode 100644
index 000000000..0d4e94ed3
--- /dev/null
+++ b/src/views/system/tenant/form.vue
@@ -0,0 +1,131 @@
+
+
+
+
diff --git a/src/views/system/tenant/index.vue b/src/views/system/tenant/index.vue
index 20c697d69..51b8fda48 100644
--- a/src/views/system/tenant/index.vue
+++ b/src/views/system/tenant/index.vue
@@ -1,174 +1,262 @@
-
-
-
-
-
-
-
-
-
- {{ row.accountCount }}
-
-
- 系统租户
- {{ getPackageName(row.packageId) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 系统租户
- {{ getPackageName(row.packageId) }}
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
+
+
+ 重置
+
+
+
+ 新增
+
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 系统租户
+ {{ getPackageName(scope.row.packageId) }}
+
+
+
+
+
+
+ {{ scope.row.accountCount }}
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+ 编辑
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/system/tenant/tenant.data.ts b/src/views/system/tenant/tenant.data.ts
deleted file mode 100644
index 2aab1b903..000000000
--- a/src/views/system/tenant/tenant.data.ts
+++ /dev/null
@@ -1,153 +0,0 @@
-import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
-import { getTenantPackageList, TenantPackageVO } from '@/api/system/tenantPackage'
-import { ComponentOptions } from '@/types/components'
-
-const { t } = useI18n() // 国际化
-
-export const tenantPackageOption: ComponentOptions[] = []
-const getTenantPackageOptions = async () => {
- const res = await getTenantPackageList()
- res.forEach((tenantPackage: TenantPackageVO) => {
- tenantPackageOption.push({
- key: tenantPackage.id,
- value: tenantPackage.id,
- label: tenantPackage.name
- })
- })
-
- return tenantPackageOption
-}
-getTenantPackageOptions()
-
-// 表单校验
-export const rules = reactive({
- name: [required],
- packageId: [required],
- contactName: [required],
- contactMobile: [required],
- accountCount: [required],
- expireTime: [required],
- username: [
- required,
- {
- min: 4,
- max: 30,
- trigger: 'blur',
- message: '用户名称长度为 4-30 个字符'
- }
- ],
- password: [
- required,
- {
- min: 4,
- max: 16,
- trigger: 'blur',
- message: '密码长度为 4-16 位'
- }
- ],
- domain: [required],
- status: [required]
-})
-
-// CrudSchema.
-const crudSchemas = reactive({
- primaryKey: 'id',
- primaryTitle: '租户编号',
- primaryType: 'id',
- action: true,
- columns: [
- {
- title: '租户名称',
- field: 'name',
- isSearch: true
- },
- {
- title: '租户套餐',
- field: 'packageId',
- table: {
- slots: {
- default: 'packageId_default'
- }
- },
- form: {
- component: 'Select',
- componentProps: {
- options: tenantPackageOption
- }
- }
- },
- {
- title: '联系人',
- field: 'contactName',
- isSearch: true
- },
- {
- title: '联系手机',
- field: 'contactMobile',
- isSearch: true
- },
- {
- title: '用户名称',
- field: 'username',
- isTable: false,
- isDetail: false
- },
- {
- title: '用户密码',
- field: 'password',
- isTable: false,
- isDetail: false,
- form: {
- component: 'InputPassword'
- }
- },
- {
- title: '账号额度',
- field: 'accountCount',
- table: {
- slots: {
- default: 'accountCount_default'
- }
- },
- form: {
- component: 'InputNumber'
- }
- },
- {
- title: '过期时间',
- field: 'expireTime',
- formatter: 'formatDate',
- form: {
- component: 'DatePicker',
- componentProps: {
- type: 'datetime',
- valueFormat: 'x'
- }
- }
- },
- {
- title: '绑定域名',
- field: 'domain'
- },
- {
- title: '租户状态',
- field: 'status',
- dictType: DICT_TYPE.COMMON_STATUS,
- dictClass: 'number',
- isSearch: true
- },
- {
- title: t('table.createTime'),
- field: 'createTime',
- formatter: 'formatDate',
- isForm: false,
- search: {
- show: true,
- itemRender: {
- name: 'XDataTimePicker'
- }
- }
- }
- ]
-})
-export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
--
Gitee
From b95196ed9a97addf0d4042c49ebc797d13acf1d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=9C=E6=96=B9=E7=99=BD?= <457776125@qq.com>
Date: Sun, 19 Mar 2023 10:49:28 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E7=A7=9F=E6=88=B7=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E4=BD=BF=E7=94=A8element=20plus=E5=AE=8C=E6=88=90=E6=94=B9?=
=?UTF-8?q?=E5=86=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/system/tenant/form.vue | 171 ++++++++++++++++++++++--------
src/views/system/tenant/index.vue | 153 +++++++++++++-------------
2 files changed, 199 insertions(+), 125 deletions(-)
diff --git a/src/views/system/tenant/form.vue b/src/views/system/tenant/form.vue
index 0d4e94ed3..71304433e 100644
--- a/src/views/system/tenant/form.vue
+++ b/src/views/system/tenant/form.vue
@@ -1,5 +1,5 @@
-