@wjya/ngx-webapp-icpc.group.pms
Version:
angular webapp : icpc.group.pms
110 lines • 6.21 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var data_source_helper_1 = require("../../../service/data-source.helper");
var core_1 = require("@angular/core");
var ngx_webapp_fx_1 = require("@wjya/ngx-webapp-fx");
var community_list_component_1 = require("./community-list.component");
var wx_qrcode_component_1 = require("./wx-qrcode.component");
var def = {
data: null,
showOperations: true,
fields: {
id: {
label: 'id',
hidden: true,
sort: { enabled: true, value: 'descend' },
query: {},
filter: { enabled: false }
},
name: {
label: '公众号名称',
sort: { enabled: true },
query: {},
filter: { enabled: false }
},
bindCommunities: {
label: '查看小区',
sort: { enabled: false },
query: {},
filter: { enabled: false },
dataTemplateEnabled: true
},
}
};
var WechatPublicAccountComponent = /** @class */ (function () {
function WechatPublicAccountComponent(injector, dataSourceHelper, userStorageService, appSettingService) {
this.injector = injector;
this.dataSourceHelper = dataSourceHelper;
this.userStorageService = userStorageService;
this.appSettingService = appSettingService;
this.dataSource = this.dataSourceHelper.officals;
this.officalAuthUrlDataSource = this.dataSourceHelper.officalAuthUrl;
this.officalCommunitiesDataSource = this.dataSourceHelper.officalCommunities;
this.officalsGetQrcodeDataSource = this.dataSourceHelper.officalsGetQrcode;
}
WechatPublicAccountComponent.prototype.ngOnInit = function () {
this.listView = new ngx_webapp_fx_1.ListView(def, this.injector);
this.communityGroupId = this.userStorageService.getCurrentOffice().id;
this.loadAll();
};
WechatPublicAccountComponent.prototype.loadAll = function () {
var _this = this;
this.dataSource.findList({
communityGroupId: this.communityGroupId,
page: this.listView.pageIndex - 1,
size: this.listView.pageSize,
sort: this.listView.sortValueToQueryStatement
}).subscribe(function (res) {
_this.listView.data = res.body;
_this.listView.setTotal(res.headers);
});
};
WechatPublicAccountComponent.prototype.getCommunity = function (dataRow) {
var _this = this;
this.communityList.name = dataRow.name;
this.officalCommunitiesDataSource.findOne(dataRow.id, { communityGroupId: this.communityGroupId }).subscribe(function (res) {
_this.communityList.getCommunityList(res.body, dataRow);
});
};
WechatPublicAccountComponent.prototype.getOfficalsAuthUrl = function () {
this.officalAuthUrlDataSource.findList({
communityGroupId: this.communityGroupId
}).subscribe(function (res) {
if (res.body.url) {
window.open(res.body.url);
}
});
};
WechatPublicAccountComponent.prototype.downLoadQrcode = function (officalId) {
var _this = this;
this.officalsGetQrcodeDataSource.findOne(officalId).subscribe(function (res) {
_this.qrcodeUrl = '../weixin/api/_public/_officals/' + res.body.ticket + '/download-qrcode';
_this.wxQrcode.qrcodeValue = res.body.url;
_this.wxQrcode.qrcodeUrl = _this.qrcodeUrl;
_this.wxQrcode.modalIsVisible = true;
});
};
WechatPublicAccountComponent.decorators = [
{ type: core_1.Component, args: [{
selector: 'zx-wechat-public-account',
template: "<zx-header-block [title]=\"'\u516C\u4F17\u53F7\u8BBE\u7F6E'\" [showBottomLine]=\"false\" [showBreadcrumb]=\"true\"><p>\u7BA1\u7406\u793E\u533A\u516C\u4F17\u53F7\u4FE1\u606F</p></zx-header-block><zx-content-block><ng-template #operations><button nz-button [nzType]=\"'primary'\" (click)=\"getOfficalsAuthUrl()\"><span>\u6DFB\u52A0\u5FAE\u4FE1\u516C\u4F17\u53F7</span></button></ng-template><ng-template #content><zx-list-view [listView]=\"listView\" (loadData)=\"loadAll()\"><ng-template #dataColumn let-dataRow=\"dataRow\" let-field=\"field\" let-value=\"value\"><div *ngIf=\"field.name == 'bindCommunities'\"><span style=\"color: red\">{{dataRow.bindCommunities.length}}</span> <a (click)=\"getCommunity(dataRow)\">\u67E5\u770B\u5C0F\u533A</a></div></ng-template><ng-template #dataOperations let-dataRow=\"dataRow\"><a [routerLink]=\"['../wechat-public-account', dataRow.id]\">\u67E5\u770B\u6388\u6743</a> <a [routerLink]=\"['../wechat-public-account/wechat-menu', dataRow.id]\">\u516C\u4F17\u53F7\u83DC\u5355\u8BBE\u7F6E</a> <a [routerLink]=\"['../wechat-public-account/my-mini-program', dataRow.id]\">\u5C0F\u7A0B\u5E8F\u8BBE\u7F6E</a><a (click)=\"downLoadQrcode(dataRow.id)\">\u4E8C\u7EF4\u7801</a></ng-template></zx-list-view></ng-template></zx-content-block><zx-community-list #communityList (reload)=\"loadAll()\"></zx-community-list><zx-wx-qrcode #wxQrcode></zx-wx-qrcode>",
styles: [
"\n :host ::ng-deep .ant-table-thead > tr > th:nth-child(3) {\n width: 33%;\n }\n "
]
},] },
];
/** @nocollapse */
WechatPublicAccountComponent.ctorParameters = function () { return [
{ type: core_1.Injector, },
{ type: data_source_helper_1.DataSourceHelper, },
{ type: ngx_webapp_fx_1.UserStorageService, },
{ type: ngx_webapp_fx_1.AppSettingService, },
]; };
WechatPublicAccountComponent.propDecorators = {
"communityList": [{ type: core_1.ViewChild, args: ['communityList',] },],
"wxQrcode": [{ type: core_1.ViewChild, args: ['wxQrcode',] },],
};
return WechatPublicAccountComponent;
}());
exports.WechatPublicAccountComponent = WechatPublicAccountComponent;
//# sourceMappingURL=wechat-public-account.component.js.map