|
@@ -8,6 +8,7 @@
|
|
|
:items="items"
|
|
|
:total="total"
|
|
|
:page-info="pageInfo"
|
|
|
+ :show-select="false"
|
|
|
@add="handleAdd"
|
|
|
@pageHandleChange="pageHandleChange"
|
|
|
@sort="handleSort"
|
|
@@ -41,7 +42,6 @@ import TableList from '@/components/List/table.vue'
|
|
|
import EditDialog from '@/components/Dialog'
|
|
|
import Linear from '@/components/Progress/linear.vue'
|
|
|
import {
|
|
|
- dataFactoryDictList,
|
|
|
sourceConfigTest
|
|
|
// sourceAdd,
|
|
|
// sourceUpdate,
|
|
@@ -52,10 +52,7 @@ import {
|
|
|
saveDatasource,
|
|
|
deleteDatasource
|
|
|
} from '@/api/dataOrigin'
|
|
|
-import {
|
|
|
- setLocalStorageAndTime
|
|
|
- // getLocalStorageAndTime
|
|
|
-} from '@/utils/localStorageAndTime'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'RDbmsDataSource',
|
|
|
components: { FilterList, TableList, EditDialog, EditPage, Linear },
|
|
@@ -105,41 +102,17 @@ export default {
|
|
|
},
|
|
|
created () {
|
|
|
// this.init()
|
|
|
- // this.initPage()
|
|
|
+ this.initPage()
|
|
|
},
|
|
|
methods: {
|
|
|
- // async init () {
|
|
|
- // // const dictionary = getLocalStorageAndTime('dataFactory', 'dataSource_type') || {}
|
|
|
- // // if (!dictionary.dataSource_type) {
|
|
|
- // // await this.initDictionary(dictionary)
|
|
|
- // // } else this.dataSource_type = dictionary.dataSource_type
|
|
|
- // // // this.formData.options.find(e => e.key === 'type').items = this.dataSource_type
|
|
|
- // // this.filter.list.find(e => e.key === 'type').items = this.dataSource_type
|
|
|
- // this.initPage()
|
|
|
- // },
|
|
|
- async initDictionary (dictionary) {
|
|
|
- try {
|
|
|
- const { data } = await dataFactoryDictList({ type: 'dataSource_type' })
|
|
|
- this.dataSource_type = dictionary.dataSource_type = data[0].itemList
|
|
|
- setLocalStorageAndTime('dataFactory', 'dataSource_type', dictionary)
|
|
|
- } catch (error) {
|
|
|
- this.$snackbar.error(error)
|
|
|
- }
|
|
|
- },
|
|
|
async initPage () {
|
|
|
try {
|
|
|
this.loading = true
|
|
|
const { data } = await getDatasourceList({
|
|
|
...this.queryForm
|
|
|
- // ...this.pageInfo
|
|
|
- // orders: this.orders
|
|
|
})
|
|
|
this.total = data.total
|
|
|
this.items = data.data_source
|
|
|
- // .map(item => {
|
|
|
- // item.type = this.dataSource_type.find(filter => filter.value === item.type).label
|
|
|
- // return item
|
|
|
- // })
|
|
|
} catch (error) {
|
|
|
this.$snackbar.error(error)
|
|
|
} finally {
|
|
@@ -188,7 +161,7 @@ export default {
|
|
|
this.itemData = {}
|
|
|
},
|
|
|
// table 关联操作 编辑
|
|
|
- async handleEdit (item) {
|
|
|
+ handleEdit (item) {
|
|
|
this.itemData = item
|
|
|
this.show = true
|
|
|
},
|