forked from github/dataease
feat(数据集): css调整,el-table替换umy-ui
This commit is contained in:
parent
c8f9ba00dd
commit
d565385aca
@ -42,7 +42,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row style="overflow: auto;height: 600px;">
|
<el-row style="overflow: auto;height: 60vh;">
|
||||||
<el-checkbox-group v-model="checkTableList" size="small">
|
<el-checkbox-group v-model="checkTableList" size="small">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-for="t in tableData"
|
v-for="t in tableData"
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
ref="plxTable"
|
ref="plxTable"
|
||||||
size="mini"
|
size="mini"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
:height="500"
|
:height="height"
|
||||||
:checkbox-config="{highlight: true}"
|
:checkbox-config="{highlight: true}"
|
||||||
>
|
>
|
||||||
<ux-table-column
|
<ux-table-column
|
||||||
@ -133,7 +133,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data: [],
|
data: [],
|
||||||
fields: [],
|
fields: [],
|
||||||
mode: '0'
|
mode: '0',
|
||||||
|
height: 500
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -143,6 +144,12 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {},
|
watch: {},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
window.onresize = () => {
|
||||||
|
return (() => {
|
||||||
|
this.height = window.innerHeight / 2
|
||||||
|
})()
|
||||||
|
}
|
||||||
|
this.height = window.innerHeight / 2
|
||||||
this.initDataSource()
|
this.initDataSource()
|
||||||
this.$refs.myCm.codemirror.on('keypress', () => {
|
this.$refs.myCm.codemirror.on('keypress', () => {
|
||||||
this.$refs.myCm.codemirror.showHint()
|
this.$refs.myCm.codemirror.showHint()
|
||||||
|
@ -1,21 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-col>
|
<el-col>
|
||||||
<span>{{ table.name }}</span>
|
<span>{{ table.name }}</span>
|
||||||
<el-table
|
<ux-grid
|
||||||
|
ref="plxTable"
|
||||||
size="mini"
|
size="mini"
|
||||||
:data="data"
|
style="width: 100%;"
|
||||||
height="40vh"
|
:height="height"
|
||||||
border
|
:checkbox-config="{highlight: true}"
|
||||||
style="width: 100%;margin-top: 6px;"
|
|
||||||
>
|
>
|
||||||
<el-table-column
|
<ux-table-column
|
||||||
v-for="field in fields"
|
v-for="field in fields"
|
||||||
:key="field.originName"
|
:key="field.originName"
|
||||||
min-width="200px"
|
min-width="200px"
|
||||||
:prop="field.originName"
|
:field="field.originName"
|
||||||
:label="field.name"
|
:title="field.name"
|
||||||
|
:resizable="true"
|
||||||
/>
|
/>
|
||||||
</el-table>
|
</ux-grid>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -25,13 +26,16 @@ import { post } from '@/api/dataset/dataset'
|
|||||||
export default {
|
export default {
|
||||||
name: 'DatasetTableData',
|
name: 'DatasetTableData',
|
||||||
props: {
|
props: {
|
||||||
// eslint-disable-next-line vue/require-default-prop
|
table: {
|
||||||
table: Object
|
type: Object,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fields: [],
|
fields: [],
|
||||||
data: []
|
data: [],
|
||||||
|
height: 500
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -39,10 +43,14 @@ export default {
|
|||||||
this.initData()
|
this.initData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
this.initData()
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
window.onresize = () => {
|
||||||
|
return (() => {
|
||||||
|
this.height = window.innerHeight / 3
|
||||||
|
})()
|
||||||
|
}
|
||||||
|
this.height = window.innerHeight / 3
|
||||||
|
this.initData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initData() {
|
initData() {
|
||||||
@ -51,6 +59,8 @@ export default {
|
|||||||
post('/dataset/table/getPreviewData', this.table).then(response => {
|
post('/dataset/table/getPreviewData', this.table).then(response => {
|
||||||
this.fields = response.data.fields
|
this.fields = response.data.fields
|
||||||
this.data = response.data.data
|
this.data = response.data.data
|
||||||
|
const datas = this.data
|
||||||
|
this.$refs.plxTable.reloadData(datas)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
ref="plxTable"
|
ref="plxTable"
|
||||||
size="mini"
|
size="mini"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
:height="500"
|
:height="height"
|
||||||
:checkbox-config="{highlight: true}"
|
:checkbox-config="{highlight: true}"
|
||||||
>
|
>
|
||||||
<ux-table-column
|
<ux-table-column
|
||||||
@ -23,12 +23,22 @@
|
|||||||
export default {
|
export default {
|
||||||
name: 'TabDataPreview',
|
name: 'TabDataPreview',
|
||||||
props: {
|
props: {
|
||||||
table: Object,
|
table: {
|
||||||
fields: Array,
|
type: Object,
|
||||||
data: Array
|
required: true
|
||||||
|
},
|
||||||
|
fields: {
|
||||||
|
type: Array,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
type: Array,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
height: 500
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -39,9 +49,13 @@ export default {
|
|||||||
this.$refs.plxTable.reloadData(datas)
|
this.$refs.plxTable.reloadData(datas)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
window.onresize = () => {
|
||||||
|
return (() => {
|
||||||
|
this.height = window.innerHeight / 2
|
||||||
|
})()
|
||||||
|
}
|
||||||
|
this.height = window.innerHeight / 2
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user