jwyu 1 year ago
parent
commit
cd5cbd9732

+ 6 - 1
src/api/modules/dataSource.js

@@ -20,7 +20,7 @@ const apiDataSource={
 
     //数据源统计
     GLStatisticTableList:params=>{
-        return http.get('/data_stat/edb_update_stat',params)
+        return http.get('/data_stat/source_stat',params)
     },
 
     //删除指标列表数据
@@ -33,6 +33,11 @@ const apiDataSource={
         return http.get('/data_stat/edb_update_log',params)
     },
 
+    //刷新失败指标详情
+    GLRefreshFailDetail:params=>{
+        return http.get('data_stat/edb_update_stat/failed',params)
+    },
+
     // 新增/编辑终端账号
     accountSave:params=>{
         return http.post('/data_stat/terminal/save',params)

BIN
src/assets/img/data_m/icon01.png


+ 24 - 1
src/views/dataSource_manage/components/DelEDBTable.vue

@@ -17,7 +17,18 @@
                 :prop="col.ColumnKey"
                 :sortable="col.IsSort===1?'custom':false"
                 align="center"
-            />
+            >
+                <template slot="header" slot-scope="scope">
+                    <span>{{col.ColumnName}}</span>
+                    <el-tooltip 
+                        effect="dark" 
+                        :content="getTableHeadTips(col.ColumnKey)" 
+                        placement="top-start"
+                    >
+                        <i class="el-icon-info" v-if="tipsKeysArr.includes(col.ColumnKey)"></i>
+                    </el-tooltip>
+                </template>
+            </el-table-column>
             <div slot="empty">
                 <tableNoData text="暂无数据"/>
             </div>
@@ -42,6 +53,7 @@ export default {
     components:{SetTableCols},
     data() {
         return {
+            tipsKeysArr:['EdbNameSource','ErDataUpdateDate'], 
             tableLoading:false,
             tableColOpts:[],
             tableData:[],
@@ -58,12 +70,14 @@ export default {
     methods: {
         //获取表格数据
         getTableList(){
+            this.tableLoading=true
             apiDataSource.GLDelTableList({
                 CurrentIndex:this.page,
                 PageSize:this.pageSize,
                 SortParam:'',
                 CreateTime:''
             }).then(res=>{
+                this.tableLoading=false
                 if(res.Ret===200){
                     const arr=res.Data.List||[]
                     this.tableData=arr
@@ -101,6 +115,15 @@ export default {
         handleShowSetTableCol(){
             this.showSetTableCols=true
         },
+
+        // table说明文案
+        getTableHeadTips(key){
+            const tipsMap={
+                EdbNameSource:'指标在数据源的全称',
+                ErDataUpdateDate:'指标数据发生变化的最早日期',
+            }
+            return tipsMap[key]
+        }
     },
 }
 </script>

+ 62 - 2
src/views/dataSource_manage/components/DetailTable.vue

@@ -60,6 +60,21 @@
             >
                 <template slot="header" slot-scope="scope">
                     <span>{{col.ColumnName}}</span>
+                    <el-tooltip 
+                        effect="dark" 
+                        :content="getTableHeadTips(col.ColumnKey)" 
+                        placement="top-start"
+                    >
+                        <i class="el-icon-info" v-if="tipsKeysArr.includes(col.ColumnKey)"></i>
+                    </el-tooltip>
+                </template>
+                <template slot-scope="scope">
+                    <span v-if="col.ColumnKey==='IsAdd'">{{scope.row.IsAdd===1?'是':'否'}}</span>
+                    <span v-else-if="col.ColumnKey==='NeedRefresh'">{{scope.row.NeedRefresh===1?'是':'否'}}</span>
+                    <span v-else-if="col.ColumnKey==='HasRefresh'">{{scope.row.HasRefresh===1?'是':'否'}}</span>
+                    <span v-else-if="col.ColumnKey==='SourceUpdateResult'">{{scope.row.SourceUpdateResult===1?'是':'否'}}</span>
+                    
+                    <span v-else>{{scope.row[col.ColumnKey]}}</span>
                 </template>
             </el-table-column>
             <div slot="empty">
@@ -88,11 +103,12 @@ export default {
     components:{SetTableCols},
     data() {
         return {
+            tipsKeysArr:['EdbNameSource','DataUpdateTime','ErDataUpdateDate','NeedRefresh','HasRefresh','SourceUpdateTime'],
             frequencyOpt,
             filterState:{
                 frequency:'',
                 keyword:'',
-                dateVal:''
+                dateVal:this.$moment().format('YYYY-MM-DD')||''
             },
             checkAll:false,
             tableColOpts:[],
@@ -103,12 +119,42 @@ export default {
             tableLoading:false,
 
             showSetTableCols:false,
+
         }
     },
     created() {
         this.getTableColOpts()
     },
     methods: {
+        //获取表格数据
+        getTableList(){
+            this.tableLoading=true
+            apiDataSource.GLDetailTableList({
+                CurrentIndex:this.page,
+                PageSize:this.pageSize,
+                SortParam:'',
+                CreateTime:this.filterState.dateVal,
+            }).then(res=>{
+                this.tableLoading=false
+                if(res.Ret===200){
+                    const arr=res.Data.List||[]
+                    this.tableData=arr
+                    this.total=res.Data.Paging.Totals
+                }
+            })
+        },
+
+        handleCurrentChange(e){
+            this.page=e
+            this.getTableList()
+        },
+
+        // 筛选项刷新列表
+        handleRefreshList(){
+            this.page=1
+            this.getTableList()
+        },
+
         // 获取表格列配置项
         getTableColOpts(){
             this.tableLoading=true
@@ -121,6 +167,7 @@ export default {
                         // this.$refs.tableIns.doLayout()
                         this.tableLoading=false
                     })
+                    this.getTableList()
                     
                 }
             })
@@ -138,7 +185,7 @@ export default {
 
         // 表格选择变更
         handleTableSelectChange(e){
-
+            this.getTableColOpts()
         },
 
         //设置刷新时间弹窗
@@ -149,6 +196,19 @@ export default {
         handleShowSetTableCol(){
             this.showSetTableCols=true
         },
+
+        // table说明文案
+        getTableHeadTips(key){
+            const tipsMap={
+                EdbNameSource:'指标在数据源的全称',
+                DataUpdateTime:'指标最近一次数据发生变化的时间',
+                ErDataUpdateDate:'指标数据发生变化的最早日期',
+                NeedRefresh:'该指标今日是否设置了定时刷新任务',
+                HasRefresh:'该指标是否发起了刷新任务',
+                SourceUpdateTime:'指标最近一次执行刷新任务的时间'
+            }
+            return tipsMap[key]
+        }
     },
 }
 </script>

+ 36 - 2
src/views/dataSource_manage/components/EDBInfoChangeTable.vue

@@ -17,7 +17,18 @@
                 :prop="col.ColumnKey"
                 :sortable="col.IsSort===1?'custom':false"
                 align="center"
-            />
+            >
+                <template slot="header" slot-scope="scope">
+                    <span>{{col.ColumnName}}</span>
+                    <el-tooltip 
+                        effect="dark" 
+                        :content="getTableHeadTips(col.ColumnKey)" 
+                        placement="top-start"
+                    >
+                        <i class="el-icon-info" v-if="tipsKeysArr.includes(col.ColumnKey)"></i>
+                    </el-tooltip>
+                </template>
+            </el-table-column>
             <div slot="empty">
                 <tableNoData text="暂无数据"/>
             </div>
@@ -43,12 +54,17 @@ export default {
     components:{SetTableCols},
     data() {
         return {
+            tipsKeysArr:['EdbNameSource','EdbName','ErDataUpdateDate'],
             tableLoading:false,
             tableColOpts:[],
             tableData:[],
             pageSize:15,
             page:1,
             total:0,
+            tableLoading:false,
+            filterState:{
+                dateVal:this.$moment().format('YYYY-MM-DD')||''
+            },
 
             showSetTableCols:false,
         }
@@ -59,12 +75,14 @@ export default {
     methods: {
         //获取表格数据
         getTableList(){
+            this.tableLoading=true
             apiDataSource.GLEdbInfoTableList({
                 CurrentIndex:this.page,
                 PageSize:this.pageSize,
                 SortParam:'',
-                CreateTime:''
+                CreateTime:this.filterState.dateVal,
             }).then(res=>{
+                this.tableLoading=false
                 if(res.Ret===200){
                     const arr=res.Data.List||[]
                     this.tableData=arr
@@ -78,6 +96,12 @@ export default {
             this.getTableList()
         },
 
+        // 筛选项刷新列表
+        handleRefreshList(){
+            this.page=1
+            this.getTableList()
+        },
+
         // 获取表格列配置项
         getTableColOpts(){
             this.tableColOpts=[]
@@ -102,6 +126,16 @@ export default {
         handleShowSetTableCol(){
             this.showSetTableCols=true
         },
+
+        // table说明文案
+        getTableHeadTips(key){
+            const tipsMap={
+                EdbNameSource:'指标在数据源的全称',
+                EdbName:'指标在ETA指标库保存的指标名称',
+                ErDataUpdateDate:'指标数据发生变化的最早日期',
+            }
+            return tipsMap[key]
+        }
     },
 }
 </script>

+ 137 - 0
src/views/dataSource_manage/components/GLRefreshFailDetail.vue

@@ -0,0 +1,137 @@
+<template>
+    <el-dialog
+        title="更新失败指标详情"
+        :visible.sync="show"
+        :close-on-click-modal="false"
+        :append-to-body="true"
+        :center="true"
+        v-dialogDrag
+        width="645px"
+        @close="handleClose"
+    >
+        <div class="gl-refresh-fail-detail-wrap">
+            <div style="margin-bottom:20px">
+                <span>终端名称:{{info.Name}}</span>
+                <span style="display:inline-block;margin-left:20px">文件夹路径:{{info.DirPath}}</span>
+            </div>
+            <div style="display:flex;justify-content: space-between;">
+                <div>
+                    <span>已成功刷新指标数:{{info.UpdateSuccessNum}}</span>
+                    <span>更新失败指标数:{{info.UpdateFailedNum}}</span>
+                </div>
+                <div style="display:flex;align-items:center;color:#409EFF;cursor: pointer;" @click="showBZ=true">
+                    <img src="~@/assets/img/data_m/icon01.png" alt="">
+                    <span>排查步骤</span>
+                </div>
+            </div>
+            <el-table
+                :data="info.List"
+                border
+                height="500"
+            >
+                <el-table-column
+                    label="频度"
+                    prop="Frequency"
+                    align="center"
+                >
+                </el-table-column>
+                <el-table-column
+                    label="数量"
+                    prop="Num"
+                    align="center"
+                >
+                </el-table-column>
+                <el-table-column
+                    label="原因"
+                    prop="SourceUpdateFailedReason"
+                    align="center"
+                >
+                </el-table-column>
+                <div slot="empty">
+                    <tableNoData text="暂无数据"/>
+                </div>
+            </el-table>
+        </div>
+
+        <!-- 排查步骤说明 -->
+        <el-dialog
+            title="排查步骤"
+            :visible.sync="showBZ"
+            :close-on-click-modal="false"
+            :center="true"
+            v-dialogDrag
+            :append-to-body="true"
+            width="500px"
+        > 
+            <div style="padding-bottom:30px;line-height:2;color:#333">
+                <div>1、在钢联终端上,用指标编码查询下是否存在该指标,避免因为指标编码变更的原因导致刷新失败。</div>
+                <div>2、核实钢联终端账号处于登录状态。</div>
+                <div>3、打开Excel,如果“钢联数据2.0”插件不存在,则需要先退出所有Excel和WPS,在钢联终端:最上面的导航栏选择工具->Excel插件修复->点击一键修复,完成钢联数据2.0插件安装。</div>
+                <div>4、打开Excel,选中“钢联数据2.0”插件,查看登录状态是否正常。</div>
+                <div>5、打开文件目录下的一个Excel,选中“钢联数据2.0”插件,点击“更新所有页”按钮后,等待十几秒,查看Excel左下角是否提示额度超限。</div>
+            </div>
+        </el-dialog>
+    </el-dialog>
+    
+</template>
+
+<script>
+import {apiDataSource} from '@/api/modules/dataSource.js'
+export default {
+    model:{
+        prop:"show",
+        event:'close'
+    },
+    props:{
+        show:{
+            type:Boolean,
+            default:false
+        },
+        TerminalCode:{
+            type:String,
+            default:''
+        },
+        date:{
+            type:String,
+            default:''
+        }
+    },
+    watch: {
+      show(n){
+          if(n){
+              this.getDetail()
+          }
+      }  
+    },
+    data() {
+        return {
+            info:{},
+            showBZ:false
+        }
+    },
+    methods: {
+        handleClose(){
+            this.$emit('close', false)
+        },
+
+        getDetail(){
+            apiDataSource.GLRefreshFailDetail({
+                TerminalCode:this.TerminalCode,
+                CreateTime:this.date
+            }).then(res=>{
+                if(res.Ret===200){
+                    this.info=res.Data
+                }
+            })
+        }
+    },
+}
+</script>
+
+<style lang='scss'>
+.gl-refresh-fail-detail-wrap{
+    color: #333;
+    padding-bottom: 30px;
+}
+
+</style>

+ 81 - 4
src/views/dataSource_manage/components/StatisticTable.vue

@@ -3,7 +3,8 @@
         <div>
             <img src="~@/assets/img/data_m/set_icon.png" alt="" style="cursor: pointer;float:right" @click="showSetTableCols=true">
         </div>
-         <el-table
+        <el-table
+            v-loading="tableLoading"
             ref="tableIns"
             :data="tableData"
             border
@@ -14,9 +15,27 @@
                 :column-key="col.ColumnKey"
                 :label="col.ColumnName"
                 :prop="col.ColumnKey"
-                :sortable="col.IsSort===1?'custom':false"
                 align="center"
-            />
+            >
+                <template slot="header" slot-scope="scope">
+                    <span>{{col.ColumnName}}</span>
+                    <el-tooltip 
+                        effect="dark" 
+                        :content="getTableHeadTips(col.ColumnKey)" 
+                        placement="top-start"
+                    >
+                        <i class="el-icon-info" v-if="tipsKeysArr.includes(col.ColumnKey)"></i>
+                    </el-tooltip>
+                </template>
+                <template slot-scope="scope">
+                    <span 
+                        v-if="col.ColumnKey==='UpdateFailedNum'" 
+                        style="color:#409EFF;cursor: pointer;"
+                        @click="handleShowFail(scope.row)"
+                    >{{scope.row.UpdateFailedNum}}</span>
+                    <span v-else>{{scope.row[col.ColumnKey]}}</span>
+                </template>
+            </el-table-column>
             <div slot="empty">
                 <tableNoData text="暂无数据"/>
             </div>
@@ -32,38 +51,81 @@
         />
         <!-- 自定义列表 -->
         <SetTableCols v-model="showSetTableCols" :ColumnType="2" @change="handleTableColChange"/>
+
+        <!-- 刷新失败详情 -->
+        <GLRefreshFailDetail v-model="showFail" :TerminalCode="TerminalCode" :date="filterState.dateVal"/>
     </div>
 </template>
 
 <script>
 import {apiDataSource} from '@/api/modules/dataSource'
 import SetTableCols from './SetTableCols.vue'
+import GLRefreshFailDetail from './GLRefreshFailDetail.vue'
 export default {
-    components:{SetTableCols},
+    components:{SetTableCols,GLRefreshFailDetail},
     data() {
         return {
+            tipsKeysArr:['NeedUpdateNum','HasUpdateNum','UpdateSuccessNum'],
             tableColOpts:[],
             tableData:[],
             pageSize:15,
             page:1,
             total:0,
+            filterState:{
+                dateVal:this.$moment().format('YYYY-MM-DD')||''
+            },
 
             showSetTableCols:false,
+            tableLoading:false,
+
+            showFail:false,
+            TerminalCode:''
         }
     },
     created() {
         this.getTableColOpts()
     },
     methods: {
+        //获取表格数据
+        getTableList(){
+            this.tableLoading=true
+            apiDataSource.GLStatisticTableList({
+                CurrentIndex:this.page,
+                PageSize:this.pageSize,
+                CreateTime:this.filterState.dateVal,
+            }).then(res=>{
+                this.tableLoading=false
+                if(res.Ret===200){
+                    const arr=res.Data.List||[]
+                    this.tableData=arr
+                    this.total=res.Data.Paging.Totals
+                }
+            })
+        },
+
+        handleCurrentChange(e){
+            this.page=e
+            this.getTableList()
+        },
+
+        // 筛选项刷新列表
+        handleRefreshList(){
+            this.page=1
+            this.getTableList()
+        },
+
         // 获取表格列配置项
         getTableColOpts(){
+            this.tableLoading=true
             this.tableColOpts=[]
             apiDataSource.GLTableColOpts({ColumnType:2}).then(res=>{
                 if(res.Ret===200){
                     this.tableColOpts=res.Data.List||[]
                     this.$nextTick(()=>{
                         // this.$refs.tableIns.doLayout()
+                        this.tableLoading=false
                     })
+                    this.getTableList()
                 }
             })
         },
@@ -75,6 +137,21 @@ export default {
         handleShowSetTableCol(){
             this.showSetTableCols=true
         },
+
+        handleShowFail(e){
+            this.TerminalCode=e.TerminalCode
+            this.showFail=true
+        },
+
+        // table说明文案
+        getTableHeadTips(key){
+            const tipsMap={
+                NeedUpdateNum:'今日该终端需定时刷新的指标数量',
+                HasUpdateNum:'今日该终端发起刷新任务的指标数量',
+                UpdateSuccessNum:' 今日该终端刷新成功的指标数量'
+            }
+            return tipsMap[key]
+        }
     },
 }
 </script>

+ 8 - 1
src/views/dataSource_manage/dataSourceListGL.vue

@@ -15,6 +15,8 @@
                     type="date"
                     placeholder="选择日期"
                     value-format="yyyy-MM-dd"
+                    :clearable="false"
+                    @change="handleDateChange"
                     style="width:200px"
                     v-if="activeNav!='DelEDBTable'"
                 />
@@ -42,12 +44,17 @@ export default {
                 {name:'指标信息变更表',key:'EDBInfoChangeTable'}
             ],
             activeNav:'DetailTable',
-            time:''
+            time:this.$moment().format('YYYY-MM-DD')||''
         }
     },
     methods: {
         handleShowSetTableCol(){
             this.$refs.comIns.handleShowSetTableCol()
+        },
+
+        handleDateChange(){
+            this.$refs.comIns.filterState.dateVal=this.time
+            this.$refs.comIns.handleRefreshList()
         }
     },
 }

+ 0 - 1
src/views/dataSource_manage/utils/config.js

@@ -2,4 +2,3 @@ export const frequencyOpt=['日度','周度','旬度','月度','季度','年度'
 
 export const refreshFrequencyOpt=['每工作日','周一','周二','周三','周四','周五','周六','周日','每月',]
 
-export const dataSourceTypeOpt=['钢联','wind','同花顺','彭博','路透']