zouyu
2023-12-21 a48ded866d223f581944ea9043df1b296b3425e3
src/views/basic/workstation/index.vue
@@ -10,7 +10,10 @@
        :ajaxFun="ajaxFun"
        ref="workstationTable"
      >
        <template #toolbar></template>
        <template #toolbar>
          <el-button type="primary" @click="addOrUpdateHandle"
          v-if="permissions.basic_workstation_add">新增</el-button>
        </template>
      </ttable>
      <!-- 弹窗, 新增 / 修改 -->
      <table-form
@@ -37,7 +40,7 @@
      innerVisible: false,
      uploadInfo: {
        // 是否展示上传EXCEL以及对应的url
        isShow: true,
        isShow: false,
        url: '/mes/workstation/upload'
      },
      prelang: 'workstation',
@@ -121,21 +124,8 @@
            searchInfoType: 'text'
          }
        ],
        toolbar: [
          {
            text: '新增',
            type: 'primary',
            fun: this.addOrUpdateHandle
          }
        ],
        operator: [
          {
            text: '删除',
            type: 'text',
            size: 'small',
            fun: this.deleteHandle
          }
        ],
        toolbar: [],
        operator: null,
        operatorConfig: {
          fixed: 'right',
          label: '操作',
@@ -155,6 +145,16 @@
    ...mapGetters(['permissions'])
  },
  created() {
    if(this.permissions.basic_workstation_del){
      this.table.operator = [
          {
            text: '删除',
            type: 'text',
            size: 'small',
            fun: this.deleteHandle
          }
        ]
    }
    this.getReportTypeDict()
  },
  methods: {
@@ -188,6 +188,10 @@
    },
    // 新增 / 修改
    addOrUpdateHandle(row) {
      if(!this.permissions.basic_workstation_edit && row.id!=null){
        this.$message.error("该角色没有操作权限")
        return
      }
      this.addOrUpdateVisible = true
      this.$nextTick(() => {
        this.$refs.addOrUpdate.init(row == null ? null : row.id)