diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.html b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.html new file mode 100644 index 00000000..05954155 --- /dev/null +++ b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.html @@ -0,0 +1,28 @@ + + + + +
+
+ +
+
+ + +
+
+
+ + +
+
+ +
+
+ +
\ No newline at end of file diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.less b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.less new file mode 100644 index 00000000..80d9010f --- /dev/null +++ b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.less @@ -0,0 +1,21 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + nz-range-picker { + width: 100%; + } +} + +.expend-options { + margin-top: -40px; +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.ts b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.ts new file mode 100644 index 00000000..12b92bed --- /dev/null +++ b/src/app/routes/sys-setting/components/audit-reason-config/audit-reason-config.component.ts @@ -0,0 +1,127 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STChange, STColumn, STComponent } from '@delon/abc/st'; +import { SFComponent, SFSchema, SFDateWidgetSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; +import { AuditResonConfigActionModalComponent } from './audit-reson-config-action-modal/audit-reson-config-action-modal.component'; + +@Component({ + selector: 'app-audit-reason-config', + templateUrl: './audit-reason-config.component.html', + styleUrls: ['./audit-reason-config.component.less'] +}) +export class AuditReasonConfigComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + url = `/rule?_allow_anonymous=true`; + + searchSchema: SFSchema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + receiveName: { + type: 'string', + title: '审核类型', + enum: [ + { label: '全部', value: '全部' }, + { label: '企业认证审核', value: '企业认证审核' }, + { label: '企业管理员审核', value: '企业管理员审核' }, + { label: '用户实名认证审核', value: '用户实名认证审核' }, + { label: '司机实名认证审核', value: '司机实名认证审核' }, + { label: '司机驾驶证审核', value: '司机驾驶证审核' }, + { label: '车辆审核', value: '车辆审核' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + change: (i: any) => { + this.sf.value.receiveName = i; + this.sf?.setValue('/receiveName', i); + } + } + }, + phone: { + type: 'string', + title: '驳回理由', + ui: { placeholder: '请输入' } + }, + createTime: { + title: '创建时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd' + } as SFDateWidgetSchema + } + } + }; + + columns: STColumn[] = [ + { title: '操作时间', index: 'updatedAt', type: 'date' }, + { title: '操作人', index: 'description' }, + { title: '操作人手机号码', index: 'description' }, + { title: '操作页面', index: 'description' }, + { title: '操作内容', index: 'description' }, + { + title: '创建时间', + index: 'updatedAt', + type: 'date' + }, + { + title: '操作', + buttons: [ + { + text: '编辑', + click: item => this.reasonAction(item) + }, + { + text: '删除', + click: item => this.deleteReason(item) + } + ] + } + ]; + + reqParams = { pageIndex: 1, pageSize: 10 }; + + constructor(public service: SystemService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + stChange(e: STChange): void {} + + reasonAction(item?: any) { + const modal = this.nzModalService.create({ + nzContent: AuditResonConfigActionModalComponent, + nzComponentParams: item ? { i: { ...item, roleId: 1, name: '车辆审核', phone: 18555555555 } } : { i: { id: 0 } }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + deleteReason(item: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => {} + }); + } + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.html b/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.html new file mode 100644 index 00000000..beead4d9 --- /dev/null +++ b/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.html @@ -0,0 +1,11 @@ + +
+ + +
+ \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.less b/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.ts b/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.ts new file mode 100644 index 00000000..ea2449a9 --- /dev/null +++ b/src/app/routes/sys-setting/components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component.ts @@ -0,0 +1,94 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../../services/system.service'; + +@Component({ + selector: 'app-audit-reson-config-action-modal', + templateUrl: './audit-reson-config-action-modal.component.html', + styleUrls: ['./audit-reson-config-action-modal.component.less'] +}) +export class AuditResonConfigActionModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + ui: SFUISchema = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + } + }; + constructor(private modal: NzModalRef, public service: SystemService) {} + + ngOnInit(): void { + this.initSF(this.i); + } + initSF(staff: any) { + this.schema = { + properties: { + name: { + title: '选择审核类型', + type: 'string', + enum: [ + { label: '全部', value: '全部' }, + { label: '企业认证审核', value: '企业认证审核' }, + { label: '企业管理员审核', value: '企业管理员审核' }, + { label: '用户实名认证审核', value: '用户实名认证审核' }, + { label: '司机实名认证审核', value: '司机实名认证审核' }, + { label: '司机驾驶证审核', value: '司机驾驶证审核' }, + { label: '车辆审核', value: '车辆审核' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + change: (i: any) => { + this.sf.value.name = i; + this.sf?.setValue('/name', i); + } + }, + default: staff.name + }, + phone: { + title: '驳回理由', + type: 'string', + ui: { placeholder: '请输入', widget: 'textarea', autosize: { minRows: 2, maxRows: 6 } }, + default: staff.phone + } + }, + required: ['name'] + }; + } + + sure() { + if (this.i.id === 0) { + const params: any = { + ...this.sf.value, + roleId: this.sf.value.roleId, + telephone: this.sf.value.phone, + staffName: this.sf.value.name + }; + // this.service.request(this.service.$api_addStaff, params).subscribe((res) => { + // console.log(res); + // if (res) { + // this.service.msgSrv.success('保存成功!'); + // this.modal.close(true); + // } + // // this.showInviteFlag = true; + // // this.inviteCode = res.inviteCode; + // }); + } else { + const params: any = { + appUserId: this.i.appUserId, + staffName: this.sf.value.name, + roleId: this.sf.value.roleId, + telephone: this.i.telephone + }; + } + } + + close() { + this.modal.destroy(); + } +} diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.html b/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.html new file mode 100644 index 00000000..beead4d9 --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.html @@ -0,0 +1,11 @@ + +
+ + +
+ \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.less b/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.ts b/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.ts new file mode 100644 index 00000000..0b999760 --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-config/basic-config-action-modal/basic-config-action-modal.component.ts @@ -0,0 +1,106 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../../services/system.service'; + +@Component({ + selector: 'app-basic-config-action-modal', + templateUrl: './basic-config-action-modal.component.html', + styleUrls: ['./basic-config-action-modal.component.less'] +}) +export class BasicConfigActionModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + ui: SFUISchema = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + } + }; + constructor(private modal: NzModalRef,public service: SystemService) {} + + ngOnInit(): void { + this.initSF(this.i); + } + initSF(staff: any) { + this.schema = { + properties: { + name: { + title: '配置类型', + type: 'string', + enum: [ + { label: '全部', value: '全部' }, + { label: '企业认证审核', value: '企业认证审核' }, + { label: '企业管理员审核', value: '企业管理员审核' }, + { label: '用户实名认证审核', value: '用户实名认证审核' }, + { label: '司机实名认证审核', value: '司机实名认证审核' }, + { label: '司机驾驶证审核', value: '司机驾驶证审核' }, + { label: '车辆审核', value: '车辆审核' } + ], + ui: { + widget: 'select', + placeholder: '请选择', + change: (i: any) => { + this.sf.value.name = i; + this.sf?.setValue('/name', i); + } + }, + default: staff.name + }, + phone: { + title: '配置项', + type: 'string', + ui: { placeholder: '请输入' }, + default: staff.phone + }, + roleId: { + type: 'string', + title: '启用状态', + enum: [ + { label: '启用', value: 1 }, + { label: '停用', value: 0 } + ], + ui: { + widget: 'radio' + } as SFRadioWidgetSchema, + default: staff?.roleId || 1 + } + }, + required: ['name', 'phone', 'roleId'] + }; + } + + sure() { + if (this.i.id === 0) { + const params: any = { + ...this.sf.value, + roleId: this.sf.value.roleId, + telephone: this.sf.value.phone, + staffName: this.sf.value.name + }; + // this.service.request(this.service.$api_addStaff, params).subscribe((res) => { + // console.log(res); + // if (res) { + // this.service.msgSrv.success('保存成功!'); + // this.modal.close(true); + // } + // // this.showInviteFlag = true; + // // this.inviteCode = res.inviteCode; + // }); + } else { + const params: any = { + appUserId: this.i.appUserId, + staffName: this.sf.value.name, + roleId: this.sf.value.roleId, + telephone: this.i.telephone + }; + } + } + + close() { + this.modal.destroy(); + } +} diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config.component.html b/src/app/routes/sys-setting/components/basic-config/basic-config.component.html new file mode 100644 index 00000000..96cbbf2e --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-config/basic-config.component.html @@ -0,0 +1,29 @@ + + + + +
+
+ +
+
+ + +
+
+
+ + + +
+
+ +
+
+ +
\ No newline at end of file diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config.component.less b/src/app/routes/sys-setting/components/basic-config/basic-config.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-config/basic-config.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/basic-config/basic-config.component.ts b/src/app/routes/sys-setting/components/basic-config/basic-config.component.ts new file mode 100644 index 00000000..8b540f2e --- /dev/null +++ b/src/app/routes/sys-setting/components/basic-config/basic-config.component.ts @@ -0,0 +1,128 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; +import { BasicConfigActionModalComponent } from './basic-config-action-modal/basic-config-action-modal.component'; + +@Component({ + selector: 'app-basic-config', + templateUrl: './basic-config.component.html', + styleUrls: ['./basic-config.component.less'] +}) +export class BasicConfigComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + url = `/rule?_allow_anonymous=true`; + + searchSchema: SFSchema = { + properties: { + receiveName: { + title: '配置类型', + type: 'string', + ui: { + widget: 'select', + placeholder: '请选择', + // asyncData: () => { + // return this.service.request(this.service.$api_getAppRoleList).pipe( + // map((res: any) => { + // this.roleList = res; + // return res.map((item: any) => { + // return { label: item.roleName, value: item.id }; + // }); + // }), + // ); + // }, + change: (i: any) => { + this.sf.value.receiveName = i; + this.sf?.setValue('/receiveName', i); + } + } + } + } + }; + + columns: STColumn[] = [ + { title: '配置类型', index: 'no' }, + { title: '配置项', index: 'description' }, + { + title: '启用状态', + className: 'text-center', + index: 'status', + type: 'badge', + badge: { + 0: { text: '启用', color: 'success' }, + 2: { text: '停用', color: 'error' }, + 3: { text: '停用', color: 'error' }, + 1: { text: '停用', color: 'error' } + } + }, + { + title: '创建时间', + index: 'updatedAt', + type: 'date' + }, + { + title: '操作', + buttons: [ + { + text: '编辑', + click: item => this.configAction(item) + }, + { + text: '停用', + click: item => this.deactivateConfig(item) + } + ] + } + ]; + + selectedRows: any[] = []; + + reqParams = { pageIndex: 1, pageSize: 10 }; + + constructor(public service: SystemService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + + configAction(item?: any) { + const modal = this.nzModalService.create({ + nzContent: BasicConfigActionModalComponent, + nzComponentParams: item ? { i: { ...item, roleId: 1, name: '车辆审核', phone: 18555555555 } } : { i: { id: 0 } }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + deactivateConfig(item?: any) { + this.nzModalService.error({ + nzTitle: '确认停用?', + nzContent: ``, + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => {} + }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.html b/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.html new file mode 100644 index 00000000..beead4d9 --- /dev/null +++ b/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.html @@ -0,0 +1,11 @@ + +
+ + +
+ \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.less b/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.less new file mode 100644 index 00000000..e69de29b diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.ts b/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.ts new file mode 100644 index 00000000..3dc63a29 --- /dev/null +++ b/src/app/routes/sys-setting/components/cart-config/cart-config-action-modal/cart-config-action-modal.component.ts @@ -0,0 +1,123 @@ +import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { SFComponent, SFRadioWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { NzMessageService } from 'ng-zorro-antd/message'; +import { NzModalRef } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../../services/system.service'; + +@Component({ + selector: 'app-cart-config-action-modal', + templateUrl: './cart-config-action-modal.component.html', + styleUrls: ['./cart-config-action-modal.component.less'] +}) +export class CartConfigActionModalComponent implements OnInit { + @ViewChild('sf', { static: false }) + sf!: SFComponent; + i: any; + schema!: SFSchema; + ui: SFUISchema = { + '*': { + spanLabelFixed: 120, + grid: { span: 24 } + } + }; + @Input() + configType: number = 1; + constructor(private modal: NzModalRef, public service: SystemService) {} + + ngOnInit(): void { + this.initSF(this.i); + console.log(this.configType); + } + initSF(staff: any) { + let required: any = []; + switch (this.configType) { + case 1: + required = ['phone1']; + break; + case 2: + required = ['phone2']; + break; + case 3: + required = ['phone3']; + break; + + default: + break; + } + this.schema = { + properties: { + phone1: { + title: '车型', + type: 'string', + ui: { + placeholder: '请输入', + hidden: this.configType === 2 || this.configType === 3 + }, + default: staff.phone1 + }, + phone2: { + title: '车长', + type: 'string', + ui: { + placeholder: '请输入', + hidden: this.configType === 1 || this.configType === 3 + }, + default: staff.phone2 + }, + phone3: { + title: '物品名称', + type: 'string', + ui: { + placeholder: '请输入', + hidden: this.configType === 1 || this.configType === 2 + }, + default: staff.phone3 + }, + roleId: { + type: 'string', + title: '状态', + enum: [ + { label: '启用', value: 1 }, + { label: '停用', value: 0 } + ], + ui: { + widget: 'radio' + } as SFRadioWidgetSchema, + default: staff?.roleId || 1 + } + }, + required: required + }; + } + + sure() { + if (this.i.id === 0) { + const params: any = { + ...this.sf.value, + roleId: this.sf.value.roleId, + telephone: this.sf.value.phone, + staffName: this.sf.value.name + }; + // this.service.request(this.service.$api_addStaff, params).subscribe((res) => { + // console.log(res); + // if (res) { + // this.service.msgSrv.success('保存成功!'); + // this.modal.close(true); + // } + // // this.showInviteFlag = true; + // // this.inviteCode = res.inviteCode; + // }); + } else { + const params: any = { + appUserId: this.i.appUserId, + staffName: this.sf.value.name, + roleId: this.sf.value.roleId, + telephone: this.i.telephone + }; + } + } + + close() { + this.modal.destroy(); + } +} diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config.component.html b/src/app/routes/sys-setting/components/cart-config/cart-config.component.html new file mode 100644 index 00000000..755e4a0a --- /dev/null +++ b/src/app/routes/sys-setting/components/cart-config/cart-config.component.html @@ -0,0 +1,33 @@ + + + + + + + + + +
+
+ +
+
+ + +
+
+
+ + +
+
+ +
+
+ +
\ No newline at end of file diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config.component.less b/src/app/routes/sys-setting/components/cart-config/cart-config.component.less new file mode 100644 index 00000000..72efc9a9 --- /dev/null +++ b/src/app/routes/sys-setting/components/cart-config/cart-config.component.less @@ -0,0 +1,21 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + .tabs-wrap>.ant-tabs-nav { + margin-bottom: 0; + } + + h1 { + margin: 0; + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/cart-config/cart-config.component.ts b/src/app/routes/sys-setting/components/cart-config/cart-config.component.ts new file mode 100644 index 00000000..b56ee7a1 --- /dev/null +++ b/src/app/routes/sys-setting/components/cart-config/cart-config.component.ts @@ -0,0 +1,174 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; +import { CartConfigActionModalComponent } from './cart-config-action-modal/cart-config-action-modal.component'; + +@Component({ + selector: 'app-cart-config', + templateUrl: './cart-config.component.html', + styleUrls: ['./cart-config.component.less'] +}) +export class CartConfigComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + tabs = [ + { + name: '车型配置', + type: 1, + isActived: false + }, + { + name: '车长配置', + type: 2, + isActived: false + }, + { + name: '禁限物品名单', + type: 3, + isActived: false + } + ]; + tabType = 1; + url = `/rule?_allow_anonymous=true`; + + searchSchema: SFSchema = { + properties: { + tabType: { + type: 'number', + ui: { + hidden: true + } + }, + params1: { + title: '车型', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + tabType: (value: number) => this.tabType === 1 + } + } + }, + params2: { + title: '车长', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + tabType: (value: number) => this.tabType === 2 + } + } + }, + params3: { + title: '物品名称', + type: 'string', + ui: { + placeholder: '请输入', + visibleIf: { + tabType: (value: number) => this.tabType === 3 + } + } + } + } + }; + + columns: STColumn[] = [ + { title: '车型', index: 'no', iif: () => this.tabType === 1 }, + { title: '车长', index: 'no', iif: () => this.tabType === 2 }, + { title: '物品名称', index: 'no', iif: () => this.tabType === 3 }, + { + title: '启用状态', + className: 'text-center', + index: 'status', + type: 'badge', + badge: { + 0: { text: '启用', color: 'success' }, + 2: { text: '禁用', color: 'error' }, + 3: { text: '禁用', color: 'error' }, + 1: { text: '禁用', color: 'error' } + } + }, + { + title: '创建时间', + index: 'updatedAt', + type: 'date' + }, + { + title: '操作', + buttons: [ + { + text: '编辑', + click: item => this.configAction(item) + }, + { + text: '删除', + click: item => this.deleteAction(item) + } + ] + } + ]; + + selectedRows: any[] = []; + + reqParams = { pageIndex: 1, pageSize: 10 }; + + constructor(public service: SystemService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + // 切换Tab + changeTab(item: any) { + this.tabType = item.type; + this.sf?.setValue('/tabType', item.type); + this.sf?.reset(); + setTimeout(() => { + this.tabs.forEach(i => (i.isActived = false)); + item.isActived = !item.isActived; + this.st.load(1); + this.st.resetColumns(); + }, 500); + } + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + + configAction(item?: any) { + const modal = this.nzModalService.create({ + nzContent: CartConfigActionModalComponent, + nzComponentParams: item + ? { i: { ...item, roleId: 1, phone1: '车辆审核', phone2: '车辆审核', phone3: '车辆审核' }, configType: this.tabType } + : { i: { id: 0 }, configType: this.tabType }, + nzFooter: null + }); + modal.afterClose.subscribe(res => { + this.st.load(); + }); + } + + deleteAction(item?: any) { + this.nzModalService.error({ + nzTitle: '确认删除?', + nzClosable: false, + nzCancelText: '取消', + nzOnOk: () => {} + }); + } + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/sys-setting/components/role-management/role-management.component.html b/src/app/routes/sys-setting/components/role-management/role-management.component.html new file mode 100644 index 00000000..f6339284 --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/role-management.component.html @@ -0,0 +1,29 @@ + + + + +
+
+ +
+
+ + +
+
+
+ + + +
+
+ +
+
+ +
\ No newline at end of file diff --git a/src/app/routes/sys-setting/components/role-management/role-management.component.less b/src/app/routes/sys-setting/components/role-management/role-management.component.less new file mode 100644 index 00000000..04fd4ba3 --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/role-management.component.less @@ -0,0 +1,13 @@ +:host::ng-deep{ + .search-box{ + .ant-card-body{ + padding-bottom: 18px; + } + } + + .content-box{ + .ant-card-body{ + padding-top: 14px; + } + } +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/role-management/role-management.component.ts b/src/app/routes/sys-setting/components/role-management/role-management.component.ts new file mode 100644 index 00000000..c0ba32d1 --- /dev/null +++ b/src/app/routes/sys-setting/components/role-management/role-management.component.ts @@ -0,0 +1,81 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-role-management', + templateUrl: './role-management.component.html', + styleUrls: ['./role-management.component.less'] +}) +export class RoleManagementComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + url = `/rule?_allow_anonymous=true`; + + searchSchema: SFSchema = { + properties: { + receiveName: { + type: 'string', + title: '角色名称', + ui: { placeholder: '请输入' } + } + } + }; + + columns: STColumn[] = [ + { title: '角色名称', index: 'no' }, + { title: '角色描述', index: 'description' }, + { title: '创建人手机号', index: 'description' }, + { + title: '创建时间', + index: 'updatedAt', + type: 'date' + }, + { + title: '操作', + buttons: [ + { + text: '编辑' + // click: item => this.staffAction(item) + }, + { + text: '删除' + // click: item => this.action(3) + } + ] + } + ]; + + selectedRows: any[] = []; + + reqParams = { pageIndex: 1, pageSize: 10 }; + + constructor(public service: SystemService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + + roleAction(item?: any) {} + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + } +} diff --git a/src/app/routes/sys-setting/components/system-logs/system-logs.component.html b/src/app/routes/sys-setting/components/system-logs/system-logs.component.html new file mode 100644 index 00000000..6cd3aed6 --- /dev/null +++ b/src/app/routes/sys-setting/components/system-logs/system-logs.component.html @@ -0,0 +1,27 @@ + + + + +
+
+ +
+
+ + + +
+
+
+ + + + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/system-logs/system-logs.component.less b/src/app/routes/sys-setting/components/system-logs/system-logs.component.less new file mode 100644 index 00000000..80d9010f --- /dev/null +++ b/src/app/routes/sys-setting/components/system-logs/system-logs.component.less @@ -0,0 +1,21 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + nz-range-picker { + width: 100%; + } +} + +.expend-options { + margin-top: -40px; +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/system-logs/system-logs.component.ts b/src/app/routes/sys-setting/components/system-logs/system-logs.component.ts new file mode 100644 index 00000000..6839951f --- /dev/null +++ b/src/app/routes/sys-setting/components/system-logs/system-logs.component.ts @@ -0,0 +1,109 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema, SFUISchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-system-logs', + templateUrl: './system-logs.component.html', + styleUrls: ['./system-logs.component.less'] +}) +export class SystemLogsComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + url = `/rule?_allow_anonymous=true`; + + searchSchema: SFSchema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + receiveName: { + type: 'string', + title: '操作人', + ui: { placeholder: '请输入' } + }, + phone: { + type: 'string', + title: '手机号码', + ui: { placeholder: '请输入' } + }, + page: { + type: 'string', + title: '操作页面', + ui: { + placeholder: '请输入' + } + }, + content: { + type: 'string', + title: '操作内容', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + createTime: { + title: '操作时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + + columns: STColumn[] = [ + { title: '操作时间', index: 'updatedAt', type: 'date' }, + { title: '操作人', index: 'description' }, + { title: '操作人手机号码', index: 'description' }, + { title: '操作页面', index: 'description' }, + { title: '操作内容', index: 'description' }, + { + title: '创建时间', + index: 'updatedAt', + type: 'date' + } + ]; + + selectedRows: any[] = []; + + reqParams = { pageIndex: 1, pageSize: 10 }; + _$expand = false; + + constructor(public service: SystemService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + stChange(e: STChange): void {} + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } +} diff --git a/src/app/routes/sys-setting/components/user-logs/user-logs.component.html b/src/app/routes/sys-setting/components/user-logs/user-logs.component.html new file mode 100644 index 00000000..fb7cfab8 --- /dev/null +++ b/src/app/routes/sys-setting/components/user-logs/user-logs.component.html @@ -0,0 +1,27 @@ + + + + +
+
+ +
+
+ + + +
+
+
+ + + + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/user-logs/user-logs.component.less b/src/app/routes/sys-setting/components/user-logs/user-logs.component.less new file mode 100644 index 00000000..80d9010f --- /dev/null +++ b/src/app/routes/sys-setting/components/user-logs/user-logs.component.less @@ -0,0 +1,21 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + nz-range-picker { + width: 100%; + } +} + +.expend-options { + margin-top: -40px; +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/user-logs/user-logs.component.ts b/src/app/routes/sys-setting/components/user-logs/user-logs.component.ts new file mode 100644 index 00000000..d7707c88 --- /dev/null +++ b/src/app/routes/sys-setting/components/user-logs/user-logs.component.ts @@ -0,0 +1,115 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-user-logs', + templateUrl: './user-logs.component.html', + styleUrls: ['./user-logs.component.less'] +}) +export class UserLogsComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + url = `/rule?_allow_anonymous=true`; + + searchSchema: SFSchema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + receiveName: { + type: 'string', + title: '登录端口', + ui: { placeholder: '请输入' } + }, + phone: { + type: 'string', + title: '登录方式', + ui: { placeholder: '请输入' } + }, + page: { + type: 'string', + title: '位置', + ui: { + placeholder: '请输入' + } + }, + content: { + type: 'string', + title: 'ip', + ui: { + placeholder: '请输入', + visibleIf: { + expand: (value: boolean) => value + } + } + }, + createTime: { + title: '登录时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + + columns: STColumn[] = [ + { title: '登录时间', index: 'updatedAt', type: 'date' }, + { title: '登录端口', index: 'description' }, + { title: '姓名', index: 'description' }, + { title: '登录方式', index: 'description' }, + { title: '位置', index: 'description' }, + { title: 'ip', index: 'description' } + ]; + selectedRows: any[] = []; + + reqParams = { pageIndex: 1, pageSize: 10 }; + _$expand = false; + + constructor(public service: SystemService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + + roleAction(item?: any) {} + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } +} diff --git a/src/app/routes/sys-setting/components/version-logs/version-logs.component.html b/src/app/routes/sys-setting/components/version-logs/version-logs.component.html new file mode 100644 index 00000000..6f566f41 --- /dev/null +++ b/src/app/routes/sys-setting/components/version-logs/version-logs.component.html @@ -0,0 +1,27 @@ + + + + +
+
+ +
+
+ + + +
+
+
+ + + + \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/version-logs/version-logs.component.less b/src/app/routes/sys-setting/components/version-logs/version-logs.component.less new file mode 100644 index 00000000..80d9010f --- /dev/null +++ b/src/app/routes/sys-setting/components/version-logs/version-logs.component.less @@ -0,0 +1,21 @@ +:host::ng-deep { + .search-box { + .ant-card-body { + padding-bottom: 18px; + } + } + + .content-box { + .ant-card-body { + padding-top: 14px; + } + } + + nz-range-picker { + width: 100%; + } +} + +.expend-options { + margin-top: -40px; +} \ No newline at end of file diff --git a/src/app/routes/sys-setting/components/version-logs/version-logs.component.ts b/src/app/routes/sys-setting/components/version-logs/version-logs.component.ts new file mode 100644 index 00000000..1d68a7ab --- /dev/null +++ b/src/app/routes/sys-setting/components/version-logs/version-logs.component.ts @@ -0,0 +1,109 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { STComponent, STColumn, STChange } from '@delon/abc/st'; +import { SFComponent, SFDateWidgetSchema, SFSchema } from '@delon/form'; +import { NzModalService } from 'ng-zorro-antd/modal'; +import { SystemService } from '../../services/system.service'; + +@Component({ + selector: 'app-version-logs', + templateUrl: './version-logs.component.html', + styleUrls: ['./version-logs.component.less'] +}) +export class VersionLogsComponent implements OnInit { + @ViewChild('st', { static: true }) + st!: STComponent; + @ViewChild('sf', { static: false }) + sf!: SFComponent; + + url = `/rule?_allow_anonymous=true`; + + searchSchema: SFSchema = { + properties: { + expand: { + type: 'boolean', + ui: { + hidden: true + } + }, + receiveName: { + type: 'string', + title: '端口', + ui: { placeholder: '请输入' } + }, + phone: { + type: 'string', + title: '端口方式', + ui: { placeholder: '请输入' } + }, + page: { + type: 'string', + title: '版本号', + ui: { + placeholder: '请输入' + } + }, + createTime: { + title: '发布时间', + type: 'string', + ui: { + widget: 'date', + mode: 'range', + format: 'yyyy-MM-dd', + visibleIf: { + expand: (value: boolean) => value + } + } as SFDateWidgetSchema + } + } + }; + + columns: STColumn[] = [ + { title: '端口', index: 'no' }, + { title: '端口方式', index: 'description' }, + { title: '版本号', index: 'description' }, + { + title: '发布时间', + index: 'updatedAt', + type: 'date' + }, + { title: '更新内容', index: 'description' } + ]; + + selectedRows: any[] = []; + + reqParams = { pageIndex: 1, pageSize: 10 }; + _$expand = false; + + constructor(public service: SystemService, private nzModalService: NzModalService) {} + + ngOnInit(): void {} + + stChange(e: STChange): void { + switch (e.type) { + case 'checkbox': + this.selectedRows = e.checkbox!; + break; + case 'filter': + this.st.load(); + break; + } + } + + roleAction(item?: any) {} + + /** + * 重置表单 + */ + resetSF() { + this.sf.reset(); + this._$expand = false; + } + + /** + * 伸缩查询条件 + */ + expandToggle() { + this._$expand = !this._$expand; + this.sf?.setValue('/expand', this._$expand); + } +} diff --git a/src/app/routes/sys-setting/sys-setting-routing.module.ts b/src/app/routes/sys-setting/sys-setting-routing.module.ts index 7e35a056..fda7ba9b 100644 --- a/src/app/routes/sys-setting/sys-setting-routing.module.ts +++ b/src/app/routes/sys-setting/sys-setting-routing.module.ts @@ -1,8 +1,24 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; +import { AuditReasonConfigComponent } from './components/audit-reason-config/audit-reason-config.component'; +import { BasicConfigComponent } from './components/basic-config/basic-config.component'; +import { CartConfigComponent } from './components/cart-config/cart-config.component'; +import { RoleManagementComponent } from './components/role-management/role-management.component'; import { StaffManagementComponent } from './components/staff-management/staff-management.component'; +import { SystemLogsComponent } from './components/system-logs/system-logs.component'; +import { UserLogsComponent } from './components/user-logs/user-logs.component'; +import { VersionLogsComponent } from './components/version-logs/version-logs.component'; -const routes: Routes = [{ path: 'staff-management', component: StaffManagementComponent }]; +const routes: Routes = [ + { path: 'staff-management', component: StaffManagementComponent }, + { path: 'role-management', component: RoleManagementComponent }, + { path: 'basic-config', component: BasicConfigComponent }, + { path: 'system-logs', component: SystemLogsComponent }, + { path: 'user-logs', component: UserLogsComponent }, + { path: 'version-logs', component: VersionLogsComponent }, + { path: 'audit-reason-config', component: AuditReasonConfigComponent }, + { path: 'cart-config', component: CartConfigComponent }, +]; @NgModule({ imports: [RouterModule.forChild(routes)], diff --git a/src/app/routes/sys-setting/sys-setting.module.ts b/src/app/routes/sys-setting/sys-setting.module.ts index b71876d6..41134a02 100644 --- a/src/app/routes/sys-setting/sys-setting.module.ts +++ b/src/app/routes/sys-setting/sys-setting.module.ts @@ -5,10 +5,36 @@ import { StaffManagementComponent } from './components/staff-management/staff-ma import { SysSettingRoutingModule } from './sys-setting-routing.module'; import { BuyerTranspowerComponent } from './components/staff-management/transpower/transpower.component'; import { SystemStaffStaffModalComponent } from './components/staff-management/staff-modal/staff-modal.component'; +import { RoleManagementComponent } from './components/role-management/role-management.component'; +import { SystemLogsComponent } from './components/system-logs/system-logs.component'; +import { UserLogsComponent } from './components/user-logs/user-logs.component'; +import { VersionLogsComponent } from './components/version-logs/version-logs.component'; +import { BasicConfigComponent } from './components/basic-config/basic-config.component'; +import { AuditReasonConfigComponent } from './components/audit-reason-config/audit-reason-config.component'; +import { BasicConfigActionModalComponent } from './components/basic-config/basic-config-action-modal/basic-config-action-modal.component'; +import { AuditResonConfigActionModalComponent } from './components/audit-reason-config/audit-reson-config-action-modal/audit-reson-config-action-modal.component'; +import { CartConfigComponent } from './components/cart-config/cart-config.component'; +import { CartConfigActionModalComponent } from './components/cart-config/cart-config-action-modal/cart-config-action-modal.component'; -const COMPONENTS = [StaffManagementComponent, BuyerTranspowerComponent, SystemStaffStaffModalComponent]; +const COMPONENTS = [ + StaffManagementComponent, + RoleManagementComponent, + BasicConfigComponent, + SystemLogsComponent, + UserLogsComponent, + VersionLogsComponent, + AuditReasonConfigComponent, + CartConfigComponent +]; +const NOTROUTECOMPONENTS = [ + BuyerTranspowerComponent, + SystemStaffStaffModalComponent, + BasicConfigActionModalComponent, + AuditResonConfigActionModalComponent, + CartConfigActionModalComponent +]; @NgModule({ - declarations: COMPONENTS, + declarations: [...COMPONENTS, ...NOTROUTECOMPONENTS], imports: [CommonModule, SysSettingRoutingModule, SharedModule] }) export class SysSettingModule {} diff --git a/src/assets/mocks/menu-data.json b/src/assets/mocks/menu-data.json index ccce72da..3d2361b8 100644 --- a/src/assets/mocks/menu-data.json +++ b/src/assets/mocks/menu-data.json @@ -85,43 +85,47 @@ }, { "text": "角色管理", - "link": "/demo/alain" + "link": "/system/role-management" }, { "text": "基础设置", - "link": "/demo/alain" + "link": "/system/basic-config" }, { "text": "车型车长配置", - "link": "/demo/alain" + "link": "/system/cart-config" }, { "text": "基础配置", - "link": "/demo/alain" + "link": "/system/basic-config" }, { "text": "系统日志", - "link": "/demo/alain" + "link": "/system/system-logs" }, { "text": "用户登录日志", - "link": "/demo/alain" + "link": "/system/user-logs" }, { "text": "版本发布记录", - "link": "/demo/alain" + "link": "/system/version-logs" }, { "text": "协议配置", - "link": "/demo/alain" + "link": "/system/alain" }, { "text": "审核驳回理由配置", - "link": "/demo/alain" + "link": "/system/audit-reason-config" }, { "text": "系统配置", "link": "/demo/alain" + }, + { + "text": "货物名称配置", + "link": "/demo/alain" } ] }