ludc
2023-07-25 2b8c4d75fd6bc38c8557dbe83020d598ac0fc74b
Source/UBCS-WEB/src/views/system/menu.vue
@@ -14,6 +14,7 @@
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @row-click="clickRowChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
@@ -21,11 +22,17 @@
               @tree-load="treeLoad">
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   v-if="permission.menu_delete"
                   plain
                   @click="handleDelete">删 除
          size="small"
          icon="el-icon-delete"
          v-if="permission.menu_delete"
          plain
          @click="handleDelete">删 除
        </el-button>
        <el-button type="success"
          size="small"
          icon="el-icon-connection"
          plain
          @click="cloneButton">从其他菜单克隆按钮
        </el-button>
      </template>
      <template slot-scope="scope" slot="menu">
@@ -45,6 +52,20 @@
        </div>
      </template>
    </avue-crud>
    <!-- 从其他菜单克隆按钮 -->
    <el-dialog title="从其他菜单克隆按钮"
        append-to-body
        :visible.sync="cloneButtonSettingBox"
        width="800px"
        style="height: 116vh; margin-top: -10vh;">
        <avue-crud
          :option="dialogeOption"
          :table-loading="dialogLoading"
          :data="useRangeData"
          @refresh-change="refreshUseRangeChange">
        </avue-crud>
      </el-dialog>
  </basic-container>
</template>
@@ -69,6 +90,7 @@
          total: 0,
        },
        option: {
          height: "auto",
          lazy: true,
          tip: false,
          simplePage: true,
@@ -82,6 +104,7 @@
          viewBtn: true,
          menuWidth: 300,
          dialogClickModal: false,
          highlightCurrentRow: true, //行选中时高亮
          column: [
            {
              label: "菜单名称",
@@ -223,6 +246,22 @@
              ]
            },
            {
              label: "路由缓存",
              prop: "keepAlive",
              type: "switch",
              dicData: [
                {
                  label: "否",
                  value: "false"
                },
                {
                  label: "是",
                  value: "true"
                }
              ],
              hide: true
            },
            {
              label: "菜单备注",
              prop: "remark",
              type: "textarea",
@@ -232,7 +271,12 @@
            }
          ]
        },
        data: []
        data: [],
        // 从其他菜单克隆按钮
        cloneOtherMenuButtons: {
          cloneButtonSettingBox: false,
        }
      };
    },
    watch: {
@@ -354,6 +398,10 @@
            });
          });
      },
      /** 从其他菜单克隆按钮 */
      cloneButton(){
      },
      searchReset() {
        this.query = {};
        this.parentId = 0;
@@ -366,8 +414,15 @@
        this.onLoad(this.page, params);
        done();
      },
      clickRowChange(row){
        this.$refs.crud.toggleSelection();
        this.selectionList = row;
        this.$refs.crud.setCurrentRow(row);
        this.$refs.crud.toggleRowSelection(row); //选中当前行
      },
      selectionChange(list) {
        this.selectionList = list;
        this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]);
      },
      selectionClear() {
        this.selectionList = [];