LAPTOP-16IUEB3P\Lenovo пре 3 година
родитељ
комит
c6a1e350fa

+ 8 - 1
src/router/routes.js

@@ -22,7 +22,14 @@ export const routes = [
   {
     path: '*',
     component: () => import('@/views/exception/404/index.vue')
-  }
+  },
+  
+  {
+    path: '/codeManagement/details',
+    component: () => import('@/views/codeManagement/details.vue'),
+    meta: { title: '编码信息' }
+  },
+  
 ];
 
 /**

+ 152 - 0
src/views/codeManagement/components/code-list-add.vue

@@ -0,0 +1,152 @@
+<!-- 用户编辑弹窗 -->
+<template>
+  <ele-modal
+    width="500px"
+    :visible="visible"
+    :close-on-click-modal="true"
+    custom-class="ele-dialog-form"
+    title="新建编码规则"
+    @update:visible="updateVisible"
+  >
+    <el-form ref="form" :model="form" :rules="rules" label-width="82px">
+      <el-row :gutter="15">
+        <el-col v-bind="styleResponsive ? { sm: 24 } : { span: 24 }">
+          <el-form-item label="编码:" prop="code">
+            <el-input
+              clearable
+              :maxlength="100"
+              v-model="form.code"
+              placeholder="请输入编码"
+            />
+          </el-form-item>
+          <el-form-item label="名称:" prop="name">
+            <el-input
+              clearable
+              :maxlength="100"
+              v-model="form.name"
+              placeholder="请输入名称"
+            />
+          </el-form-item>
+          <el-form-item label="描述:" prop="remark">
+            <el-input
+              clearable
+              type="textarea"
+              :maxlength="100"
+              v-model="form.remark"
+              :row="2"
+              placeholder="请输入描述"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template v-slot:footer>
+      <el-button @click="updateVisible(false)">取消</el-button>
+      <el-button type="primary" :loading="loading" @click="save">
+        保存
+      </el-button>
+    </template>
+  </ele-modal>
+</template>
+
+<script>
+  import { getNotBoundAccount } from '@/api/system/user';
+  import { getUserDetail , saveOrUpdateUser , checkExistence } from '@/api/system/organization'
+  export default {
+    components: { },
+    props: {
+      // 弹窗是否打开
+      visible: Boolean,
+      // 修改回显的数据
+      data: Object,
+      // 全部机构
+      organizationList: Array,
+      // 机构id
+      organizationId: [Number,String]
+    },
+    data() {
+      const defaultForm = {
+        id: null,
+        groupId: null,
+        name: '',
+        sex: null,
+        email: '',
+        phone: '',
+        age:'',
+        accountId:''
+      };
+      return {
+        defaultForm,
+        // 表单数据
+        form: { ...defaultForm },
+        // 表单验证规则
+        rules: {
+          name: [{ required: true, message: '请输入名称',trigger: 'blur'}],
+          code: [{ required: true, message: '请输入编码',trigger: 'blur'}],
+        },
+        // 提交状态
+        loading: false,
+        // 是否是修改
+        isUpdate: false,
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 保存编辑 */
+      save() {
+        this.$refs.form.validate((valid) => {
+          if (!valid) {
+            return false;
+          }
+          this.loading = true;
+          const data = {
+            ...this.form,
+          };
+          saveOrUpdateUser(data)
+            .then((msg) => {
+              this.loading = false;
+              if(this.isUpdate){
+                 this.$message.success('人员信息编辑成功');
+              }else{
+                 this.$message.success('人员新增成功');
+              }
+              this.updateVisible(false);
+              this.$emit('done');
+            })
+            .catch((e) => {
+              this.loading = false;
+              this.$message.error(e.message);
+            });
+        });
+      },
+      /* 更新visible */
+      updateVisible(value) {
+        this.$emit('update:visible', value);
+      }
+    },
+    watch: {
+      visible(visible) {
+        if (visible) {
+          if (this.data) {
+            // getUserDetail(this.data.id).then(res=>{
+            //    this.form = {...res}
+            //    this.city = res.addressId?res.addressId.toString():null
+            //    this.isUpdate = true;
+            // })
+          } else {
+            // this.form.groupId = this.organizationId;
+            // this.isUpdate = false;
+          }
+        } else {
+          this.$refs.form.clearValidate();
+          this.form = { ...this.defaultForm };
+        }
+      }
+    }
+  };
+</script>

+ 195 - 0
src/views/codeManagement/components/code-list.vue

@@ -0,0 +1,195 @@
+<template>
+  <div>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 265px)"
+      full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form"
+      cache-key="systemOrgUserTable"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+        <code-search @search="reload">
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="openEdit()"
+          >
+            添加
+          </el-button>
+        </code-search>
+      </template>
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-link
+          type="primary"
+          :underline="false"
+          icon="el-icon-edit"
+          @click="openEdit(row)"
+        >
+          编辑
+        </el-link>
+        <el-popconfirm
+          class="ele-action"
+          title="确定要删除此用户吗?"
+          @confirm="remove(row)"
+        >
+          <template v-slot:reference>
+            <el-link type="danger" :underline="false" icon="el-icon-delete">
+              删除
+            </el-link>
+          </template>
+        </el-popconfirm>
+      </template>
+    </ele-pro-table>
+    <!-- 编辑弹窗 -->
+    <code-list-add
+      :data="current"
+      :visible.sync="showEdit"
+      :organization-list="organizationList"
+      :organization-id="organizationId"
+      @done="reload"
+    />
+  </div>
+</template>
+
+<script>
+  import CodeSearch from './code-search.vue';
+  import CodeListAdd from './code-list-add.vue';
+  import { getUserPage , removePersonnel } from '@/api/system/organization';
+
+  export default {
+    components: { CodeSearch, CodeListAdd },
+    props: {
+      // 机构id
+      organizationId: [Number,String],
+      // 全部机构
+      organizationList: Array
+    },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            label: '编码',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'loginName',
+            label: '名称',
+            sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'status',
+            label: '描述',
+            align: 'center',
+            sortable: 'custom',
+            minWidth: 200,
+            showOverflowTooltip: true,
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 130,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        // 当前编辑数据
+        current: null,
+        // 是否显示编辑弹窗
+        showEdit: false,
+        statusOptions:[
+          {value:1,label:'全职'},
+          {value:2,label:'兼职'},
+          {value:3,label:'实习'},
+          {value:4,label:'正式'},
+          {value:5,label:'试用'},
+          {value:6,label:'离职'}
+        ],
+      };
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getUserPage({
+          ...where,
+          ...order,
+          pageNum:page,
+          size:limit,
+          groupId: this.organizationId
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+      /* 显示编辑 */
+      openEdit(row) {
+        if(row){
+           this.$router.push({
+             path: '/codeManagement/details'
+           });
+        }else{
+          this.current = row;
+          this.showEdit = true;
+        }
+
+      },
+      /* 删除 */
+      remove(row) {
+        const loading = this.$loading({ lock: true });
+        removePersonnel([row.id])
+          .then((msg) => {
+            loading.close();
+            this.$message.success(msg);
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+            this.$message.error(e.message);
+          });
+      },
+      /* 更改状态 */
+      editStatus(row) {
+        const loading = this.$loading({ lock: true });
+        updateUserStatus(row.userId, row.status)
+          .then((msg) => {
+            loading.close();
+            this.$message.success(msg);
+          })
+          .catch((e) => {
+            loading.close();
+            row.status = !row.status ? 1 : 0;
+            this.$message.error(e.message);
+          });
+      }
+    },
+    watch: {
+      // 监听机构id变化
+      organizationId() {
+        this.reload();
+      }
+    }
+  };
+</script>

+ 90 - 0
src/views/codeManagement/components/code-search.vue

@@ -0,0 +1,90 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    size="small"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="10">
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item>
+          <el-input
+            clearable
+            size="small"
+            v-model="where.code"
+            placeholder="请输入编码"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item>
+          <el-input
+            clearable
+            size="small"
+            v-model="where.name"
+            placeholder="请输入名称"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item>
+          <el-input
+            clearable
+            size="small"
+            v-model="where.remark"
+            placeholder="请输入描述"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { md: 6 } : { span: 6 }">
+        <el-form-item>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <slot></slot>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        code: '',
+        name: '',
+        remark:''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 1 - 1
src/views/codeManagement/details.vue

@@ -69,7 +69,7 @@ export default {
   data() {
     return {
       form: {},
-      formRules: {},
+      addFormRules: {},
       tableData: [
         {
           sort: 1,

+ 135 - 194
src/views/codeManagement/index.vue

@@ -1,207 +1,148 @@
 <template>
-  <div class="app-container ele-body">
-    <div class="zw-page-table">
-      <!-- 条件区 -->
-      <el-form label-width="100px" class="zw-criterion">
-        <div class="zw-criterion-normal">
-          <el-row>
-            <el-col :span="4">
-              <el-form-item label-width="80px" label="类型编码">
-                <el-input placeholder="请输入内容"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="4">
-              <el-form-item label-width="80px" label="类型编码">
-                <el-input placeholder="请输入内容"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="4" style="padding-left: 10px">
-              <el-button
-                type="primary"
-                @click="search"
-                icon="el-icon-search"
-     
-                >搜索</el-button
-              >
-              <el-button @click="reset" icon="el-icon-refresh-left" 
-                >重置</el-button
-              >
-            </el-col>
-          </el-row>
-        </div>
-      </el-form>
-    </div>
-    <div class="butn-wrap">
-      <el-button
-        type="primary"
-        @click="add"
-        icon="el-icon-search"
-        size="small"
-        >新增</el-button
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <ele-split-layout
+        width="266px"
+        allow-collapse
+        :right-style="{ overflow: 'hidden' }"
       >
-    </div>
-    <div class="container-main">
-      <div class="tree-wrap">
-        <tree ref="tree" :data="treeData" @change="treeChange"></tree>
-      </div>
-      <div class="main-wrap">
-        <el-table class="table" :data="tableData">
-          <el-table-column prop="s1" label="编码" width="180">
-          </el-table-column>
-          <el-table-column prop="name" label="名称" width="180">
-          </el-table-column>
-          <el-table-column prop="address" label="描述"></el-table-column>
-          <el-table-column prop="address" label="操作">
-            <template slot-scope="{ row }">
-              <el-button type="text" @click="junmpEdit(row)" size="small"
-                >编辑</el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-
-        <div class="pagination-wrap">
-          <el-pagination
-            background
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="total"
-            :page-size="size"
-            :current-page.sync="page"
-            @current-change="handleCurrentChange"
-            @size-change="handleSizeChange"
-          >
-          </el-pagination>
+        <div>
+          <!-- 操作按钮 -->
+          <ele-toolbar class="ele-toolbar-actions">
+            <div style="margin: 5px 0">
+              <el-input size="small" suffix-icon="el-icon-search" placeholder="请输入功能名称" v-model="filterText"> </el-input>
+            </div>
+          </ele-toolbar>
+          <div class="ele-border-lighter sys-organization-list">
+            <el-tree
+              ref="tree"
+              :data="data"
+              highlight-current
+              node-key="id"
+              :props="{ label: 'name' }"
+              :expand-on-click-node="false"
+              :default-expand-all="true"
+              @node-click="onNodeClick"
+            />
+          </div>
         </div>
-      </div>
-    </div>
-    <addDialog ref="addDialog"></addDialog>
+        <template v-slot:content>
+          <code-list
+            v-if="current"
+            :organization-list="data"
+            :organization-id="current.id"
+          />
+        </template>
+      </ele-split-layout>
+    </el-card>
   </div>
 </template>
+
 <script>
-import tree from './components/tree.vue';
-import addDialog from './components/addDialog.vue'
-export default {
-  components: {
-    tree,
-    addDialog
-  },
-  data() {
-    return {
-      treeData: [
-        {
-          id: 1,
-          label: '一级 1',
-          children: [
-            {
-              id: 4,
-              label: '二级 1-1',
-              children: [
-                {
-                  id: 9,
-                  label: '三级 1-1-1'
-                },
-                {
-                  id: 10,
-                  label: '三级 1-1-2'
-                }
-              ]
-            }
-          ]
-        },
-        {
-          id: 2,
-          label: '一级 2',
-          children: [
-            {
-              id: 5,
-              label: '二级 2-1'
-            },
-            {
-              id: 6,
-              label: '二级 2-2'
-            }
-          ]
-        },
-        {
-          id: 3,
-          label: '一级 3',
-          children: [
-            {
-              id: 7,
-              label: '二级 3-1'
-            },
-            {
-              id: 8,
-              label: '二级 3-2'
-            }
-          ]
-        }
-      ],
-      tableData: [
-        {
-          s1: '1'
-        }
-      ],
-      total: 0,
-      size: 10,
-      page: 1
-    };
-  },
-  methods: {
-    treeChange(val) {
-      console.log(val);
+  import CodeList from './components/code-list.vue';
+  import {
+    listOrganizations,
+    removeOrganization
+  } from '@/api/system/organization';
+
+  export default {
+    name: 'codeManagement',
+    components: { CodeList },
+    data() {
+      return {
+        // 加载状态
+        loading: true,
+        // 列表数据
+        data: [],
+        // 选中数据
+        current: null,
+        // 是否显示表单弹窗
+        showEdit: false,
+        // 编辑回显数据
+        editData: null,
+        // 上级id
+        parentId: null,
+        filterText:''
+      };
     },
-    // 编辑
-    junmpEdit(row) {
-      // this.$router.push({
-      //   path: '/codeManagement/details'
-      // });
-      this.$refs.addDialog.open('edit')
+    created() {
+      this.query();
     },
-    search() {},
-    reset() {},
-    handleCurrentChange() {},
-    handleSizeChange() {},
-    add(){
-      this.$refs.addDialog.open('add')
+    methods: {
+      /* 查询 */
+      query() {
+        this.loading = true;
+        listOrganizations()
+          .then((list) => {
+            this.loading = false;
+            this.data = this.$util.toTreeData({
+              data: list,
+              idField: 'id',
+              parentIdField: 'parentId'
+            });
+            this.$nextTick(() => {
+              this.onNodeClick(this.data[0]);
+            });
+          })
+          .catch((e) => {
+            this.loading = false;
+            this.$message.error(e.message);
+          });
+      },
+      /* 选择数据 */
+      onNodeClick(row) {
+        if (row) {
+          this.current = row;
+          this.parentId = row.id;
+          this.$refs.tree.setCurrentKey(row.id);
+        } else {
+          this.current = null;
+          this.parentId = null;
+        }
+      },
+      /* 显示编辑 */
+      openEdit(item) {
+        this.editData = item;
+        this.showEdit = true;
+      },
+      /* 删除 */
+      remove() {
+        this.$confirm('确定要删除选中的机构吗?', '提示', {
+          type: 'warning'
+        })
+          .then(() => {
+            const loading = this.$loading({ lock: true });
+            removeOrganization([this.current.id])
+              .then((msg) => {
+                loading.close();
+                this.$message.success(msg);
+                this.query();
+              })
+              .catch((e) => {
+                loading.close();
+                this.$message.error(e.message);
+              });
+          })
+          .catch(() => {});
+      }
     }
-  }
-};
+  };
 </script>
+
 <style lang="scss" scoped>
-.app-container {
-  min-height: calc(100vh - 150px);
-}
-.container-main {
-  display: flex;
-  height: calc(100vh - 230px);
-  .tree-wrap {
-    width: 220px;
-  }
-  .main-wrap {
-    flex: 1;
-    margin-left: 20px;
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
   }
-}
 
-.btn {
-  background: #157a2c;
-  color: #ffffff;
-}
-.zw-page-table {
-  background: #ffffff;
-  padding-top: 20px;
-  margin-bottom: 20px;
-}
-.pagination-wrap {
-  display: flex;
-  justify-content: flex-end;
-  padding: 10px 0;
-}
-.tree-wrap {
-  background: #ffffff;
-}
-.butn-wrap{
-  margin-bottom: 10px;
-}
-</style>
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+</style>

+ 207 - 0
src/views/codeManagement/index2.vue

@@ -0,0 +1,207 @@
+<template>
+  <div class="app-container ele-body">
+    <div class="zw-page-table">
+      <!-- 条件区 -->
+      <el-form label-width="100px" class="zw-criterion">
+        <div class="zw-criterion-normal">
+          <el-row>
+            <el-col :span="4">
+              <el-form-item label-width="80px" label="类型编码">
+                <el-input placeholder="请输入内容"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="4">
+              <el-form-item label-width="80px" label="类型编码">
+                <el-input placeholder="请输入内容"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="4" style="padding-left: 10px">
+              <el-button
+                type="primary"
+                @click="search"
+                icon="el-icon-search"
+
+                >搜索</el-button
+              >
+              <el-button @click="reset" icon="el-icon-refresh-left"
+                >重置</el-button
+              >
+            </el-col>
+          </el-row>
+        </div>
+      </el-form>
+    </div>
+    <div class="butn-wrap">
+      <el-button
+        type="primary"
+        @click="add"
+        icon="el-icon-search"
+        size="small"
+        >新增</el-button
+      >
+    </div>
+    <div class="container-main">
+      <div class="tree-wrap">
+        <tree ref="tree" :data="treeData" @change="treeChange"></tree>
+      </div>
+      <div class="main-wrap">
+        <el-table class="table" :data="tableData">
+          <el-table-column prop="s1" label="编码" width="180">
+          </el-table-column>
+          <el-table-column prop="name" label="名称" width="180">
+          </el-table-column>
+          <el-table-column prop="address" label="描述"></el-table-column>
+          <el-table-column prop="address" label="操作">
+            <template slot-scope="{ row }">
+              <el-button type="text" @click="junmpEdit(row)" size="small"
+                >编辑</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <div class="pagination-wrap">
+          <el-pagination
+            background
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="total"
+            :page-size="size"
+            :current-page.sync="page"
+            @current-change="handleCurrentChange"
+            @size-change="handleSizeChange"
+          >
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+    <addDialog ref="addDialog"></addDialog>
+  </div>
+</template>
+<script>
+import tree from './components/tree.vue';
+import addDialog from './components/addDialog.vue'
+export default {
+  components: {
+    tree,
+    addDialog
+  },
+  data() {
+    return {
+      treeData: [
+        {
+          id: 1,
+          label: '一级 1',
+          children: [
+            {
+              id: 4,
+              label: '二级 1-1',
+              children: [
+                {
+                  id: 9,
+                  label: '三级 1-1-1'
+                },
+                {
+                  id: 10,
+                  label: '三级 1-1-2'
+                }
+              ]
+            }
+          ]
+        },
+        {
+          id: 2,
+          label: '一级 2',
+          children: [
+            {
+              id: 5,
+              label: '二级 2-1'
+            },
+            {
+              id: 6,
+              label: '二级 2-2'
+            }
+          ]
+        },
+        {
+          id: 3,
+          label: '一级 3',
+          children: [
+            {
+              id: 7,
+              label: '二级 3-1'
+            },
+            {
+              id: 8,
+              label: '二级 3-2'
+            }
+          ]
+        }
+      ],
+      tableData: [
+        {
+          s1: '1'
+        }
+      ],
+      total: 0,
+      size: 10,
+      page: 1
+    };
+  },
+  methods: {
+    treeChange(val) {
+      console.log(val);
+    },
+    // 编辑
+    junmpEdit(row) {
+      // this.$router.push({
+      //   path: '/codeManagement/details'
+      // });
+      this.$refs.addDialog.open('edit')
+    },
+    search() {},
+    reset() {},
+    handleCurrentChange() {},
+    handleSizeChange() {},
+    add(){
+      this.$refs.addDialog.open('add')
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-container {
+  min-height: calc(100vh - 150px);
+}
+.container-main {
+  display: flex;
+  height: calc(100vh - 230px);
+  .tree-wrap {
+    width: 220px;
+  }
+  .main-wrap {
+    flex: 1;
+    margin-left: 20px;
+  }
+}
+
+.btn {
+  background: #157a2c;
+  color: #ffffff;
+}
+.zw-page-table {
+  background: #ffffff;
+  padding-top: 20px;
+  margin-bottom: 20px;
+}
+.pagination-wrap {
+  display: flex;
+  justify-content: flex-end;
+  padding: 10px 0;
+}
+.tree-wrap {
+  background: #ffffff;
+}
+.butn-wrap{
+  margin-bottom: 10px;
+}
+</style>

+ 8 - 3
src/views/system/menu/index.vue

@@ -44,9 +44,14 @@
             type="primary"
             size="mini"
             :disable-transitions="true"
-          >
-            {{row.type==1?'菜单':(row.type==2?'按钮':'')}}
-          </el-tag>
+            v-if="row.type==1"
+          > 菜单  </el-tag>
+          <el-tag
+            type="warning"
+            size="mini"
+            :disable-transitions="true"
+            v-if="row.type==2"
+          >  按钮  </el-tag>
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">