<template>
<div class="logo">
</div>
</template>
<script>
export default {
name: "",
computed: {
},
data(){
return {
getDdsListTimer: null,
getDdsValidateTimer: null
}
},
mounted(){
// this.validateDdsLogin(); //初始化获取session
// this.getDdsListTimer = setInterval(this.getDdsList, 10000); //数据每10秒同步一次
// this.getDdsValidateTimer = setInterval(this.validateDdsLogin, 1800000); //权限身份每半小时秒同步一次
},
beforeDestroy(){
// clearInterval(this.getDdsListTimer);
// clearInterval(this.getDdsValidateTimer);
},
methods: {
async validateDdsLogin(){
await this.$datadiscovery.get("/portal/frame/login/validate-login/manage_report?userID=VTIwMDAwMDA=&userPassword=XWIHJkvKjtkoq92BRot1Bg==").then((res) => {
console.log("dds权限认证成功:" + JSON.stringify(res.data));
},(err) => {
this.$Message.danger("dds权限认证失败" + err);
});
},
async getDdsList(){
console.log("获取dds列表数据定时任务启动。")
let dtwinLbael = 'LABEL84110E3B50E04FD8BAE9B4D280BA93A7'; //dts分类标签
let listParam = "?page=0&rows=100&type=all&labelIds=" + dtwinLbael;
await this.$datadiscovery.get("/report/myreport/manage/query-reps/manage_report" + listParam).then((res) => {
// console.log(JSON.stringify(res.data));
this.getRows = res.data.reportList.rows;
this.insertToTwins();
},(err) => {
this.$Message.danger("获取dds列表数据失败" + err);
});
},
async insertToTwins(){
let paramList = [];
for(let i = 0; i < this.getRows.length; i++){
if(this.getRows[i].delFlag != '0' || this.getRows[i].dataDeletaFlag != '0'){
break;
}
let chart = {};
chart.reportId = this.getRows[i].reportId;
chart.compName = this.getRows[i].reportName;
chart.updateTime = this.getRows[i].adminTime;
chart.comment = this.getRows[i].reportConfig;
chart.imgbyte = this.getRows[i].imgByte;
paramList.push(chart);
}
await this.$confParmJson.post("/component/compInfo/addDtsComponent", JSON.stringify(paramList)).then((res) => {
console.log(res.data.message)
},(err) => {
this.$Message.danger("dds组件入库异常" + err);
});
}
}
};
</script>
前端定时任务
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
相关阅读更多精彩内容
- 1.计划任务基本概述 1.什么是crond crond就是计划任务,类似于我们平时生活中的闹钟。定点执行。 2.为...
- 1.sgid的作用就是让普通用户可以在执行某个设置了sgid位的命令时,拥有和命令对应用户组(一般为root用户组...
- 一、在JAVA开发领域,目前可以通过以下几种方式进行定时任务 1、单机部署模式 Timer:jdk中自带的一个定时...
- 定时任务方案 三种1,spring Scheduled2,Quartz3,Timer定时器 一种Scheduled...