Bladeren bron

数据源

zhengnaiwen_citu 3 maanden geleden
bovenliggende
commit
80f596475d
2 gewijzigde bestanden met toevoegingen van 5 en 32 verwijderingen
  1. 1 1
      src/api/dataOrigin.js
  2. 4 31
      src/views/dataOrigin/rdbmsDataSource/index.vue

+ 1 - 1
src/api/dataOrigin.js

@@ -25,7 +25,7 @@ export function datasourceParse (data) {
 }
 // 数据源 快捷解析
 export function deleteDatasource (data) {
-  return http.formData('/datasource/delete', data)
+  return http.post('/datasource/delete', data)
 }
 
 // 非结构化数据源 名片解析

+ 4 - 31
src/views/dataOrigin/rdbmsDataSource/index.vue

@@ -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
     },