You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
197 lines
18 KiB
197 lines
18 KiB
"use strict";
|
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
function step(op) {
|
|
if (f) throw new TypeError("Generator is already executing.");
|
|
while (_) try {
|
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
switch (op[0]) {
|
|
case 0: case 1: t = op; break;
|
|
case 4: _.label++; return { value: op[1], done: false };
|
|
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
default:
|
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
if (t[2]) _.ops.pop();
|
|
_.trys.pop(); continue;
|
|
}
|
|
op = body.call(thisArg, _);
|
|
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
}
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var userNum_1 = require("../../../../api/userNum");
|
|
Page({
|
|
data: {
|
|
loadType: 'none',
|
|
loadVisible: false,
|
|
orderType: 'asc',
|
|
conditionList: [
|
|
{ title: '按照注册用户排名', id: '1', select: true },
|
|
{ title: '按照党员总数排名', id: '2', select: false },
|
|
{ title: '按照大于50岁党员排名', id: '3', select: false },
|
|
{ title: '按照小于50岁党员排名', id: '4', select: false }
|
|
],
|
|
conditionVisible: false,
|
|
choosedCondition: {
|
|
title: '按照注册用户排名',
|
|
id: '1'
|
|
},
|
|
preloadVisible: true,
|
|
userAnalysisList: [],
|
|
pageNo: 1,
|
|
pageSize: 10,
|
|
deptId: '',
|
|
deptName: '',
|
|
streetTotalDetail: {
|
|
userTotal: 0,
|
|
partyNumber: 0,
|
|
userNumber: 0,
|
|
partyNumberRatio: 0,
|
|
userNumberRatio: 0,
|
|
companyRepresentTotal: 0,
|
|
companyRepresentTotalRatio: 0
|
|
},
|
|
deadline: ''
|
|
},
|
|
onLoad: function (options) {
|
|
this.setData({
|
|
deptId: options.deptId,
|
|
deptName: options.deptName
|
|
});
|
|
this.initLoad();
|
|
},
|
|
onReachBottom: function () {
|
|
this.setData({
|
|
loadVisible: true
|
|
});
|
|
if (this.data.loadType === 'more') {
|
|
this.setData({
|
|
pageNo: this.data.pageNo + 1
|
|
});
|
|
this.initLoad();
|
|
}
|
|
},
|
|
navigateToDetail: function () {
|
|
return false;
|
|
},
|
|
changeOrder: function () {
|
|
var type = 'asc';
|
|
if (this.data.orderType === 'asc') {
|
|
type = 'desc';
|
|
}
|
|
else if (this.data.orderType === 'desc') {
|
|
type = 'asc';
|
|
}
|
|
this.setData({
|
|
orderType: type,
|
|
userAnalysisList: [],
|
|
preloadVisible: true,
|
|
loadType: 'none',
|
|
loadVisible: false,
|
|
pageNo: 1
|
|
});
|
|
this.initLoad();
|
|
},
|
|
onChnageCondition: function (e) {
|
|
var _this = this;
|
|
var list = this.data.conditionList;
|
|
list.forEach(function (item) {
|
|
if (item.id === e.currentTarget.dataset.id) {
|
|
item.select = true;
|
|
_this.setData({
|
|
'choosedCondition.title': item.title,
|
|
'choosedCondition.id': item.id
|
|
});
|
|
}
|
|
else {
|
|
item.select = false;
|
|
}
|
|
});
|
|
this.setData({
|
|
conditionList: list,
|
|
userAnalysisList: [],
|
|
preloadVisible: true,
|
|
loadType: 'none',
|
|
loadVisible: false,
|
|
pageNo: 1
|
|
});
|
|
this.initLoad();
|
|
},
|
|
showCondition: function () {
|
|
this.setData({
|
|
conditionVisible: !this.data.conditionVisible
|
|
});
|
|
},
|
|
initLoad: function () {
|
|
return __awaiter(this, void 0, void 0, function () {
|
|
var orderStyle, para, res, streetTotalDetail, key, err_1;
|
|
return __generator(this, function (_a) {
|
|
switch (_a.label) {
|
|
case 0:
|
|
orderStyle = '2';
|
|
if (this.data.orderType === 'asc') {
|
|
orderStyle = '2';
|
|
}
|
|
else if (this.data.orderType === 'desc') {
|
|
orderStyle = '1';
|
|
}
|
|
_a.label = 1;
|
|
case 1:
|
|
_a.trys.push([1, 3, , 4]);
|
|
para = {
|
|
pageIndex: this.data.pageNo,
|
|
pageSize: this.data.pageSize,
|
|
deptId: this.data.deptId,
|
|
deptType: '3',
|
|
orderType: this.data.choosedCondition.id,
|
|
orderStyle: orderStyle
|
|
};
|
|
return [4, userNum_1.getUserSituationList(para)];
|
|
case 2:
|
|
res = _a.sent();
|
|
console.log('用户分析,一级列表', res);
|
|
streetTotalDetail = this.data.streetTotalDetail;
|
|
for (key in this.data.streetTotalDetail) {
|
|
streetTotalDetail[key] = res.data.totalDTO[key];
|
|
}
|
|
this.setData({
|
|
userAnalysisList: this.data.userAnalysisList.concat(res.data.listDTO),
|
|
preloadVisible: false,
|
|
loadType: res.data.listDTO.length === 10 ? 'more' : 'none',
|
|
streetTotalDetail: streetTotalDetail,
|
|
deadline: res.data.deadline
|
|
});
|
|
return [3, 4];
|
|
case 3:
|
|
err_1 = _a.sent();
|
|
console.log(err_1);
|
|
this.setData({
|
|
userAnalysisList: [],
|
|
preloadVisible: false,
|
|
loadType: 'none'
|
|
});
|
|
return [3, 4];
|
|
case 4: return [2];
|
|
}
|
|
});
|
|
});
|
|
}
|
|
});
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlzdHJpY3REZXRhaWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJkaXN0cmljdERldGFpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLG1EQUE4RDtBQUU5RCxJQUFJLENBQUM7SUFDSCxJQUFJLEVBQUU7UUFDSixRQUFRLEVBQUUsTUFBTTtRQUNoQixXQUFXLEVBQUUsS0FBSztRQUNsQixTQUFTLEVBQUUsS0FBSztRQUNoQixhQUFhLEVBQUU7WUFDYixFQUFFLEtBQUssRUFBRSxVQUFVLEVBQUUsRUFBRSxFQUFFLEdBQUcsRUFBRSxNQUFNLEVBQUUsSUFBSSxFQUFFO1lBQzVDLEVBQUUsS0FBSyxFQUFFLFVBQVUsRUFBRSxFQUFFLEVBQUUsR0FBRyxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUU7WUFDN0MsRUFBRSxLQUFLLEVBQUUsYUFBYSxFQUFFLEVBQUUsRUFBRSxHQUFHLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRTtZQUNoRCxFQUFFLEtBQUssRUFBRSxhQUFhLEVBQUUsRUFBRSxFQUFFLEdBQUcsRU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