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

Merge branch 'ETA1.5.1'

cxmo преди 10 месеца
родител
ревизия
76ba5335ba

+ 135 - 1
src/api/modules/dataApi.js

@@ -385,8 +385,142 @@ const dataAuthInterface = {
 		return http.get('/datamanage/manual/classify/all_list',params)
 	}
 }
+/* 数据刷新设置 */
+const dataRefreshInterface = {
+    /**
+     * 获取数据源列表,Child不为空则显示第二个筛选框
+     * @param {*} params 
+     * @returns 
+     */
+    getDataSourceList:params=>{
+        return http.get("/datamanage/edb_info/refresh/source_list",params)
+    },
+    /**
+     * 获取数据源刷新的默认设置
+     * @param {Object} params 
+     * @param {Number} params.Source
+     * @param {Number} params.SubSource
+     * @param {String} params.Frequency
+     * @returns 
+     */
+    getDefaultConfig:params=>{
+        return http.get("/datamanage/edb_info/refresh/default_config",params)
+    },
+    /**
+     * 获取终端列表
+     * @param {Object} params 
+     * @param {Number} params.Source
+     * @returns 
+     */
+    getTerminalList:params=>{
+        return http.get("/data_stat/terminal/code",params)
+    },
+    /**
+     * 获取分类列表
+     * @param {Object} params 
+     * @param {Number} params.Source 
+     * @returns 
+     */
+    getClassifyList:params=>{
+        return http.get("/datamanage/edb_info/refresh/classify_list",params)
+    },
+    /**
+     * 获取筛选后的指标列表
+     * @param {Object} params 
+     * @param {Number} params.Source 
+     * @param {Number} params.SubSource
+     * @param {Number} params.ClassifyId
+     * @param {String} params.TerminalCode
+     * @param {Number} params.SysUserId
+     * @param {String} params.Frequency
+     * @param {String} params.Keyword
+     * @param {String} params.Status
+     * @param {String} params.SortParam 排序字段:end_date(最新日期)
+     * @param {String} params.SortType 排序类型,正序:asc;逆序:desc
+     * @param {Number} params.PageSize
+     * @param {Number} params.CurrentIndex
+     * @returns 
+     */
+    getEdbTableList:params=>{
+        return http.get("/datamanage/edb_info/refresh/edb_list",params)
+    },
+    /**
+     * 单独设置指标刷新时间
+     * @param {Object} params 
+     * @param {Number} params.Source
+     * @param {Number} params.SubSource
+     * @param {String} params.ClassifyId 筛选项 多选
+     * @param {String} params.TerminalCode 筛选项
+     * @param {String} params.SysUserId 筛选项 多选
+     * @param {String} params.Frequency 筛选项 多选
+     * @param {String} params.Keyword 筛选项
+     * @param {String} params.Status 筛选项
+     * @param {Boolean} params.IsSelectAll
+     * @param {Object[]} params.EdbSelectIdList
+     * @param {Object[]} params.List
+     * @param {String} params.List[].RefreshFrequency
+     * @param {Number} params.List[].RefreshFrequencyDay
+     * @param {String} params.List[].RefreshTime
+     * @param {Number} params.List[].RefreshAllData
+     * @param {Number} params.List[].RefreshDataNum
+     * @returns 
+     */
+    setRefreshTime(params){
+        return http.post("/datamanage/edb_info/refresh/config/save",params)
+    },
+    /**
+     * 设置默认的指标刷新时间
+     * @param {Object} params 
+     * @param {Number} params.Source
+     * @param {Number} params.SubSource
+     * @param {String} params.Frequency 
+     * @param {Object[]} params.List
+     * @param {String} params.List[].RefreshFrequency
+     * @param {Number} params.List[].RefreshFrequencyDay
+     * @param {String} params.List[].RefreshTime
+     * @param {Number} params.List[].RefreshAllData
+     * @param {Number} params.List[].RefreshDataNum
+     * @returns 
+     */
+    setDefaultTime(params){
+        return http.post("/datamanage/edb_info/refresh/default_config/save",params)
+    },
+    /**
+     * 设置指标刷新状态
+     * @param {Object} params 
+     * @param {Number} params.Source
+     * @param {Number} params.SubSource
+     * @param {String} params.ClassifyId 筛选项 多选
+     * @param {String} params.TerminalCode 筛选项
+     * @param {String} params.SysUserId 筛选项 多选
+     * @param {String} params.Frequency 筛选项 多选
+     * @param {String} params.Keyword 筛选项
+     * @param {String} params.Status 筛选项
+     * @param {Boolean} params.IsSelectAll
+     * @param {Object[]} params.EdbSelectIdList
+     * @param {String} params.ModifyStatus 需要更改的状态,枚举值:启用、暂停
+     * @returns 
+     */
+    setRefreshStatus(params){
+        return http.post("/datamanage/edb_info/refresh/status/save",params)
+    },
+    /**
+     * 获取单个指标的刷新配置
+     * @param {Object} params 
+     * @param {Number} params.EdbInfoId
+     * @param {Number} params.Source
+     * @param {Number} params.SubSource
+     * @returns 
+     */
+    getSimgleEdbRefreshTime(params){
+        return http.get("/datamanage/edb_info/refresh/edb_config",params)
+    },
+
+
+}
 
 export {
 	dataInterence,
-	dataAuthInterface
+	dataAuthInterface,
+    dataRefreshInterface
 }

+ 6 - 0
src/routes/modules/oldRoutes.js

@@ -366,6 +366,12 @@ export default [
         name: "数据源终端管理",
         hidden: true,
       },
+      {
+        path: "dataRefreshSetting",
+        component: () => import("@/views/system_manage/dataRefreshSetting.vue"),
+        name: "数据刷新设置",
+        hidden: true,
+      },
     ],
   },
   // 外部链接

+ 5 - 1
src/utils/buttonConfig.js

@@ -598,7 +598,11 @@ export const sysDepartPermission = {
     sysRole_addRole:'sysRole:addRole',//添加角色
     /*-----------英文权限配置-------- */
     enAuthManage_del:'enAuthManage:del',
-    enAuthManage_settingAuth:'enAuthManage:settingAuth'
+    enAuthManage_settingAuth:'enAuthManage:settingAuth',
+    /*-----------数据刷新设置-------- */
+    refresh_default:'refresh:default', //默认刷新时间 
+    refresh_time:'refresh:time', //设置刷新时间
+    refresh_state:'refresh:state', //设置刷新状态
 }
 /*-----------数据操作权限-------- */
 export const operateAuthPermission = {

+ 2 - 1
src/views/dataEntry_manage/databaseComponents/edbDetailData.vue

@@ -35,7 +35,8 @@
 					<span>{{ item.label }}</span>
 				</template>
 				<template slot-scope="scope">
-					<span>{{ scope.row[item.key] }}</span>
+					<span v-if="item.key==='NoUpdate'">{{scope.row[item.key]?'暂停':'启用'}}</span>
+					<span v-else>{{ scope.row[item.key] }}</span>
 				</template>
 			</el-table-column>
 			<div slot="empty" style="padding: 50px 0 320px;">

+ 14 - 0
src/views/dataEntry_manage/databaseList.vue

@@ -644,6 +644,11 @@ export default {
 					key: 'ModifyTime',
 					minwidthsty: '120px',
 				},
+				{
+					label:'刷新状态',
+					key:'NoUpdate',
+					widthsty:'100px'
+				},
 				{
 					label: '添加人',
 					key: 'SysUserRealName',
@@ -1324,6 +1329,11 @@ export default {
 		},
 		/* 刷新获取指标最新数据 */
 		refreshTargetHandle: _.debounce(function() {
+			//如果该指标为暂停刷新,则提示
+			if(this.EdbData.NoUpdate){
+				this.$message.warning("该指标已暂停刷新")
+				return
+			}
 			if(this.selected_edbid) {
 				this.loading = this.$loading({
 					lock: true,
@@ -1765,6 +1775,10 @@ export default {
 
 		/* 基础指标刷新 */
 		refreshBaseHandler() {
+			if(this.EdbData.NoUpdate){
+				this.$message.warning("该指标已暂停刷新")
+				return 
+			}
 			this.refreshLoading = true;
 			this.loading = this.$loading({
 					lock: true,

+ 7 - 1
src/views/edbHistoryPage.vue

@@ -29,7 +29,10 @@ export default {
         renderContent(h, data) {
             return (
                 <el-tooltip content={data.RuleTitle} placement='top' popper-class='node-tooltip'>
-                    <span class='node'>{data.EdbName}</span>
+                    {
+                        data.IsStop?<span class='node stop'>{data.EdbName+'(暂停更新)'}</span>
+                        :<span class='node'>{data.EdbName}</span>
+                    }
                 </el-tooltip>
             )
         },
@@ -110,6 +113,9 @@ export default {
                 }
             }
         }
+        .stop{
+            color:red;
+        }
     }
     .org-tree-node-children {
         .org-tree-node ~ .org-tree-node{

+ 259 - 0
src/views/system_manage/components/refreshConfig.vue

@@ -0,0 +1,259 @@
+<template>
+    <!-- 刷新配置 + 添加删除-->
+    <div class="refresh-config-wrap">
+        <!-- form -->
+        <el-form :model="dynamicForm" ref="dynamicForm" label-width="110px" class="dynamic-form">
+            <div class="group" v-for="(item,index) in dynamicForm.configList" :key="item.key">
+                <div class="delete btn-box" @click="deleteSetting(index)"
+                    v-if="index!==0"><i class="el-icon-delete"></i>删除</div>
+                <el-form-item label="刷新频率" class="item">
+                    <el-form-item :prop="`configList[${index}].frequency`" :rules="{required:true,message:'请选择刷新频率',trigger: 'blur'}">
+                        <el-select v-model="item.frequency">
+                            <el-option v-for="i in frequencyType" :key="i.key" 
+                                :label="i.label" :value="i.key"/>
+                        </el-select>
+                    </el-form-item>
+                    
+                    <!-- 每周 -->
+                    <el-form-item :prop="`configList[${index}].frequency_week`" v-if="item.frequency.includes('周')" :rules="{required:true,message:'请选择刷新频率',trigger: 'blur'}">
+                        <el-select v-model="item.frequency_week" class="full-input" key="week">
+                            <el-option v-for="i in weekList" :key="i.key" 
+                                :label="i.label" :value="i.key"/>
+                        </el-select>
+                    </el-form-item>
+                    
+                    <!-- 每旬、月、季、半年、年 -->
+                    <el-form-item :prop="`configList[${index}].frequency_last`" v-if="!item.frequency.includes('日')&&!item.frequency.includes('周')"
+                        :rules="{required:true,message:'请选择刷新频率',trigger: 'blur'}">
+                        <el-select v-model="item.frequency_last" :key="item.key" key="option">
+                            <el-option v-for="i in timeOptionList" :key="i.key" 
+                                :label="i.label" :value="i.key"/>
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item :prop="`configList[${index}].frequency_n`" v-if="item.frequency_last==='n'&&!item.frequency.includes('日')&&!item.frequency.includes('周')"
+                        :rules="{required:true,message:'请选择刷新频率',trigger: 'blur'}">
+                        <el-input v-model="item.frequency_n" type="number" :min="1" :max="n_limit_map[item.frequency]||10">
+                            <template slot="prefix">N=</template>
+                        </el-input>
+                    </el-form-item>
+                </el-form-item>
+                <el-form-item class="item" label="时间">
+                    <el-form-item :prop="`configList[${index}].time`" :rules="{required:true,message:'请选择刷新时间',trigger: 'blur'}">
+                        <el-select v-model="item.time" class="full-input" key="single">
+                            <el-option v-for="i in timeList" :key="i" 
+                                :label="i" :value="i"/>
+                        </el-select>
+                    </el-form-item>
+                </el-form-item>
+                <el-form-item v-if="Source!==11"
+                    :prop="`configList[${index}].num`" label="刷新单元格数" class="item" :rules="{required:true,message:'请输入刷新单元格数',trigger: 'blur'}">
+                    <el-input v-model="item.num" type="number"></el-input>
+                    <el-checkbox v-model="item.isAll">全部刷新</el-checkbox>
+                </el-form-item>
+                <div class="line"></div>
+                <div class="add btn-box" @click="addSetting"
+                    v-if="index===dynamicForm.configList.length-1&&index<maxSetting-1">
+                    <i class="el-icon-circle-plus-outline"></i>添加刷新时间</div>
+            </div>
+        </el-form>
+    </div>
+</template>
+
+<script>
+const config = {
+    frequency:'',//刷新频率:
+    frequency_week:'',//频率为每周时,选择
+    frequency_last:'',//第N天或最后一天
+    frequency_n:1,
+    time:'',//时间
+    num:7,//刷新单元格数
+    isAll:false,//全部刷新
+}
+export default {
+    props:{
+        Source:{
+            type:Number,
+        },
+        defaultForm:{
+            type:Object
+        }
+    },
+    data() {
+        return {
+            maxSetting:5,//可设置的刷新时间数量
+            dynamicForm:{
+                configList:[{
+                        ...config,
+                        key:0
+                    }
+                ]
+            },
+            frequencyType:[
+                {label:'每自然日',key:'每自然日'},
+                {label:'每交易日',key:'每交易日'},
+                {label:'每周',key:'每周'},
+                {label:'每旬',key:'每旬'},
+                {label:'每月',key:'每月'},
+                {label:'每季',key:'每季'},
+                {label:'每半年',key:'每半年'},
+                {label:'每年',key:'每年'},
+            ],
+            //每周,可多选
+            weekList:[
+                {key:1,label:'周一'},
+                {key:2,label:'周二'},
+                {key:3,label:'周三'},
+                {key:4,label:'周四'},
+                {key:5,label:'周五'},
+                {key:6,label:'周六'},
+                {key:7,label:'周日'}
+            ],
+            //每旬、月、季、半年、年
+            timeOptionList:[
+                {label:'第N天',key:'n'},
+                {label:'最后一天',key:'last'}
+            ],
+            //时间选项,仅整点
+            timeList:[
+                '00:00','00:30','01:00','01:30','02:00','02:30','03:00','03:30',
+                '04:00','04:30','05:00','05:30','06:00','06:30','07:00','07:30',
+                '08:00','08:30','09:00','09:30','10:00','10:30','11:00','11:30',
+                '12:00','12:30','13:00','13:30','14:00','14:30','15:00','15:30',
+                '16:00','16:30','17:00','17:30','18:00','18:30','19:00','19:30',
+                '20:00','20:30','21:00','21:30','22:00','22:30','23:00','23:30'
+            ],
+            //N 范围 1-~
+            n_limit_map:{
+                '每旬':11,
+                '每月':31,
+                '每季':92,
+                '每半年':184,
+                '每年':365
+            },
+        };
+    },
+    watch:{
+        defaultForm:{
+            handler(newVal){
+                this.dynamicForm = this.formatForm(newVal)
+            },
+            deep:true
+        }
+    },
+    methods: {
+        addSetting(){
+            this.dynamicForm.configList.push({
+                ...config,
+                key:Date.now()
+            })
+        },
+        deleteSetting(index){
+            this.dynamicForm.configList.splice(index,1)
+        },
+        //将接口数据转换成form支持的格式
+        formatForm(form){
+            const {configList=[]} = form
+            if(!configList.length){
+                return {
+                    configList:[{
+                        ...config,
+                        key:0
+                    }]
+                }
+            }
+            const formatList = configList.map((item)=>{
+                let isOther = false
+                if(!item.RefreshFrequency.includes("周")&&!item.RefreshFrequency.includes("日")){
+                    isOther = true
+                }
+                return {
+                    frequency:item.RefreshFrequency,
+                    frequency_week:item.RefreshFrequency.includes("周")?item.RefreshFrequencyDay:'',
+                    frequency_last:isOther?(item.RefreshFrequencyDay===0?'last':'n'):'',
+                    frequency_n:item.RefreshFrequencyDay,
+                    time:item.RefreshTime,
+                    num:item.RefreshDataNum,
+                    isAll:Boolean(item.RefreshAllData)
+                }
+            })
+            return {
+                configList:formatList
+            }
+        },
+        //将数据转换成接口形式
+        getFormList(){
+            const list = this.dynamicForm.configList.map((item)=>{
+                //RefreshFrequencyDay: 每自然日、每交易日传0;每周传1~7;其他传n,最后一天n=0
+                let FrequencyDay = 0
+                if(item.frequency.includes("日")){
+                    FrequencyDay = 0
+                }else if(item.frequency.includes("周")){
+                    FrequencyDay = item.frequency_week
+                }else{
+                    FrequencyDay = item.frequency_last==='last'?0:item.frequency_n
+                }
+                return {
+                    RefreshFrequency:item.frequency,
+                    RefreshFrequencyDay:Number(FrequencyDay),
+                    RefreshTime:item.time,
+                    RefreshAllData:Number(item.isAll),
+                    RefreshDataNum:Number(item.num),
+                }
+            })
+            return list
+        }
+    },
+};
+</script>
+
+<style lang="scss">
+.refresh-config-wrap{
+        .dynamic-form{
+            .group{
+                position:relative;
+                padding: 30px 0 8px 0;
+                /* border-bottom: 1px solid #EBEFF6; */
+                &:first-child{
+                    padding-top: 0;
+                }
+                .line{
+                    height:1px;
+                    background-color: #EBEFF6;
+                }
+                .btn-box{
+                    cursor: pointer;
+                    i{
+                        margin-right: 8px;
+                        font-size: 16px;
+                    }
+                    &.add{
+                        display:inline-block;
+                        margin-top: 20px;
+                        color:#0052D9;
+                    }
+                    &.delete{
+                        position: absolute;
+                        right:10px;
+                        top:10px;
+                        color:#AD352F;
+                    }
+                }
+                .item{
+                    .el-input{
+                        width:110px;
+                    }
+                    .full-input{
+                        width: 100%;
+                        .el-input{
+                            width:100%;
+                        }
+                    }
+                    >.el-form-item__content{
+                        display: flex;
+                        gap:10px;
+                    }
+                }
+            }
+        }
+}
+</style>

+ 732 - 0
src/views/system_manage/dataRefreshSetting.vue

@@ -0,0 +1,732 @@
+<template>
+    <!-- 数据源刷新设置 -->
+    <div class="data-refresh-setting-wrap">
+        <div class="top-box">
+            <div class="select-box">
+                <span>选择数据源</span>
+                <el-select placeholder="请选择数据源" v-model="Source" @change="handleSourceChange">
+                    <el-option v-for="item in SourceList" :key="item.Source" 
+                    :label="item.SourceName" :value="item.Source"/>
+                </el-select>
+                <el-select placeholder="请选择数据源" v-model="SubSource" v-if="SubSourceList.length" @change="handleSubSourceChange">
+                    <el-option v-for="item in SubSourceList" :key="item.Source" 
+                    :label="item.SubSourceName" :value="item.SubSource"/>
+                </el-select>
+                <el-button type="primary" @click="showDialog(true)"
+                    v-permission="permissionBtn.sysDepartPermission.refresh_default"
+                >默认刷新时间</el-button>
+            </div>
+            
+            <el-input placeholder="指标ID/指标名称" prefix-icon="el-icon-search" clearable
+                v-model="selectOption.keyWord" @input="selectOptionChange('keyWord')"
+                v-if="![34,11].includes(Source)&&Source"></el-input>
+            
+        </div>
+        <div class="table-box" v-if="hasSelectOption">
+            <div class="table-select" v-loading="selectOptionLoading">
+                <div class="select-list">
+                    <el-select placeholder="终端编码" no-match-text="请选择完整数据源" clearable
+                        v-model="selectOption.terminalCode" @change="selectOptionChange('terminalCode')">
+                        <el-option v-for="i in terminalCodeList" :key="i.TerminalCode"
+                            :label="i.Name" :value="i.TerminalCode"/>
+                    </el-select>
+                    <el-cascader placeholder="ETA指标库分类" no-match-text="请选择完整数据源" clearable
+                        v-model="selectOption.classify" @change="selectOptionChange('classify')"
+                        :options="edbClassifyList" 
+                        :show-all-levels="false"
+                        collapse-tags
+                        :props="{
+                            emitPath:true,
+                            value:'ClassifyId',
+                            label:'ClassifyName',
+                            children:'Children',
+                            multiple:true
+                        }" />
+                    <el-cascader
+                        placeholder="创建人" no-match-text="请选择完整数据源" style="height: 40px;"
+                        v-model="selectOption.user" @change="selectOptionChange('user')"
+                        :options="userList"
+                        :props="{
+                            value: 'ItemId',
+                            label: 'ItemName',
+                            children: 'Children',
+                            emitPath: false,
+                            multiple:true,
+                        }"
+                        collapse-tags
+                        :show-all-levels="false"
+                        clearable
+                        filterable 
+                    />
+                    <el-select placeholder="频度" v-model="selectOption.frequency" @change="selectOptionChange('frequency')" multiple collapse-tags clearable>
+                        <el-option v-for="i in frequencyList" :key="i"
+                            :label="i" :value="i"
+                        />
+                    </el-select>
+                    <el-select placeholder="刷新状态" v-model="selectOption.state" @change="selectOptionChange('state')" clearable>
+                        <el-option label="启用刷新" value="启用"/>
+                        <el-option label="暂停刷新" value="暂停"/>
+                    </el-select>
+                </div>
+                <div class="select-other">
+                    <el-checkbox :indeterminate="isIndeterminate" v-model="isCheckAll" @change="listCheckAllChange">列表全选</el-checkbox>
+                    <el-button type="primary" @click="showDialog(false)"
+                        v-permission="permissionBtn.sysDepartPermission.refresh_time"
+                        :disabled="!tableData.length"
+                    >设置刷新时间</el-button>
+                    <el-button type="primary" @click="isSetStateDialogShow=true"
+                        v-permission="permissionBtn.sysDepartPermission.refresh_state"
+                        :disabled="!tableData.length"
+                    >设置刷新状态</el-button>
+                </div>
+            </div>
+            <el-table :data="tableData" border
+                ref="edbDataRef"
+                @selection-change="selectionChange"
+                @select="selectHandle" 
+                @select-all="selectAllHandle"
+                @sort-change="handleSortChange"
+                >
+                <!-- 多选 -->
+                <el-table-column
+                    align="center"
+                    type="selection"
+                    width="55">
+                </el-table-column>
+                <el-table-column v-for="column in columns" :key="column.key"
+                    :prop="column.key"
+                    :label="column.label"
+                    :min-width="column.minWidth"
+                    :sortable="column.sortable?column.sortable:false"
+                    align="center"
+                    >
+                    <template slot-scope="{row}">
+                        <span v-if="column.key==='IsStop'">
+                            {{row.IsStop?'暂停刷新':'启用刷新'}}
+                        </span>
+                        <span v-else>
+                            {{row[column.key]}}
+                        </span>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <el-pagination 
+                :current-page="currentPage"
+                :page-size="pageSize"
+                :total="total"
+                @current-change="handleCurrentChange"
+            />
+        </div>
+        <!-- 默认刷新时间,设置刷新时间 -->
+        <el-dialog custom-class="refresh-setting-dialog"
+            :title="(isDefault?'默认':'设置')+'刷新时间'"
+            :visible.sync="isSetTimeDialogShow"
+            :close-on-click-modal="false"
+            :modal-append-to-body="false"
+            @close="isSetTimeDialogShow=false"
+            width="578px"
+            top="5vh"
+            v-dialogDrag
+            center
+        >
+            <div class="dialog-container" v-loading="defaultDialogLoading">
+                <!-- 默认刷新时间设置数据频度 -->
+                <div class="default-box" v-if="isDefault&&Source!==11">
+                    <label style="display: block;width:88px;text-align:right;padding-right: 12px;">数据频度</label>
+                    <el-select style="margin-left: 10px;" v-model="defaultFrequency" @change="handleDefaultChange">
+                        <el-option v-for="i in frequencyList" :key="i"
+                            :label="i" :value="i"
+                        />
+                    </el-select>
+                </div>
+                <!-- 刷新配置 -->
+                <div class="refresh-box">
+                    <RefreshConfig
+                        ref="refreshconfig"
+                        :Source="Source"
+                        :defaultForm="defaultForm"
+                    ></RefreshConfig>
+                </div>
+                
+            </div>
+            <!-- 弹窗按钮 -->
+            <div class="dialog-btn">
+                <el-button type="primary" plain @click="isSetTimeDialogShow=false">取消</el-button>
+                <el-button type="primary" @click="handleSetRefreshTime">确定</el-button>
+            </div>
+        </el-dialog>
+        <!-- 设置刷新状态 -->
+        <el-dialog custom-class="refresh-setting-dialog"
+            title="设置刷新状态"
+            :visible.sync="isSetStateDialogShow"
+            :close-on-click-modal="false"
+            :modal-append-to-body="false"
+            @close="isSetStateDialogShow=false"
+            width="578px"
+            top="5vh"
+            v-dialogDrag
+            center
+        >
+            <div class="dialog-container" style="text-align: center;margin:60px 0;">
+                <el-radio label="暂停" v-model="isState">暂停刷新</el-radio>
+                <el-radio label="启用" v-model="isState">启用刷新</el-radio>
+            </div>
+            <!-- 弹窗按钮 -->
+            <div class="dialog-btn">
+                <el-button type="primary" plain @click="isSetStateDialogShow=false">取消</el-button>
+                <el-button type="primary" @click="setRefreshStatus">确定</el-button>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import RefreshConfig from './components/refreshConfig.vue';
+import {dataRefreshInterface,dataAuthInterface} from '@/api/modules/dataApi.js';
+export default {
+    components: { RefreshConfig },
+    data() {
+        return {
+            Source:'',
+            SourceList:[],
+            SubSource:'',
+            SubSourceList:[],
+
+            frequencyList:['日度','周度','旬度','月度','季度','半年度','年度'],
+            terminalCodeList:[],
+            edbClassifyList:[],
+            userList:[],
+
+            selectOption:{
+                frequency:'',//频度
+                user:'',//创建人
+                classify:'',//分类
+                state:'',//状态
+                terminalCode:'',//终端编码
+                keyWord:'',//关键字
+                sortType:'',//升序降序
+                sortParam:'',//排序字段
+            },
+            hasSelectOption:false,
+            selectOptionLoading:false,
+
+            columns: [
+                {key: 'IndexCode',label: '指标编码'},
+                {key: 'IndexName',label: '指标全称',minWidth:150},
+                {key: 'EndDate',label: '最新日期',sortable:'custom'},
+                {key: 'EndValue',label: '最新值'},
+                {key: 'SysUserRealName',label: '创建人'}, 
+                {key: 'Frequency',label: '频度'},
+                {key: 'RefreshTime',label: '刷新时间',minWidth:150},
+                {key: 'IsStop',label: '刷新状态'}
+            ],
+            tableData: [],
+            tableDataIds:[],
+            pageSize:10,
+            currentPage:1,
+            total:0,
+
+            isSetTimeDialogShow: false,//设置刷新时间弹窗
+            defaultDialogLoading:false,//可能需要获取默认设置,增加loading
+            isDefault:false,//是否是默认刷新时间
+            defaultForm:{},//默认刷新时间的配置
+            defaultFrequency:'日度',//默认刷新时间的频率
+
+            isSetStateDialogShow:false,//设置刷新状态弹窗
+            isState:'启用',//启用刷新or暂停刷新
+            //全部全选
+            isIndeterminate:false,
+            isCheckAll:false,
+            isSelectAll:false,//为true时,selectList是剔除的指标,为false时selectList是已选择的指标
+            //已选择/已剔除的指标id
+            selectList:[],//监听table的select-all select
+            selectionReactCancel:false,
+        };
+    },
+    methods: {
+        //展示刷新时间弹窗
+        showDialog(isDefault){
+            this.isDefault = isDefault
+            this.isSetTimeDialogShow = true
+            if(isDefault){
+                //判断数据源是否选择
+                if(!this.Source){
+                    this.$message.warning("请选择数据源")
+                    return
+                }
+                /* if(this.SubSourceList.length&&!this.SubSource){
+                    this.$message.warning("请选择完整数据源")
+                    return
+                } */
+                //SMM不带频度
+                if(this.Source===11){
+                    this.defaultFrequency=''
+                }else{
+                    this.defaultFrequency = '日度'
+                }
+                this.handleDefaultChange()
+            }else{
+                //单独设置指标,需判断指标是否为单个
+                if((this.total===1&&!this.selectList.length)||(!this.isSelectAll&&this.selectList.length===1)){
+                    //单个则回显刷新时间
+                    this.getEdbRefreshDetail()
+                }else{
+                    this.defaultForm={}
+                }
+                
+            }
+        },
+        //获取对应频度下的默认刷新时间
+        handleDefaultChange(){
+            this.defaultDialogLoading = true
+            dataRefreshInterface.getDefaultConfig({
+                Frequency:this.defaultFrequency,
+                Source:Number(this.Source),
+                SubSource:Number(this.SubSource)
+            }).then(res=>{
+                this.defaultDialogLoading = false
+                if(res.Ret!==200) return 
+                let configList = res.Data||[]
+                configList = configList.map((item,index)=>{
+                    return {
+                        ...item,
+                        key:index
+                    }
+                })
+                this.defaultForm = {
+                    configList
+                }
+            })
+        },
+        //获取单个指标的刷新时间
+        getEdbRefreshDetail(){
+            this.defaultDialogLoading = true
+            let EdbInfoId = 0
+            if(this.total===1){
+                EdbInfoId = this.tableData[0].EdbInfoId
+            }else{
+                EdbInfoId = this.selectList[0]
+            }
+            dataRefreshInterface.getSimgleEdbRefreshTime({
+                EdbInfoId,
+                Source:Number(this.Source),
+                SubSource:Number(this.SubSource)
+            }).then(res=>{
+                this.defaultDialogLoading = false
+                if(res.Ret!==200) return 
+                let configList = res.Data||[]
+                configList = configList.map((item,index)=>{
+                    return {
+                        ...item,
+                        key:index
+                    }
+                })
+                this.defaultForm = {
+                    configList
+                }
+            })
+        },
+        //获取数据源列表
+        getSourceList(){
+            dataRefreshInterface.getDataSourceList().then(res=>{
+                if(res.Ret!==200) return 
+                this.SourceList = res.Data||[]
+            })
+        },
+        //一级数据源改变时,二级数据源和筛选项也重新赋值
+        handleSourceChange(){
+            const source = this.SourceList.find(i=>i.Source===this.Source)||{Child:[]}
+            this.SubSourceList = source.Child
+            this.SubSource=''
+            this.hasSelectOption = ![34,11].includes(this.Source)
+            if(this.hasSelectOption){
+                this.resetSelect()
+                this.tableData = []
+            }
+            //如果没有二级数据源,则请求表格筛选项数据;钢联化工,SMM没有筛选项数据
+            if(!this.SubSourceList.length&&this.hasSelectOption){
+                this.getSelectOption()
+                this.selectOptionChange()
+            }
+            //如果有二级数据源,默认选中第一个
+            if(this.SubSourceList.length){
+                this.SubSource = this.SubSourceList[0].SubSource
+                this.handleSubSourceChange()
+            }
+        },
+        handleSubSourceChange(){
+            this.getSelectOption()
+            this.selectOptionChange()
+        },
+        //获取终端编码列表
+        async getTerminalCodeList(){
+            if(!this.Source) return 
+            const res = await dataRefreshInterface.getTerminalList({
+                Source:Number(this.Source)
+            })
+            if(res.Ret!==200) return 
+            this.terminalCodeList = res.Data?res.Data.List||[]:[]
+        },
+        //获取分类列表
+        async getClassifyList(){
+            if(!this.Source) return 
+            const res = await dataRefreshInterface.getClassifyList({
+                Source:Number(this.Source)
+            })
+            if(res.Ret!==200) return 
+            this.edbClassifyList = res.Data||[]
+        },
+        //获取用户列表
+        getUserList() {
+            dataAuthInterface.userSearch({
+                KeyWord: ''
+            }).then(res => {
+                if(res.Ret !== 200) return 
+                this.userList = res.Data||[]
+            })
+        },
+        async getSelectOption(){
+            this.selectOptionLoading = true
+            //获取终端编码列表
+            await this.getClassifyList()
+            //获取分类列表
+            await this.getTerminalCodeList()
+            this.selectOptionLoading = false
+        },
+        //切换数据源时重置表格选项
+        resetSelect(){
+            this.terminalCodeList=[]
+            this.edbClassifyList = []
+            this.selectOption = {
+                frequency:'',
+                user:'',
+                classify:'',
+                state:'',
+                terminalCode:''
+            }
+            this.selectList=[]
+        },
+        //表格筛选项改变时触发
+        selectOptionChange(type){
+            this.currentPage = 1
+            this.getTableData('optionChange')
+        },
+        handleCurrentChange(page){
+            this.currentPage = page
+            this.getTableData()
+        },
+        async getTableData(type){
+            const {frequency,user,classify,state,terminalCode,keyWord,sortParam,sortType} = this.selectOption
+            const classifyArr = Array.isArray(classify)?classify:[]
+            const classifyId = [...new Set(classifyArr.join(',').split(','))]
+            const res = await dataRefreshInterface.getEdbTableList({
+                Source:Number(this.Source),
+                SubSource:Number(this.SubSource),
+                ClassifyId:classifyId.join(','),
+                TerminalCode:terminalCode,
+                SysUserId:Array.isArray(user)?user.join(','):user,
+                Frequency:Array.isArray(frequency)?frequency.join(','):frequency,
+                Keyword:keyWord,
+                Status:state,
+                SortParam:sortParam,
+                SortType:sortType,
+                PageSize:Number(this.pageSize),
+                CurrentIndex:Number(this.currentPage)
+            })
+            if(res.Ret!==200) return 
+            const {Paging,List} = res.Data||{}
+            this.tableData = List||[]
+            this.total = Paging.Totals||0
+            if(this.tableData.length>0){
+              this.tableDataIds = this.tableData.map(it => it.EdbInfoId)
+            }else{
+              this.tableDataIds = []
+            }
+            if(type==='optionChange'){
+                //如果是表格筛选项改变导致重新请求数据
+                //数据获取完成后,列表全选,表格全选
+                this.selectList = []
+                this.listCheckAllChange(true)
+            }else{
+                //若不是,数据获取完成后,查询列表全选的值
+                //若当页有数据在selectList内,则勾选/剔除
+                this.adjustSelection()
+            }
+        },
+        //勾选/取消勾选表格项
+        adjustSelection(){
+            this.selectionReactCancel=true
+            if(!this.isSelectAll){
+                this.selectList.map(it =>{
+                    let row = this.tableData.find(da => da.EdbInfoId==it)
+                    if(row){
+                        setTimeout(()=>{
+                            this.$refs.edbDataRef.toggleRowSelection(row,true)
+                        },10)
+                    }
+                })
+            }else{
+                this.$refs.edbDataRef && this.$refs.edbDataRef.clearSelection()
+                this.$refs.edbDataRef &&this.$refs.edbDataRef.toggleAllSelection()
+                this.selectList.map(it =>{
+                    let row = this.tableData.find(da => da.EdbInfoId==it)
+                    if(row){
+                        setTimeout(()=>{
+                            this.$refs.edbDataRef.toggleRowSelection(row,false)
+                        },50)
+                    }
+                })
+            }
+            setTimeout(()=>{
+                this.selectionReactCancel=false
+            },50)
+        },
+        //列表全选改变
+        listCheckAllChange(value){
+            this.selectList = []
+            this.isSelectAll = value
+            this.$refs.edbDataRef && this.$refs.edbDataRef.clearSelection()
+            if(value){
+                this.$refs.edbDataRef && this.$refs.edbDataRef.toggleAllSelection()
+            }
+        },
+        selectionChange(selection){
+            if(this.selectionReactCancel) return 
+            // selectAllHandle的触发在selectionChange后面,将selectionChange的逻辑延迟一下
+            setTimeout(()=>{
+                // 去重
+                let duplicateArr = Array.from(new Set(this.selectList))
+                //isSelectAll为true时,selectList表示需要剔除的项
+                //isSelectAll为false时,selectList表示需要勾选的项
+                //全选
+                if((duplicateArr.length == this.total && (!this.isSelectAll))|| (duplicateArr.length == 0 && this.isSelectAll)){
+                    this.isCheckAll = true
+                    this.isIndeterminate=false
+                //全不选
+                }else if((duplicateArr.length == 0 && (!this.isSelectAll))|| (duplicateArr.length == this.total && this.isSelectAll)){
+                    this.isCheckAll = false
+                    this.isIndeterminate=false
+                //半选
+                }else{
+                    this.isCheckAll = false
+                    this.isIndeterminate=true
+                }
+            },1)
+        },
+        selectHandle(selection,row){
+            if(this.selectionReactCancel) return 
+            let check = false; 
+            if(selection.some(it => it.EdbInfoId == row.EdbInfoId)){
+                // 勾选
+                if(this.isSelectAll){
+                    check=false
+                }else{
+                    check=true
+                }
+            }else{
+                // 取消勾选
+                if(this.isSelectAll){
+                    check=true
+                }else{
+                    check=false
+                }
+            }
+            if(check){
+                this.selectList.push(row.EdbInfoId)
+                }else{
+                this.selectList=this.selectList.filter(it => it!=row.EdbInfoId)
+            }
+        },
+        selectAllHandle(selection){
+            if(this.selectionReactCancel) return 
+            let check = false; 
+            if(selection && selection.length>0){
+                // 全选
+                if(this.isSelectAll){
+                    check=false
+                }else{
+                    check=true
+                }
+            }else{
+                // 全不选
+                if(this.isSelectAll){
+                    check=true
+                }else{
+                    check=false
+                }
+            }
+            if(check){
+                this.selectList =  [...this.selectList,...this.tableDataIds]
+            }else{
+                this.selectList = this.selectList.filter(it => !this.tableDataIds.includes(it))
+            }
+        },
+        //设置刷新时间
+        async handleSetRefreshTime(){
+            //校验表格
+            try{
+                await this.$refs.refreshconfig.$refs.dynamicForm.validate()
+            }catch(e){
+                console.log(e)
+                return
+            }
+            //转换数据格式
+            const list = this.$refs.refreshconfig.getFormList()
+            //判断是否是默认时间,走不同接口
+            if(this.isDefault){
+                this.setDefaultTime(list)
+            }else{
+                this.setRefreshTime(list)
+            }
+        },
+        setRefreshTime(list){
+            const {frequency,user,classify,state,terminalCode,keyWord} = this.selectOption
+            const classifyArr = Array.isArray(classify)?classify:[]
+            const classifyId = [...new Set(classifyArr.join(',').split(','))]
+            dataRefreshInterface.setRefreshTime({
+                Source:Number(this.Source),
+                SubSource:Number(this.SubSource),
+                ClassifyId:classifyId.join(','),
+                TerminalCode:terminalCode,
+                SysUserId:Array.isArray(user)?user.join(','):user,
+                Frequency:Array.isArray(frequency)?frequency.join(','):frequency,
+                Keyword:keyWord,
+                Status:state,
+                IsSelectAll:this.isSelectAll,
+                EdbSelectIdList:this.selectList,
+                List:list
+            }).then(res=>{
+                if(res.Ret!==200) return
+                this.$message.success("设置刷新时间成功")
+                this.selectOptionChange()
+                this.isSetTimeDialogShow = false
+            })
+        },
+        setDefaultTime(list){
+            dataRefreshInterface.setDefaultTime({
+                Source:Number(this.Source),
+                SubSource:Number(this.SubSource),
+                Frequency:this.defaultFrequency,
+                List:list
+            }).then(res=>{
+                if(res.Ret!==200) return 
+                this.$message.success("设置默认刷新时间成功")
+                this.isSetTimeDialogShow = false
+            })
+        },
+        setRefreshStatus(){
+            const {frequency,user,classify,state,terminalCode,keyWord} = this.selectOption
+            const classifyArr = Array.isArray(classify)?classify:[]
+            const classifyId = [...new Set(classifyArr.join(',').split(','))]
+            dataRefreshInterface.setRefreshStatus({
+                Source:Number(this.Source),
+                SubSource:Number(this.SubSource),
+                ClassifyId:classifyId.join(','),
+                TerminalCode:terminalCode,
+                SysUserId:Array.isArray(user)?user.join(','):user,
+                Frequency:Array.isArray(frequency)?frequency.join(','):frequency,
+                Keyword:keyWord,
+                Status:state,
+                IsSelectAll:this.isSelectAll,
+                EdbSelectIdList:this.selectList,
+                ModifyStatus:this.isState
+            }).then(res=>{
+                if(res.Ret!==200) return 
+                this.$message.success("设置刷新状态成功")
+                this.selectOptionChange()
+                this.isSetStateDialogShow = false
+            })
+        },
+        handleSortChange({prop,order}){
+            if(order){
+                this.selectOption.sortParam = 'end_date'
+                this.selectOption.sortType = order==='ascending'?'asc':'desc'
+            }else{
+                this.selectOption.sortParam = ''
+                this.selectOption.sortType = ''
+            }
+            this.selectOptionChange()
+        }
+    },
+    mounted(){
+        this.getSourceList()
+        this.getUserList()
+    }
+};
+</script>
+
+<style scoped lang="scss">
+.data-refresh-setting-wrap{
+    min-height: calc(100vh - 120px);
+    display: flex;
+    flex-direction: column;
+    .top-box,.table-box{
+        box-sizing: border-box;
+        padding:20px;
+        background-color: #fff;
+        border:1px solid #C8CDD9;
+        border-radius: 4px;
+    }
+    .top-box{
+        margin-bottom: 20px;
+        display: flex;
+        justify-content: space-between;
+        .el-input{
+            width:260px;
+        }
+        .select-box{
+            .el-select{
+                margin:0 20px;
+            }
+        }
+    }
+    .table-box{
+        flex:1;
+        .el-select{
+            min-width:180px;
+        }
+        .table-select{
+            display: flex;
+            justify-content: space-between;
+            .select-list{
+                flex:1;
+                display: flex;
+                flex-wrap: wrap;
+                gap:20px;
+            }
+            .select-other{
+                .el-button{
+                    margin-left:30px;
+                }
+            }
+        }
+        .el-table{
+            margin:20px 0;
+        }
+        .el-pagination{
+            text-align: right;
+        }
+    }
+    .refresh-setting-dialog{
+        margin-bottom: 0;
+        .dialog-container{
+            overflow: hidden;
+            .default-box{
+                display: flex;
+                align-items: center;
+                padding-bottom: 30px;
+                margin-bottom: 30px;
+                border-bottom: 1px solid #EBEFF6;
+            }
+            .refresh-box{
+                max-height: 65vh;
+                overflow-y: auto;
+            }
+        }
+        .dialog-btn{
+            text-align: center;
+            padding: 25px 0;
+        }
+    }
+}
+</style>