From 7eced09de0d4bf790e506a6564779699b533238b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=91=A8=E5=BB=BA?= <1348660141@qq.com>
Date: Wed, 16 Aug 2023 17:31:28 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=E9=87=8D?=
=?UTF-8?q?=E7=BD=AE=E5=8F=8A=E6=A0=A1=E9=AA=8C=E9=97=AE=E9=A2=98=EF=BC=8C?=
=?UTF-8?q?=E9=83=A8=E5=88=86=E8=A1=A8=E5=8D=95=E5=A2=9E=E5=8A=A0=E6=A0=A1?=
=?UTF-8?q?=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Profile/components/ResetPwd.vue | 8 +--
src/views/system/dept/dept.data.ts | 1 +
src/views/system/dict/dict.data.ts | 3 +-
src/views/system/dict/dict.type.ts | 3 +-
src/views/system/menu/index.vue | 2 +-
src/views/system/tenantPackage/index.vue | 59 +++++++++++++++++++++++
6 files changed, 69 insertions(+), 7 deletions(-)
diff --git a/src/views/Profile/components/ResetPwd.vue b/src/views/Profile/components/ResetPwd.vue
index d36e22d6..af8f2b40 100644
--- a/src/views/Profile/components/ResetPwd.vue
+++ b/src/views/Profile/components/ResetPwd.vue
@@ -1,12 +1,12 @@
-
+
-
+
-
+
@@ -31,7 +31,7 @@ const password = reactive({
})
// 表单校验
-const equalToPassword = (value, callback) => {
+const equalToPassword = (rule, value, callback) => {
if (password.newPassword !== value) {
callback(new Error(t('profile.password.diffPwd')))
} else {
diff --git a/src/views/system/dept/dept.data.ts b/src/views/system/dept/dept.data.ts
index c6945841..a80d531b 100644
--- a/src/views/system/dept/dept.data.ts
+++ b/src/views/system/dept/dept.data.ts
@@ -6,6 +6,7 @@ const { t } = useI18n() // 国际化
export const rules = reactive({
name: [required],
sort: [required],
+ status: [required],
// email: [required],
email: [
{ required: true, message: t('profile.rules.mail'), trigger: 'blur' },
diff --git a/src/views/system/dict/dict.data.ts b/src/views/system/dict/dict.data.ts
index be2514e0..7444b636 100644
--- a/src/views/system/dict/dict.data.ts
+++ b/src/views/system/dict/dict.data.ts
@@ -5,7 +5,8 @@ const { t } = useI18n()
export const dictDataRules = reactive({
label: [required],
value: [required],
- sort: [required]
+ sort: [required],
+ status: [required]
})
// crudSchemas
export const crudSchemas = reactive({
diff --git a/src/views/system/dict/dict.type.ts b/src/views/system/dict/dict.type.ts
index 73b5a021..f6260bd1 100644
--- a/src/views/system/dict/dict.type.ts
+++ b/src/views/system/dict/dict.type.ts
@@ -4,7 +4,8 @@ const { t } = useI18n() // 国际化
// 表单校验
export const dictTypeRules = reactive({
name: [required],
- type: [required]
+ type: [required],
+ status: [required]
})
// 新增 + 修改
const crudSchemas = reactive({
diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue
index e64baaea..278586a7 100644
--- a/src/views/system/menu/index.vue
+++ b/src/views/system/menu/index.vue
@@ -38,7 +38,7 @@
-
+
+
+
+
+
+
+
+
+
+
+
@@ -77,9 +110,11 @@ const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗
const menuOptions = ref([]) // 树形结构
+const menuOptionsDetail = ref([]) // 树形结构-详情
const menuExpand = ref(false)
const menuNodeAll = ref(false)
const treeRef = ref>()
+const treeRefDetail = ref>()
const treeNodeAll = ref(false)
const formRef = ref() // 表单 Ref
const loading = ref(false) // 遮罩层
@@ -100,10 +135,21 @@ const validateCategory = (rule: any, value: any, callback: any) => {
}
}
rules.menuIds = [{ required: true, validator: validateCategory, trigger: 'blur' }]
+const dealTreeData = (item) => {
+ for (var i = 0; i < item.length; i++) {
+ item[i].disabled = true
+ if (item[i].children) {
+ dealTreeData(item[i].children)
+ }
+ }
+ return item
+}
const getTree = async () => {
const res = await listSimpleMenusApi()
menuOptions.value = handleTree(res)
+ let treeData = JSON.parse(JSON.stringify(handleTree(res)))
+ menuOptionsDetail.value = dealTreeData(treeData)
}
const [registerTable, { reload, deleteData }] = useXTable({
@@ -140,6 +186,19 @@ const handleUpdate = async (rowId: number) => {
})
}
+// 详情操作
+let detailData = ref()
+const handleDetail = async (rowId: number) => {
+ setDialogTile('detail')
+ // 设置数据
+ const res = await TenantPackageApi.getTenantPackageApi(rowId)
+ // 设置选中
+ res.menuIds?.forEach((item: any) => {
+ unref(treeRefDetail)?.setChecked(item, true, false)
+ })
+ detailData.value = res
+}
+
// 提交按钮
const submitForm = async () => {
const elForm = unref(formRef)?.getElFormRef()