configureRules.vue 2.33 KB
<route lang="yaml">
  name: configureRules //标签管理
  </route>

<script lang="ts" setup name="configureRules">
import { TableColumnWidth } from '@/utils/enum';

const dataBasePage = ref({
  limit: 10,
  curr: 1,
  sizes: [
    { label: "10", value: 10 },
    { label: "20", value: 20 },
    { label: "100", value: 100 },
    { label: "150", value: 150 },
    { label: "200", value: 200 },
  ],
});

const dataBaseTableInfo = ref({
  id: "data-base-table",
  multiple: false,
  fixedSelection: true,
  fields: [
    { label: "序号", type: "index", width: 56, align: "center" },
    { label: "数据源", field: "databaseChName", width: 140 },
    { label: "表名称", field: "tableChName", width: 180 },
    { label: "数据库表", field: "enName", width: 120 },
    {
      label: "新建方式", field: "foundMode", width: 140, getName: (scope) => {
        let dataGrade = scope.row.foundMode;
        return dataGrade == 1 ? '根据文件新建' : '已有表新建';
      }
    },
    {
      label: "状态", field: "state", type: 'tag', width: 180, getName: (scope) => {
        let status = scope.row.state;
        // 0 草稿中 1 已建表 2 已有默认表
        return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表';
      }
    },
    { label: "任务修改人", field: "damName", width: 120 },
    { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
    { label: "描述", field: "databaseName", width: 120, align: 'center' },
    {
      label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y',
      inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center'
    },

  ],
  data: [],
  page: {
    type: "normal",
    rows: 0,
    ...dataBasePage.value,
  },
  actionInfo: {
    label: "操作",
    type: "btn",
    width: 300,
    fixed: 'right',
    btns: [
      {
        label: "配置业务规则", value: "edit", click: (scope) => {
          console.log('编辑', scope);
          // 路由跳转configure-rules


        }
      },

      {
        label: "编辑表结构", value: "copy", click: (scope) => {
          console.log('复制', scope);
        }
      }
    ]

  },
  loading: false
});
</script>
<template>
  <div class="table_panel_wrap">
    <Table :tableInfo="dataBaseTableInfo" />
  </div>
</template>