zouyu
2023-12-21 a48ded866d223f581944ea9043df1b296b3425e3
src/views/basic/post/index.vue
@@ -13,7 +13,10 @@
            :ajaxFun="ajaxFun"
            ref="partFamilyTable"
          >
            <template #toolbar></template>
            <template #toolbar>
              <el-button @click="addOrUpdateHandle" type="primary"
              v-if="permissions.basic_post_add">新增</el-button>
            </template>
          </ttable>
        </el-col>
        <el-col :span="12" style="padding-left: 10px">
@@ -115,27 +118,13 @@
            searchInfoType: 'text'
          }
        ],
        toolbar: [
          {
            text: '新增',
            type: 'primary',
            fun: this.addOrUpdateHandle
          }
        ],
        operator: [
          {
            text: '删除',
            icon: 'el-icon-delete',
            type: 'text',
            size: 'small',
            fun: this.deleteHandle
          }
        ],
        toolbar: [],
        operator: null,
        operatorConfig: {
          fixed: 'right',
          label: '操作',
          width: 60,
          minWidth: 60
          width: 70,
          minWidth: 70
        }
      },
@@ -202,6 +191,19 @@
    TableForm,
    ttable
  },
  created(){
    if(this.permissions.basic_staff_del){
      this.table.operator = [
          {
            text: '删除',
            icon: 'el-icon-delete',
            type: 'text',
            size: 'small',
            fun: this.deleteHandle
          }
        ]
    }
  },
  computed: {
    ...mapGetters(['permissions'])
  },
@@ -212,6 +214,9 @@
    },
    // 新增 / 修改
    addOrUpdateHandle(row) {
      if(!this.permissions.basic_post_edit && row.id!=null){
        return
      }
      this.addOrUpdateVisible = true
      this.$nextTick(() => {
        this.$refs.addOrUpdate.init(row == null ? null : row.id)