Commit 3cfdebab by zhanghui1

完善矿机列表一期需求

parent 2d57f0de
{
"name": "poolin_app",
"name": "poolin_app_new",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@tweenjs/tween.js": {
"version": "17.2.0",
"resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-17.2.0.tgz",
"integrity": "sha1-IfibcJuvxLMDra56g7TzWg2eR5Y="
},
"accepts": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz",
......@@ -72,6 +77,11 @@
"integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=",
"dev": true
},
"animate.css": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/animate.css/-/animate.css-3.5.2.tgz",
"integrity": "sha1-keZo3AaagI5eSZUUhnuXquAWbDY="
},
"ansi-html": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz",
......@@ -2623,11 +2633,18 @@
}
},
"echarts": {
"version": "3.8.5",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-3.8.5.tgz",
"integrity": "sha512-E+nnROMfCeiLeoT/fZyX8SE8mKzwkTjyemyoBF543oqjRtjTSKQAVDEihMXy4oC6pJS0tYGdMqCA2ATk8onyRg==",
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-4.0.2.tgz",
"integrity": "sha512-2kLhHvSAVbJ6QYVDxuySFp/+LfJxlYTYyPaOfwqydiFMAL9Wx7jzarfR1P4P6DFzLCZi4U4mv6EcZhH9BantKQ==",
"requires": {
"zrender": "3.7.4"
"zrender": "4.0.1"
},
"dependencies": {
"zrender": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-4.0.1.tgz",
"integrity": "sha512-VC9bTAZwd5OVgryysxBgNvIZuwBsRJbIDkSyK9PAk7e9wE/M0k4R3eylVYc1IAcDXvccSFnj4/NkzCteh/YSpA=="
}
}
},
"ee-first": {
......@@ -2657,14 +2674,6 @@
"electron-releases": "2.1.0"
}
},
"element-resize-detector": {
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/element-resize-detector/-/element-resize-detector-1.1.12.tgz",
"integrity": "sha1-iz/W7t2hf5wAs2Cg6i35knroC6I=",
"requires": {
"batch-processor": "1.0.0"
}
},
"element-ui": {
"version": "2.0.11",
"resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.0.11.tgz",
......@@ -4444,11 +4453,6 @@
"integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=",
"dev": true
},
"lodash.debounce": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
"integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168="
},
"lodash.memoize": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
......@@ -8998,9 +9002,9 @@
"integrity": "sha512-3D+lY7HTkKbtswDM4BBHgqyq+qo8IAEE8lz8va1dz3LLmttjgo0FxairO4r1iN2OBqk8o1FyL4hvzzTFEdQSEw=="
},
"vue-awesome-swiper": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/vue-awesome-swiper/-/vue-awesome-swiper-3.1.0.tgz",
"integrity": "sha512-w81WiG7Hh51ygtuZyDgnQ0lHOmrAMObWLLWj2kExUj1WaRQZJSfMG54SuL0zSHXzojVnqbwaVzh4loywibiryA==",
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/vue-awesome-swiper/-/vue-awesome-swiper-3.1.2.tgz",
"integrity": "sha512-A0ZrKo0JM0jltb4bz33l3pOKfaIMJiKI+74OzeCc7rQi6gYCoZQsAc3wn1iT64VlkwqtmiN9a1s5dEUoxcbwSg==",
"requires": {
"object-assign": "4.1.1",
"swiper": "4.0.7"
......@@ -9016,12 +9020,27 @@
}
},
"vue-echarts-v3": {
"version": "1.0.18",
"resolved": "https://registry.npmjs.org/vue-echarts-v3/-/vue-echarts-v3-1.0.18.tgz",
"integrity": "sha512-Kz6NT5lWJSUBqTKxgCFrnB2ujHKREbI8rWWrq6bm2mcPk3Cj+ukdMfgjcSAEAr2UKcLXXo0DKnLVUddE0cWRJA==",
"version": "1.0.19",
"resolved": "https://registry.npmjs.org/vue-echarts-v3/-/vue-echarts-v3-1.0.19.tgz",
"integrity": "sha512-BjHsJ069q/B+Py7ZwPhGpQKak8nCJR1eYCZFI3hG9aeifGxcW9pWnaSbFjhh4TF1UtKKGF33x+v9xdR1fyLh9A==",
"requires": {
"element-resize-detector": "1.1.13",
"lodash": "4.17.5"
},
"dependencies": {
"element-resize-detector": {
"version": "1.1.13",
"resolved": "https://registry.npmjs.org/element-resize-detector/-/element-resize-detector-1.1.13.tgz",
"integrity": "sha1-9hkH6YqRsa0hX5J5C8FRE99oRE0=",
"requires": {
"element-resize-detector": "1.1.12",
"lodash.debounce": "4.0.8"
"batch-processor": "1.0.0"
}
},
"lodash": {
"version": "4.17.5",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz",
"integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw=="
}
}
},
"vue-hot-reload-api": {
......@@ -9681,11 +9700,6 @@
"dev": true
}
}
},
"zrender": {
"version": "3.7.4",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-3.7.4.tgz",
"integrity": "sha512-5Nz7+L1wIoL0+Pp/iOP56jD6eD017qC9VRSgUBheXBiAHgOBJZ4uh4/g6e83acIwa8RKSyZf/FlceKu5ntUuxQ=="
}
}
}
......@@ -64,6 +64,19 @@ export default {
messageGroup: '全部',
messageSort: '默认排序',
api: '',
group_id: 0,
status: 'ALL',
page_size: 30,
page: 1,
keyword: '',
order_by: '',
sort: '',
workers_active: 0,
workers_dead: 0,
workers_inactive: 0,
i: 0,
tablist: [{
text: '全部',
......@@ -78,22 +91,15 @@ export default {
text: '失效',
status: 'DEAD'
}],
workers_active: 0,
workers_dead: 0,
workers_inactive: 0,
order_by: '',
sort: '', //asc
page: 1,
pagesize: 30,
sortArray: [{
name: '默认排序',
method: () => {
this.messageSort = '默认排序';
// puid=78&status=ALL&order_by=worker_name&sort=desc&page=1&pagesize=30
console.log(this.status)
//console.log(this.status)
this.order_by = '';
this.sort = '';
this.tableData = [];
this.getWorker();
}
},
......@@ -105,14 +111,8 @@ export default {
this.order_by = 'shares_24h';
this.sort = 'asc';
this.page = 1;
// console.log("排序参数api:",this.api);
// console.log("排序参数puid:",this.puid);
// console.log("排序参数group_id:",this.group_id);
// console.log("排序参数status:",this.status);
// console.log("排序参数order_by:",this.order_by);
// console.log("排序参数page:",this.page);
// console.log("排序参数page_size:",this.page_size);
this.sortWorkder();
this.tableData = [];
this.sortWorker();
}
},
{
......@@ -123,7 +123,8 @@ export default {
this.order_by = 'shares_24h';
this.sort = 'desc';
this.page = 1;
this.sortWorkder();
this.tableData = [];
this.sortWorker();
}
},
{
......@@ -134,7 +135,8 @@ export default {
this.order_by = 'worker_name';
this.sort = 'desc';
this.page = 1;
this.sortWorkder();
this.tableData = [];
this.sortWorker();
}
},
{
......@@ -145,7 +147,8 @@ export default {
this.order_by = 'reject_rate';
this.sort = 'desc';
this.page = 1;
this.sortWorkder();
this.tableData = [];
this.sortWorker();
}
},
{
......@@ -156,7 +159,8 @@ export default {
this.order_by = 'reject_rate';
this.sort = 'asc';
this.page = 1;
this.sortWorkder();
this.tableData = [];
this.sortWorker();
}
},
{
......@@ -167,15 +171,11 @@ export default {
this.order_by = 'last_share_time';
this.sort = 'desc';
this.page = 1;
this.sortWorkder();
this.tableData = [];
this.sortWorker();
}
}
],
api: '',
group_id: 0,
status: 'ALL',
page_size: 30,
page: 1,
tableData: [],
}
},
......@@ -201,17 +201,28 @@ export default {
this.getWorker();
},
methods: {
goMinerShow(worker_id) {
//矿机详情
this.$router.push('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/miners/' + worker_id)
getGroup() {
this.showGroup = !this.showGroup;
this.showSort = false;
},
formGroup(msg) {
this.messageGroup = msg.group_name;
this.showGroup = false;
this.group_id = msg.group_id;
this.status = msg.status;
if (this.order_by.length > 0) {
this.sortWorker()
} else {
this.getWorker()
}
},
tabClick(status, index) {
//miners-tab点击切换的选中状态
this.$indicator.open({ spinnerType: 'fading-circle' })
this.status = status;
this.page = 1;
this.tableData = [];
if (this.order_by.length > 0) {
this.sortWorkder();
this.sortWorker();
} else {
this.getWorker();
}
......@@ -220,34 +231,23 @@ export default {
this.showSort = !this.showSort;
this.showGroup = false;
},
getGroup() {
this.showGroup = !this.showGroup;
this.showSort = false;
},
formGroup(msg) {
// console.log("切换分组信息:", msg)
this.messageGroup = msg.group_name;
this.showGroup = false;
this.group_id = msg.group_id;
this.status = msg.status;
if (this.order_by.length > 0) {
this.sortWorkder()
} else {
this.getWorker()
}
goMinerShow(worker_id) {
//矿机详情
this.$router.push('/my/' + this.puid + '/' + this.coin_type + '/' + this.region_id + '/miners/' + worker_id)
},
getWorker() {
//默认排序下的获取矿机列表
let self = this;
fn.getApiBaseUrl(self.region_id, self.coin_type).then(api => {
this.api = api;
fn.getWorker(api, self.puid, self.group_id, self.status, self.page_size).then(res => {
fn.getWorker(api, self.puid, self.group_id, self.status, self.page_size, self.page).then(res => {
if (res.data.err_no == 0) {
//console.log("矿机列表", res.data.data.data)
self.tableData = res.data.data.data;
if (res.data.data.data.length > 0) {
self.tableData = self.tableData.concat(res.data.data.data);
this.workers_active = res.data.data.workers_active;
this.workers_dead = res.data.data.workers_dead;
this.workers_inactive = res.data.data.workers_inactive;
}
try {
if (res.data.data.data[0].hasOwnProperty("shares_24h")) {
self.hideCol = 1;
......@@ -268,11 +268,14 @@ export default {
});
})
},
sortWorkder() {
sortWorker() {
//排序方法
fn.sortWorkder(this.api, this.puid, this.group_id, this.status, this.order_by, this.sort, this.page, this.page_size).then(res => {
fn.sortWorker(this.api, this.puid, this.group_id, this.status, this.order_by, this.sort, this.page, this.page_size).then(res => {
if (res.data.err_no == 0) {
this.tableData = res.data.data.data;
if (res.data.data.data.length > 0) {
this.tableData = this.tableData.concat(res.data.data.data);
}
} else {
this.$toast("获取矿工列表列表错误!");
}
......@@ -285,18 +288,25 @@ export default {
pullingUp() {
this.search(this.page + 1)
this.getTableData(this.page + 1)
},
search(page) {
fn.getPaymentHistory(this.api, this.puid, page).then(res => {
if (res.data.data.data.length > 0) {
getTableData(page) {
this.page = page;
this.paymentList.push(res.data.data)
this.scroll.forceUpdate(true)
if (this.order_by.length > 0) {
this.sortWorker()
} else {
this.scroll.forceUpdate(false)
this.getWorker()
}
})
this.scroll.forceUpdate(true)
// fn.getPaymentHistory(this.api, this.puid, page).then(res => {
// if (res.data.data.data.length > 0) {
// this.page = page;
// this.paymentList.push(res.data.data)
// this.scroll.forceUpdate(true)
// } else {
// this.scroll.forceUpdate(false)
// }
// })
},
},
}
......@@ -309,4 +319,5 @@ export default {
bottom: 1rem!important;
}
}
</style>
......@@ -48,7 +48,7 @@ axios.interceptors.request.use(config => {
function checkToken() {
return new Promise((resolve, reject) => {
resolve('eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlEwTTBNRUl4UVRVME5qazJNa0ZFT0RCRk56WkJNVGc0TmtFd09UWkNOakZGTlRFMFEwVTJOdyJ9.eyJpc3MiOiJodHRwczovL2Jsb2NraW4uYXV0aDAuY29tLyIsInN1YiI6ImF1dGgwfDU5ZjE3OTc5ZDljMGM1MzZiZjRhMzVjMSIsImF1ZCI6WyJodHRwczovL3d3dy5wb29saW4uY29tL2FwaSIsImh0dHBzOi8vYmxvY2tpbi5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNTE3NTYzNDkwLCJleHAiOjE1MTc1NzA2OTAsImF6cCI6IkZhczI5dWJNNW52NElFMlZUQ3ZEWU5iaWtIeTF0bDBkIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSByZWFkIHdyaXRlIn0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myFHWxX3_DaRfJZSj2tFSYpM2Ck6P1ZfpIVZPzad1S_sUZiy10K2o5Qzc1Ln540Dc4BG3NiYnDYn2Uy_g');
})
}
......
......@@ -493,12 +493,12 @@ export default {
* @param {[type]} status [description:ALL、ACTIVE、INACTIVE、DEAD]
* @return {[type]} [description]
*/
getWorker(apiBaseUrl, puid, group, status, page_size) {
getWorker(apiBaseUrl, puid, group, status, page_size, page) {
//console.log("getWorker")
if (group == 0) {
return $axios(apiBaseUrl + '/worker?puid=' + puid + '&status=' + status + '&pagesize=' + page_size)
return $axios(apiBaseUrl + '/worker?puid=' + puid + '&status=' + status + '&pagesize=' + page_size + '&page=' + page)
} else {
return $axios(apiBaseUrl + '/worker?puid=' + puid + '&group=' + group + '&status=' + status + '&pagesize=' + page_size)
return $axios(apiBaseUrl + '/worker?puid=' + puid + '&group=' + group + '&status=' + status + '&pagesize=' + page_size + '&page=' + page)
}
// .then(res => { return mock.worker })
},
......@@ -512,12 +512,12 @@ export default {
* @param {[type]} keyword [description:关键词]
* @return {[type]} [description]
*/
searchWorker(apiBaseUrl, puid, group, keyword, page_size) {
searchWorker(apiBaseUrl, puid, group, keyword, page_size, page) {
//console.log("searchWorker")
if (group == 0) {
return $axios(apiBaseUrl + '/worker?puid=' + puid + '&keyword=' + keyword + '&pagesize=' + page_size)
return $axios(apiBaseUrl + '/worker?puid=' + puid + '&keyword=' + keyword + '&pagesize=' + page_size + '&page=' + page)
} else {
return $axios(apiBaseUrl + '/worker?puid=' + puid + '&group=' + group + '&keyword=' + keyword + '&pagesize=' + page_size)
return $axios(apiBaseUrl + '/worker?puid=' + puid + '&group=' + group + '&keyword=' + keyword + '&pagesize=' + page_size + '&page=' + page)
}
},
/**
......@@ -532,7 +532,7 @@ export default {
* @param {[type]} sort [description:asc/desc]
* @return {[type]} [description]
*/
sortWorkder(apiBaseUrl, puid, group, status, order_by, sort, page, page_size) {
sortWorker(apiBaseUrl, puid, group, status, order_by, sort, page, page_size) {
//console.log("sortWorkder")
if (group == 0) {
return $axios(apiBaseUrl + '/worker?puid=' + puid + '&status=' + status + '&order_by=' + order_by + '&sort=' + sort + '&page=' + page + '&pagesize=' + page_size)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment