Blame view

src/views/system/dictionaries/dictionaries.js 1.59 KB
1 2 3 4 5
/*
 * @Description: 
 * @Autor: renchao
 * @LastEditTime: 2023-04-11 10:49:40
 */
任超 committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
import filter from '@/utils/filter.js'
let vm = null

const sendThis = (_this) => {
  vm = _this
}
class data extends filter {
  constructor() {
    super()
  }
  columns () {
    return [
      {
        label: '序号',
        type: 'index',
        width: '50',
        render: (h, scope) => {
          return (
            <div>
              {(vm.pageData.currentPage - 1) * vm.pageData.pageSize + scope.$index + 1}
            </div>
          )
        }
      },
      {
任超 committed
31
        prop: "dcode",
任超 committed
32 33 34
        label: "字典类型编码",
      },
      {
任超 committed
35
        prop: "dname",
任超 committed
36 37 38 39 40 41 42
        label: "字典类型名称",
      },
      {
        label: "是否允许修改",
        render: (h, scope) => {
          return (
            <div>
任超 committed
43
              {
任超 committed
44
                scope.row.isenable == '1' ?
任超 committed
45 46 47
                  <div class='allow'>允许</div> :
                  <div class='prohibit'>禁止</div>
              }
任超 committed
48 49 50 51 52 53
            </div>
          )
        }
      },
      {
        label: '操作',
54
        width: '80',
任超 committed
55 56 57
        render: (h, scope) => {
          return (
            <div>
任超 committed
58
              {
任超 committed
59
                scope.row.isenable == '1' ?
任超 committed
60 61 62
                  <el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.editClick(scope.row, 1) }}>修改</el-button> :
                  <el-button type="text" icon="el-icon-view" onClick={() => { vm.editClick(scope.row, 2) }}>查看</el-button>
              }
任超 committed
63 64 65 66 67 68 69 70 71 72 73 74
            </div>
          )
        }
      }
    ]
  }
}
let datas = new data()
export {
  datas,
  sendThis
}