diff --git a/sgzb-ui/src/components/TableCom/index.vue b/sgzb-ui/src/components/TableCom/index.vue index eb805a16..2c1e0e00 100644 --- a/sgzb-ui/src/components/TableCom/index.vue +++ b/sgzb-ui/src/components/TableCom/index.vue @@ -1,8 +1,8 @@ @@ -16,6 +16,26 @@ export default { Table, Tools, }, + props: { + config: { + type: Object, + default: () => null, + }, + }, + data() { + return { + formLabel: [], + columnList: [], + } + }, + + created() { + if (this.config) { + const { formLabel, columnList } = this.formLabel + this.formLabel = formLabel + this.columnList = columnList + } + }, } diff --git a/sgzb-ui/src/views/demo.vue b/sgzb-ui/src/views/demo.vue index 8e8bfb20..772d267f 100644 --- a/sgzb-ui/src/views/demo.vue +++ b/sgzb-ui/src/views/demo.vue @@ -1,6 +1,6 @@ @@ -10,6 +10,27 @@ export default { components: { TableCom, }, + data() { + return { + config: { + formLabel: [ + { f_label: '测试1', f_model: 'demo', f_type: 'ipt' }, + { f_label: '测试1', f_model: 'demo', f_type: 'ipt' }, + { f_label: '测试1', f_model: 'demo', f_type: 'ipt' }, + { + f_label: '测试1', + f_model: 'demo', + f_type: 'sel', + f_selList: [{ label: '测试', value: '999' }], + }, + { f_label: '测试1', f_model: 'demo', f_type: 'ipt' }, + { f_label: '测试1', f_model: 'demo', f_type: 'date' }, + { f_label: '测试1', f_model: 'demo', f_type: 'ipt' }, + ], + columnList: [], + }, + } + }, }