<template>
    <div class="page-container">
        <div class="flex-wrap search-box">
            <div class="search-item">
                <a-select class="label-option" v-model="search.table_uid" @change="getFieldList">
                    <a-select-option v-for="(table, index) in search.table_list" :key="index" :value="table.uid">
                        {{ table.name }}
                    </a-select-option>
                </a-select>
            </div>
            <div class="search-item">
                <a-select class="label-option" v-model="search.custom_search.key">
                    <a-select-option
                        v-for="(item,idx) in search.custom_search.keys"
                        :key="idx"
                        :value="item.value"
                    >
                        {{ item.label }}
                    </a-select-option>
                </a-select>
            </div>
            <div class="search-item">
                <a-select class="condition-option" v-model="search.custom_search.condition">
                    <a-select-option
                        v-for="(item,idx) in search.custom_search.conditions"
                        :key="idx"
                        :value="item.value"
                    >
                        {{ item.label }}
                    </a-select-option>
                </a-select>
            </div>
            <div class="search-item">
                <a-input-search
                    class="search-value"
                    placeholder="请输入"
                    :max-length="100"
                    v-model="search.custom_search.value"
                    @search="getFieldList"
                />
            </div>
            <div class="search-item">
                <a-button @click="unsetSearch">
                    <a-icon type="reload"/>
                </a-button>
            </div>
            <div class="search-item">
                <a-button type="primary" @click="openModelAdd">
                    添加
                </a-button>
            </div>
        </div>
        <a-table
            :columns="tableData.columns"
            :loading="tableData.loading"
            :dataSource="tableData.data"
            :pagination="tableData.pager"
            @change="tableChange"
            :rowKey="(record, index) => {return index}"
            :scroll="{ x: 800, y: 400 }"
        >
            <template slot="operation" slot-scope="record">
                <a @click="openModelEdit(record)">编辑</a>
                <a-divider type="vertical"/>
                <a-popconfirm
                    title="确定删除该信息吗"
                    ok-text="确定"
                    cancel-text="取消"
                    @confirm="() => handleDelete(record)"
                >
                    <a class="danger" @click.stop="">删除</a>
                </a-popconfirm>
            </template>
        </a-table>
        <a-modal
            v-model="model.isVisible"
            width="70%"
            centered
            :title="model.title"
            :confirmLoading="model.is_loading"
            @ok="handleOk"
            @cancel="handleCancle"
        >
            <a-form-model
                ref="form"
                :model="model.form"
                :rules="model.rules"
            >
                <a-form-model-item label="字段名称" prop="name">
                    <a-input v-model="model.form.name" type="text" placeholder="请输入"/>
                </a-form-model-item>
                <a-form-model-item label="字段别名" prop="alias">
                    <a-input v-model="model.form.alias" type="text" placeholder="请输入"/>
                </a-form-model-item>
                <a-form-model-item label="排序" prop="listorder">
                    <a-input-number v-model="model.form.listorder" :min="1" style="width: 100%"/>
                </a-form-model-item>
                <a-form-model-item label="字段类型" prop="formtype">
                    <a-select v-model="model.form.formtype" :disabled="Boolean(this.model.form.uid)" allowClear>
                        <a-select-option v-for="(item,idx) in model.formtypes"
                                         :key="idx"
                                         :value="item.value">
                            {{ item.label }}
                        </a-select-option>
                    </a-select>
                </a-form-model-item>
                <a-form-model-item label="字段设置">
                    <a-card>
                        <a-form-model
                            ref="form"
                            :model="model.form"
                            :rules="model.rules"
                            :label-col="{span: 4}"
                            :wrapper-col="{span: 18}"
                        >
                            <a-form-model-item label="允许为空"
                                               v-if="show_ele(['text','textarea','datetime','number','box','file'])">
                                <a-select v-model="model.form.setting.is_allow_null" style="width: 75%">
                                    <a-select-option key="1" :value=1>是</a-select-option>
                                    <a-select-option key="0" :value=0>否</a-select-option>
                                </a-select>
                            </a-form-model-item>
                            <a-form-model-item label="是否唯一" v-if="show_ele(['text'])">
                                <a-select v-model="model.form.setting.is_unique" style="width: 75%">
                                    <a-select-option key="1" :value=1>是</a-select-option>
                                    <a-select-option key="0" :value=0>否</a-select-option>
                                </a-select>
                            </a-form-model-item>
                            <a-form-model-item label="输入提示" v-if="show_ele(['text','textarea','datetime','number'])">
                                <a-input v-model="model.form.setting.tip" style="width: 75%" placeholder="请输入"/>
                            </a-form-model-item>
                            <a-form-model-item label="最小长度" v-if="show_ele(['text'])">
                                <a-input-number v-model="model.form.setting.min_length" :min="1" :max="255"
                                                style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="最大长度" v-if="show_ele(['text'])">
                                <a-input-number v-model="model.form.setting.max_length" :min="1" :max="255"
                                                style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="正则校验" v-if="show_ele(['text','number'])">
                                <!-- input 嵌套一个 select -->
                                <a-input v-model="model.form.setting.reg" style="width: 75%">
                                    <a-select slot="addonAfter" default-value="" style="width: 100px">
                                        <a-select-option
                                            v-for="(item,idx) in model.regs"
                                            :key="idx"
                                            :value="item.key"
                                            @click="sync_regs(item.value)">
                                            {{ item.label }}
                                        </a-select-option>
                                    </a-select>
                                </a-input>
                            </a-form-model-item>
                            <a-form-model-item label="校验提示" v-if="show_ele(['text','number'])">
                                <a-input v-model="model.form.setting.reg_tip" placeholder="请输入" style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="文本框类型" v-if="show_ele(['text'])">
                                <a-select v-model="model.form.setting.type" style="width: 75%">
                                    <a-select-option key="2" value='text'>文本框</a-select-option>
                                    <a-select-option key="3" value='password'>密码框</a-select-option>
                                </a-select>
                            </a-form-model-item>
                            <a-form-model-item label="文本域高度" v-if="show_ele(['textarea'])">
                                <a-input-number v-model="model.form.setting.text_height" :min="1" style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="时间格式" v-if="show_ele(['datetime'])">
                                <a-select v-model="model.form.setting.date_format" style="width: 75%">
                                    <a-select-option key="1" value='YYYY-MM-DD HH:mm:ss'>2021-10-01 12:00:00
                                    </a-select-option>
                                    <a-select-option key="2" value='YYYY-MM-DD'>2021-10-01</a-select-option>
                                    <a-select-option key="3" value='HH:mm:ss'>12:00:00</a-select-option>
                                </a-select>
                            </a-form-model-item>
                            <a-form-model-item label="选项类型" v-if="show_ele(['box'])">
                                <a-select v-model="model.form.setting.box_type" style="width: 75%">
                                    <a-select-option key="1" value='select'>下拉框-单选</a-select-option>
                                    <a-select-option key="2" value='multiSelect'>下拉框-多选</a-select-option>
                                    <a-select-option key="3" value='radio'>单选框</a-select-option>
                                    <a-select-option key="4" value='checkbox'>复选框</a-select-option>
                                </a-select>
                            </a-form-model-item>
                            <a-form-model-item label="选项列表" v-if="show_ele(['box'])">
                                <a-textarea v-model="model.form.setting.options" type="text"
                                            placeholder="请输入选项值，以换行隔开，可以输入键值对，比如 China:中国"
                                            style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="允许类型" v-if="show_ele(['image'])">
                                <a-textarea v-model="model.form.setting.allow_image_type" type="text"
                                            placeholder="多个类型用竖线分隔"
                                            style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="图片宽度" v-if="show_ele(['image'])">
                                <a-input-number v-model="model.form.setting.image_width" :min="1" style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="图片高度" v-if="show_ele(['image'])">
                                <a-input-number v-model="model.form.setting.image_height" :min="1"
                                                style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="最小值" v-if="show_ele(['number'])">
                                <a-input-number v-model="model.form.setting.min_value" :min="1" style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="最大值" v-if="show_ele(['number'])">
                                <a-input-number v-model="model.form.setting.max_value" :min="1" style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="小数位数" v-if="show_ele(['number'])">
                                <a-input-number v-model="model.form.setting.decimal_number" :min="1"
                                                style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="联动菜单" v-if="show_ele(['linkage'])">
                                <a-select v-model="model.form.setting.link_type" style="width: 75%">
                                    <a-select-option key="1" value='china'>中国</a-select-option>
                                    <a-select-option key="2" value='organization'>组织</a-select-option>
                                </a-select>
                            </a-form-model-item>
                        </a-form-model>
                    </a-card>
                </a-form-model-item>
                <a-form-model-item label="默认设置">
                    <a-card>
                        <a-form-model
                            ref="form"
                            :model="model.form"
                            :rules="model.rules"
                            :label-col="{span: 4}"
                            :wrapper-col="{span: 18}"
                        >
                            <a-form-model-item label="默认值类型" prop="setting.default.type">
                                <a-select v-model="model.form.setting.default.type" style="width: 75%">
                                    <a-select-option key="1" :value='1'>空</a-select-option>
                                    <a-select-option key="2" :value='2'>自定义</a-select-option>
                                    <a-select-option key="3" :value='3'>系统值</a-select-option>
                                </a-select>
                            </a-form-model-item>
                            <a-form-model-item label="自定义值" v-if="this.model.form.setting.default.type === 2"
                                               prop="setting.default.custom_value">
                                <a-input v-model="model.form.setting.default.custom_value" style="width: 75%"/>
                            </a-form-model-item>
                            <a-form-model-item label="系统值" v-if="this.model.form.setting.default.type === 3">
                                <a-select v-model="model.form.setting.default.system_value" style="width: 75%">
                                    <a-select-option key="1" value='user'>用户名</a-select-option>
                                    <a-select-option key="2" value='now'>当前时刻</a-select-option>
                                    <a-select-option key="3" value='group'>当前组织</a-select-option>
                                </a-select>
                            </a-form-model-item>
                            <a-form-model-item label="引用时机"
                                               v-if="this.model.form.setting.default.type === 2||this.model.form.setting.default.type === 3">
                                <a-select v-model="model.form.setting.default.use_time" style="width: 75%">
                                    <a-select-option key="1" :value=1>录入时引用</a-select-option>
                                    <a-select-option key="2" :value=2>总是引用</a-select-option>
                                </a-select>
                            </a-form-model-item>
                        </a-form-model>
                    </a-card>
                </a-form-model-item>
                <a-form-model-item label="字段名显示位置" prop="setting.display_position">
                    <a-select v-model="model.form.setting.display_position">
                        <a-select-option key="1" value='right'>居右</a-select-option>
                        <a-select-option key="2" value='left'>居左</a-select-option>
                        <a-select-option key="3" value='center'>居中</a-select-option>
                    </a-select>
                </a-form-model-item>
                <a-form-model-item label="字段名显示宽度" prop="setting.display_width">
                    <a-input-number v-model="model.form.setting.display_width" type="text" placeholder="请输入"
                                    style="width: 100%"/>
                </a-form-model-item>
                <a-form-model-item label="描述">
                    <a-input
                        v-model="model.form.description" type="textarea" placeholder="请输入"/>
                </a-form-model-item>
            </a-form-model>
        </a-modal>
    </div>
</template>
<script>


import pager from "../../../config/pagination.conf"
import {deep_copy, merge_obj, gettype} from "../../../utils/functions";
import bus from "../../../utils/bus";

export default {
    name: "list",
    data() {
        return {
            tableData: {
                loading: false,
                data: [],
                columns: [
                    //排序 listorder 字段编号uid 字段名称name 字段别名alias 字段类型formtype 描述description 创建时间created  操作（编辑 删除）
                    {
                        title: '排序', //列头显示文字
                        dataIndex: 'listorder',//对应数据的 key
                        width: 80,//列宽度
                        key: 'listorder', //Vue 需要的 key
                        scopedSlots: {customRender: 'sort'},// 设置字段的scopedSlots.customRender = SOMENAME ，在table中可以用template slot=SOMENAME slot-scope=dataIndex,record,index 使用该行数据
                    },
                    {
                        title: '字段编号', //列头显示文字
                        dataIndex: 'uid',//对应数据的 key
                        width: 200,//列宽度
                        key: 'uid',
                    },
                    {
                        title: '字段名称', //列头显示文字
                        dataIndex: 'name',//对应数据的 key
                        key: 'name',
                    },
                    {
                        title: '字段别名', //列头显示文字
                        dataIndex: 'alias',//对应数据的 key
                        key: 'alias',
                    },
                    {
                        title: '字段类型', //列头显示文字
                        dataIndex: 'formtype',//对应数据的 key
                        key: 'formtype',
                    },
                    {
                        title: '描述', //列头显示文字
                        dataIndex: 'description',//对应数据的 key
                        ellipsis: true,
                        key: 'description',
                    },
                    {
                        title: '创建时间', //列头显示文字
                        dataIndex: 'created',//对应数据的 key
                        key: 'created',
                    },
                    {
                        title: '操作',
                        key: 'operation',
                        scopedSlots: {customRender: 'operation'},
                    },
                ],
                pager: deep_copy(pager),
            },
            search: {
                table_list: [],
                table_uid: '',
                custom_search: {
                    keys: [
                        {label: "字段编号", value: "uid",},
                        {label: "字段名称", value: "name",},
                        {label: "字段别名", value: "alias",},
                    ],
                    conditions: [
                        {label: "包含", value: "like"},
                        {label: "等于", value: "="},
                        {label: "不等于", value: "!="},
                        {label: "小于", value: "<"},
                        {label: "小于等于", value: "<="},
                        {label: "大于", value: ">"},
                        {label: "大于等于", value: ">="},
                    ],
                    key: "uid",
                    condition: 'like',
                    value: ''
                }
            },
            model: {
                isVisible: false,
                is_loading: false,
                title: "添加字段",
                rules: {
                    name: [{required: true, message: "请输入字段名称", trigger: "blur"},],
                    alias: [{required: true, message: "请输入字段别名", trigger: "blur"}, {
                        pattern: /^[a-z][0-9|a-z|_]*$/,
                        message: "只能包含数字字母下划线，且以字母开头",
                        trigger: "blur"
                    },],
                    listorder: [{required: true, message: "请输入数字", trigger: "blur"},],
                    formtype: [{required: true, message: "请选择", trigger: "blur"},],
                    "setting.default.type": [{required: true, message: "请选择", trigger: "blur"},],
                    "setting.default.custom_value": [{required: true, message: "请输入自定义值", trigger: "blur"},],
                    "setting.display_position": [{required: true, message: "请选择位置", trigger: "blur"},],
                    "setting.display_width": [{required: true, message: "请填写宽度", trigger: "blur"},],
                },
                formtypes: [
                    {label: "单行文本", value: "text"},
                    {label: "多行文本", value: "textarea"},
                    {label: "日期时间", value: "datetime"},
                    {label: "选项", value: "box"},
                    {label: "图片", value: "image"},
                    {label: "附件", value: "file"},
                    {label: "数字", value: "number"},
                    {label: "联动菜单", value: "linkage"},
                ],
                regs: [
                    {key: '', label: "常用正则", value: ""},
                    {key: 'number', label: "数字", value: "\\d+(.\\d+)?"},
                    {key: 'int', label: "整数", value: "\\d+"},
                    {key: 'letter', label: "字母", value: "[a-z][A-Z]+"},
                    {key: 'int_and_number', label: "字母+数字", value: "[0-9|a-z|A-Z]+"},
                    {key: 'email', label: "Email", value: "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"},
                    {key: 'qq', label: "QQ", value: "[1-9][0-9]{4,}"},
                    {key: 'link', label: "超链接", value: "http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w-./?%&=]*)?"},
                    {key: 'id', label: "身份证", value: "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)"},
                    {
                        key: 'mobile',
                        label: "手机号",
                        value: "(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\\d{8}"
                    },
                    {key: 'tel', label: "电话号", value: "(\\(\\d{3,4}-)|\\d{3.4}-)?\\d{7,8}"},
                    {key: 'post', label: "邮政编码", value: "[1-9]\\d{5}"},
                ],
                form: {
                    table_id: '', //选择当前搜索中的table_id TBF1631524245352391
                    name: '',//字段名称：
                    alias: '',//字段别名：
                    listorder: 1, //排序：
                    formtype: 'text',//字段类型：
                    //字段设置：
                    setting: {
                        //默认设置：
                        default: {
                            type: 1,//1.空 2.自定义 3.系统值
                            custom_value: '',//
                            system_value: 'user',//user.用户名 now.当前时刻 group.当前组织
                            use_time: 1,//引入时机 暂未用到
                        },
                        display_position: "right",//字段名显示位置：
                        display_width: 80,//字段名显示宽度：
                        is_allow_null: 1,//是否为空 select框不能说bool类型 需要在提交的时候转换成boolen
                        is_unique: 0,//是否唯一 同上
                        tip: '',//输入提示
                        min_length: 1,//最小长度
                        max_length: 255,//最大长度
                        reg: '',//正则校验
                        reg_tip: '',//校验提示
                        type: 'text',//文本类型 text,password
                        text_height: 300,//文本域高度  formtype=textarea
                        box_type: 'select',//select:下拉框-单选，multiSelect:下拉框-多选，radio:单选框，checkbox:复选框
                        per_row_number: 2,//每行个数，formtype=box 使用
                        options: '',//选项列表formtype=box 使用 et.["cn:中国","us:美国"]
                        date_format: 'YYYY-MM-DD HH:mm:ss',//日期格式 formtype=datetime 'YYYY-MM-DD HH:mm:ss','YYYY-MM-DD','HH:mm:ss'
                        allow_image_type: 'gif|jpg|jpeg|png|bmp',//允许的图片类型 ['gif', 'jpg', 'jpeg', 'png', 'bmp']
                        image_width: 100,//图片宽度
                        image_height: 100,//图片高度
                        link_type: 'china',//联动菜单 china,organization
                        max_value: 0,//最大值 formtype=number
                        min_value: 0,//最小值 formtype=number
                        decimal_number: 0,//小数点个数，默认0
                    },
                    //描述：
                    description: ''
                },
                form_template: {
                    table_id: '', //选择当前搜索中的table_id TBF1631524245352391
                    name: '',//字段名称：
                    alias: '',//字段别名：
                    listorder: 1, //排序：
                    formtype: 'text',//字段类型：
                    //字段设置：
                    setting: {
                        //默认设置：
                        default: {
                            type: 1,//1.空 2.自定义 3.系统值
                            custom_value: '',//
                            system_value: 'user',//user.用户名 now.当前时刻 group.当前组织
                            use_time: 1,//引入时机 暂未用到
                        },
                        display_position: "right",//字段名显示位置：
                        display_width: 80,//字段名显示宽度：
                        is_allow_null: 1,//是否为空 select框不能说bool类型 需要在提交的时候转换成boolen
                        is_unique: 0,//是否唯一 同上
                        tip: '',//输入提示
                        min_length: 1,//最小长度
                        max_length: 255,//最大长度
                        reg: '',//正则校验
                        reg_tip: '',//校验提示
                        type: 'text',//文本类型 text,password
                        text_height: 300,//文本域高度  formtype=textarea
                        box_type: 'select',//select:下拉框-单选，multiSelect:下拉框-多选，radio:单选框，checkbox:复选框
                        per_row_number: 2,//每行个数，formtype=box 使用
                        options: '',//选项列表formtype=box 使用 et.["cn:中国","us:美国"]
                        date_format: 'YYYY-MM-DD HH:mm:ss',//日期格式 formtype=datetime 'YYYY-MM-DD HH:mm:ss','YYYY-MM-DD','HH:mm:ss'
                        allow_image_type: 'gif|jpg|jpeg|png|bmp',//允许的图片类型 ['gif', 'jpg', 'jpeg', 'png', 'bmp']
                        image_width: 100,//图片宽度
                        image_height: 100,//图片高度
                        link_type: 'china',//联动菜单 china,organization
                        max_value: 0,//最大值 formtype=number
                        min_value: 0,//最小值 formtype=number
                        decimal_number: 0,//小数点个数，默认0
                    },
                    //描述：
                    description: ''
                },
            }
        };
    },
    created() {
        this.getTableList().then(this.getFieldList())
        //获取tablelist
        //获取field-list
    },
    activated() {
        this.getTableList().then(this.getFieldList())
    },
    methods: {
        show_ele($arr) {
            //是否展示当前的元素 取决于type是否在当arr中
            return $arr.indexOf(this.model.form.formtype) !== -1
        },
        //同步正则
        sync_regs(value) {
            this.model.form.setting.reg = value
        },
        getTableList() {
            return new Promise((resolve, reject) => {
                this.api.post("table_list").then(res => {
                    let data = res.result
                    this.search.table_list = data.data
                    this.search.table_uid = data.data[0].uid
                    resolve()
                })
            })
        },
        unsetSearch() {
            this.search.custom_search.key = "uid"
            this.search.custom_search.condition = "like"
            this.search.custom_search.value = ""
            this.getFieldList()
        },
        handleOk() {
            //提交表单
            let that = this
            const submit_data = deep_copy(that.model.form)
            submit_data.setting.is_allow_null = Boolean(submit_data.setting.is_allow_null)
            submit_data.setting.is_unique = Boolean(submit_data.setting.is_unique)
            submit_data.setting.allow_image_type = submit_data.setting.allow_image_type.split('|')
            if (submit_data.setting.options)
                submit_data.setting.options = submit_data.setting.options.split('\n')
            let uri = submit_data.uid ? 'field_update' : 'field_create'
            that.$refs['form'].validate(valid => {
                if (valid) {
                    // that.model.is_loading = true
                    that.api.post(uri, submit_data).then(res => {
                        that.model.isVisible = false
                        that.getFieldList()
                        //这里处理提交完成的动作
                    }).catch().finally(() => {
                        that.model.is_loading = false
                    })
                }
            });
        },
        handleCancle() {
            this.model.isVisible = false
        },
        getFieldList() {
            let that = this
            let params = {
                page_size: that.tableData.pager.pageSize,
                page_index: that.tableData.pager.current
            }
            let where_and = []
            if (this.search.table_uid) {
                where_and.push(['table_id', '=', this.search.table_uid])
            }
            let search_value = this.search.custom_search.value.trim()
            if (search_value) {
                where_and.push([this.search.custom_search.key, this.search.custom_search.condition, search_value])
            }
            params.where_and = where_and
            that.tableData.loading = true
            this.api.post("field_list", params).then(res => {
                let data = res.result
                that.tableData.pager.total = data.total_records
                that.tableData.pager.current = data.page_index
                that.tableData.data = data.data
            }).catch().finally(() => {
                that.tableData.loading = false
            })
        },
        openModelAdd() {
            this.model.isVisible = true
            this.model.title = "添加字段"
            this.model.form = deep_copy(this.model.form_template)
            this.model.form.table_id = this.search.table_uid
        },
        openModelEdit(record) {
            this.model.title = "编辑字段"
            const temp_record = deep_copy(record)
            const form_template = deep_copy(this.model.form_template)
            if (temp_record.setting.allow_image_type && gettype(temp_record.setting.allow_image_type === 'array'))
                temp_record.setting.allow_image_type = temp_record.setting.allow_image_type.join('|')
            if (temp_record.setting.is_allow_null)
                temp_record.setting.is_allow_null = Number(temp_record.setting.is_allow_null)
            if (temp_record.setting.is_unique)
                temp_record.setting.is_unique = Number(temp_record.setting.is_unique)
            if (temp_record.setting.options)
                temp_record.setting.options = temp_record.setting.options.join('\n')
            //初始化form数据
            merge_obj(form_template, temp_record)
            this.model.form = form_template
            this.model.isVisible = true
        },
        handleDelete(record) {
            let that = this
            that.api.post("field_delete", {uid: record.uid}).then(res => {
                that.getFieldList()
            })
        },
        tableChange(pagination, filters, sorter, {currentDataSource}) {
            this.tableData.pager.current = pagination.current
            this.tableData.pager.pageSize = pagination.pageSize
            this.getFieldList()
        }
    }
}
</script>

<style scoped>
</style>
