zhangxiao
2024-08-30 c02bff2911f720d54388f4abb6456ec1777f8a96
src/views/authority/role/index.vue
@@ -87,6 +87,9 @@
        </template>
        <template #operations="{ record }">
          <a-space>
            <a-button type="outline" @click="operation(2, record)"
            >编辑</a-button
            >
            <a-button
              type="dashed"
              status="warning"
@@ -285,7 +288,7 @@
  import Authheader from '@/views/authority/components/authheader.vue';
  import router from "@/router";
  import { queryCanvasList } from "@/api/Agent";
  import { getUserResources } from "@/utils/auth";
  import { getUserInfo, getUserResources } from "@/utils/auth";
  import { forEach } from "lodash";
  let treeDataMenu = ref([]);
@@ -338,6 +341,7 @@
  let resourcevisible = ref(false);
  let selectRole = ref({});
  let u =JSON.parse(getUserInfo());
  const eachChildrenAdd=(node)=>{
    if (node.children?.length > 0) {
@@ -580,6 +584,14 @@
      editform.value.remark = "";
    }
    if (t == 2) {
      visible.value = true;
      formRef.value?.resetFields();
      save.value = '编辑';
      editform.value.roleId=record.roleId
      editform.value.roleName = record.roleName;
    }
    //删除
    if (t == 3) {
      await RoleDelete(record.roleId).then((res) => {
@@ -597,6 +609,7 @@
      checkStrictlyKnowledge.value = [];
      checkedKeysKnowledge.value = [];
      checkStrictlyDialog.value = [];
      checkStrictlyAgent.value = [];
      checkedKeysDialog.value = [];
      selectRole.value = record;
      if (record.resources) {
@@ -694,17 +707,19 @@
  const MenuData = async (key) => {
    await ResourceList(key).then((res) => {
      let newTree=[]
      removeChild(res.rows,newTree)
      let newTree = [];
      if (u.role != "admin") {
        removeChild(res.rows, newTree);
      }
      treeDataMenu.value = [...res.rows];
    });
  };
  KnowledgeList().then((res) => {
  KnowledgeList(u.role).then((res) => {
    knowledgeList.value = res.data;
  });
  DialogList().then((res) => {
  DialogList(u.role).then((res) => {
    DialogsList.value = res.data;
  });
  queryCanvasList(null).then((canvas) => {