wangting
2024-09-27 1d8ffe35090c3e541dc2e0d9a26a4ef1c853d3b1
UI授权
已修改3个文件
已添加2个文件
291 ■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/api/authority/ui/uiAuthor.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/UIDialog.vue 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue 109 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/authority/ui/uiAuthor.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
import request from '@/router/axios';
// åŠŸèƒ½æ¨¡å—æŸ¥è¯¢
export function getUIAuthor(params) {
  return request({
    url: "/api/uiManagerController/getUIAuthor",
    method: "get",
    params
  });
}
//授权
export const authorizedUI = (params) => {
  return request({
    url: '/api/uiManagerController/authorizedUI',
    method: 'post',
    data: params
  })
}
Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/UIDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,143 @@
<template>
  <el-dialog v-dialogDrag
             :title="dialog.title"
             :visible.sync="dialog.showDialog"
             width="1000px"
             :append-to-body="true"
             class="avue-dialog"
             :destroy-on-close="true"
             :close-on-click-modal="false"
             @close="cancelDialog">
    <el-aside>
      <basic-container>
        <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
              <i class="el-icon-user-solid"></i>
                {{ (node || {}).label }}
            </span>
          </span>
        </avue-tree>
      </basic-container>
    </el-aside>
    <el-main>
      <basic-container>
        <avue-tree ref="uiTree" :data="uiTreeData" :option="uiTreeOption">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
              <i class="el-icon-user-solid"></i>
                {{ (node || {}).label }}
            </span>
          </span>
        </avue-tree>
      </basic-container>
    </el-main>
    <div class="dialog-footer avue-dialog__footer">
      <el-button type="primary" plain size="small" @click="submitDialog" >授权</el-button>
      <el-button type="primary" plain size="small" @click="clearValue" >重置</el-button>
      <el-button size="small" @click="cancelDialog">取 æ¶ˆ</el-button>
    </div>
  </el-dialog>
</template>
<script>
import {gridRoles} from '@/api/system/role/api'
import {getUIAuthor,authorizedUI} from "@/api/authority/ui/uiAuthor";
export default {
name: "UIDialog",
  data() {
    return {
      dialog: {
        showDialog: false,
        title: "UI授权",
        loading: false,
        type: "add",
      },
      type:'',//业务类型
      context:'',//UI上下文code
      treeOption: {
        height: '500px',
        menu: false,
        addBtn: false,
        props: {
          label: 'name',
          value: 'oid',
          children: 'children'
        }
      },
      nodeRow: {},
      treeData: [],
      uiTreeOption: {
        height: '500px',
        menu: false,
        addBtn: false,
        filter:false,
        props: {
          label: 'name',
          value: 'oid',
          children: 'children'
        }
      },
      uiTreeData: [],
    }
  },
  methods:{
    openDialog(type,context) {
      this.type=type;
      this.context=context;
      this.dialog.showDialog = true;
      this.getTreeList()
    },
    cancelDialog() {
      this.dialog.loading = false;
      this.dialog.showDialog = false;
    },
    getTreeList() {
      const loading = this.$loading({});
      gridRoles().then(res => {
        this.treeData = res.data.data;
        loading.close();
      }).catch(error=>{
        loading.close();
      })
    },
    // è§’色点击
    nodeClick(row) {
      this.nodeRow = row;
      const loading = this.$loading({});
      getUIAuthor().then(res => {
        this.uiTreeData = res.data.data;
        loading.close();
      }).catch(error=>{
        loading.close();
      })
    },
    submitDialog() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          const formData={}
          authorizedUI(formData).then(res => {
            if (res.data.success) {
              this.$message.success("保存成功");
              this.cancelDialog();
            }
          });
        } else {
          return false;
        }
      });
    },
    clearValue(){
      this.$refs.uiTree.setCheckedNodes([])
    }
  }
}
</script>
<style scoped>
</style>
Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue
@@ -1,33 +1,17 @@
<template>
  <el-container>
    <el-aside>
      <basic-container>
        <div ref="TreeBox" style="height: calc(100vh - 144px);!important;">
          <div class="headerCon">
            <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">创建
            </el-button>
            <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">修改
            </el-button>
            <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">删除
            </el-button>
            <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出
            </el-button>
            <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">导入
            </el-button>
            <el-button class="smallBtn" plain size="small" type="primary"
                       @click="checkViewClickHandler">查看使用范围
            </el-button>
          </div>
        <div ref="TreeBox" style="height: calc(100vh - 154px);!important;">
          <!-- å·¦ä¾§æ ‘         -->
          <div style="height:  calc(100vh - 280px);">
          <div style="height:  calc(100vh - 200px);">
            <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
              <i class="el-icon-s-promotion"></i>
                {{ (node || {}).label }}
            </span>
          </span>
              <span slot-scope="{ node, data }" class="el-tree-node__label">
               <span style="font-size: 15px">
                  <i class="el-icon-user-solid"></i>
                    {{ (node || {}).label }}
                </span>
              </span>
            </avue-tree>
          </div>
        </div>
@@ -43,8 +27,83 @@
</template>
<script>
import {gridRoles} from "@/api/system/role/api";
import {getUIAuthor,authorizedUI} from "@/api/authority/ui/uiAuthor";
export default {
  name: "index"
  name: "index",
  data() {
    return {
      type:'',//业务类型
      treeOption: {
        height: '500px',
        menu: false,
        addBtn: false,
        props: {
          label: 'name',
          value: 'oid',
          children: 'children'
        }
      },
      nodeRow: {},
      treeData: [],
      uiTreeOption: {
        height: '500px',
        menu: false,
        addBtn: false,
        filter:false,
        props: {
          label: 'name',
          value: 'oid',
          children: 'children'
        }
      },
      uiTreeData: [],
    }
  },
  created() {
    this.getTreeList()
  },
  methods:{
    getTreeList() {
      const loading = this.$loading({});
      gridRoles().then(res => {
        this.treeData = res.data.data;
        loading.close();
      }).catch(error=>{
        loading.close();
      })
    },
    // è§’色点击
    nodeClick(row) {
      this.nodeRow = row;
      const loading = this.$loading({});
      getUIAuthor().then(res => {
        this.uiTreeData = res.data.data;
        loading.close();
      }).catch(error=>{
        loading.close();
      })
    },
    saveHandler() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          const formData={}
          authorizedUI(formData).then(res => {
            if (res.data.success) {
              this.$message.success("保存成功");
              this.cancelDialog();
            }
          });
        } else {
          return false;
        }
      });
    },
    clearValue(){
      this.$refs.uiTree.setCheckedNodes([])
    }
  }
}
</script>
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
@@ -98,15 +98,11 @@
      dialog: {
        showDialog: false,
        title: "创建",
        submitTxt: "保存",
        submitIcon: "el-icon-check",
        loading: false,
        type: "add",
      },
      crudDialog: {
        showDialog: false,
        submitTxt: "保存",
        submitIcon: "el-icon-check",
      },
      formItems:[{
        label: '查询模板名称',
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/index.vue
@@ -38,7 +38,7 @@
            <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">删除</el-button>-->
            <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出</el-button>
            <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导入</el-button>
            <el-button icon="el-icon-place" plain size="small" type="primary" @click="">授权</el-button>
            <el-button icon="el-icon-place" plain size="small" type="primary" @click="uiAuthorHandler">授权</el-button>
          </template>
          <template slot="menu" slot-scope="scope">
            <el-button icon="el-icon-edit" size="small" type="text" @click="rowEditBtnClick(scope.row)">编辑
@@ -126,6 +126,7 @@
      <!-- å¯¼å…¥ -->
      <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" :fileData="fileData" title="导入"
                   @updata="getTableList" @upfaildata="upFail"></upload-file>
      <!--页签窗口-->
      <el-dialog v-dialogDrag
                 :title="dialog.title"
                 :visible.sync="dialog.showDialog"
@@ -137,6 +138,8 @@
                 @close="dialog.showDialog=false">
          <pl-show :uiDefineData="dialog.uiDefineData"></pl-show>
      </el-dialog>
      <!--ui授权-->
      <ui-author ref="uiAuthor"></ui-author>
    </el-main>
  </el-container>
@@ -147,9 +150,10 @@
import basicOption from "@/util/basic-option";
import func from "@/util/func";
import plShow from "@/views/modelingMenu/ui/uiDefine/rightRegion/plShow";
import uiAuthor from "@/views/authority/ui/uiAuthorization/UIDialog"
export default {
  name: "index",
  components:{plShow},
  components:{plShow,uiAuthor},
  data() {
    return {
      dialog: {
@@ -581,6 +585,14 @@
    upFail(response){
    },
    //ui授权
    uiAuthorHandler(){
      if (this.selectList.length!=1) {
        this.$message.error('请选择一条数据');
        return;
      }
      this.$refs.uiAuthor.openDialog(this.nodeRow.attributes.name,this.selectList[0].plCode);
    },
    // ç¼–辑按钮
    rowEditBtnClick(row) {
      this.form={