榆山数据端小程序
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

"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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlzdHJpY3REZXRhaWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJkaXN0cmljdERldGFpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLG1EQUE4RDtBQUU5RCxJQUFJLENBQUM7SUFDSCxJQUFJLEVBQUU7UUFDSixRQUFRLEVBQUUsTUFBTTtRQUNoQixXQUFXLEVBQUUsS0FBSztRQUNsQixTQUFTLEVBQUUsS0FBSztRQUNoQixhQUFhLEVBQUU7WUFDYixFQUFFLEtBQUssRUFBRSxVQUFVLEVBQUUsRUFBRSxFQUFFLEdBQUcsRUFBRSxNQUFNLEVBQUUsSUFBSSxFQUFFO1lBQzVDLEVBQU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