gaoluyang
2025-02-26 2c2188d3b41b9646ea5ee4202a11d135ce03daa2
Merge remote-tracking branch 'origin/dev' into dev
已修改2个文件
已添加2个文件
873 ■■■■ 文件已修改
src/api/cnas/process/sampleDisposal.js 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/CNAS/process/sampleDisposal/index.vue 625 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/menu/index.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/role/index.vue 175 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cnas/process/sampleDisposal.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
// æ£€æµ‹æˆ–校准物品的处置
import request from "@/utils/request";
// ä¿®æ”¹
export function doProcessDeal(data) {
  return request({
    url: "/processDeal/doProcessDeal",
    method: "post",
    data: data,
  });
}
// æ–°å¢ž
export function addProcessDeal(data) {
  return request({
    url: "/processDeal/addProcessDeal",
    method: "post",
    data: data,
  });
}
// æäº¤åŽ†å²  ä¼ å‚id
export function submitProcessTotaldeal(data) {
  return request({
    url: "/processTotaldeal/submitProcessTotaldeal",
    method: "post",
    data: data,
  });
}
//查询详情  åˆ†é¡µæŸ¥è¯¢é‡Œé¢totaldealId  ä¼ å‚历史的id
export function pageProcessDeal(query) {
  return request({
    url: "/processDeal/pageProcessDeal",
    method: "get",
    params: query,
  });
}
// å®¡æ ¸  ä¼ å‚id和通过不通过state(中文)
export function checkProcessTotaldeal(data) {
  return request({
    url: "/processTotaldeal/checkProcessTotaldeal",
    method: "post",
    data: data,
  });
}
// æ‰¹å‡†  ä¼ å‚id和通过不通过state(中文)
export function ratifyProcessTotaldeal(data) {
  return request({
    url: "/processTotaldeal/ratifyProcessTotaldeal",
    method: "post",
    data: data,
  });
}
//删除
export function delProcessDeal(query) {
  return request({
    url: "/processDeal/delProcessDeal",
    method: "delete",
    params: query,
  });
}
src/views/CNAS/process/sampleDisposal/index.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,625 @@
<template>
  <div class="sample-disposal">
    <el-row class="title">
      <el-col :span="20" style="padding-left: 20px;text-align: left;">检测或校准物品的处置</el-col>
      <el-col :span="4" style="text-align: right;">
        <!-- <el-button size="medium" type="primary" @click="handleDown" v-loading="outLoading" style="margin-right: 16px;">导出</el-button> -->
      </el-col>
    </el-row>
    <el-tabs type="border-card" v-model="activeName" style="height: 100%;" @tab-click="queryParams.totaldealId = ''">
      <el-tab-pane label="填写" name="填写" style="height: 100%;" :key="1">
        <el-button size="small" type="primary" @click="handleAdd0" style="margin-left: 20px;"
          v-if="addPower">新增</el-button>
        <div class="table" style="height: calc(100% - 200px)" v-if="activeName == '填写'">
          <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading"
            :height="'calc(100vh - 290px)'" :page="page" @pagination="pagination"></lims-table>
          <!-- <ValueTable ref="ValueTable0" :url="$api.processTotaldeal.pageProcessDeal" :componentData="componentData0"
            :key="upIndex0" :delUrl="$api.processTotaldeal.delProcessDeal" /> -->
        </div>
      </el-tab-pane>
      <el-tab-pane label="历史记录" name="历史记录" style="height: 100%;" :key="2">
        <div class="search">
          <div class="search_thing">
            <div class="search_label">年月:</div>
            <div class="search_input">
              <el-date-picker v-model="componentData.entity.month" type="month" placeholder="选择月" format="yyyy-MM"
                value-format="yyyy-MM" size="small" @change="refreshTable()">
              </el-date-picker>
            </div>
          </div>
          <div class="search_thing" style="padding-left: 30px;">
            <el-button size="small" @click="refresh()">重 ç½®</el-button>
            <el-button size="small" type="primary" @click="refreshTable()">查 è¯¢</el-button>
          </div>
        </div>
        <div class="table">
          <!-- <ValueTable ref="ValueTable" :url="$api.processTotaldeal.pageProcessTotaldeal" :componentData="componentData"
            :key="upIndex" /> -->
        </div>
      </el-tab-pane>
    </el-tabs>
    <!-- æ–°å¢žæ ·å“ -->
    <el-dialog :title="title" :visible.sync="addDialogVisible" width="400px">
      <el-row>
        <el-col :span="24" style="margin-bottom: 16px;">
          <div class="search_thing">
            <div class="search_label">样品名称:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                v-model="addInfo.sampleName"></el-input></div>
          </div>
        </el-col>
        <el-col :span="24" style="margin-bottom: 16px;">
          <div class="search_thing">
            <div class="search_label">样品编号:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                v-model="addInfo.sampleCode"></el-input></div>
          </div>
        </el-col>
        <el-col :span="24" style="margin-bottom: 16px;">
          <div class="search_thing">
            <div class="search_label">供样单位:</div>
            <div class="search_input">
              <el-select v-model="addInfo.sampleSupplier" size="small">
                <el-option :label="item.company" :value="item.company" v-for="(item, index) in customPageList"
                  :key="item.id"></el-option>
              </el-select>
            </div>
          </div>
        </el-col>
        <el-col :span="24" style="margin-bottom: 16px;">
          <div class="search_thing">
            <div class="search_label">数量:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                v-model="addInfo.num"></el-input>
            </div>
          </div>
        </el-col>
        <el-col :span="24" style="margin-bottom: 16px;">
          <div class="search_thing">
            <div class="search_label">处理方式:</div>
            <div class="search_input"><el-input size="small" placeholder="请输入" clearable
                v-model="addInfo.dealMethod"></el-input></div>
          </div>
        </el-col>
        <el-col :span="24" style="margin-bottom: 16px;">
          <div class="search_thing">
            <div class="search_label">时间:</div>
            <div class="search_input">
              <el-date-picker v-model="addInfo.dealTime" type="date" size="small" placeholder="选择日期" format="yyyy-MM-dd"
                value-format="yyyy-MM-dd" style="width: 100%;">
              </el-date-picker>
            </div>
          </div>
        </el-col>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="addDialogVisible = false">取 æ¶ˆ</el-button>
        <el-button type="primary" @click="submitAdd" :loading="addLoading">ç¡® å®š</el-button>
      </span>
    </el-dialog>
    <!-- è¯¦æƒ…/下载/审核/批准 -->
    <el-dialog :title="title0" :visible.sync="lookDialogVisible" width="800px" :class="{ downPdf: title0 == '下载' }"
      :modal="title0 != '下载'" top="5vh">
      <filePreview v-if="lookDialogVisible" :fileUrl="javaApi + '/word/' + currentInfo.url" :currentFile="{}"
        style="max-height: 70vh;overflow-y: auto;" />
      <span slot="footer" class="dialog-footer" v-if="title0 == '审核' || title0 == '批准'">
        <el-button @click="submitCheck('不通过')" :loading="noCheckLoading">不通过</el-button>
        <el-button type="primary" @click="submitCheck('通过')" :loading="checkLoading">通 è¿‡</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import limsTable from "@/components/Table/lims-table.vue";
import filePreview from "@/components/Preview/filePreview.vue";
import { selectCustomPageList } from "@/api/system/customer";
import {
  doProcessDeal,
  addProcessDeal,
  submitProcessTotaldeal,
  pageProcessDeal,
  checkProcessTotaldeal,
  ratifyProcessTotaldeal,
  delProcessDeal,
} from "@/api/cnas/process/sampleDisposal";
export default {
  components: {
    limsTable,
    filePreview,
  },
  name: "SampleDisposal",
  data() {
    return {
      activeName: '填写',
      title: '新增',
      addDialogVisible: false,
      addLoading: false,
      outLoading: false,
      editDialogVisible: false,
      lookDialogVisible: false,
      title0: '查看',
      noCheckLoading: false,
      checkLoading: false,
      // åŽ†å²åˆ—è¡¨
      componentData: {
        entity: {
          month: null,
          orderBy: {
            field: 'id',
            order: 'desc'
          }
        },
        isIndex: true,
        showSelect: false,
        select: false,
        do: [{
          id: 'handleLook',
          font: '查看',
          type: 'text',
          method: 'handleLook',
        }, {
          id: 'handleDown0',
          font: '下载',
          type: 'text',
          method: 'handleDown0',
          disabFun: (row, index) => {
            return !row.url
          }
        },
        // {
        //   id: 'handleAdd',
        //   font: '填写',
        //   type: 'text',
        //   method: 'handleAdd',
        //   disabFun: (row, index) => {
        //     return row.submitState=='已提交'
        //   }
        // },
        {
          id: 'handleSubmit',
          font: '提交',
          type: 'text',
          method: 'handleSubmit',
          disabFun: (row, index) => {
            return !!row.submitState && row.submitState != '待提交'
          }
        }, {
          id: 'handleCheck',
          font: '审核',
          type: 'text',
          method: 'handleCheck',
          disabFun: (row, index) => {
            return row.examineState == '通过' || row.submitState == '待提交'
          }
        }, {
          id: 'handleApproval',
          font: '批准',
          type: 'text',
          method: 'handleApproval',
          disabFun: (row, index) => {
            return row.ratifyState == '通过' || row.submitState == '待提交'
          }
        }],
        tagField: {},
        selectField: {},
        requiredAdd: [],
        requiredUp: [],
        needSort: [],
        inputType: ''
      },
      // æ ·å“åˆ—表
      componentData0: {
        entity: {
          totaldealId: null,
          orderBy: {
            field: 'id',
            order: 'desc'
          }
        },
        isIndex: true,
        showSelect: false,
        select: false,
        do: [{
          id: 'handleAdd0',
          font: '修改',
          type: 'text',
          method: 'handleAdd0'
        }, {
          id: 'delete',
          font: '删除',
          type: 'text',
          method: 'doDiy'
        }],
        tagField: {},
        selectField: {},
        requiredAdd: [],
        requiredUp: [],
        needSort: [],
        inputType: ''
      },
      upIndex0: 100,
      entityCopy: {},
      upIndex: 0,
      addInfo: {},//新增样品
      customPageList: [],
      currentInfo: {
        arr: []
      },//查看的详情
      outPower: false,
      addPower: false,
      queryParams: {},
      tableData: [],
      column: [
        { label: "样品名称", prop: "sampleName" },
        { label: "样品编号", prop: "sampleCode" },
        { label: "供样单位", prop: "sampleSupplier" },
        { label: "数量", prop: "num" },
        { label: "处理方式", prop: "dealMethod" },
        { label: "时间", prop: "dealTime" },
        {
          dataType: "action",
          fixed: "right",
          label: "操作",
          operation: [
            {
              name: "编辑",
              type: "text",
              clickFun: (row) => {
                this.handleAdd0(row);
              },
            },
            {
              name: "删除",
              type: "text",
              clickFun: (row) => {
                this.handleDelete(row);
              },
            },
          ],
        },
      ],
      page: {
        total: 0,
        size: 10,
        current: 0,
      },
      tableLoading: false,
    };
  },
  mounted() {
    // this.entityCopy = this.HaveJson(this.componentData.entity);
    this.getCustomPageList()
    // this.getPower()
  },
  methods: {
    getPower() {
      let power = JSON.parse(sessionStorage.getItem('power'))
      let add = false
      let out = false
      let submitProcessTotaldeal = false
      let checkProcessTotaldeal = false
      let ratifyProcessTotaldeal = false
      for (var i = 0; i < power.length; i++) {
        if (power[i].menuMethod == 'addProcessDeal') {
          add = true
        }
        // if (power[i].menuMethod == 'exportProcessEvaluate') {
        //   out = true
        // }
        if (power[i].menuMethod == 'submitProcessTotaldeal') {
          submitProcessTotaldeal = true
        }
        if (power[i].menuMethod == 'checkProcessTotaldeal') {
          checkProcessTotaldeal = true
        }
        if (power[i].menuMethod == 'ratifyProcessTotaldeal') {
          ratifyProcessTotaldeal = true
        }
      }
      if (!ratifyProcessTotaldeal) {
        this.componentData.do.splice(4, 1)
      }
      if (!checkProcessTotaldeal) {
        this.componentData.do.splice(3, 1)
      }
      if (!submitProcessTotaldeal) {
        this.componentData.do.splice(2, 1)
      }
      if (!add) {
        this.componentData0.do.splice(1, 1)
        this.componentData0.do.splice(0, 1)
      }
      this.addPower = add
    },
    // èŽ·å–é€æ ·å•ä½åˆ—è¡¨
    getCustomPageList() {
      selectCustomPageList({
        current: -1,
        size: -1
      }).then(res => {
        this.customPageList = res.data.body.records
      }).catch(err => { });
    },
    handleDown() { },
    getList() {
      this.tableLoading = true;
      let param = { ...this.queryParams, ...this.page };
      delete param.total;
      pageProcessDeal({ ...param })
        .then((res) => {
          this.tableLoading = false;
          if (res.code === 200) {
            this.tableData = res.data.records;
            this.page.total = res.data.total;
          }
        })
        .catch((err) => {
          this.tableLoading = false;
        });
    },
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.getList();
    },
    refresh() {
      this.queryParams = {};
      this.page.current = 1;
      this.getList();
    },
    refreshTable() {
      this.page.current = 1;
      this.getList();
    },
    // å¡«å†™
    // handleAdd(row){
    //   this.componentData0.entity.totaldealId = row.id
    //   this.editDialogVisible = true
    // },
    // æ‰“开新增界面
    handleAdd0(row) {
      if (row) {
        this.addInfo = this.HaveJson(row)
        this.title = '编辑'
      } else {
        this.title = '新增'
        this.addInfo = {}
      }
      this.addDialogVisible = true
    },
    // æäº¤æ–°å¢ž
    submitAdd() {
      if (this.addInfo.id) {
        // ç¼–辑
        this.addLoading = true
        doProcessDeal({
          totaldealId: this.queryParams.totaldealId,
          ...this.addInfo
        }).then(res => {
          this.addLoading = false
          if (res.code === 201) return
          this.addDialogVisible = false
          this.$message({
            type: 'success',
            message: '编辑成功!'
          });
          this.$refs.ValueTable0.selectList()
        }).catch(err => { });
      } else {
        // æ–°å¢ž
        this.addLoading = true
        addProcessDeal({
          totaldealId: this.queryParams.totaldealId,
          ...this.addInfo
        }).then(res => {
          this.addLoading = false
          if (res.code === 201) return
          this.addDialogVisible = false
          this.$message({
            type: 'success',
            message: '新增成功!'
          });
          this.$refs.ValueTable0.selectList()
        }).catch(err => { });
      }
    },
    // æäº¤
    handleSubmit(row) {
      this.$confirm('是否提交 ' + row.month + ' æœˆä»½çš„æ•°æ®', '提交', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        submitProcessTotaldeal({
          id: row.id
        }).then(res => {
          if (res.code === 201) return
          this.$message({
            type: 'success',
            message: '提交成功!'
          });
          this.$refs['ValueTable'].selectList()
        }).catch(err => { });
      })
    },
    // æŸ¥çœ‹
    handleLook(row) {
      // console.log(row)
      // this.title0 = '查看'
      // this.commonFun(row)
      this.activeName = '填写'
      this.queryParams.totaldealId = row.id
      this.$nextTick(() => {
        this.$refs['ValueTable0'].selectList()
      })
    },
    commonFun(row, callbanck) {
      this.currentInfo = row
      this.queryParams.totaldealId = row.id
      pageProcessDeal({
        current: -1,
        size: -1, ...this.queryParams
      }).then(res => {
        this.currentInfo.arr = res.data.body.records
        this.lookDialogVisible = true
        if (callbanck) {
          callbanck()
        }
      }).catch(err => { });
    },
    // å®¡æ ¸
    handleCheck(row) {
      this.title0 = '审核'
      this.commonFun(row)
    },
    // æ‰¹å‡†
    handleApproval(row) {
      this.title0 = '批准'
      this.commonFun(row)
    },
    // æäº¤å®¡æ ¸/批准
    submitCheck(state) {
      if (state == '通过') {
        this.checkLoading = true
      } else {
        this.noCheckLoading = true
      }
      if (this.title0 == '审核') {
        checkProcessTotaldeal({
          id: this.currentInfo.id,
          state: state
        }).then(res => {
          this.checkLoading = false
          this.noCheckLoading = false
          if (res.code === 201) return
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
          this.$refs['ValueTable'].selectList()
          this.lookDialogVisible = false
        }).catch(err => { });
      } else if (this.title0 == '批准') {
        ratifyProcessTotaldeal({
          id: this.currentInfo.id,
          state: state
        }).then(res => {
          this.checkLoading = false
          this.noCheckLoading = false
          if (res.code === 201) return
          this.$message({
            type: 'success',
            message: '操作成功!'
          });
          this.$refs['ValueTable'].selectList()
          this.lookDialogVisible = false
        }).catch(err => { });
      }
    },
    // å¯¼å‡ºè¯¦æƒ…
    handleDown0(row) {
      // åŽç«¯ä¸‹è½½
      let url = this.javaApi + '/word/' + row.url
      this.$download.saveAs(url, row.month + ' æ ·å“å¤„理申请表');
    },
    handleDelete(row) {
      this.$confirm("是否删除该条数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          delProcessDeal({ id: row.id }).then((res) => {
            if (res.code == 201) return;
            this.$message.success("删除成功");
            this.refresh();
          });
        })
        .catch(() => { });
    },
  },
}
</script>
<style scoped>
.title {
  height: 60px;
  line-height: 60px;
}
.search {
  background-color: #fff;
  height: 40px;
  display: flex;
  align-items: center;
  position: relative;
}
.search_thing {
  width: 350px;
  display: flex;
  align-items: center;
}
.search_label {
  width: 110px;
  font-size: 14px;
  text-align: right;
}
.search_input {
  width: calc(100% - 110px);
}
.table {
  background-color: #fff;
  width: calc(100% - 40px);
  height: calc(100% - 60px - 140px);
  padding: 20px;
}
.downPdf {
  opacity: 0 !important;
}
.tables {
  table-layout: fixed;
  width: 100%;
  margin-top: 10px;
}
.tables td {
  height: 40px;
  width: 100px;
  text-align: center;
  font-size: 14px;
  word-wrap: break-word;
  white-space: normal;
}
.en {
  font-size: 12px;
  word-break: break-word;
  /* è‡ªåŠ¨æ–­è¡Œ */
  overflow-wrap: break-word;
  /* é˜²æ­¢æº¢å‡º */
  white-space: normal;
  /* é»˜è®¤æ¢è¡Œ */
}
.user-info {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  margin-top: 20px;
}
.user-info .el-button {
  margin: 0;
}
>>>.el-tabs__content {
  height: 100%;
}
</style>
src/views/system/menu/index.vue
@@ -223,8 +223,8 @@
                </el-tooltip>
                åªçœ‹æˆ‘按钮
              </span>
              <el-switch v-model="form.isRersonalButton" inactive-text="不显示" active-text="显示" inactive-value="0"
                active-value="1">
              <el-switch v-model="form.isRersonalButton" inactive-text="不显示" active-text="显示" :inactive-value="0"
                :active-value="1">
              </el-switch>
            </el-form-item>
          </el-col>
@@ -340,7 +340,8 @@
        isFrame: "1",
        isCache: "0",
        visible: "0",
        status: "0"
        status: "0",
        isRersonalButton: 0
      };
      this.resetForm("form");
    },
@@ -379,6 +380,7 @@
      this.getTreeselect();
      getMenu(row.menuId).then(response => {
        this.form = response.data;
        this.form.isRersonalButton = Number(this.form.isRersonalButton)
        this.open = true;
        this.title = "修改菜单";
      });
src/views/system/role/index.vue
@@ -4,48 +4,22 @@
      <div>
        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
          <el-form-item label="角色名称" prop="roleName">
            <el-input
              v-model="queryParams.roleName"
              placeholder="请输入角色名称"
              clearable
              style="width: 200px"
              @keyup.enter.native="handleQuery"
            />
            <el-input v-model="queryParams.roleName" placeholder="请输入角色名称" clearable style="width: 200px"
              @keyup.enter.native="handleQuery" />
          </el-form-item>
          <el-form-item label="权限字符" prop="roleKey">
            <el-input
              v-model="queryParams.roleKey"
              placeholder="请输入权限字符"
              clearable
              style="width: 200px"
              @keyup.enter.native="handleQuery"
            />
            <el-input v-model="queryParams.roleKey" placeholder="请输入权限字符" clearable style="width: 200px"
              @keyup.enter.native="handleQuery" />
          </el-form-item>
          <el-form-item label="状态" prop="status">
            <el-select
              v-model="queryParams.status"
              placeholder="角色状态"
              clearable
              style="width: 200px"
            >
              <el-option
                v-for="dict in dict.type.sys_normal_disable"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            <el-select v-model="queryParams.status" placeholder="角色状态" clearable style="width: 200px">
              <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label"
                :value="dict.value" />
            </el-select>
          </el-form-item>
          <el-form-item label="创建时间">
            <el-date-picker
              v-model="dateRange"
              style="width: 200px"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
            <el-date-picker v-model="dateRange" style="width: 200px" value-format="yyyy-MM-dd" type="daterange"
              range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查 è¯¢</el-button>
@@ -54,7 +28,8 @@
        </el-form>
      </div>
      <div class="addButton mb8">
        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:role:add']">新增</el-button>
        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['system:role:add']">新增</el-button>
      </div>
    </div>
@@ -66,12 +41,8 @@
      <el-table-column label="显示顺序" prop="roleSort" width="100" />
      <el-table-column label="状态" align="center" width="100">
        <template slot-scope="scope">
          <el-switch
            v-model="scope.row.status"
            active-value="0"
            inactive-value="1"
            @change="handleStatusChange(scope.row)"
          ></el-switch>
          <el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
            @change="handleStatusChange(scope.row)"></el-switch>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
@@ -81,26 +52,11 @@
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope" v-if="scope.row.roleId !== 1">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:role:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:role:remove']"
          >删除</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleView(scope.row)"
          >详细</el-button>
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
            v-hasPermi="['system:role:edit']">修改</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
            v-hasPermi="['system:role:remove']">删除</el-button>
          <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">详细</el-button>
<!--          <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">-->
<!--            <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>-->
<!--            <el-dropdown-menu slot="dropdown">-->
@@ -114,13 +70,8 @@
      </el-table-column>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />
    <!-- æ·»åŠ æˆ–ä¿®æ”¹è§’è‰²é…ç½®å¯¹è¯æ¡† -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
@@ -142,28 +93,28 @@
        </el-form-item>
        <el-form-item label="状态">
          <el-radio-group v-model="form.status" :disabled="title === '查看角色'">
            <el-radio
              v-for="dict in dict.type.sys_normal_disable"
              :key="dict.value"
              :label="dict.value"
            >{{dict.label}}</el-radio>
            <el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label
              }}</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="菜单权限">
          <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')" v-if="title !== '查看角色'">展开/折叠</el-checkbox>
          <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')" v-if="title !== '查看角色'">全选/全不选</el-checkbox>
          <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')" v-if="title !== '查看角色'">父子联动</el-checkbox>
          <el-tree
            :disabled="title === '查看角色'"
            class="tree-border"
            :data="menuOptions"
            show-checkbox
            ref="menu"
            node-key="id"
            :check-strictly="!form.menuCheckStrictly"
            empty-text="加载中,请稍候"
            :props="defaultProps"
          ></el-tree>
          <el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')"
            v-if="title !== '查看角色'">展开/折叠</el-checkbox>
          <el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')"
            v-if="title !== '查看角色'">全选/全不选</el-checkbox>
          <el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')"
            v-if="title !== '查看角色'">父子联动</el-checkbox>
          <el-tree :disabled="title === '查看角色'" class="tree-border" :data="menuOptions" show-checkbox ref="menu"
            node-key="id" :check-strictly="!form.menuCheckStrictly" empty-text="加载中,请稍候" :props="defaultProps">
            <span class="custom-tree-node" slot-scope="{ node, data }">
              <span>{{ node.label }}</span>
              <span>
                <el-checkbox v-model="data.isRersonal" :true-label="1" :false-label="0"
                  v-if="data.isRersonalButton == 1" @change="m => chooseMe(m, data)"
                  :disabled="title === '查看角色'">只看我</el-checkbox>
              </span>
            </span>
          </el-tree>
        </el-form-item>
        <el-form-item label="备注">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" :disabled="title === '查看角色'"></el-input>
@@ -186,29 +137,17 @@
        </el-form-item>
        <el-form-item label="权限范围">
          <el-select v-model="form.dataScope" @change="dataScopeSelectChange">
            <el-option
              v-for="item in dataScopeOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            ></el-option>
            <el-option v-for="item in dataScopeOptions" :key="item.value" :label="item.label"
              :value="item.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="数据权限" v-show="form.dataScope == 2">
          <el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
          <el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">全选/全不选</el-checkbox>
          <el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
          <el-tree
            class="tree-border"
            :data="deptOptions"
            show-checkbox
            default-expand-all
            ref="dept"
            node-key="id"
            :check-strictly="!form.deptCheckStrictly"
            empty-text="加载中,请稍候"
            :props="defaultProps"
          ></el-tree>
          <el-checkbox v-model="form.deptCheckStrictly"
            @change="handleCheckedTreeConnect($event, 'dept')">父子联动</el-checkbox>
          <el-tree class="tree-border" :data="deptOptions" show-checkbox default-expand-all ref="dept" node-key="id"
            :check-strictly="!form.deptCheckStrictly" empty-text="加载中,请稍候" :props="defaultProps"></el-tree>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
@@ -232,6 +171,8 @@
      loading: true,
      // é€‰ä¸­æ•°ç»„
      ids: [],
      // åªçœ‹æˆ‘数组
      isRersonalMenuIds: [],
      // éžå•个禁用
      single: true,
      // éžå¤šä¸ªç¦ç”¨
@@ -399,6 +340,7 @@
        status: "0",
        menuIds: [],
        deptIds: [],
          isRersonalMenuIds: [],
        menuCheckStrictly: true,
        deptCheckStrictly: true,
        remark: undefined
@@ -546,6 +488,7 @@
        if (valid) {
          if (this.form.roleId != undefined) {
            this.form.menuIds = this.getMenuAllCheckedKeys();
            this.form.isRersonalMenuIds = this.isRersonalMenuIds;
            updateRole(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
@@ -553,6 +496,7 @@
            });
          } else {
            this.form.menuIds = this.getMenuAllCheckedKeys();
            this.form.isRersonalMenuIds = this.isRersonalMenuIds;
            addRole(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
@@ -588,6 +532,15 @@
      this.download('system/role/export', {
        ...this.queryParams
      }, `role_${new Date().getTime()}.xlsx`)
    },
    // åªçœ‹æˆ‘
    chooseMe(val, data) {
      let index = this.isRersonalMenuIds.findIndex(m => m == data.id)
      if (index < 0 && val == 1) {
        this.isRersonalMenuIds.push(data.id)
      } else if (val == 0 && index > -1) {
        this.isRersonalMenuIds.splice(index, 1)
      }
    }
  }
};
@@ -598,7 +551,17 @@
  display: flex;
  justify-content: space-between;
}
.addButton {
  margin-top: 3px;
}
.custom-tree-node {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  padding-right: 8px;
}
</style>