From 12b8d3cdfdf42c6f5f7d2120c2c0a09973af2241 Mon Sep 17 00:00:00 2001
From: yinbangzhong <zhongbangyin@126.com>
Date: 星期二, 13 八月 2024 19:31:57 +0800
Subject: [PATCH] 用户字段调整

---
 src/views/authority/role/index.vue       |  809 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/locale/en-US.ts                      |    2 
 src/views/authority/role/locale/en-US.ts |    4 
 config/vite.config.dev.ts                |   12 
 src/locale/zh-CN.ts                      |    2 
 src/views/authority/role/locale/zh-CN.ts |    3 
 src/api/authority.ts                     |   38 ++
 src/router/routes/modules/authority.ts   |   10 
 8 files changed, 874 insertions(+), 6 deletions(-)

diff --git a/config/vite.config.dev.ts b/config/vite.config.dev.ts
index 8701dba..8238ae6 100644
--- a/config/vite.config.dev.ts
+++ b/config/vite.config.dev.ts
@@ -14,8 +14,8 @@
       proxy: {
         '/base': {
           // target: 'http://aiotlink.com:8189',
-          target: 'http://192.168.20.116:8089',
-          // target: 'http://192.168.20.158:8089',
+          //target: 'http://192.168.20.116:8089',
+          target: 'http://192.168.20.158:8089',
           changeOrigin: true,
           ws: true,
           // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
@@ -23,17 +23,17 @@
           // secure: false
         },
         '/api': {
-          target: 'http://192.168.20.116:8089',
-          // target: 'http://192.168.20.158:8089',
           // target: 'http://aiotlink.com:8189',
+          //target: 'http://192.168.20.116:8089',
+          target: 'http://192.168.20.158:8089',
           changeOrigin: true,
           ws: true,
           // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
         },
         '/api/v1': {
-          target: 'http://192.168.20.116:8089',
-          // target: 'http://192.168.20.158:8089',
           // target: 'http://aiotlink.com:8189',
+          //target: 'http://192.168.20.116:8089',
+          target: 'http://192.168.20.158:8089',
           changeOrigin: true,
           ws: true,
           // rewrite: (path) => path.replace(new RegExp(`^/basic-api`), ''),
diff --git a/src/api/authority.ts b/src/api/authority.ts
index f3a9039..6ef6840 100644
--- a/src/api/authority.ts
+++ b/src/api/authority.ts
@@ -63,6 +63,44 @@
   total: number;
 }
 
+export interface Role {
+  roleId:  string;
+  createTime:  string;
+  updateTime:  string;
+  roleName:  string;
+  remark:  string;
+  iconCls:  string;
+  roleSort:  string;
+  status:  string;
+  roleKey:  string;
+  dataScope:  string;
+  dept: any;
+  resources: any;
+}
+
+export function RoleList(params: Pagination) {
+  return axios.get<Result<Role[]>>('/base/system/role/list', { params });
+}
+
+export function RoleDelete(id) {
+  return axios.delete('/base/system/role/' + id);
+}
+
+export function RoleEdit(role) {
+  return axios.put('/base/system/role', { role });
+}
+
+export function RoleAdd(role) {
+  return axios.post('/base/system/role', { role });
+}
+
+export function Rolestatus(roleId, status) {
+  return axios.put('/base/system/role/changeStatus', {
+    roleId: roleId,
+    status: status,
+  });
+}
+
 export function UserList(params: Pagination) {
   return axios.get<Result<User[]>>('/base/system/user/list', { params });
 }
diff --git a/src/locale/en-US.ts b/src/locale/en-US.ts
index 1c15251..6b294fe 100644
--- a/src/locale/en-US.ts
+++ b/src/locale/en-US.ts
@@ -6,6 +6,7 @@
 import localeUser from '@/views/authority/users/locale/en-US';
 import localeOrganization from '@/views/authority/organization/locale/en-US';
 import localeResource from '@/views/authority/resource/locale/en-US';
+import localeRole from '@/views/authority/role/locale/en-US';
 
 import localeMonitor from '@/views/dashboard/monitor/locale/en-US';
 
@@ -59,6 +60,7 @@
   ...localeUser,
   ...localeOrganization,
   ...localeResource,
+  ...localeRole,
 
   ...localeMonitor,
   ...localeSearchTable,
diff --git a/src/locale/zh-CN.ts b/src/locale/zh-CN.ts
index ac7fb04..5f6edd3 100644
--- a/src/locale/zh-CN.ts
+++ b/src/locale/zh-CN.ts
@@ -6,6 +6,7 @@
 import localeUser from '@/views/authority/users/locale/zh-CN';
 import localeOrganization from '@/views/authority/organization/locale/zh-CN';
 import localeResource from '@/views/authority/resource/locale/zh-CN';
+import localeRole from '@/views/authority/role/locale/zh-CN';
 
 import localeMonitor from '@/views/dashboard/monitor/locale/zh-CN';
 
@@ -64,6 +65,7 @@
   ...localeUser,
   ...localeOrganization,
   ...localeResource,
+  ...localeRole,
 
   ...localeMonitor,
   ...localeSearchTable,
diff --git a/src/router/routes/modules/authority.ts b/src/router/routes/modules/authority.ts
index e62c7e4..d848aa2 100644
--- a/src/router/routes/modules/authority.ts
+++ b/src/router/routes/modules/authority.ts
@@ -42,6 +42,16 @@
         roles: ['*'],
       },
     },
+    {
+      path: 'role',
+      name: 'role',
+      component: () => import('@/views/authority/role/index.vue'),
+      meta: {
+        locale: 'menu.role.title',
+        requiresAuth: true,
+        roles: ['*'],
+      },
+    },
   ],
 };
 
diff --git a/src/views/authority/role/index.vue b/src/views/authority/role/index.vue
new file mode 100644
index 0000000..2704363
--- /dev/null
+++ b/src/views/authority/role/index.vue
@@ -0,0 +1,809 @@
+<template>
+  <div class="container">
+    <authheader :items="menuTips"></authheader>
+    <a-card ref="account" class="general-card">
+      <div class="table-page-search-wrapper">
+        <div class="search-wrapper">
+          <div>
+            <a-input
+              v-model="formModel.name"
+              :style="{ width: '320px' }"
+              :placeholder="$t('璇疯緭鍏�')"
+            />
+          </div>
+          <div>
+            <a-button
+              type="primary"
+              @click="search"
+              style="margin-right: 20px; margin-left: 10px"
+            >
+              <template #icon>
+                <icon-search />
+              </template>
+              {{ $t('searchTable.form.search') }}
+            </a-button>
+            <a-button @click="reset">
+              <template #icon>
+                <icon-refresh />
+              </template>
+              {{ $t('searchTable.form.reset') }}
+            </a-button>
+          </div>
+        </div>
+        <div class="search-wrapper">
+          <div>
+            <a-space>
+              <a-button type="primary" :align="'right'" @click="operation(0)"
+                >+ 鏂板缓瑙掕壊</a-button
+              >
+            </a-space>
+          </div>
+          <div class="wrapper-icon">
+            <a-tooltip :content="$t('searchTable.actions.refresh')">
+              <div class="action-icon" @click="search">
+                <icon-refresh size="18" />
+              </div>
+            </a-tooltip>
+            <a-dropdown @select="handleSelectDensity">
+              <a-tooltip :content="$t('searchTable.actions.density')">
+                <div class="action-icon">
+                  <icon-line-height size="18" />
+                </div>
+              </a-tooltip>
+              <template #content>
+                <a-doption
+                  v-for="item in densityList"
+                  :key="item.value"
+                  :value="item.value"
+                  :class="{ active: item.value === size }"
+                >
+                  <span>{{ item.name }}</span>
+                </a-doption>
+              </template>
+            </a-dropdown>
+          </div>
+        </div>
+      </div>
+      <a-table
+        row-key="id"
+        :loading="loading"
+        :pagination="pagination"
+        :columns="columns"
+        :data="renderData"
+        :bordered="false"
+        :size="size"
+        @page-change="onPageChange"
+      >
+        <template #index="{ rowIndex }">
+          {{ rowIndex + 1 + (pagination.current - 1) * pagination.pageSize }}
+        </template>
+        <template #dept="{ record }">{{
+          record.dept ? record.dept.deptName : ''
+        }}</template>
+        <template #status="{ record }">
+          <a-switch
+            checked-value="1"
+            unchecked-value="0"
+            @change="statusChange(record.status, record)"
+            v-model="record.status"
+          />
+        </template>
+        <template #operations="{ record }">
+          <a-space>
+            <a-button type="outline" @click="operation(2, record)"
+              >缂栬緫</a-button
+            >
+            <a-popconfirm
+              content="Are you sure you want to delete?"
+              type="success"
+              @ok="operation(3, record)"
+            >
+              <a-button type="outline" status="danger">鍒犻櫎</a-button>
+            </a-popconfirm>
+            <a-button
+              type="dashed"
+              status="warning"
+              @click="operation(4, record)"
+              >鏉冮檺閰嶇疆</a-button
+            >
+            <a-button status="success" @click="operation(5, record)"
+              >閮ㄩ棬閰嶇疆</a-button
+            >
+          </a-space>
+        </template>
+      </a-table>
+    </a-card>
+    <a-modal
+      v-model:visible="visible"
+      :title="save"
+      @cancel="handleCancel(1)"
+      @ok="editHandleOk"
+    >
+      <a-form :model="editform">
+        <a-form-item field="roleName" label="瑙掕壊鍚�">
+          <a-input v-model="editform.roleName" />
+        </a-form-item>
+        <a-form-item field="roleKey" label="鏉冮檺瀛楃涓�">
+          <a-input v-model="editform.roleKey" />
+        </a-form-item>
+        <a-form-item field="remark" label="澶囨敞">
+          <a-input v-model="editform.remark" />
+        </a-form-item>
+      </a-form>
+    </a-modal>
+    <a-modal
+      width="50%"
+      v-model:visible="deptvisible"
+      title="閮ㄩ棬閰嶇疆"
+      @cancel="handleCancel(2)"
+      @ok="editDeptHandleOk"
+    >
+      <div :style="{ display: 'flex' }">
+        <a-card
+          :style="{ 'width': '460px', 'height': '500px', 'overflow-y': 'auto' }"
+          title="鏈烘瀯"
+          hoverable
+        >
+          <a-tree
+            class="tree-demo"
+            v-model:checked-keys="checkedKeys"
+            v-model:expanded-keys="expandKdys"
+            :checkable="true"
+            :data="treeData"
+            :show-line="showLine"
+            @check="onCheck"
+            :fieldNames="{
+              key: 'deptId',
+              title: 'deptName',
+              children: 'children',
+            }"
+            :check-strictly="checkStrictly"
+          >
+          </a-tree>
+        </a-card>
+        <a-card class="card-demo" title="鐢ㄦ埛鎵�灞炴満鏋�" hoverable>
+          <a-space wrap>
+            <a-tag
+              v-for="(tag, index) of checkStrictly"
+              :key="tag.deptId"
+              @close="handleRemove(tag)"
+            >
+              {{ tag.deptName }}
+            </a-tag>
+          </a-space>
+        </a-card>
+      </div>
+    </a-modal>
+    <a-modal
+      width="30%"
+      v-model:visible="resourcevisible"
+      title="鏉冮檺閰嶇疆"
+      @cancel="handleCancel(3)"
+      @ok="editResourceHandleOk"
+    >
+      <div :style="{ 'display': 'flex', 'flex-direction': 'column' }">
+        <a-tabs
+          :style="{ 'width': '100%', 'height': '500px', 'overflow-y': 'auto' }"
+        >
+          <a-tab-pane key="1">
+            <template #title>
+              <icon-calendar />
+              鑿滃崟
+            </template>
+            <a-tree
+              class="tree-demo"
+              v-model:checked-keys="checkedKeysMenu"
+              v-model:expanded-keys="expandKdysMenu"
+              :checkable="true"
+              :data="treeDataMenu"
+              :show-line="showLineMenu"
+              @check="onCheckMenu"
+              :fieldNames="{
+                key: 'menuId',
+                title: 'menuName',
+                children: 'children',
+              }"
+              :check-strictly="checkStrictlyMenu"
+            >
+            </a-tree>
+          </a-tab-pane>
+          <a-tab-pane key="2">
+            <template #title>
+              <icon-clock-circle />
+              鐭ヨ瘑搴�
+            </template>
+            <a-space direction="vertical" size="large">
+              <a-checkbox-group
+                v-model="checkedKeysKnowledge"
+                direction="vertical"
+                @change="onCheckKnowledge"
+              >
+                <a-checkbox
+                  v-for="(knowledg, index) of knowledgeList"
+                  :value="knowledg.id"
+                  :lable="knowledg.name"
+                  @change="onCheckKnowledge"
+                >
+                  {{ knowledg.name }}
+                </a-checkbox>
+              </a-checkbox-group>
+            </a-space>
+          </a-tab-pane>
+          <a-tab-pane key="3">
+            <template #title>
+              <icon-user />
+              鏅鸿兘浣�
+            </template>
+            <a-checkbox-group
+              v-model="checkedKeysDialog"
+              direction="vertical"
+              @change="onCheckDialog"
+            >
+              <a-checkbox
+                v-for="(dialog, index) of DialogsList"
+                :value="dialog.id"
+                :lable="dialog.name"
+                @change="onCheckDialog"
+              >
+                {{ dialog.name }}
+              </a-checkbox>
+            </a-checkbox-group>
+          </a-tab-pane>
+        </a-tabs>
+        <a-card
+          :style="{
+            'width': '100%',
+            'height': '200px',
+            'overflow-y': 'auto',
+            'margin': '1px',
+          }"
+          class="card-demo"
+          title="鐢ㄦ埛鎵�鏈夋潈闄�"
+          hoverable
+        >
+          <a-space wrap>
+            鑿滃崟鍔熻兘锛�
+            <a-tag
+              v-for="(tag, index) of checkStrictlyMenu"
+              :key="tag.menuId"
+              @close="handleMenuRemove(tag)"
+            >
+              {{ tag.menuName }}
+            </a-tag>
+          </a-space>
+          <a-divider />
+          <a-space wrap>
+            鐭ヨ瘑搴�:
+            <a-tag
+              v-for="(tag, index) of checkStrictlyKnowledge"
+              :key="tag.knowledgeId"
+              @close="handleKnowledgeRemove(tag)"
+            >
+              {{ tag.knowledgeName }}
+            </a-tag>
+          </a-space>
+          <a-divider />
+          <a-space wrap>
+            鏅鸿兘浣�:
+            <a-tag
+              v-for="(tag, index) of checkStrictlyDialog"
+              :key="tag.dialogId"
+              @close="handleDialogRemove(tag)"
+            >
+              {{ tag.dialogName }}
+            </a-tag>
+          </a-space>
+        </a-card>
+      </div>
+    </a-modal>
+  </div>
+</template>
+
+<script lang="ts" setup>
+  import { computed, reactive, ref } from 'vue';
+  import { useI18n } from 'vue-i18n';
+  import useLoading from '@/hooks/loading';
+  import { Pagination } from '@/types/global';
+  import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
+  import {
+    DialogList,
+    KnowledgeList,
+    OrganizationList,
+    ResourceList, Role, RoleAdd, RoleDelete, RoleEdit, RoleList, Rolestatus,
+    User,
+    UserAdd,
+    UserChangePwd,
+    UserDelete,
+    UserEdit,
+    UserList,
+    Userstatus
+  } from "@/api/authority";
+  import { Modal } from '@arco-design/web-vue';
+  import Authheader from '@/views/authority/components/authheader.vue';
+
+  let treeData = ref([]);
+  let checkedKeys = ref([]);
+  let expandKdys = ref([]);
+  let checkStrictly = ref([]);
+
+  let treeDataMenu = ref([]);
+  let checkedKeysMenu = ref([]);
+  let expandKdysMenu = ref([]);
+  let checkStrictlyMenu = ref([]);
+
+  let checkedKeysKnowledge = ref([]);
+  let checkStrictlyKnowledge = ref([]);
+
+  let checkedKeysDialog = ref([]);
+  let checkStrictlyDialog = ref([]);
+
+  let knowledgeList = ref([]);
+  let DialogsList = ref([]);
+
+  let menuTips = ref(['鏉冮檺绠$悊', '瑙掕壊']);
+  type SizeProps = 'mini' | 'small' | 'medium' | 'large';
+  const account = ref(null);
+  const generateFormModel = () => {
+    return {
+      name: '',
+    };
+  };
+  let showLine = ref(true);
+  const { loading, setLoading } = useLoading(true);
+  const { t } = useI18n();
+  let save = ref('鏂板');
+  let renderData = ref<Role[]>([]);
+  let formModel = ref(generateFormModel());
+  let editform = ref<Role>({
+    createTime: "",
+    dataScope: "",
+    iconCls: "",
+    remark: "",
+    roleId: "",
+    roleKey: "",
+    roleName: "",
+    roleSort: "0",
+    status: "",
+    updateTime: ""
+  });
+
+  let size = ref<SizeProps>('medium');
+  let visible = ref(false);
+  let deptvisible = ref(false);
+  let resourcevisible = ref(false);
+  let selectRole = ref({});
+
+  const onCheck = (newCheckedKeys, event) => {
+    let o = { deptId: event.node.deptId, deptName: event.node.deptName };
+    if (event.checked) {
+      checkStrictly.value.push(o);
+    } else {
+      checkStrictly.value.forEach((val, idx, array) => {
+        // val: 褰撳墠鍊�
+        if (val.deptId == event.node.deptId) {
+          checkStrictly.value.splice(idx, 1);
+          return true;
+        }
+      });
+    }
+  };
+  const onCheckMenu = (newCheckedKeys, event) => {
+    let o = { menuId: event.node.menuId, menuName: event.node.menuName };
+    if (event.checked) {
+      checkStrictlyMenu.value.push(o);
+    } else {
+      checkStrictlyMenu.value.forEach((val, idx, array) => {
+        // val: 褰撳墠鍊�
+        if (val.menuId == event.node.menuId) {
+          checkStrictlyMenu.value.splice(idx, 1);
+          return true;
+        }
+      });
+    }
+  };
+  const onCheckKnowledge = (newCheckedKeys, event) => {
+    let o = {
+      knowledgeId: event.target.value,
+      knowledgeName: event.target.labels[0].innerText,
+    };
+    if (event.target.checked) {
+      checkStrictlyKnowledge.value.push(o);
+    } else {
+      checkStrictlyKnowledge.value.forEach((val, idx, array) => {
+        // val: 褰撳墠鍊�
+        if (val.knowledgeId == event.target.value) {
+          checkStrictlyKnowledge.value.splice(idx, 1);
+          return true;
+        }
+      });
+    }
+  };
+  const onCheckDialog = (newCheckedKeys, event) => {
+    let o = {
+      dialogId: event.target.value,
+      dialogName: event.target.labels[0].innerText,
+    };
+    if (event.target.checked) {
+      checkStrictlyDialog.value.push(o);
+    } else {
+      checkStrictlyDialog.value.forEach((val, idx, array) => {
+        // val: 褰撳墠鍊�
+        if (val.dialogId == event.target.value) {
+          checkStrictlyDialog.value.splice(idx, 1);
+          return true;
+        }
+      });
+    }
+  };
+
+  const handleRemove = (key) => {
+    checkStrictly.value = checkStrictly.value.filter((tag) => tag !== key);
+  };
+  const handleMenuRemove = (key) => {
+    checkStrictlyMenu.value = checkStrictlyMenu.value.filter(
+      (tag) => tag !== key
+    );
+  };
+  const handleKnowledgeRemove = (key) => {
+    checkStrictlyKnowledge.value = checkStrictlyKnowledge.value.filter(
+      (tag) => tag !== key
+    );
+  };
+  const handleDialogRemove = (key) => {
+    checkStrictlyDialog.value = checkStrictlyDialog.value.filter(
+      (tag) => tag !== key
+    );
+  };
+
+  const basePagination: Pagination = {
+    current: 1,
+    pageSize: 15,
+  };
+  const pagination = reactive({
+    ...basePagination,
+  });
+
+  const densityList = computed(() => [
+    {
+      name: t('searchTable.size.mini'),
+      value: 'mini',
+    },
+    {
+      name: t('searchTable.size.small'),
+      value: 'small',
+    },
+    {
+      name: t('searchTable.size.medium'),
+      value: 'medium',
+    },
+    {
+      name: t('searchTable.size.large'),
+      value: 'large',
+    },
+  ]);
+  const columns = computed<TableColumnData[]>(() => [
+    {
+      title: t('搴忓彿'),
+      dataIndex: 'index',
+      slotName: 'index',
+    },
+    {
+      title: t('瑙掕壊鍚�'),
+      dataIndex: 'roleName',
+    },
+    {
+      title: t('鍒涘缓鏃堕棿'),
+      dataIndex: 'createTime',
+    },
+    {
+      title: t('鏉冮檺瀛楃涓�'),
+      dataIndex: 'roleKey',
+      slotName: 'roleKey',
+    },
+    {
+      title: t('鐘舵��'),
+      dataIndex: 'status',
+      slotName: 'status',
+    },
+    {
+      title: t('searchTable.columns.operations'),
+      dataIndex: 'operations',
+      slotName: 'operations',
+    },
+  ]);
+
+  const statusChange = async (value, record) => {
+    await Rolestatus(record.roleId, value).then((res) => {});
+  };
+
+  const handleCancel = (type) => {
+    if (type == 1) {
+      visible.value = false;
+    }
+    if (type == 2) {
+      deptvisible.value = false;
+    }
+    if (type == 2) {
+      resourcevisible.value = false;
+    }
+  };
+
+  const editDeptHandleOk = async () => {
+    let depts: Array = [],
+      role: Role = { roleId: selectRole.value.roleId };
+    checkStrictly.value.forEach((val) => {
+      depts.push(val.deptId);
+    });
+    role.dept = depts;
+    await RoleEdit(role).then((res) => {
+      fetchData();
+    });
+  };
+
+  const editResourceHandleOk = async () => {
+    let resources: Array = [],
+      dialogs: Array = [],
+      Knowledges: Array = [],
+      role: Role = { roleId: selectRole.value.roleId };
+    checkStrictlyMenu.value.forEach((val) => {
+      resources.push(val.menuId);
+    });
+    role.resources = resources;
+
+    checkStrictlyKnowledge.value.forEach((val) => {
+      Knowledges.push(val.knowledgeId);
+    });
+    role.knowledges = Knowledges;
+
+    checkStrictlyDialog.value.forEach((val) => {
+      dialogs.push(val.dialogId);
+    });
+    role.dialogs = dialogs;
+
+    await RoleEdit(role).then((res) => {
+      fetchData();
+    });
+  };
+
+  const editHandleOk = async () => {
+    if (editform.value.roleId.length > 0) {
+      await RoleEdit({
+        ...editform.value,
+      } as unknown as Role).then((res) => {
+        fetchData();
+      });
+    } else {
+      await RoleAdd({
+        ...editform.value,
+      } as unknown as Role).then((res) => {
+        fetchData();
+      });
+    }
+  };
+  const operation = async (t, record) => {
+    if (t == 0) {
+      save.value = '鏂板';
+      visible.value = true;
+      editform.value.roleName = "";
+      editform.value.roleKey = "";
+      editform.value.remark = "";
+    }
+    //缂栬緫
+    if (t == 2) {
+      visible.value = true;
+      save.value = '缂栬緫';
+      editform.value.roleId=record.roleId
+      editform.value.roleName = record.roleName;
+      editform.value.roleKey = record.roleKey;
+      editform.value.remark = record.remark;
+    }
+    //鍒犻櫎
+    if (t == 3) {
+      await RoleDelete(record.roleId).then((res) => {
+        if (res.code == 200) {
+          fetchData();
+        }
+      });
+    }
+    //鏉冮檺
+    if (t == 4) {
+      resourcevisible.value = true;
+      checkedKeysMenu.value = [];
+      expandKdysMenu.value = [];
+      checkStrictlyMenu.value = [];
+      checkStrictlyKnowledge.value = [];
+      checkedKeysKnowledge.value = [];
+      checkStrictlyDialog.value = [];
+      checkedKeysDialog.value = [];
+      selectRole.value = record;
+      if (record.resources) {
+        record.resources.forEach((val) => {
+          checkStrictlyMenu.value.push({
+            menuId: val.menuId,
+            menuName: val.menuName,
+          });
+          checkedKeysMenu.value.push(val.menuId);
+          expandKdysMenu.value.push(val.menuId);
+        });
+      }
+      if (record.knowledges) {
+        record.knowledges.forEach((val) => {
+          checkStrictlyKnowledge.value.push({
+            knowledgeId: val.id,
+            knowledgeName: val.name,
+          });
+          checkedKeysKnowledge.value.push(val.id);
+        });
+      }
+      if (record.dialogs) {
+        record.dialogs.forEach((val) => {
+          checkStrictlyDialog.value.push({
+            dialogId: val.id,
+            dialogName: val.name,
+          });
+          checkedKeysDialog.value.push(val.id);
+        });
+      }
+    }
+    //鏈烘瀯
+    if (t == 5) {
+      deptvisible.value = true;
+      checkedKeys.value = [];
+      expandKdys.value = [];
+      checkStrictly.value = [];
+      selectRole.value = record;
+      expandKdys.value.push('0');
+      if (record.dept) {
+        record.dept.forEach((val) => {
+          checkStrictly.value.push({
+            deptId: val.deptId,
+            deptName: val.deptName,
+          });
+          checkedKeys.value.push(val.deptId);
+          expandKdys.value.push(val.deptId);
+        });
+      }
+    }
+  };
+
+  const fetchData = async (
+    params: Pagination = { current: 1, pageSize: 20 }
+  ) => {
+    setLoading(true);
+    try {
+      await RoleList(params).then((res) => {
+        renderData.value = res.rows;
+        console.log(renderData);
+        pagination.current = params.current;
+        pagination.total = res.total;
+      });
+    } catch (err) {
+      // you can report use errorHandler or other
+    } finally {
+      setLoading(false);
+    }
+  };
+
+  const search = () => {
+    fetchData({
+      ...basePagination,
+      ...formModel.value,
+    } as unknown as Pagination);
+  };
+
+  const onPageChange = (current: number) => {
+    fetchData({ ...basePagination, current });
+  };
+
+  const OrganizationData = async (key) => {
+    await OrganizationList(key).then((res) => {
+      treeData.value = [...res.rows];
+    });
+  };
+  const MenuData = async (key) => {
+    await ResourceList(key).then((res) => {
+      treeDataMenu.value = [...res.rows];
+    });
+  };
+
+  KnowledgeList().then((res) => {
+    knowledgeList.value = res.rows;
+  });
+
+  DialogList().then((res) => {
+    DialogsList.value = res.rows;
+  });
+  fetchData();
+  OrganizationData('');
+  MenuData();
+
+  const reset = () => {
+    formModel.value = generateFormModel();
+  };
+
+  const handleSelectDensity = (
+    val: string | number | Record<string, any> | undefined,
+    e: Event
+  ) => {
+    size.value = val as SizeProps;
+  };
+</script>
+
+<style scoped lang="less">
+  .card-demo {
+    width: 460px;
+    margin-left: 24px;
+    transition-property: all;
+  }
+
+  .card-demo:hover {
+    transform: translateY(-4px);
+  }
+  .table-page-search-wrapper {
+    padding-top: 10px;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 20px;
+    padding-bottom: 10px;
+    border-bottom: 1px solid #e8e8e8;
+    .search-wrapper {
+      display: flex;
+      .wrapper-icon {
+        display: flex;
+        align-items: center;
+        margin-left: 40px;
+        // margin-right: 40px;
+      }
+    }
+  }
+</style>
+<style lang="less">
+  .ant-table-wrapper {
+    .ant-table-tbody {
+      tr {
+        td {
+          .ant-table-row-cell-break-word {
+            .ant-table-column-sorter {
+              display: none;
+            }
+          }
+        }
+      }
+    }
+
+    .search-wrapper {
+      display: flex;
+      .wrapper-icon {
+        display: flex;
+        align-items: center;
+        margin-left: 40px;
+        // margin-right: 40px;
+      }
+    }
+  }
+</style>
+<style lang="less">
+  .ant-table-wrapper {
+    .ant-table-tbody {
+      tr {
+        td {
+          .ant-table-row-cell-break-word {
+            .ant-table-column-sorter {
+              display: none;
+            }
+          }
+        }
+      }
+    }
+  }
+</style>
+<style lang="less" scoped>
+  .table-page-search-wrapper {
+    .ant-form-inline {
+      :deep(.ant-form-item) {
+        display: flex;
+      }
+    }
+  }
+</style>
diff --git a/src/views/authority/role/locale/en-US.ts b/src/views/authority/role/locale/en-US.ts
new file mode 100644
index 0000000..e61c7eb
--- /dev/null
+++ b/src/views/authority/role/locale/en-US.ts
@@ -0,0 +1,4 @@
+export default {
+  "menu.role.title": "Role",
+};
+// export default { "menu.user.title": "Account" };
\ No newline at end of file
diff --git a/src/views/authority/role/locale/zh-CN.ts b/src/views/authority/role/locale/zh-CN.ts
new file mode 100644
index 0000000..e57d63e
--- /dev/null
+++ b/src/views/authority/role/locale/zh-CN.ts
@@ -0,0 +1,3 @@
+export default {
+  'menu.role.title': '瑙掕壊',
+};
\ No newline at end of file

--
Gitblit v1.8.0