|
|
@@ -147,6 +147,10 @@ export class AdminResourceComponent implements OnInit {
|
|
|
readonly filterUserMoneyType = signal(1);
|
|
|
readonly filterUserMoneyStartDate = signal('');
|
|
|
readonly filterUserMoneyEndDate = signal('');
|
|
|
+ readonly filterPromotionParentUserId = signal(0);
|
|
|
+ readonly filterPromotionOnlyWithChildren = signal(false);
|
|
|
+ readonly filterPromotionStartDate = signal('');
|
|
|
+ readonly filterPromotionEndDate = signal('');
|
|
|
readonly updatingUserLevel = signal(false);
|
|
|
readonly filterBaikeStatus = signal(-100);
|
|
|
readonly filterBaikeElite = signal(-100);
|
|
|
@@ -171,7 +175,7 @@ export class AdminResourceComponent implements OnInit {
|
|
|
readonly icons = { ChevronLeft, ChevronRight, Eye, KeyRound, LoaderCircle, Pencil, Plus, RefreshCw, Search, Trash2, X };
|
|
|
readonly columns = computed(() => {
|
|
|
const fields = this.schema()?.fields ?? [];
|
|
|
- const preferred = ['objectId', 'name', 'title', 'typeName', 'pageNodeName', 'compName', 'tlpName', 'pName', 'pTitle', 'questionTitle', 'tName', 'newsName', 'nodeName', 'value', 'remark', 'qtitle', 'sName', 'storeName', 'styleName', 'count', 'content', 'str1', 'categoryname', 'dicname', 'cateName', 'gradeName', 'cClassName', 'testPoint', 'kName', 'tname', 'username', 'userName', 'realName', 'cname', 'type1', 'type2', 'detail', 'cdate', 'sRemrk', 'askId', 'zoneId', 'typeId', 'shape', 'qtype', 'required', 'ztype', 'priority', 'zstatus', 'storeState', 'storeCommendState', 'storeStyleId', 'sDefault', 'sIndex', 'str4', 'sdate', 'edate', 'fileUrl', 'type', 'state', 'eliteLevel', 'orderId', 'mobile', 'sourceKey', 'status', 'createdAt', 'updatedAt'];
|
|
|
+ const preferred = ['objectId', 'name', 'title', 'typeName', 'pageNodeName', 'compName', 'tlpName', 'pName', 'pTitle', 'questionTitle', 'tName', 'newsName', 'nodeName', 'value', 'remark', 'qtitle', 'sName', 'storeName', 'styleName', 'count', 'content', 'str1', 'categoryname', 'dicname', 'cateName', 'gradeName', 'cClassName', 'testPoint', 'kName', 'tname', 'username', 'userName', 'honeyName', 'parentUserName', 'promotionCount', 'parentUserId', 'regTime', 'realName', 'cname', 'type1', 'type2', 'detail', 'cdate', 'sRemrk', 'askId', 'zoneId', 'typeId', 'shape', 'qtype', 'required', 'ztype', 'priority', 'zstatus', 'storeState', 'storeCommendState', 'storeStyleId', 'sDefault', 'sIndex', 'str4', 'sdate', 'edate', 'fileUrl', 'type', 'state', 'eliteLevel', 'orderId', 'mobile', 'sourceKey', 'status', 'createdAt', 'updatedAt'];
|
|
|
const rank = (name: string): number => { const index = preferred.indexOf(name); return index < 0 ? preferred.length : index; };
|
|
|
return fields.map((field, index) => ({ field, index })).sort((a, b) => rank(a.field.name) - rank(b.field.name) || a.index - b.index).map(({ field }) => field).slice(0, 7);
|
|
|
});
|
|
|
@@ -198,6 +202,7 @@ export class AdminResourceComponent implements OnInit {
|
|
|
this.filterStoreStatus.set(-100); this.resetStoreActions();
|
|
|
this.resetTagKeyActions();
|
|
|
this.filterUserMoneyType.set(1); this.filterUserMoneyStartDate.set(''); this.filterUserMoneyEndDate.set('');
|
|
|
+ this.filterPromotionParentUserId.set(0); this.filterPromotionOnlyWithChildren.set(false); this.filterPromotionStartDate.set(''); this.filterPromotionEndDate.set('');
|
|
|
this.filterBaikeStatus.set(-100); this.filterBaikeElite.set(-100);
|
|
|
this.filterSystemLogType1.set(''); this.filterSystemLogType2.set(''); this.filterSystemLogStartDate.set(''); this.filterSystemLogEndDate.set('');
|
|
|
void this.load(1, true);
|
|
|
@@ -213,7 +218,7 @@ export class AdminResourceComponent implements OnInit {
|
|
|
if (this.className() === 'FontPicShape' && reloadSchema) await this.loadFontShapeTypes();
|
|
|
if (['DesignQuestion', 'DesignAnswer'].includes(this.className()) && reloadSchema) { await this.loadSurveys(); if (!this.filterSurveyId() && this.surveys().length) this.filterSurveyId.set(this.surveyIdOf(this.surveys()[0])); }
|
|
|
if (this.className() === 'StoreApplication' && reloadSchema) await this.loadStoreStyles();
|
|
|
- const pageOperation = this.className() === 'Grade' && this.filterGradeCategoryId() > 0 ? 'gradeOptions' : this.className() === 'Search' ? 'searchNavigations' : this.className() === 'AdZone' ? 'adZones' : this.className() === 'AdInfo' ? 'adInfos' : this.className() === 'FontPicShape' ? 'fontShapes' : this.className() === 'FontPicShapeType' ? 'fontShapeTypes' : this.className() === 'DesignAsk' ? 'surveys' : this.className() === 'DesignQuestion' ? 'surveyQuestions' : this.className() === 'DesignAnswer' ? 'surveyResults' : this.className() === 'ServiceSeat' ? 'serviceSeats' : this.className() === 'Temp' ? 'serviceCodes' : this.className() === 'StoreApplication' ? 'storeApplications' : this.className() === 'StoreStyle' ? 'storeStyles' : this.className() === 'ContentTagKey' ? 'contentTagKeys' : this.className() === 'UserLevel' ? 'userLevels' : this.className() === 'UserMoneyLog' ? 'userMoneyLogs' : this.className() === 'Baike' ? 'baikeEntries' : this.className() === 'CRMSAttr' ? 'crmClientTypes' : this.className() === 'ShopFareTlp' ? 'shopFareTemplates' : this.className() === 'SysLog' ? 'systemLogs' : this.className() === 'MisType' ? 'misTypes' : this.className() === 'PageStyle' ? 'pageStyles' : this.className() === 'PlatComp' ? 'platformCompanies' : 'list';
|
|
|
+ const pageOperation = this.className() === 'Grade' && this.filterGradeCategoryId() > 0 ? 'gradeOptions' : this.className() === 'Search' ? 'searchNavigations' : this.className() === 'AdZone' ? 'adZones' : this.className() === 'AdInfo' ? 'adInfos' : this.className() === 'FontPicShape' ? 'fontShapes' : this.className() === 'FontPicShapeType' ? 'fontShapeTypes' : this.className() === 'DesignAsk' ? 'surveys' : this.className() === 'DesignQuestion' ? 'surveyQuestions' : this.className() === 'DesignAnswer' ? 'surveyResults' : this.className() === 'ServiceSeat' ? 'serviceSeats' : this.className() === 'Temp' ? 'serviceCodes' : this.className() === 'StoreApplication' ? 'storeApplications' : this.className() === 'StoreStyle' ? 'storeStyles' : this.className() === 'ContentTagKey' ? 'contentTagKeys' : this.className() === 'UserLevel' ? 'userLevels' : this.className() === 'UserMoneyLog' ? 'userMoneyLogs' : this.className() === 'UserPromotion' ? 'userPromotions' : this.className() === 'Baike' ? 'baikeEntries' : this.className() === 'CRMSAttr' ? 'crmClientTypes' : this.className() === 'ShopFareTlp' ? 'shopFareTemplates' : this.className() === 'SysLog' ? 'systemLogs' : this.className() === 'MisType' ? 'misTypes' : this.className() === 'PageStyle' ? 'pageStyles' : this.className() === 'PlatComp' ? 'platformCompanies' : 'list';
|
|
|
const pagePayload: Record<string, unknown> = { className: this.className(), page: pageNumber, pageSize: 20, search: this.search().trim() };
|
|
|
if (pageOperation === 'gradeOptions') { pagePayload['categoryId'] = this.filterGradeCategoryId(); pagePayload['parentId'] = this.filterGradeParentId(); }
|
|
|
if (pageOperation === 'searchNavigations') { pagePayload['type'] = this.filterSearchNavigationType(); pagePayload['state'] = this.filterSearchNavigationState(); pagePayload['elite'] = this.filterSearchNavigationElite(); }
|
|
|
@@ -224,6 +229,7 @@ export class AdminResourceComponent implements OnInit {
|
|
|
if (pageOperation === 'surveyQuestions' || pageOperation === 'surveyResults') pagePayload['askId'] = this.filterSurveyId();
|
|
|
if (pageOperation === 'storeApplications') pagePayload['status'] = this.filterStoreStatus();
|
|
|
if (pageOperation === 'userMoneyLogs') { pagePayload['type'] = this.filterUserMoneyType(); pagePayload['startDate'] = this.filterUserMoneyStartDate(); pagePayload['endDate'] = this.filterUserMoneyEndDate(); }
|
|
|
+ if (pageOperation === 'userPromotions') { pagePayload['parentUserId'] = this.filterPromotionParentUserId(); pagePayload['onlyWithChildren'] = this.filterPromotionOnlyWithChildren(); pagePayload['startDate'] = this.filterPromotionStartDate(); pagePayload['endDate'] = this.filterPromotionEndDate(); }
|
|
|
if (pageOperation === 'baikeEntries') { pagePayload['status'] = this.filterBaikeStatus(); pagePayload['elite'] = this.filterBaikeElite(); }
|
|
|
if (pageOperation === 'systemLogs') { pagePayload['type1'] = this.filterSystemLogType1(); pagePayload['type2'] = this.filterSystemLogType2(); pagePayload['startDate'] = this.filterSystemLogStartDate(); pagePayload['endDate'] = this.filterSystemLogEndDate(); }
|
|
|
this.page.set(await this.functions.admin<ResourcePage>(pageOperation, pagePayload));
|
|
|
@@ -238,7 +244,7 @@ export class AdminResourceComponent implements OnInit {
|
|
|
const objectId = String(row['objectId'] ?? '');
|
|
|
this.error.set('');
|
|
|
try {
|
|
|
- const detailOperation = this.className() === 'ContentTagKey' ? 'getContentTagKeys' : this.className() === 'UserMoneyLog' ? 'getUserMoneyLog' : 'get';
|
|
|
+ const detailOperation = this.className() === 'ContentTagKey' ? 'getContentTagKeys' : this.className() === 'UserMoneyLog' ? 'getUserMoneyLog' : this.className() === 'UserPromotion' ? 'getUserPromotion' : 'get';
|
|
|
const detail = await this.functions.admin<Record<string, unknown>>(detailOperation, { className: this.className(), objectId });
|
|
|
this.draftId.set(objectId); this.draft.set(detail); this.fieldErrors.set({}); this.fieldInputs.set({}); this.resetPasswordFields(); this.resetCreateUserFields(); this.resetUserActions(detail); this.resetContentActions(detail); this.resetNodeActions(detail); this.resetSpecialActions(detail); this.resetGuestbookActions(detail); this.resetGuestCategoryActions(detail); this.resetBarActions(detail); this.resetExamClassActions(detail); this.resetExamPointActions(detail); this.resetKnowledgeActions(detail); this.resetTeacherActions(detail); this.resetDictionaryActions(detail); this.resetGradeActions(detail); this.resetAdActions(detail); this.resetFontShapeActions(detail); this.resetSurveyActions(); this.resetServiceActions(detail); this.resetStoreActions(detail); this.resetTagKeyActions(detail); this.resetPlatformCompanyActions(detail); this.editorOpen.set(true);
|
|
|
if (this.className() === '_User') await this.loadUserGroups();
|