master
2022-03-22 e3f069b4fbb1ddcbc9f1c0832634200555789268
src/cool/modules/base/views/menu.vue
@@ -1,80 +1,82 @@
<template>
   <cl-crud :ref="setRefs('crud')" :on-refresh="onRefresh" @load="onLoad">
      <el-row type="flex">
         <cl-refresh-btn />
         <cl-add-btn />
         <cl-menu-quick @success="refresh()" v-if="isDev" />
      </el-row>
  <cl-crud :ref="setRefs('crud')"
           :on-refresh="onRefresh"
           @load="onLoad">
    <el-row type="flex">
      <cl-refresh-btn />
      <cl-add-btn />
      <cl-menu-quick @success="refresh()"
                     v-if="isDev" />
    </el-row>
      <el-row>
         <cl-table :ref="setRefs('table')" v-bind="table" @row-click="onRowClick">
            <!-- 名称 -->
            <template #column-name="{ scope }">
               <span>{{ scope.row.name }}</span>
               <el-tag
                  v-if="!scope.row.isShow"
                  size="mini"
                  effect="dark"
                  type="danger"
                  style="margin-left: 10px"
                  >隐藏</el-tag
               >
            </template>
    <el-row>
      <cl-table :ref="setRefs('table')"
                v-bind="table"
                @row-click="onRowClick">
        <!-- 名称 -->
        <template #column-name="{ scope }">
          <span>{{ scope.row.name }}</span>
          <el-tag v-if="!scope.row.isShow"
                  size="mini"
                  effect="dark"
                  type="danger"
                  style="margin-left: 10px">隐藏</el-tag>
        </template>
            <!-- 图标 -->
            <template #column-icon="{ scope }">
               <icon-svg :name="scope.row.icon" size="16px" style="margin-top: 5px" />
            </template>
        <!-- 图标 -->
        <template #column-icon="{ scope }">
          <icon-svg :name="scope.row.icon"
                    size="16px"
                    style="margin-top: 5px" />
        </template>
            <!-- 权限 -->
            <template #column-perms="{ scope }">
               <el-tag
                  v-for="(item, index) in scope.row.permList"
                  :key="index"
                  size="mini"
                  effect="dark"
                  style="margin: 2px; letter-spacing: 0.5px"
                  >{{ item }}</el-tag
               >
            </template>
        <!-- 权限 -->
        <template #column-perms="{ scope }">
          <el-tag v-for="(item, index) in scope.row.permList"
                  :key="index"
                  size="mini"
                  effect="dark"
                  style="margin: 2px; letter-spacing: 0.5px">{{ item }}</el-tag>
        </template>
            <!-- 路由 -->
            <template #column-router="{ scope }">
               <el-link v-if="scope.row.type == 1" type="primary" :href="scope.row.router">{{
        <!-- 路由 -->
        <template #column-router="{ scope }">
          <el-link v-if="scope.row.type == 1"
                   type="primary"
                   :href="scope.row.router">{{
                  scope.row.router
               }}</el-link>
               <span v-else>{{ scope.row.router }}</span>
            </template>
          <span v-else>{{ scope.row.router }}</span>
        </template>
            <!-- 路由缓存 -->
            <template #column-keepAlive="{ scope }">
               <template v-if="scope.row.type == 1">
                  <i v-if="scope.row.keepAlive" class="el-icon-check"></i>
                  <i v-else class="el-icon-close"></i>
               </template>
            </template>
        <!-- 路由缓存 -->
        <template #column-keepAlive="{ scope }">
          <template v-if="scope.row.type == 1">
            <i v-if="scope.row.keepAlive"
               class="el-icon-check"></i>
            <i v-else
               class="el-icon-close"></i>
          </template>
        </template>
            <!-- 行新增 -->
            <template #slot-add="{ scope }">
               <el-button
                  v-if="scope.row.type != 2"
                  type="text"
                  size="mini"
                  @click="upsertAppend(scope.row)"
                  >新增</el-button
               >
            </template>
         </cl-table>
      </el-row>
        <!-- 行新增 -->
        <template #slot-add="{ scope }">
          <el-button v-if="scope.row.type != 2"
                     type="text"
                     size="mini"
                     @click="upsertAppend(scope.row)">新增</el-button>
        </template>
      </cl-table>
    </el-row>
      <el-row type="flex">
         <cl-flex1 />
         <cl-pagination :props="{ layout: 'total' }" />
      </el-row>
    <el-row type="flex">
      <cl-flex1 />
      <cl-pagination :props="{ layout: 'total' }" />
    </el-row>
      <!-- 编辑 -->
      <cl-upsert v-bind="upsert" />
   </cl-crud>
    <!-- 编辑 -->
    <cl-upsert v-bind="upsert" />
  </cl-crud>
</template>
<script lang="ts">
@@ -139,6 +141,7 @@
      // 刷新
      function refresh() {
         console.log("刷新方法内打印");
         refs.value.crud.refresh();
      }