zouyu
2023-12-27 4e2bb29096ac63837f8d2c5e25766ee094f45d6c
src/views/equipment/equipment/index.vue
@@ -225,40 +225,8 @@
            searchInfoType: 'text'
          }
        ],
        toolbar: [
          {
            text: '新增',
            type: 'primary',
            fun: this.addOrUpdateHandle
          },
          {
              text: '标签打印',
              type: 'primary',
              fun: this.labelPrint
            },
          {
            text: '同步',
            type: 'primary',
            loading: false,
            fun: this.pullEquipFun
          }
        ],
        operator: [
          {
            text: '修改',
            icon: 'el-icon-edit',
            type: 'text',
            size: 'small',
            fun: this.addOrUpdateHandle
          },
          {
            text: '删除',
            icon: 'el-icon-delete',
            type: 'text',
            size: 'small',
            fun: this.deleteHandle
          }
        ],
        toolbar: [],
        operator: null,
        operatorConfig: {
          fixed: 'right',
          label: '操作',
@@ -279,6 +247,49 @@
    ...mapGetters(['permissions'])
  },
  created() {
    this.uploadInfo.isShow = this.permissions.equipment_equipment_upload
    if(this.permissions.equipment_equipment_add){
      this.table.toolbar.push({
            text: '新增',
            type: 'primary',
            fun: this.addOrUpdateHandle
          })
    }
    if(this.permissions.equipment_equipment_labelprint){
      this.table.toolbar.push({
              text: '标签打印',
              type: 'primary',
              fun: this.labelPrint
            })
    }
    if(this.permissions.equipment_equipment_sync){
      this.table.toolbar.push({
            text: '同步',
            type: 'primary',
            loading: false,
            fun: this.pullEquipFun
          })
    }
    let arr = []
    if(this.permissions.equipment_equipment_edit){
      arr.push({
            text: '修改',
            icon: 'el-icon-edit',
            type: 'text',
            size: 'small',
            fun: this.addOrUpdateHandle
          })
    }
    if(this.permissions.equipment_equipment_del){
      arr.push({
            text: '删除',
            icon: 'el-icon-delete',
            type: 'text',
            size: 'small',
            fun: this.deleteHandle
          })
    }
    this.table.operator = arr.length>0 ? arr : null
    remote('work_shop').then((response) => {
      if (response.data.code === 0) {
        this.workshopList = response.data.data