wangting
2024-10-22 fc7f59bcd94cebfcc3b2a1278984a3bb7b39edaa
功能模板树节点操作后局部刷新
已修改3个文件
已删除1个文件
已重命名2个文件
已添加2个文件
636 ■■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/api/system/fileManager/index.vue 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/system/log/logBasic.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/log/index.vue 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/log/basicConf.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/system/log/index.vue 170 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/systemModel/operateType/index.vue 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/system/fileManager/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,155 @@
<template>
  <!--文件柜管理-->
  <basic-container>
    <avue-crud
      ref="fileCrud"
      :data="tableData"
      :option="option"
      :page.sync="page"
      :table-loading="tableLoading"
      @on-load="getTableList"
      @refresh-change="handleRefresh"
      @search-change="handleSearch"
      @search-reset="handleReset"
      @size-change="sizeChange"
      @current-change="currentChange"
    >
      <template slot="menuLeft" slot-scope="scope">
        <el-button icon="el-icon-download" plain size="small" type="primary" @click="allDelHandler">导出</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import basicOption from "@/util/basic-option";
import {getLogListByContion} from "@/api/system/log/logBasic";
export default {
  name: "index",
  data: function () {
    return {
      tableLoading: false,
      tableData: [],
      option: {
        ...basicOption,
        addBtn:false,
        editBtn: false,
        delBtn: false,
        calcHeight: -60,
        align:'left',
        headerAlign:'center',
        menu:false,
        searchMenuSpan: 6,
        searchIcon:false,
        column: [
          {
            label: '用户名',
            prop: 'truename',
            search:true,
            searchSpan: 4,
            searchLabel:'操作用户',
            type:'select',
            dicUrl:'/api/loginBasicController/getOperatingUsers',
            sortable:true,
            width: 150
          }, {
            label: '姓名',
            prop: 'username',
            sortable:true,
            width: 150
          },{
            label: '用户IP',
            prop: 'userIp',
            search:true,
            searchSpan: 4,
            sortable:true,
            width: 150
          },{
            label: '模块',
            prop: 'moduleName',
            sortable:true,
            overHidden: true,
          },{
            label: '操作',
            prop: 'type',
            sortable:true,
            width: 150
          },{
            label: '时间',
            prop: 'date',
            type:'date',
            search:true,
            searchOrder: 1,
            searchSpan: 8,
            searchRange: true,
            searchLabel:'查询日期',
            valueFormat:'yyyy-MM-dd',
            width: 160
          },{
            label: '描述',
            prop: 'result',
            overHidden: true,
            width:380,
          },
        ]
      },
      page: {
        currentPage: 1,
        pageSize: 50,
        total: 0,
        pageSizes: [10, 30, 50, 100],
      },
      searchParams: {}
    }
  },
  methods: {
    // è¡¨æ ¼è¯·æ±‚
    getTableList() {
      this.tableLoading = true;
      getLogListByContion(this.page.currentPage, this.page.pageSize, {'logType':this.$route.query.logType,...this.searchParams}).then(res => {
        this.tableData = res.data.data;
        this.page.total = res.data.total;
        this.tableLoading = false;
      })
    },
    // æœç´¢æŸ¥è¯¢
    handleSearch(params, done) {
      this.searchParams = {
        userName:params.truename,
        ipText:params.userIp,
        startDate:params.date[0],
        endDate:params.date[1]
      };
      this.getTableList();
      done();
    },
    // é‡ç½®æœç´¢æ¡ä»¶
    handleReset() {
      this.searchParams = {};
      this.getTableList();
    },
    // æ¡æ•°
    sizeChange(val) {
      this.page.pageSize = val;
    },
    // é¡µç 
    currentChange(val) {
      this.page.currentPage = val;
    },
    handleRefresh(){
      this.getTableList();
    }
  }
}
</script>
<style scoped>
</style>
Source/plt-web/plt-web-ui/src/api/system/log/logBasic.js
ÎļþÃû´Ó Source/plt-web/plt-web-ui/src/api/log/logBasic.js ÐÞ¸Ä
@@ -24,6 +24,15 @@
  })
}
//获取操作用户
export function getOperatingUsers( params) {
  return request({
    url: "/api/loginBasicController/getOperatingUsers",
    method: "get",
    params
  });
}
export function getLogListByContion(page, limit, params) {
  return request({
    url: "/api/loginBasicController/getLogListByContion",
@@ -35,3 +44,14 @@
    }
  });
}
// å¯¼å‡º
export const exportLog = (params) => {
  return request({
    url: '/api/loginBasicController/exportLog',
    method: 'get',
    headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'},
    responseType: 'blob',
    params
  })
}
Source/plt-web/plt-web-ui/src/views/log/index.vue
ÎļþÒÑɾ³ý
Source/plt-web/plt-web-ui/src/views/system/log/basicConf.vue
ÎļþÃû´Ó Source/plt-web/plt-web-ui/src/views/log/basicConf.vue ÐÞ¸Ä
@@ -21,7 +21,7 @@
</template>
<script>
import {getPeroid,savePeriod,deleteLog} from "@/api/log/logBasic";
import {getPeroid,savePeriod,deleteLog} from "@/api/system/log/logBasic";
export default {
  name: "basicConf",
  data: function () {
Source/plt-web/plt-web-ui/src/views/system/log/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,170 @@
<template>
  <basic-container>
    <avue-crud
      ref="logCrud"
      :data="tableData"
      :option="option"
      :page.sync="page"
      :table-loading="tableLoading"
      @on-load="getTableList"
      @refresh-change="handleRefresh"
      @search-change="handleSearch"
      @search-reset="handleReset"
      @size-change="sizeChange"
      @current-change="currentChange"
    >
      <template slot="menuLeft" slot-scope="scope">
        <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出</el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import basicOption from "@/util/basic-option";
import {getLogListByContion,getOperatingUsers,exportLog} from "@/api/system/log/logBasic";
import func from "@/util/func";
export default {
name: "index",
  data: function () {
    return {
      tableLoading: false,
      tableData: [],
      option: {
        ...basicOption,
        addBtn:false,
        editBtn: false,
        delBtn: false,
        calcHeight: -60,
        align:'left',
        headerAlign:'center',
        menu:false,
        searchMenuSpan: 6,
        searchIcon:false,
        column: [
          {
            label: '用户名',
            prop: 'truename',
            search:true,
            searchSpan: 4,
            searchLabel:'操作用户',
            type:'select',
            dicUrl:'/api/loginBasicController/getOperatingUsers',
            sortable:true,
            width: 150
          }, {
            label: '姓名',
            prop: 'username',
            sortable:true,
            width: 150
          },{
            label: '用户IP',
            prop: 'userIp',
            search:true,
            searchSpan: 4,
            sortable:true,
            width: 150
          },{
            label: '模块',
            prop: 'moduleName',
            sortable:true,
            overHidden: true,
          },{
            label: '操作',
            prop: 'type',
            sortable:true,
            width: 150
          },{
            label: '时间',
            prop: 'date',
            type:'date',
            search:true,
            searchOrder: 1,
            searchSpan: 8,
            searchRange: true,
            searchLabel:'查询日期',
            valueFormat:'yyyy-MM-dd',
            width: 160
          },{
            label: '描述',
            prop: 'result',
            overHidden: true,
            width:380,
          },
        ]
      },
      page: {
        currentPage: 1,
        pageSize: 50,
        total: 0,
        pageSizes: [10, 30, 50, 100],
      },
      searchParams: {}
    }
  },
  watch: {
    $route(to, from) {
      this.getTableList();
    }
  },
  methods: {
    // è¡¨æ ¼è¯·æ±‚
    getTableList() {
      this.tableLoading = true;
      getLogListByContion(this.page.currentPage, this.page.pageSize, {'logType':this.$route.query.logType,...this.searchParams}).then(res => {
        this.tableData = res.data.data;
        this.page.total = res.data.total;
        this.tableLoading = false;
      })
    },
    // æœç´¢æŸ¥è¯¢
    handleSearch(params, done) {
      this.searchParams = {
        userName:params.truename,
        ipText:params.userIp,
        startDate:params.date[0],
        endDate:params.date[1]
      };
      this.getTableList();
      done();
    },
    // é‡ç½®æœç´¢æ¡ä»¶
    handleReset() {
      this.searchParams = {};
      this.getTableList();
    },
    // æ¡æ•°
    sizeChange(val) {
      this.page.pageSize = val;
    },
    // é¡µç 
    currentChange(val) {
      this.page.currentPage = val;
    },
    handleRefresh(){
      this.getTableList();
    },
    // å¯¼å‡º
    exportClickHandler() {
      const loading = this.$loading({});
      exportLog().then(res => {
        func.downloadFileByBlobHandler(res);
        this.createdLoading = false
        this.$message.success('导出成功');
        loading.close();
      })
    },
  }
}
</script>
<style scoped>
</style>
Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue
@@ -2,8 +2,8 @@
  <el-container v-loading="createdLoading">
    <el-aside>
      <basic-container>
        <div style="max-height: calc(100vh - 170px);overflow: auto">
          <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick">
        <div style="max-height: calc(100vh - 150px);overflow: auto">
          <avue-tree :key="refresh" node-key="id" 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-s-promotion"></i>
@@ -17,7 +17,7 @@
    <el-main>
      <basic-container>
        <el-form ref="form" :model="form" label-width="85px" style="height: 79vh">
        <el-form ref="form" :model="form" label-width="85px" style="max-height: calc(100vh - 180px);overflow: auto;">
          <span v-if="form.childType !== 0">
            <el-form-item label="模块名:">
            <el-input v-model="form.name" placeholder="请输入模块名"></el-input>
@@ -202,6 +202,7 @@
      addStatus: false,
      editStatus: false,
      nodeRow: {},
      currentClickNode:null,
      form: {},
      treeData: [],
      treeOption: {
@@ -255,9 +256,10 @@
  },
  methods: {
    // æ ‘行点击
    nodeClick(row) {
    nodeClick(row,node) {
      this.form = {...row};
      this.nodeRow = {...row};
      this.currentClickNode=node;
      this.addStatus = false;
      this.editStatus = false;
    },
@@ -312,7 +314,7 @@
          this.addStatus = false;
          // this.resetFormValue();
          this.form.childType = null;
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
          this.handleRefreshTree('add')
        }
      })
    },
@@ -356,7 +358,7 @@
          this.editStatus = false;
          // this.resetFormValue();
          this.form.childType = null;
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
          this.handleRefreshTree('edit')
        }
      })
    },
@@ -371,7 +373,7 @@
        delModule(this.form).then(res => {
          if (res.data.code === 200) {
            this.$message.success(res.data.msg);
            this.resetFormValue();
            this.handleRefreshTree('del')
            this.addStatus = false;
            this.editStatus = false;
          }
@@ -389,8 +391,6 @@
      exportFunctionSql({isFunction: true}).then(res => {
        func.downloadFileByBlobHandler(res);
        this.$message.success('导出成功');
      }).catch(err => {
        this.$message.error(err);
      });
    },
@@ -425,12 +425,11 @@
        }
      })
      addOperationType(list).then(res => {
        console.log(res)
        if (res.data.code === 200) {
          this.methodsVisble = false;
          this.$message.success(res.data.msg);
          this.form.childType = null;
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
          this.handleRefreshTree('add') // åˆ·æ–°å·¦ä¾§æ ‘
        }
      })
    },
@@ -460,7 +459,7 @@
      updateAlias(params).then(res => {
        if (res.data.code === 200) {
          this.$message.success(res.data.msg);
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
          this.handleRefreshTree('edit')
        }
      })
    },
@@ -480,7 +479,7 @@
          console.log(res);
          if (res.data.code === 200) {
            this.$message.success(res.data.msg);
            this.resetFormValue();
            this.handleRefreshTree('del');
          }
        })
      }).catch(() => {
@@ -506,6 +505,23 @@
    // å¯¼å…¥
    upLoadClickHandler() {
      this.$refs.upload.visible = true;
    },
    handleRefreshTree(type) {
      //type:add\edit\del
      if(type=="del"){
        this.$refs.tree.remove(this.currentClickNode);
        this.currentClickNode=null;
        this.form={};
      }else{
        if (this.currentClickNode) {
          let node = this.currentClickNode.parent;
          node.loaded = false;
          node.expand();
          this.$refs.tree.setCurrentNode(this.currentClickNode);
        }else {
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
        }
      }
    }
  }
}
Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue
@@ -2,8 +2,8 @@
  <el-container v-loading="createdLoading">
    <el-aside>
      <basic-container>
        <div style="max-height: calc(100vh - 170px);overflow: auto">
          <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick">
        <div style="max-height: calc(100vh - 150px);overflow: auto">
          <avue-tree :key="refresh" node-key="id" 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-s-promotion"></i>
@@ -17,7 +17,7 @@
    <el-main>
      <basic-container>
        <el-form ref="form" :model="form" label-width="85px" style="height: 79vh">
        <el-form ref="form" :model="form" label-width="85px" style="max-height: calc(100vh - 180px);overflow: auto;">
          <span v-if="form.childType !== 0">
            <el-form-item label="模块名:">
            <el-input v-model="form.name" placeholder="请输入模块名"></el-input>
@@ -202,6 +202,7 @@
      addStatus: false,
      editStatus: false,
      nodeRow: {},
      currentClickNode:null,
      form: {},
      treeData: [],
      treeOption: {
@@ -255,10 +256,11 @@
  },
  methods: {
    // æ ‘行点击
    nodeClick(row) {
    nodeClick(row,node) {
      console.log(row.childType);
      this.form = {...row};
      this.nodeRow = {...row};
      this.currentClickNode = node;
      this.addStatus = false;
      this.editStatus = false;
    },
@@ -313,7 +315,7 @@
          this.addStatus = false;
          // this.resetFormValue();
          this.form.childType = null;
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
          this.handleRefreshTree('add')
        }
      })
    },
@@ -357,7 +359,7 @@
          this.editStatus = false;
          // this.resetFormValue();
          this.form.childType = null;
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
          this.handleRefreshTree('edit')
        }
      })
    },
@@ -372,7 +374,7 @@
        delModule(this.form).then(res => {
          if (res.data.code === 200) {
            this.$message.success(res.data.msg);
            this.resetFormValue();
            this.handleRefreshTree('del')
            this.addStatus = false;
            this.editStatus = false;
          }
@@ -461,23 +463,21 @@
      updateAlias(params).then(res => {
        if (res.data.code === 200) {
          this.$message.success(res.data.msg);
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
          this.handleRefreshTree('edit')
        }
      })
    },
    // åˆ é™¤æ¨¡å—下关联的操作类型
    deleteOperationClickHandler() {
      console.log(this.form);
      const params = {
        funcId: this.form.funcId,
        operId: this.form.operId
      }
      delFuncOperation(params).then(res => {
        console.log(res);
        if (res.data.code === 200) {
          this.$message.success(res.data.msg);
          this.resetFormValue();
          this.handleRefreshTree('del');
        }
      })
    },
@@ -489,14 +489,29 @@
        func.downloadFileByBlobHandler(res);
        this.createdLoading = false
        this.$message.success('导出成功');
      }).catch(err => {
        this.$message.error(err);
      })
    },
    // å¯¼å…¥
    upLoadClickHandler() {
      this.$refs.upload.visible = true;
    },
    handleRefreshTree(type) {
      //type:add\edit\del
      if(type=="del"){
        this.$refs.tree.remove(this.currentClickNode);
        this.currentClickNode=null;
        this.form={};
      }else{
        if (this.currentClickNode) {
          let node = this.currentClickNode.parent;
          node.loaded = false;
          node.expand();
          this.$refs.tree.setCurrentNode(this.currentClickNode);
        }else {
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
        }
      }
    }
  }
}
Source/plt-web/plt-web-ui/src/views/systemModel/operateType/index.vue
@@ -2,8 +2,8 @@
  <el-container>
    <el-aside>
      <basic-container>
        <div style="max-height: calc(100vh - 170px);overflow: auto">
          <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick">
        <div style="max-height: calc(100vh - 150px);overflow: auto">
          <avue-tree :key="refresh" node-key="id" 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-s-promotion"></i>
@@ -17,7 +17,7 @@
    <el-main>
      <basic-container>
        <el-form ref="form" :model="form" label-width="85px" style="height: 79vh">
        <el-form ref="form" :model="form" label-width="85px" style="max-height: calc(100vh - 180px);overflow: auto;">
          <el-form-item label="名称:">
            <el-input v-model="form.name" placeholder="请输入名称"></el-input>
          </el-form-item>
@@ -73,6 +73,7 @@
      editStatus:false,
      addStatus: false,
      nodeRow: {},
      currentClickNode:null,
      form: {},
      treeData: [],
      treeOption: {
@@ -111,10 +112,11 @@
  },
  methods: {
    // æ ‘行点击
    nodeClick(row) {
    nodeClick(row,node) {
      console.log(row);
      this.form = {...row};
      this.nodeRow = {...row};
      this.currentClickNode=node;
      this.addStatus = false;
      this.editStatus = false;
    },
@@ -173,7 +175,7 @@
      addOperationType(params).then(res => {
        if(res.data.code === 200){
          this.$message.success(res.data.msg);
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
          this.handleRefreshTree('add')
          this.addStatus = false;
        }
      })
@@ -227,7 +229,7 @@
      updateOperationType(params).then(res => {
        if(res.data.code === 200){
          this.$message.success(res.data.msg);
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
          this.handleRefreshTree('edit')
          this.editStatus = false;
        }
      })
@@ -243,7 +245,7 @@
        delOperationType(this.form).then(res => {
          if (res.data.code === 200) {
            this.$message.success(res.data.msg);
            this.resetFormValue();
            this.handleRefreshTree('del')
            this.addStatus = false;
            this.editStatus = false;
            this.nodeRow = {};
@@ -262,10 +264,25 @@
      exportFunctionSql({isFunction: false}).then(res => {
        func.downloadFileByBlobHandler(res);
        this.$message.success('导出成功');
      }).catch(err => {
        this.$message.error(err);
      });
    },
    handleRefreshTree(type) {
      //type:add\edit\del
      if(type=="del"){
        this.$refs.tree.remove(this.currentClickNode);
        this.currentClickNode=null;
        this.form={};
      }else{
        if (this.currentClickNode) {
          let node = this.currentClickNode.parent;
          node.loaded = false;
          node.expand();
          this.$refs.tree.setCurrentNode(this.currentClickNode);
        }else {
          this.refresh = Math.random(); // åˆ·æ–°å·¦ä¾§æ ‘
        }
      }
    }
  }
}
</script>