wangting
2024-12-27 3cf3b2f28930c50a938f91cb1d18f374de52683e
action分类改为树表显示,页面渲染时加载图标库文件
已修改3个文件
86 ■■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/App.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Icons/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/App.vue
@@ -5,6 +5,9 @@
  </div>
</template>
<script>
import {getIcons} from "@/api/UI/Icons";
import store from "@/store";
export default {
  name: "app",
  data() {
@@ -12,7 +15,10 @@
  },
  watch: {},
  created() {
    //获取所有图标,存在session
    getIcons().then(res => {
      store.dispatch("setIcons", res.data.data);
    })
  },
  methods: {},
  computed: {}
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue
@@ -23,28 +23,34 @@
    <el-main>
      <basic-container v-if="treeNodeRow.id === 'root' ">
        <div class="headerCon">
          <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler">创建
          </el-button>
          <!--<el-button v-if="permissionList.editBtn" icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">修改
          </el-button>
          <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">删除
          </el-button>-->
          <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">导入
          </el-button>
          <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出
          </el-button>
        </div>
        <div>
          <avue-crud
            ref="treeCrud"
            v-model="treeForm"
            :data="treeData[0].childs"
            :data="treeData[0].children"
            :option="treeCrudOption"
            @row-del="rowTreeDelHandler"
            @row-save="rowTreeSaveHandler"
            @row-update="rowTreeUpdataHandler"
            @refresh-change="handleRefresh">
            <template slot="menuLeft">
              <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler(treeNodeRow)">创建
              </el-button>
              <!--<el-button v-if="permissionList.editBtn" icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">修改
              </el-button>
              <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">删除
              </el-button>-->
              <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">导入
              </el-button>
              <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出
              </el-button>
            </template>
            <template #menu="{ row, size }">
              <el-button v-if="permissionList.addBtn" :size="size" icon="el-icon-plus"
                         text
                         type="text"
                         @click="addTreeClickHandler(row)">新增子级</el-button>
            </template>
          </avue-crud>
        </div>
      </basic-container>
@@ -174,7 +180,7 @@
        props: {
          label: 'name',
          value: 'id',
          children: 'childs'
          children: 'children'
        }
      },
      treeData: []
@@ -206,7 +212,9 @@
        addBtn: false,
        calcHeight: -50,
        highlightCurrentRow: true,
        menuWidth: 160,
        rowKey: 'id',
        rowParentKey: 'pid',
        menuWidth: 360,
        span: 24,
        labelWidth: 100,
        dialogWidth: '800',
@@ -229,11 +237,6 @@
        }, {
          label: '父主类',
          prop: 'pidName',
          formatter:function(row){
            if(row.pid=='root'){
              return 'Action分类'
            }
          },
          disabled: true,
          span: 24
        }, {
@@ -396,7 +399,7 @@
      }
      getActionTree(params).then(res => {
        const data = res.data.obj;
        this.treeData = [data];
        this.treeData = this.treeDataFormAtter([data],'Action分类');
        const selectTreeData = this.option.column.find(item => item.prop === 'plActionCls'); // 找到action添加分类树
        const dicData=[data];
        dicData[0].disabled=true;//根节点不能选
@@ -404,11 +407,25 @@
      })
    },
    treeDataFormAtter(items,pidName) {
      return items.map(item => {
        // 转换当前节点的属性
        const formList = {
          ...item,
          pidName:pidName,
          children: item.childs && item.childs.length > 0 ? this.treeDataFormAtter(item.childs,item.name) : undefined
        };
        return formList;
      });
    },
    // 左侧树行点击
    nodeClick(row) {
      this.treeNodeRow = row;
      this.getRightTableList(row);
      this.bottomData = [];
      if(this.treeNodeRow.id !== 'root'){
        this.getRightTableList(row);
        this.bottomData = [];
      }
    },
    // 头部刷新按钮
@@ -675,16 +692,20 @@
    },
    // 左侧树创建
    addTreeClickHandler() {
      if (func.isEmptyObject(this.treeNodeRow)) {
    addTreeClickHandler(row) {
      let parentRow=row;
      if(!row || !row.id){
        parentRow=this.treeNodeRow
      }
      if (func.isEmptyObject(parentRow)) {
        this.$message.error('请选择一条分类进行添加');
        return;
      }
      if (!this.treeNodeRow.id && this.treeNodeRow.name=='未分类') {
      if (!parentRow.id && parentRow.name=='未分类') {
        this.$message.error('未分类下不能创建子分类');
        return;
      }
      const {createTime, creator, name, id, description} = this.treeNodeRow;
      const {createTime, creator, name, id, description} = parentRow;
      this.$set(this.treeForm, 'createTime', func.formattedDate(createTime));
      this.$set(this.treeForm, 'creator', creator);
      this.$set(this.treeForm, 'pid', id);
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Icons/index.vue
@@ -226,7 +226,8 @@
  },
  created() {
    this.getGroups();
    this.initList();  },
    this.initList();
  },
  methods:{
    getGroups() {
      getDicts('EnumIconGroups').then(res => {