Преглед на файлове

新增同步数据资源

ljr-395181403 преди 1 година
родител
ревизия
db0144a303

+ 12 - 6
src/pages/auth-object-manage/sort-code-manage/data-item.vue

@@ -3,7 +3,7 @@
         <!-- 搜索栏 -->
         <search-bar :conditionForm="conditionForm" @submitSearch="receiveSearch"></search-bar>
         <!-- 操作栏 -->
-        <operate-bar v-if="false" :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
+        <operate-bar :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
         <!-- 表格 -->
         <new-table
             ref="table"
@@ -23,20 +23,21 @@ import { dataItemlImportUrl } from "@/api/import"
 import searchBar from "@/components/search-bar"
 import operateBar from "@/components/operate-bar"
 import newTable from "@/components/new-table"
-import { searchOpt, importOpt, detailOpt } from "@/mixins/page-opt"
+import { searchOpt, importOpt, detailOpt, syncOpt } from "@/mixins/page-opt"
 import { dataItemTable, tableOptList, pageOptList } from "./DataConfig"
+import { tableColumnSyncUrl } from "@/api/sync"
 const area = ["1200px", "600px"]
 const labelWidth = "180px"
 
 export default {
     components: { searchBar, operateBar, newTable },
-    mixins: [searchOpt, importOpt, detailOpt],
+    mixins: [searchOpt, importOpt, detailOpt, syncOpt],
     data() {
         return {
             dataItemlTableUrl,
             dataItemTable,
             tableOptList: ["详情", "删除"],
-            pageOptList: ["导入"],
+            pageOptList: ["同步数据资源"],
             conditionForm: [
                 {
                     label: "字段中文名称",
@@ -60,11 +61,16 @@ export default {
             if (opt == "详情") {
                 this.details = row
                 this.handleViewDetail(row.id, otherParams)
-            } else if (opt == "删除") {
+            }
+            if (opt == "删除") {
                 this.handleDelete(row)
-            } else if (opt == "导入") {
+            }
+            if (opt == "导入") {
                 this.handleImport(dataItemlImportUrl, "appDataItem", "数据项导入")
             }
+            if (opt == "同步数据资源") {
+                this.handleSync(tableColumnSyncUrl)
+            }
         },
         /**
          * 删除

+ 12 - 6
src/pages/auth-object-manage/sort-code-manage/data-set.vue

@@ -3,7 +3,7 @@
         <!-- 搜索栏 -->
         <search-bar :conditionForm="conditionForm" @submitSearch="receiveSearch"></search-bar>
         <!-- 操作栏 -->
-        <operate-bar v-if="false" :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
+        <operate-bar :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
         <!-- 表格 -->
         <new-table
             ref="table"
@@ -19,24 +19,25 @@
 
 <script>
 import { dataSetlTableUrl, delDataSet, getDataSetDetail } from "@/api/data-auth.js"
+import { tableColumnSyncUrl } from "@/api/sync"
 import { dataSetlImportUrl } from "@/api/import"
 import searchBar from "@/components/search-bar"
 import operateBar from "@/components/operate-bar"
 import newTable from "@/components/new-table"
-import { searchOpt, importOpt, detailOpt } from "@/mixins/page-opt"
+import { searchOpt, importOpt, detailOpt, syncOpt } from "@/mixins/page-opt"
 import { dataSetTable, tableOptList, pageOptList } from "./DataConfig.js"
 const area = ["1200px", "600px"]
 const labelWidth = "180px"
 
 export default {
     components: { searchBar, operateBar, newTable },
-    mixins: [searchOpt, importOpt, detailOpt],
+    mixins: [searchOpt, importOpt, detailOpt, syncOpt],
     data() {
         return {
             dataSetlTableUrl,
             dataSetTable,
             tableOptList: ["详情", "删除"],
-            pageOptList: ["导入"],
+            pageOptList: ["同步数据资源"],
             conditionForm: [
                 {
                     label: "数据资源名称",
@@ -60,11 +61,16 @@ export default {
             if (opt == "详情") {
                 this.details = row
                 this.handleViewDetail(row.id, otherParams)
-            } else if (opt == "删除") {
+            }
+            if (opt == "删除") {
                 this.handleDelete(row)
-            } else if (opt == "导入") {
+            }
+            if (opt == "导入") {
                 this.handleImport(dataSetlImportUrl, "appData", "数据集导入")
             }
+            if (opt == "同步数据资源") {
+                this.handleSync(tableColumnSyncUrl)
+            }
         },
         /**
          * 删除

+ 124 - 123
src/pages/auth-object-manage/sort-code-manage/field-sort-code.vue

@@ -1,133 +1,134 @@
-<!--
-字段分类表码列表
-@Author: linqian
-@Date: 2021-03-31 15:30:11
--->
 <template>
-  <div>
-    <!-- 搜索栏 -->
-    <search-bar :conditionForm="fieldSortConditionForm" @submitSearch="receiveSearch"></search-bar>
-    <!-- 操作栏 -->
-    <operate-bar :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
-    <!-- 列表 -->
-    <new-table
-      ref="table"
-      :tableUrl="fieldClassifyTableUrl"
-      :tableHeader="tableHeader"
-      :condition="condition"
-      :tableOptList="tableOptList"
-      @submitTableOpt="receviceOpt"
-    >
-    </new-table>
-  </div>
+    <div>
+        <!-- 搜索栏 -->
+        <search-bar :conditionForm="fieldSortConditionForm" @submitSearch="receiveSearch"></search-bar>
+        <!-- 操作栏 -->
+        <operate-bar :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
+        <!-- 列表 -->
+        <new-table
+            ref="table"
+            :tableUrl="fieldClassifyTableUrl"
+            :tableHeader="tableHeader"
+            :condition="condition"
+            :tableOptList="tableOptList"
+            @submitTableOpt="receviceOpt"
+        >
+        </new-table>
+    </div>
 </template>
 
 <script>
-import searchBar from '@/components/search-bar';
-import operateBar from '@/components/operate-bar';
-import newTable from '@/components/new-table';
-import { fieldSortConfig, pageOptList, tableOptList, fieldSortConditionForm } from './DataConfig';
-import { fieldClassifyTableUrl, delFieldClassify, getFieldClassifyDetail, saveFieldClassify, updateFieldClassify } from '@/api/data-auth';
-import { fieldSortSyncUrl, tableColumnSyncUrl} from '@/api/sync';
-import { searchOpt, importOpt, syncOpt, addEditOpt } from '@/mixins/page-opt';
-const area = ['900px', '400px'];
-const labelWidth = '160px';
+import searchBar from "@/components/search-bar"
+import operateBar from "@/components/operate-bar"
+import newTable from "@/components/new-table"
+import { fieldSortConfig, pageOptList, tableOptList, fieldSortConditionForm } from "./DataConfig"
+import {
+    fieldClassifyTableUrl,
+    delFieldClassify,
+    getFieldClassifyDetail,
+    saveFieldClassify,
+    updateFieldClassify
+} from "@/api/data-auth"
+import { fieldSortSyncUrl, tableColumnSyncUrl } from "@/api/sync"
+import { searchOpt, importOpt, syncOpt, addEditOpt } from "@/mixins/page-opt"
+const area = ["900px", "400px"]
+const labelWidth = "160px"
 export default {
-  components: { searchBar, operateBar, newTable },
-  mixins: [searchOpt, importOpt, syncOpt, addEditOpt],
-  data() {
-    return {
-      fieldClassifyTableUrl,
-      tableHeader: fieldSortConfig,
-      fieldSortConditionForm,
-      tableOptList: tableOptList.slice(1, 3),
-      pageOptList: ["新增", "同步", "同步数据资源"],
-    };
-  },
-  computed: {},
-  methods: {
-    async receviceOpt(opt, row) {
-      const otherParams = {
-        config: fieldSortConfig,
-        labelWidth,
-        area
-      };
-      if (opt == '新增') {
-        this.handleOpenEditForm('新增', 'add', otherParams);
-      } else if (opt == '修改') {
-        const detailInfo = await this.getDetail(row.secId);
-        this.handleOpenEditForm('编辑', 'update', { ...otherParams, detailInfo });
-        this.handleEdit(row);
-      } else if (opt == '详情') {
-        this.handleViewDetail(row);
-      } else if (opt == '删除') {
-        this.handleDelete(row);
-      } else if (opt == '同步') {
-        this.handleSync(fieldSortSyncUrl);
-      } else if (opt == '导入') {
-        // this.handleImport(dataLevelImportUrl, 'dataLevel', '数据资源分类表码导入');
-      } else if (opt == '同步数据资源') {
-        this.handleSync(tableColumnSyncUrl);
-      }
-    },
-    /**
-     * 获取详情
-     */
-    getDetail(id) {
-      return new Promise((resolve) => {
-        getFieldClassifyDetail(id).then((res) => {
-          resolve(res.data.content);
-        });
-      });
+    components: { searchBar, operateBar, newTable },
+    mixins: [searchOpt, importOpt, syncOpt, addEditOpt],
+    data() {
+        return {
+            fieldClassifyTableUrl,
+            tableHeader: fieldSortConfig,
+            fieldSortConditionForm,
+            tableOptList: tableOptList.slice(1, 3),
+            pageOptList: ["新增", "同步"]
+        }
     },
+    computed: {},
+    methods: {
+        async receviceOpt(opt, row) {
+            const otherParams = {
+                config: fieldSortConfig,
+                labelWidth,
+                area
+            }
+            if (opt == "新增") {
+                this.handleOpenEditForm("新增", "add", otherParams)
+            } else if (opt == "修改") {
+                const detailInfo = await this.getDetail(row.secId)
+                this.handleOpenEditForm("编辑", "update", { ...otherParams, detailInfo })
+                this.handleEdit(row)
+            } else if (opt == "详情") {
+                this.handleViewDetail(row)
+            } else if (opt == "删除") {
+                this.handleDelete(row)
+            } else if (opt == "同步") {
+                this.handleSync(fieldSortSyncUrl)
+            } else if (opt == "导入") {
+                // this.handleImport(dataLevelImportUrl, 'dataLevel', '数据资源分类表码导入');
+            } else if (opt == "同步数据资源") {
+                this.handleSync(tableColumnSyncUrl)
+            }
+        },
+        /**
+         * 获取详情
+         */
+        getDetail(id) {
+            return new Promise(resolve => {
+                getFieldClassifyDetail(id).then(res => {
+                    resolve(res.data.content)
+                })
+            })
+        },
 
-    /**
-     * 删除
-     */
-    handleDelete(row, e) {
-      this.$dgConfirm(`是否确定删除这条数据!`, '提示', {}).then(() => {
-        delFieldClassify(row.secId).then((res) => {
-          this.$message.success('删除成功!');
-          this.handleSearch();
-        });
-      });
-    },
-    /**
-     * @description: 保存表单
-     * @param { 表单数据 } form
-     * @param { 新增还是编辑 } type
-     * @param { 弹框 } layer
-     */
-    async saveForm(form, type, layer) {
-      const res = type == 'update' ? await this.update(form) : await this.add(form);
-      if (res.data.result == '200') {
-        this.$message.success('保存成功');
-        layer.close(layer.dialogIndex);
-        this.handleSearch();
-      } else {
-        this.$message.warning(res.data.msg);
-      }
-    },
-    add(form) {
-      return new Promise((resolve) => {
-        saveFieldClassify(form).then((res) => {
-          resolve(res);
-        });
-      });
+        /**
+         * 删除
+         */
+        handleDelete(row, e) {
+            this.$dgConfirm(`是否确定删除这条数据!`, "提示", {}).then(() => {
+                delFieldClassify(row.secId).then(res => {
+                    this.$message.success("删除成功!")
+                    this.handleSearch()
+                })
+            })
+        },
+        /**
+         * @description: 保存表单
+         * @param { 表单数据 } form
+         * @param { 新增还是编辑 } type
+         * @param { 弹框 } layer
+         */
+        async saveForm(form, type, layer) {
+            const res = type == "update" ? await this.update(form) : await this.add(form)
+            if (res.data.result == "200") {
+                this.$message.success("保存成功")
+                layer.close(layer.dialogIndex)
+                this.handleSearch()
+            } else {
+                this.$message.warning(res.data.msg)
+            }
+        },
+        add(form) {
+            return new Promise(resolve => {
+                saveFieldClassify(form).then(res => {
+                    resolve(res)
+                })
+            })
+        },
+        update(form) {
+            return new Promise(resolve => {
+                updateFieldClassify(form).then(res => {
+                    resolve(res)
+                })
+            })
+        }
     },
-    update(form) {
-      return new Promise((resolve) => {
-        updateFieldClassify(form).then((res) => {
-          resolve(res);
-        });
-      });
-    }
-  },
-  created() {},
-  mounted() {}
-};
+    created() {},
+    mounted() {}
+}
 </script>
 
-<style lang='scss'>
-@import url('./index.scss');
-</style>
+<style lang="scss">
+@import url("./index.scss");
+</style>

+ 1 - 1
src/pages/auth-object-manage/sort-code-manage/index.vue

@@ -19,9 +19,9 @@
 import dataSet from "./data-set.vue"
 import dataItem from "./data-item.vue"
 import dataLevel from "./data-level.vue"
-import fieldSortCode from "./field-sort-code.vue"
 import safeLevelCode from "./safe-level-code.vue"
 import sourceSortCode from "./source-sort-code.vue"
+import fieldSortCode from "./field-sort-code.vue"
 import fieldRelSort from "./filed-rel-sort.vue"
 export default {
     components: {

+ 133 - 132
src/pages/auth-object-manage/sort-code-manage/source-sort-code.vue

@@ -1,143 +1,144 @@
-<!--
-数据资源分类表码列表
-@Author: linqian
-@Date: 2021-03-31 15:30:11
--->
 <template>
-  <div>
-    <!-- 搜索栏 -->
-    <search-bar :conditionForm="sourceSortConditionForm" @submitSearch="receiveSearch"></search-bar>
-    <!-- 操作栏 -->
-    <operate-bar :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
-    <!-- 列表 -->
-    <new-table
-      ref="table"
-      :tableUrl="dataSourceClaTableUrl"
-      :tableHeader="tableHeader"
-      :condition="condition"
-      :tableOptList="tableOptList"
-      @submitTableOpt="receviceOpt"
-    >
-    </new-table>
-  </div>
+    <div>
+        <!-- 搜索栏 -->
+        <search-bar :conditionForm="sourceSortConditionForm" @submitSearch="receiveSearch"></search-bar>
+        <!-- 操作栏 -->
+        <operate-bar :pageOptList="pageOptList" @submitPageOpt="receviceOpt"></operate-bar>
+        <!-- 列表 -->
+        <new-table
+            ref="table"
+            :tableUrl="dataSourceClaTableUrl"
+            :tableHeader="tableHeader"
+            :condition="condition"
+            :tableOptList="tableOptList"
+            @submitTableOpt="receviceOpt"
+        >
+        </new-table>
+    </div>
 </template>
 
 <script>
 import {
-  dataSourceClaTableUrl,
-  delDataSourceCla,
-  getDataSourceClaDetail,
-  saveDataSourceCla,
-  updateDataSourceCla
-} from '@/api/data-auth';
-import { dataSourceSyncUrl, tableColumnSyncUrl } from '@/api/sync';
-import searchBar from '@/components/search-bar';
-import operateBar from '@/components/operate-bar';
-import newTable from '@/components/new-table';
-import { sourceSortConfig, pageOptList, tableOptList, sourceSortConditionForm } from './DataConfig';
-import { searchOpt, importOpt, syncOpt, addEditOpt, detailOpt } from '@/mixins/page-opt';
-const area = ['900px', '600px'];
-const labelWidth = '160px';
+    dataSourceClaTableUrl,
+    delDataSourceCla,
+    getDataSourceClaDetail,
+    saveDataSourceCla,
+    updateDataSourceCla
+} from "@/api/data-auth"
+import { dataSourceSyncUrl, tableColumnSyncUrl } from "@/api/sync"
+import searchBar from "@/components/search-bar"
+import operateBar from "@/components/operate-bar"
+import newTable from "@/components/new-table"
+import { sourceSortConfig, pageOptList, tableOptList, sourceSortConditionForm } from "./DataConfig"
+import { searchOpt, importOpt, syncOpt, addEditOpt, detailOpt } from "@/mixins/page-opt"
+const area = ["900px", "600px"]
+const labelWidth = "160px"
 export default {
-  components: { searchBar, operateBar, newTable },
-  mixins: [searchOpt, importOpt, syncOpt, addEditOpt, detailOpt],
-  data() {
-    return {
-      dataSourceClaTableUrl,
-      sourceSortConditionForm,
-      tableHeader: sourceSortConfig.slice(0, -1),
-      pageOptList: ["新增", "同步", "同步数据资源"],
-      tableOptList,
-      optList: [
-        { icon: 'el-icon-edit', tooltip: '修改', on: this.handleEdit },
-        { icon: 'el-icon-document', tooltip: '详情', on: this.handleViewDetail },
-        { icon: 'el-icon-delete', tooltip: '删除', on: this.handleDelete }
-      ]
-    };
-  },
-  computed: {},
-  methods: {
-    async receviceOpt(opt, row) {
-      const otherParams = {
-        config: sourceSortConfig,
-        labelWidth,
-        area
-      };
-      if (opt == '新增') {
-        this.handleOpenEditForm('新增', 'add', otherParams);
-      } else if (opt == '修改') {
-        const detailInfo = await this.getDetail(row.labId);
-        this.handleOpenEditForm('编辑', 'update', { ...otherParams, detailInfo });
-      } else if (opt == '详情') {
-         this.handleViewDetail(row.labId, otherParams);
-      } else if (opt == '删除') {
-        this.handleDelete(row);
-      } else if (opt == '同步') {
-        this.handleSync(dataSourceSyncUrl);
-      } else if (opt == '导入') {
-        // this.handleImport(dataLevelImportUrl, 'dataLevel', '数据资源分类表码导入');
-      } else if (opt == '同步数据资源') {
-        this.handleSync(tableColumnSyncUrl);
-      }
-    },
-    /**
-     * 获取详情
-     */
-    getDetail(id) {
-      return new Promise((resolve) => {
-        getDataSourceClaDetail(id).then((res) => {
-          resolve(res.data.content);
-        });
-      });
+    components: { searchBar, operateBar, newTable },
+    mixins: [searchOpt, importOpt, syncOpt, addEditOpt, detailOpt],
+    data() {
+        return {
+            dataSourceClaTableUrl,
+            sourceSortConditionForm,
+            tableHeader: sourceSortConfig.slice(0, -1),
+            pageOptList: ["新增", "同步"],
+            tableOptList,
+            optList: [
+                { icon: "el-icon-edit", tooltip: "修改", on: this.handleEdit },
+                { icon: "el-icon-document", tooltip: "详情", on: this.handleViewDetail },
+                { icon: "el-icon-delete", tooltip: "删除", on: this.handleDelete }
+            ]
+        }
     },
+    computed: {},
+    methods: {
+        async receviceOpt(opt, row) {
+            const otherParams = {
+                config: sourceSortConfig,
+                labelWidth,
+                area
+            }
+            if (opt == "新增") {
+                this.handleOpenEditForm("新增", "add", otherParams)
+            }
+            if (opt == "修改") {
+                const detailInfo = await this.getDetail(row.labId)
+                this.handleOpenEditForm("编辑", "update", { ...otherParams, detailInfo })
+            }
+            if (opt == "详情") {
+                this.handleViewDetail(row.labId, otherParams)
+            }
+            if (opt == "删除") {
+                this.handleDelete(row)
+            }
+            if (opt == "同步") {
+                this.handleSync(dataSourceSyncUrl)
+            }
+            if (opt == "导入") {
+                // this.handleImport(dataLevelImportUrl, 'dataLevel', '数据资源分类表码导入');
+            }
+            if (opt == "同步数据资源") {
+                this.handleSync(tableColumnSyncUrl)
+            }
+        },
+        /**
+         * 获取详情
+         */
+        getDetail(id) {
+            return new Promise(resolve => {
+                getDataSourceClaDetail(id).then(res => {
+                    resolve(res.data.content)
+                })
+            })
+        },
 
-    /**
-     * 删除
-     */
-    handleDelete(row, e) {
-      this.$dgConfirm(`是否确定删除这条数据!`, '提示', {}).then(() => {
-        delDataSourceCla(row.labId).then((res) => {
-          this.$message.success('删除成功!');
-          this.handleSearch();
-        });
-      });
-    },
-    /**
-     * @description: 保存表单
-     * @param { 表单数据 } form
-     * @param { 新增还是编辑 } type
-     * @param { 弹框 } layer
-     */
-    async saveForm(form, type, layer) {
-      const res = type == 'update' ? await this.update(form) : await this.add(form);
-      if (res.data.result == '200') {
-        this.$message.success('保存成功');
-        layer.close(layer.dialogIndex);
-        this.handleSearch();
-      } else {
-        this.$message.warning(res.data.msg);
-      }
-    },
-    add(form) {
-      return new Promise((resolve) => {
-        saveDataSourceCla(form).then((res) => {
-          resolve(res);
-        });
-      });
+        /**
+         * 删除
+         */
+        handleDelete(row, e) {
+            this.$dgConfirm(`是否确定删除这条数据!`, "提示", {}).then(() => {
+                delDataSourceCla(row.labId).then(res => {
+                    this.$message.success("删除成功!")
+                    this.handleSearch()
+                })
+            })
+        },
+        /**
+         * @description: 保存表单
+         * @param { 表单数据 } form
+         * @param { 新增还是编辑 } type
+         * @param { 弹框 } layer
+         */
+        async saveForm(form, type, layer) {
+            const res = type == "update" ? await this.update(form) : await this.add(form)
+            if (res.data.result == "200") {
+                this.$message.success("保存成功")
+                layer.close(layer.dialogIndex)
+                this.handleSearch()
+            } else {
+                this.$message.warning(res.data.msg)
+            }
+        },
+        add(form) {
+            return new Promise(resolve => {
+                saveDataSourceCla(form).then(res => {
+                    resolve(res)
+                })
+            })
+        },
+        update(form) {
+            return new Promise(resolve => {
+                updateDataSourceCla(form).then(res => {
+                    resolve(res)
+                })
+            })
+        }
     },
-    update(form) {
-      return new Promise((resolve) => {
-        updateDataSourceCla(form).then((res) => {
-          resolve(res);
-        });
-      });
-    }
-  },
-  created() {},
-  mounted() {}
-};
+    created() {},
+    mounted() {}
+}
 </script>
 
-<style lang='scss'>
-@import url('./index.scss');
-</style>
+<style lang="scss">
+@import url("./index.scss");
+</style>