jwyu пре 1 година
родитељ
комит
235d448490

+ 19 - 0
src/api/modules/dataSource.js

@@ -0,0 +1,19 @@
+import http from "@/api/http.js"
+
+// 数据源管理模块
+const apiDataSource={
+    //获取数据源列表列配置项
+    //列表类型ColumnType:1数据源明细表,2数据源统计表,3删除指标列表,4指标信息变更表"
+    tableColOpts:params=>{
+        return http.get('/data_stat/source_column',params)
+    },
+
+    //编辑自定义列
+    tableColEdit:params=>{
+        return http.post('/data_stat/source_column/edit',params)
+    }
+}
+
+export {
+    apiDataSource
+}

+ 21 - 1
src/utils/buttonConfig.js

@@ -212,8 +212,28 @@ export const dataSourcePermission = {
     /*--------EIA  STEO报告---- */
     eiaData_export:'eiaData:export',
     /*--------国家统计局---- */
-    gjtjjData_export:'gjtjjData:export'
+    gjtjjData_export:'gjtjjData:export',
 
+    /*--------数据源管理---- */
+    //数据源明细表
+    dataSource_detailTable_see:'dataSource:detailTable:see',//查看
+    dataSource_detailTable_checkAll:'dataSource:detailTable:checkAll',//列表全选
+    dataSource_detailTable_refresh:'dataSource:detailTable:refresh',//一键刷新
+    dataSource_detailTable_setRefreshTime:'dataSource:detailTable:setRefreshTime',//设置刷新时间
+    dataSource_detailTable_filterDate:'dataSource:detailTable:filterDate',//日期筛选
+    // 数据源统计表
+    dataSource_statisticTable_see:'dataSource:statisticTable:see',//查看
+    dataSource_statisticTable_filterDate:'dataSource:statisticTable:filterDate',//日期筛选
+    // 删除指标表
+    dataSource_delTable_see:'dataSource:delTable:see',//查看
+    // 指标信息变更表
+    dataSource_edbInfoTable_see:'dataSource:edbInfoTable:see',//查看
+    dataSource_edbInfoTable_filterDate:'dataSource:edbInfoTable:filterDate',//日期筛选
+    /*--------数据源终端管理---- */
+    dataSource_account_see:'dataSourceAccount:see',//查看
+    dataSource_account_add:'dataSourceAccount:add',//新增终端账号
+    dataSource_account_edit:'dataSourceAccount:edit',//编辑
+    dataSource_account_enable:'dataSourceAccount:enable',//禁用/启用
 }
 
 /*

+ 86 - 4
src/views/dataSource_manage/components/DelEDBTable.vue

@@ -1,15 +1,97 @@
 <template>
-    <div class="detail-table-wrap">
-        指标删除表
+    <div class="del-table-wrap">
+        <div class="top-wrap">
+            <img class="set-icon" src="~@/assets/img/data_m/set_icon.png" alt="" @click="showSetTableCols=true">
+        </div>
+         <el-table
+            ref="tableIns"
+            :data="tableData"
+            border
+            @selection-change="handleSelectionChange"
+        >
+            <el-table-column
+                type="selection"
+                width="55"
+                fixed="left"
+                align="center"
+            />
+            <el-table-column
+                v-for="col in tableColOpts"
+                :key="col.ColumnKey"
+                :column-key="col.ColumnKey"
+                :label="col.ColumnName"
+                :prop="col.ColumnKey"
+                :sortable="col.IsSort===1?'custom':false"
+                align="center"
+            />
+            <div slot="empty">
+                <tableNoData text="暂无数据"/>
+            </div>
+        </el-table>
+        <el-pagination
+          layout="total,prev,pager,next,jumper"
+          background
+          @current-change="handleCurrentChange"
+          :page-size="pageSize"
+          @size-change="handleSizeChange"
+          :total="total"
+          style="float: right;margin-top:20px"
+        />
+        <!-- 自定义列表 -->
+        <SetTableCols v-model="showSetTableCols" :ColumnType="3" @change="handleTableColChange"/>
     </div>
 </template>
 
 <script>
+import {apiDataSource} from '@/api/modules/dataSource'
+import SetTableCols from './SetTableCols.vue'
 export default {
+    components:{SetTableCols},
+    data() {
+        return {
+            tableColOpts:[],
+            tableData:[],
+            pageSize:15,
+            page:1,
+            total:0,
 
+            showSetTableCols:false,
+        }
+    },
+    created() {
+        this.getTableColOpts()
+    },
+    methods: {
+        // 获取表格列配置项
+        getTableColOpts(){
+            this.tableColOpts=[]
+            apiDataSource.tableColOpts({ColumnType:3}).then(res=>{
+                if(res.Ret===200){
+                    this.tableColOpts=res.Data.List||[]
+                    this.$nextTick(()=>{
+                        // this.$refs.tableIns.doLayout()
+                    })
+                }
+            })
+        },
+
+        handleTableColChange(){
+            this.getTableColOpts()
+        },
+    },
 }
 </script>
 
-<style>
-
+<style lang="scss" scoped>
+.del-table-wrap{
+    .top-wrap{
+        display: flex;
+        justify-content: flex-end;
+        margin-bottom: 30px;
+        .set-icon{
+            width: 40px;
+            cursor: pointer;
+        }
+    }
+}
 </style>

+ 61 - 10
src/views/dataSource_manage/components/DetailTable.vue

@@ -47,19 +47,32 @@
                 clearable
                 style="width:200px"
             />
-            <el-checkbox v-model="checkAll">列表全选</el-checkbox>
+            <el-checkbox 
+                v-model="checkAll"
+                v-permission="permissionBtn.dataSourcePermission.dataSource_detailTable_checkAll"
+            >列表全选</el-checkbox>
         </div>
         <div class="right-opt-box">
-            <el-button type="primary" plain>一键刷新</el-button>
-            <el-button type="primary" @click="handleShowSetRefreshTime">设置刷新时间</el-button>
+            <el-button 
+                type="primary" 
+                plain 
+                v-permission="permissionBtn.dataSourcePermission.dataSource_detailTable_refresh"
+            >一键刷新</el-button>
+            <el-button 
+                type="primary" 
+                @click="handleShowSetRefreshTime"
+                v-permission="permissionBtn.dataSourcePermission.dataSource_detailTable_setRefreshTime"
+            >设置刷新时间</el-button>
             <img class="set-icon" src="~@/assets/img/data_m/set_icon.png" alt="" @click="showSetTableCols=true">
         </div>
         </div>
         <el-table
-            ref="multipleTable"
+            v-loading="tableLoading"
+            ref="tableIns"
             :data="tableData"
             border
-            @selection-change="handleSelectionChange"
+            @selection-change="handleTableSelectChange"
+            @sort-change="handleTableSortChange"
         >
             <el-table-column
                 type="selection"
@@ -69,10 +82,11 @@
             />
             <el-table-column
                 v-for="col in tableColOpts"
-                :key="col.key"
-                :label="col.name"
-                :prop="col.key"
-                :sortable="col.sortable"
+                :key="col.ColumnKey"
+                :column-key="col.ColumnKey"
+                :label="col.ColumnName"
+                :prop="col.ColumnKey"
+                :sortable="col.IsSort===1?'custom':false"
                 align="center"
             />
             <div slot="empty">
@@ -89,13 +103,14 @@
           style="float: right;margin-top:20px"
         />
         <!-- 自定义列表 -->
-        <SetTableCols v-model="showSetTableCols" />
+        <SetTableCols v-model="showSetTableCols" :ColumnType="1" @change="handleTableColChange"/>
         <!-- 设置刷新时间 -->
         <SetRefreshTime v-model="showSetRefreshTime"/> 
     </div>
 </template>
 
 <script>
+import {apiDataSource} from '@/api/modules/dataSource'
 import {frequencyOpt} from '../utils/config'
 import SetRefreshTime from './SetRefreshTime.vue'
 import SetTableCols from './SetTableCols.vue'
@@ -114,6 +129,7 @@ export default {
             pageSize:15,
             page:1,
             total:0,
+            tableLoading:false,
 
             showSetTableCols:false,
 
@@ -121,8 +137,43 @@ export default {
         }
     },
     created() {
+        this.getTableColOpts()
     },
     methods: {
+        // 获取表格列配置项
+        getTableColOpts(){
+            if(!this.permissionBtn.checkPermissionBtn(this.permissionBtn.dataSourcePermission.dataSource_detailTable_see)) return 
+            this.tableLoading=true
+            this.tableColOpts=[]
+            apiDataSource.tableColOpts({ColumnType:1}).then(res=>{
+                if(res.Ret===200){
+                    const arr=res.Data.List||[]
+                    this.tableColOpts=arr.filter(item=>item.IsShow===1)
+                    this.$nextTick(()=>{
+                        // this.$refs.tableIns.doLayout()
+                        this.tableLoading=false
+                    })
+                    
+                }
+            })
+        },
+
+        // 表格配置项变更
+        handleTableColChange(){
+            this.getTableColOpts()
+        },
+
+        // 排序
+        handleTableSortChange({column, prop, order}){
+            console.log(column, prop, order);
+        },
+
+        // 表格选择变更
+        handleTableSelectChange(e){
+
+        },
+
+
         handleShowSetRefreshTime(){
             this.showSetRefreshTime=true
         }

+ 86 - 4
src/views/dataSource_manage/components/EDBInfoChangeTable.vue

@@ -1,15 +1,97 @@
 <template>
-    <div class="detail-table-wrap">
-        信息变更表
+    <div class="edbinfo-table-wrap">
+        <div class="top-wrap">
+            <img class="set-icon" src="~@/assets/img/data_m/set_icon.png" alt="" @click="showSetTableCols=true">
+        </div>
+         <el-table
+            ref="tableIns"
+            :data="tableData"
+            border
+            @selection-change="handleSelectionChange"
+        >
+            <el-table-column
+                type="selection"
+                width="55"
+                fixed="left"
+                align="center"
+            />
+            <el-table-column
+                v-for="col in tableColOpts"
+                :key="col.ColumnKey"
+                :column-key="col.ColumnKey"
+                :label="col.ColumnName"
+                :prop="col.ColumnKey"
+                :sortable="col.IsSort===1?'custom':false"
+                align="center"
+            />
+            <div slot="empty">
+                <tableNoData text="暂无数据"/>
+            </div>
+        </el-table>
+        <el-pagination
+          layout="total,prev,pager,next,jumper"
+          background
+          @current-change="handleCurrentChange"
+          :page-size="pageSize"
+          @size-change="handleSizeChange"
+          :total="total"
+          style="float: right;margin-top:20px"
+        />
+        <!-- 自定义列表 -->
+        <SetTableCols v-model="showSetTableCols" :ColumnType="4" @change="handleTableColChange"/>
     </div>
 </template>
 
 <script>
+import {apiDataSource} from '@/api/modules/dataSource'
+import SetTableCols from './SetTableCols.vue'
 export default {
+    components:{SetTableCols},
+    data() {
+        return {
+            tableColOpts:[],
+            tableData:[],
+            pageSize:15,
+            page:1,
+            total:0,
 
+            showSetTableCols:false,
+        }
+    },
+    created() {
+        this.getTableColOpts()
+    },
+    methods: {
+        // 获取表格列配置项
+        getTableColOpts(){
+            this.tableColOpts=[]
+            apiDataSource.tableColOpts({ColumnType:4}).then(res=>{
+                if(res.Ret===200){
+                    this.tableColOpts=res.Data.List||[]
+                    this.$nextTick(()=>{
+                        // this.$refs.tableIns.doLayout()
+                    })
+                }
+            })
+        },
+
+        handleTableColChange(){
+            this.getTableColOpts()
+        },
+    },
 }
 </script>
 
-<style>
-
+<style lang="scss" scoped>
+.edbinfo-table-wrap{
+    .top-wrap{
+        display: flex;
+        justify-content: flex-end;
+        margin-bottom: 30px;
+        .set-icon{
+            width: 40px;
+            cursor: pointer;
+        }
+    }
+}
 </style>

+ 58 - 5
src/views/dataSource_manage/components/SetTableCols.vue

@@ -7,7 +7,7 @@
       :center="true"
       v-dialogDrag
       custom-class="dialogclass"
-      width="700px"
+      width="550px"
       @close="handleClose"
     >
         <draggable
@@ -17,20 +17,23 @@
             tag="div"
             handle=".drag"
         >
-            <div class="list-item">
-                <el-checkbox><span class="name">名好处呢</span></el-checkbox>
+            <div class="list-item" v-for="item in list" :key="item.ColumnKey">
+                <el-checkbox v-model="item.checked" :disabled="item.IsMust===1">
+                    <span class="name" :style="{color:item.IsMust===1?'#C0C4CC':''}">{{item.ColumnName}}</span>
+                </el-checkbox>
                 <img class="drag" src="~@/assets/img/data_m/move_ico2.png" alt="">
             </div>
         </draggable>
         <div style="text-align:center;margin:30px 0">
             <el-button type="primary" plain @click="handleClose">取消</el-button>
-            <el-button type="primary">确定</el-button>
+            <el-button type="primary" @click="handleSave">确定</el-button>
         </div>
     </el-dialog>
 </template>
 
 <script>
 import draggable from 'vuedraggable';
+import {apiDataSource} from '@/api/modules/dataSource'
 export default {
     components:{draggable},
     model:{
@@ -41,9 +44,59 @@ export default {
         show:{
             type:Boolean,
             default:false
+        },
+        ColumnType:{//1数据源明细表,2数据源统计表,3删除指标列表,4指标信息变更表"
+            type:Number,
+            default:0
+        }
+    },
+    watch: {
+        show(n){
+            if(n){
+                this.getTableColOpts()
+            }
+        }  
+    },
+    data() {
+        return {
+            list:[]
         }
     },
     methods: {
+        // 获取表格列配置项
+        getTableColOpts(){
+            apiDataSource.tableColOpts({ColumnType:this.ColumnType}).then(res=>{
+                if(res.Ret===200){
+                    const arr=res.Data.List||[]
+                    this.list=arr.map(item=>{
+                        return {
+                            ...item,
+                            checked:item.IsShow===1?true:false
+                        }
+                    })
+                }
+            })
+        },
+
+        handleSave(){
+            const list=this.list.map(item=>{
+                return {
+                    Id:item.Id,
+                    IsShow:item.checked?1:0
+                }
+            })
+            apiDataSource.tableColEdit({
+                list:list
+            }).then(res=>{
+                if(res.Ret===200){
+                    this.$message.success('保存成功')
+                    this.$emit('change')
+
+                    this.handleClose()
+                }
+            })
+        },
+
         handleClose(){
             this.$emit('close', false)
         }
@@ -54,7 +107,7 @@ export default {
 <style lang="scss" scoped>
 .list-wrap{
     .list-item{
-        padding: 5px 0;
+        padding: 10px 0;
         border-bottom: 1px solid #000;
         display: flex;
         justify-content: space-between;

+ 71 - 1
src/views/dataSource_manage/components/StatisticTable.vue

@@ -3,13 +3,82 @@
         <div class="top-wrap">
             <img class="set-icon" src="~@/assets/img/data_m/set_icon.png" alt="" @click="showSetTableCols=true">
         </div>
-        
+         <el-table
+            ref="tableIns"
+            :data="tableData"
+            border
+            @selection-change="handleSelectionChange"
+        >
+            <el-table-column
+                type="selection"
+                width="55"
+                fixed="left"
+                align="center"
+            />
+            <el-table-column
+                v-for="col in tableColOpts"
+                :key="col.ColumnKey"
+                :column-key="col.ColumnKey"
+                :label="col.ColumnName"
+                :prop="col.ColumnKey"
+                :sortable="col.IsSort===1?'custom':false"
+                align="center"
+            />
+            <div slot="empty">
+                <tableNoData text="暂无数据"/>
+            </div>
+        </el-table>
+        <el-pagination
+          layout="total,prev,pager,next,jumper"
+          background
+          @current-change="handleCurrentChange"
+          :page-size="pageSize"
+          @size-change="handleSizeChange"
+          :total="total"
+          style="float: right;margin-top:20px"
+        />
+        <!-- 自定义列表 -->
+        <SetTableCols v-model="showSetTableCols" :ColumnType="2" @change="handleTableColChange"/>
     </div>
 </template>
 
 <script>
+import {apiDataSource} from '@/api/modules/dataSource'
+import SetTableCols from './SetTableCols.vue'
 export default {
+    components:{SetTableCols},
+    data() {
+        return {
+            tableColOpts:[],
+            tableData:[],
+            pageSize:15,
+            page:1,
+            total:0,
 
+            showSetTableCols:false,
+        }
+    },
+    created() {
+        this.getTableColOpts()
+    },
+    methods: {
+        // 获取表格列配置项
+        getTableColOpts(){
+            this.tableColOpts=[]
+            apiDataSource.tableColOpts({ColumnType:2}).then(res=>{
+                if(res.Ret===200){
+                    this.tableColOpts=res.Data.List||[]
+                    this.$nextTick(()=>{
+                        // this.$refs.tableIns.doLayout()
+                    })
+                }
+            })
+        },
+
+        handleTableColChange(){
+            this.getTableColOpts()
+        },
+    },
 }
 </script>
 
@@ -18,6 +87,7 @@ export default {
     .top-wrap{
         display: flex;
         justify-content: flex-end;
+        margin-bottom: 30px;
         .set-icon{
             width: 40px;
             cursor: pointer;

+ 12 - 2
src/views/dataSource_manage/dataSourceList.vue

@@ -13,11 +13,12 @@
                 v-model="dateVal"
                 type="date"
                 placeholder="选择日期"
-                 value-format="yyyy-MM-dd"
+                value-format="yyyy-MM-dd"
+                v-if="showFilterDate"
             />
         </div>
         <div class="main-box">
-            <component :is='activeNav'></component>
+            <component :is='activeNav' :filterDate="dateVal"></component>
         </div>
     </div>
 </template>
@@ -29,6 +30,15 @@ import EDBInfoChangeTable from './components/EDBInfoChangeTable.vue'
 import StatisticTable from './components/StatisticTable.vue'
 export default {
     components:{DelEDBTable,DetailTable,EDBInfoChangeTable,StatisticTable},
+    computed: {
+        showFilterDate(){
+            if(this.activeNav==='DelEDBTable') return false
+            if(this.activeNav==='DetailTable'&&this.permissionBtn.checkPermissionBtn(this.permissionBtn.dataSourcePermission.dataSource_detailTable_filterDate)) return true
+            if(this.activeNav==='StatisticTable'&&this.permissionBtn.checkPermissionBtn(this.permissionBtn.dataSourcePermission.dataSource_statisticTable_filterDate)) return true
+            if(this.activeNav==='EDBInfoChangeTable'&&this.permissionBtn.checkPermissionBtn(this.permissionBtn.dataSourcePermission.dataSource_edbInfoTable_filterDate)) return true
+            return false
+        }  
+    },
     data() {
         return {
             navOpt:[