1
lzhe
2024-05-05 eaa73e206c85307bfee1e52c0851ca4bab20334d
src/views/console/system/menu.vue
@@ -2,7 +2,7 @@
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-03-26 10:28:33
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-04-01 18:24:25
 * @LastEditTime: 2024-04-07 11:54:15
 * @FilePath: /smart-web/src/views/master/person/main/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@@ -43,8 +43,8 @@
      <div>
         <div class="dict-Btn">
            <div class="dict-btn-bottom"> 
               <el-button type="primary" @click="addPerson">+ 新增</el-button>
               <el-button type="danger" plain @click="delPerson">删除</el-button>
               <el-button type="primary" @click="addData">+ 新增</el-button>
               <el-button type="danger" plain @click="delData">删除</el-button>
            </div>
         </div>
         <div class="dict-table">
@@ -72,7 +72,7 @@
                     <el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看</el-button>
                     <el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button>
                     <el-button text type="primary" size="small" @click="table_del(scope.row, scope.$index)">删除</el-button>
                     <el-button text type="primary" size="small" @click="addPerson(scope.row, scope.$index)">新增子项</el-button>
                     <el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index,'fixed')">新增子项</el-button>
                  </template>
               </el-table-column>
            </el-table>
@@ -88,6 +88,7 @@
      name: "allocation",
      data(){
         return {
            selection: [],
            applicationList: [],
            searchData: {
               name: "",
@@ -123,7 +124,7 @@
      methods: {
         handleSuccess(formAddMenu) {
            this.searchData.parentId = formAddMenu.parentId;
            this.searchBtn();
            this.clearSearch();
         },
         tableLoad(row,treeNode,resolve) {
            this.searchData.parentId= row.id;
@@ -132,7 +133,6 @@
                  resolve(res.data);
               }
            })
         },
         clearSearch() {
            this.searchData= {
@@ -177,7 +177,7 @@
               this.$HTTP.post("/api/blade-system/menu/remove?ids="+row.id).then(res=> {
                  if(res.code == 200) {
                     that.$message.success("操作成功");
                     that.searchBtn();
                     that.searchclick();
                  }
               })
            }).catch(() => {
@@ -185,18 +185,20 @@
            })
         },
         //添加
         addPerson(){
         addData(){
            this.dialog.save = true
            this.$nextTick(() => {
               this.$refs.saveDialog.open()
            })
         },
         table_edit(row){
            this.dialog.save = true
         table_edit(row,index,fixed){
            this.$HTTP.get("/api/blade-system/menu/detail?id="+row.id).then(res=> {
               if(res.code == 200) {
                  this.dialog.save = true;
                  this.$nextTick(() => {
                     if(fixed) {  //判断新增子项
                        res.data.fixed = "fixed";
                     }
                     this.$refs.saveDialog.open('edit').setData(res.data);
                  })
               }
@@ -209,8 +211,30 @@
               this.$refs.saveDialog.open('show').setData(row)
            })
         },
         handleSelectionChange() {},
         delPerson() {},
         handleSelectionChange(selection) {
            this.selection = selection;
         },
         delData() {
            if(this.selection.length == 0) {
               this.$message({
                   message: '请选择至少一条数据',
                   type: 'warning'
                 });
                 return;
            }
            var selStr = "";
            this.selection.map(item=> {
               selStr += item.id + ","
            })
            selStr = selStr.replace(/,$/, '');
            var that = this;
            this.$HTTP.post("/api/blade-system/menu/remove?ids="+selStr).then(res=> {
               if(res.code == 200) {
                  that.$message.success("操作成功");
                  that.searchclick();
               }
            })
         },
         changeDepartment() {
            this.departmentVisible = true;
         },