|
@@ -146,6 +146,10 @@
|
|
|
计划任务执行次数
|
|
|
<el-input v-model="currentTaskInfo.planTimes" placeholder="计划任务执行次数"></el-input>
|
|
|
</div>
|
|
|
+ <div class="input">
|
|
|
+ 预估GAS
|
|
|
+ <el-input v-model="currentTaskInfo.estimatedGas" placeholder="预估GAS"></el-input>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
@@ -325,7 +329,7 @@
|
|
|
</div>
|
|
|
<div class="item" v-for="item in currentRecordData.airdropParams">
|
|
|
<div class="title">
|
|
|
- {{item.note}}
|
|
|
+ {{ item.note }}
|
|
|
</div>
|
|
|
<div class="info">
|
|
|
{{ item.value }}
|
|
@@ -338,12 +342,12 @@
|
|
|
正在进行中
|
|
|
</div>
|
|
|
<div class="number">
|
|
|
- 总计交互地址: {{ongoingDataTotal}}
|
|
|
+ 总计交互地址: {{ ongoingDataTotal }}
|
|
|
</div>
|
|
|
</div>
|
|
|
-<!-- <div class="right" style="cursor: pointer" @click="refresh">-->
|
|
|
-<!-- <img src="../../assets/autoplay/Frame.svg" alt="Frame">-->
|
|
|
-<!-- </div>-->
|
|
|
+ <!-- <div class="right" style="cursor: pointer" @click="refresh">-->
|
|
|
+ <!-- <img src="../../assets/autoplay/Frame.svg" alt="Frame">-->
|
|
|
+ <!-- </div>-->
|
|
|
<div class="button" @click="refresh">
|
|
|
<img src="../../assets/autoplay/Frame.svg" alt="Frame">
|
|
|
刷新
|
|
@@ -462,7 +466,7 @@
|
|
|
</div>
|
|
|
<div class="item" v-for="item in currentRecordData.airdropParams">
|
|
|
<div class="title">
|
|
|
- {{item.note}}
|
|
|
+ {{ item.note }}
|
|
|
</div>
|
|
|
<div class="info">
|
|
|
{{ item.value }}
|
|
@@ -475,7 +479,7 @@
|
|
|
已完成
|
|
|
</div>
|
|
|
<div class="number">
|
|
|
- 总计交互地址: {{ongoingDataTotal}}
|
|
|
+ 总计交互地址: {{ ongoingDataTotal }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -531,9 +535,9 @@
|
|
|
<img src="../../assets/autoplay/done_all.svg" alt="done_all">
|
|
|
执行进度已完成
|
|
|
</div>
|
|
|
-<!-- <div class="number">-->
|
|
|
-<!-- {{ currentTaskInfo.executeTimes }}/{{ currentTaskInfo.planTimes }}-->
|
|
|
-<!-- </div>-->
|
|
|
+ <!-- <div class="number">-->
|
|
|
+ <!-- {{ currentTaskInfo.executeTimes }}/{{ currentTaskInfo.planTimes }}-->
|
|
|
+ <!-- </div>-->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -597,7 +601,7 @@
|
|
|
</div>
|
|
|
<div class="item" v-for="item in currentRecordData.airdropParams">
|
|
|
<div class="title">
|
|
|
- {{item.note}}
|
|
|
+ {{ item.note }}
|
|
|
</div>
|
|
|
<div class="info">
|
|
|
{{ item.value }}
|
|
@@ -610,7 +614,7 @@
|
|
|
正在进行中
|
|
|
</div>
|
|
|
<div class="number">
|
|
|
- 总计交互地址: {{ongoingDataTotal}}
|
|
|
+ 总计交互地址: {{ ongoingDataTotal }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="display: flex;align-items: center;gap:32px">
|
|
@@ -786,18 +790,18 @@
|
|
|
<el-input v-model="batchExecutionParams.intervalMax" placeholder="输入最大间隔时间/分"></el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<!-- <div class="item">-->
|
|
|
-<!-- <div class="title">-->
|
|
|
-<!-- 交互金额-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- <el-input v-model="batchExecutionParams.amount" placeholder="输入最大交互金额"></el-input>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- <div class="item">-->
|
|
|
-<!-- <div class="title">-->
|
|
|
-<!-- 最大 Gas fee-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- <el-input v-model="batchExecutionParams.maxGas" placeholder="输入最大 Gas fee"></el-input>-->
|
|
|
-<!-- </div>-->
|
|
|
+ <!-- <div class="item">-->
|
|
|
+ <!-- <div class="title">-->
|
|
|
+ <!-- 交互金额-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- <el-input v-model="batchExecutionParams.amount" placeholder="输入最大交互金额"></el-input>-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- <div class="item">-->
|
|
|
+ <!-- <div class="title">-->
|
|
|
+ <!-- 最大 Gas fee-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!-- <el-input v-model="batchExecutionParams.maxGas" placeholder="输入最大 Gas fee"></el-input>-->
|
|
|
+ <!-- </div>-->
|
|
|
<div class="item" v-for="item in paramsData">
|
|
|
<div class="title">
|
|
|
{{ item.note }}
|
|
@@ -812,7 +816,7 @@
|
|
|
<div class="inputTitle">
|
|
|
钱包密码
|
|
|
</div>
|
|
|
- <el-input type="password" :show-password="true" v-model="batchExecutionParams.password"
|
|
|
+ <el-input type="password" :show-password="true" v-model="password"
|
|
|
placeholder="输入钱包密码"></el-input>
|
|
|
<div class="confirm" @click="batchExecutionTask">
|
|
|
<img src="../../assets/autoplay/check1.svg" alt="check1">
|
|
@@ -897,6 +901,10 @@
|
|
|
计划任务执行次数
|
|
|
<el-input v-model="currentAddTaskInfo.planTimes" placeholder="计划任务执行次数"></el-input>
|
|
|
</div>
|
|
|
+ <div class="input">
|
|
|
+ 预估GAS
|
|
|
+ <el-input v-model="currentAddTaskInfo.estimatedGas" placeholder="预估GAS"></el-input>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
@@ -910,6 +918,8 @@ import {addTaskInfo, batchExecution, getExecutionRecord, modifyTaskInfo, paramet
|
|
|
import {getGroupList} from "@/api/adress";
|
|
|
import {getInteractionRecord, retryFailed} from "@/api/record";
|
|
|
import {projectPage} from "@/api/project";
|
|
|
+import CryptoJS from "crypto-js";
|
|
|
+import Web3 from 'web3'
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -938,10 +948,10 @@ export default {
|
|
|
value1: '',
|
|
|
recordData: [],
|
|
|
ongoingData: [],//下一层
|
|
|
- ongoingDataTotal:0,
|
|
|
+ ongoingDataTotal: 0,
|
|
|
drawerStrategy: false,
|
|
|
accountPassword: false,
|
|
|
- retryPassword:false,
|
|
|
+ retryPassword: false,
|
|
|
batchExecutionParams: {
|
|
|
groupName: '',
|
|
|
maxGas: '',
|
|
@@ -952,9 +962,10 @@ export default {
|
|
|
projectId: '',
|
|
|
taskId: ''
|
|
|
},
|
|
|
- retryParams:{
|
|
|
- executeId:'',
|
|
|
- password:''
|
|
|
+ password:'',
|
|
|
+ retryParams: {
|
|
|
+ executeId: '',
|
|
|
+ password: ''
|
|
|
},
|
|
|
currentTaskInfo: {
|
|
|
taskType: '',
|
|
@@ -963,7 +974,8 @@ export default {
|
|
|
amsTaskId: '',
|
|
|
planTimes: '',
|
|
|
projectName: '',
|
|
|
- taskCode:''
|
|
|
+ taskCode: '',
|
|
|
+ estimatedGas: ''
|
|
|
},
|
|
|
currentRecordData: {},
|
|
|
paramsData: [],
|
|
@@ -1030,6 +1042,19 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
batchExecutionTask() {
|
|
|
+ // 要加密的数据
|
|
|
+ const dataToEncrypt = this.password;
|
|
|
+ console.log('输入的密码:', dataToEncrypt);
|
|
|
+ // 获取当前北京时间
|
|
|
+ const beijingDate = this.getCurrentBeijingTime();
|
|
|
+ // 生成keyByte
|
|
|
+ const keyByte = this.generateKeyByteArray(beijingDate);
|
|
|
+ console.log('生成的toHex:', keyByte);
|
|
|
+ // 加密数据
|
|
|
+ const encryptedData = this.encryptData(dataToEncrypt, keyByte);
|
|
|
+ console.log('加密后的数据:', encryptedData);
|
|
|
+
|
|
|
+ this.batchExecutionParams.password = encryptedData
|
|
|
this.batchExecutionParams.airdropParams = this.paramsData
|
|
|
batchExecution(this.batchExecutionParams).then(() => {
|
|
|
this.accountPassword = false
|
|
@@ -1037,6 +1062,43 @@ export default {
|
|
|
this.getTaskList()
|
|
|
})
|
|
|
},
|
|
|
+ // 获取当前北京时间并格式化为 YYYYMMDD
|
|
|
+ getCurrentBeijingTime() {
|
|
|
+ const localDate = new Date();
|
|
|
+ const localTime = localDate.getTime(); // 获取当前本地时间的时间戳
|
|
|
+ const localOffset = localDate.getTimezoneOffset() * 60000; // 本地时区偏移的毫秒数
|
|
|
+ const utcTime = localTime + localOffset; // 转换为 UTC 时间
|
|
|
+ const beijingOffset = 8 * 60 * 60000; // 北京时区偏移的毫秒数
|
|
|
+ const beijingTime = utcTime + beijingOffset; // 加上北京时区偏移
|
|
|
+
|
|
|
+ const beijingDate = new Date(beijingTime);
|
|
|
+ const year = beijingDate.getFullYear();
|
|
|
+ const month = (beijingDate.getMonth() + 1).toString().padStart(2, '0');
|
|
|
+ const day = beijingDate.getDate().toString().padStart(2, '0');
|
|
|
+
|
|
|
+ return `${year}${month}${day}${year}${month}${day}`;
|
|
|
+ },
|
|
|
+ // 生成
|
|
|
+ generateKeyByteArray(content) {
|
|
|
+ let bytes = [];
|
|
|
+ let len, c;
|
|
|
+ len = content.length;
|
|
|
+ for (let i = 0; i < len; i++) {
|
|
|
+ c = content[i];
|
|
|
+ bytes.push(parseInt(c))
|
|
|
+ }
|
|
|
+ console.log('当前北京时间的数组',bytes);
|
|
|
+ return Web3.utils.bytesToHex(bytes).substring(2);
|
|
|
+ },
|
|
|
+ // 加密函数
|
|
|
+ encryptData(word, keyStr) {
|
|
|
+ let key = CryptoJS.enc.Hex.parse(keyStr)
|
|
|
+ console.log('CryptoJS生成的key',key);
|
|
|
+ let encrypted = CryptoJS.AES.encrypt(word, key, {mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7}) // 加密模式为ECB,补码方式为PKCS5Padding(也就是PKCS7)
|
|
|
+
|
|
|
+ return encrypted.toString()
|
|
|
+
|
|
|
+ },
|
|
|
viewTaskDetails(item) {
|
|
|
this.currentTaskInfo = JSON.parse(JSON.stringify(item))
|
|
|
this.drawerDetails = true
|
|
@@ -1048,7 +1110,8 @@ export default {
|
|
|
airdropProjectId: this.currentTaskInfo.amsProjectId,
|
|
|
amsTaskId: this.currentTaskInfo.amsTaskId,
|
|
|
planTimes: this.currentTaskInfo.planTimes,
|
|
|
- taskCode:this.currentTaskInfo.taskCode
|
|
|
+ taskCode: this.currentTaskInfo.taskCode,
|
|
|
+ estimatedGas: this.currentTaskInfo.estimatedGas
|
|
|
}
|
|
|
modifyTaskInfo(params).then(() => {
|
|
|
this.drawerDetails = false
|
|
@@ -1074,7 +1137,8 @@ export default {
|
|
|
taskName: this.currentAddTaskInfo.taskName,
|
|
|
airdropProjectId: this.currentAddTaskInfo.airdropProjectId,
|
|
|
planTimes: this.currentAddTaskInfo.planTimes,
|
|
|
- taskCode: this.currentAddTaskInfo.taskCode
|
|
|
+ taskCode: this.currentAddTaskInfo.taskCode,
|
|
|
+ estimatedGas: this.currentAddTaskInfo.estimatedGas
|
|
|
}
|
|
|
console.log(params);
|
|
|
addTaskInfo(params).then(() => {
|
|
@@ -1123,18 +1187,18 @@ export default {
|
|
|
this.paramsData = res
|
|
|
})
|
|
|
},
|
|
|
- retry(){
|
|
|
+ retry() {
|
|
|
let params = {
|
|
|
- executeId:this.currentRecordData.executeId,
|
|
|
- password:this.retryParams.password
|
|
|
+ executeId: this.currentRecordData.executeId,
|
|
|
+ password: this.retryParams.password
|
|
|
}
|
|
|
- retryFailed(params).then(res =>{
|
|
|
+ retryFailed(params).then(res => {
|
|
|
console.log(res);
|
|
|
this.refresh()
|
|
|
this.retryPassword = false
|
|
|
})
|
|
|
},
|
|
|
- drawerRecordClosed(){
|
|
|
+ drawerRecordClosed() {
|
|
|
this.drawerRecordStatus = 0;
|
|
|
this.retryPassword = false
|
|
|
}
|
|
@@ -1209,6 +1273,7 @@ export default {
|
|
|
flex-wrap: wrap;
|
|
|
height: 650px;
|
|
|
overflow: auto;
|
|
|
+
|
|
|
.app-container-table-main-item {
|
|
|
width: 340px;
|
|
|
height: 315px;
|
|
@@ -1538,12 +1603,14 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
gap: 8px;
|
|
|
- .back{
|
|
|
+
|
|
|
+ .back {
|
|
|
cursor: pointer;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- gap:4px;
|
|
|
+ gap: 4px;
|
|
|
}
|
|
|
+
|
|
|
.missionName {
|
|
|
display: flex;
|
|
|
gap: 8px;
|
|
@@ -1643,7 +1710,8 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
flex-wrap: wrap;
|
|
|
- gap:20px;
|
|
|
+ gap: 20px;
|
|
|
+
|
|
|
.item {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
@@ -1692,12 +1760,13 @@ export default {
|
|
|
color: #8e8f91;
|
|
|
}
|
|
|
}
|
|
|
- .button{
|
|
|
+
|
|
|
+ .button {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
width: fit-content;
|
|
|
height: 36px;
|
|
|
- gap:4px;
|
|
|
+ gap: 4px;
|
|
|
border: 1px solid #E0E0E0;
|
|
|
border-radius: 40px;
|
|
|
padding: 0 12px;
|
|
@@ -1796,6 +1865,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.accountPassword {
|
|
|
width: 440px;
|
|
|
height: 374px;
|