Merge branch 'feature/partner' of https://gitlab.eascs.com/tms-ui/tms-obc-web into feature/partner

This commit is contained in:
潘晓云
2022-03-17 17:24:56 +08:00
40 changed files with 2637 additions and 23 deletions

View File

@ -49,9 +49,9 @@ export class StartupService {
let data;
if (this.coreSrv.loginStatus) {
// 本地菜单
data = this.loadMockData();
// data = this.loadMockData();
// 远程菜单
// data = this.loadRemoteData();
data = this.loadRemoteData();
} else {
data = this.loadMockData();
}
@ -134,12 +134,12 @@ export class StartupService {
const userData = this.httpClient.post(this.userSrv.$api_get_user_by_token, {}).pipe(map((res: any) => res.data));
// 菜单数据
const menuData = this.httpClient
.post(this.coreSrv.$api_get_current_user_menus, {
appId: this.coreSrv.envSrv.getEnvironment().appId
})
.pipe(map((res: any) => res.data));
// const menuData = this.httpClient.get('assets/mocks/menu-data.json').pipe(map((res: any) => res.data.menu));
// const menuData = this.httpClient
// .post(this.coreSrv.$api_get_current_user_menus, {
// appId: this.coreSrv.envSrv.getEnvironment().appId
// })
// .pipe(map((res: any) => res.data));
const menuData = this.httpClient.get('assets/mocks/menu-data.json').pipe(map((res: any) => res.data.menu));
return zip(appData, userData, menuData);
}

View File

@ -20,7 +20,14 @@ const alainConfig: AlainConfig = {
sf: { button: { search: '查询' }, ui: { placeholder: '请输入' } },
pageHeader: { homeI18n: 'home', recursiveBreadcrumb: true },
auth: { login_url: '/passport/login' },
acl: { guard_url: '/exception/403' }
acl: { guard_url: '/exception/403' },
chart: {
// 以下是默认配置,如果项目无法外网访问,可以根据 `angular.json` 配置将依赖包直接使用 `./assets***` 路径
libs: [
'https://gw.alipayobjects.com/os/lib/antv/g2/4.1.4/dist/g2.min.js',
'https://gw.alipayobjects.com/os/lib/antv/data-set/0.11.7/dist/data-set.js'
]
}
};
const alainModules = [AlainThemeModule.forRoot(), DelonACLModule.forRoot()];

View File

@ -0,0 +1,24 @@
<!-- 页头 -->
<page-header-wrapper [title]="''" [logo]="logo">
<ng-template #logo>
<button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
<i nz-icon nzType="left" nzTheme="outline"></i>
</button>
</ng-template>
</page-header-wrapper>
<nz-card>
<div class="modal-header">
<div class="modal-title" *ngIf="queryParams.type === 'add'">新增banner</div>
<div class="modal-title" *ngIf="queryParams.type === 'edit'">编辑banner</div>
<div class="modal-title" *ngIf="queryParams.type === 'view'">查看banner</div>
</div>
<sf #sf [schema]="schema" [ui]="ui" [button]="'none'" [formData]="detailData">
</sf>
<div class="modal-footer" *ngIf="queryParams.type !== 'view'">
<button nz-button type="button" (click)="checkSort()" nzType="primary" [disabled]="validFalg">保存</button>
<button nz-button type="button" (click)="goBack()">取消</button>
</div>
</nz-card>
<!-- <nz-modal [(nzVisible)]="isVisible" nzTitle="The first Modal" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<baidu-map [inputAddress]="detailData.companyAddress" [inputPoint]="inputPoint" (outputPointAddress)="outputPointAddress($event)"></baidu-map>
</nz-modal> -->

View File

@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BannerComponentsAddComponent } from './add.component';
describe('BannerComponentsAddComponent', () => {
let component: BannerComponentsAddComponent;
let fixture: ComponentFixture<BannerComponentsAddComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BannerComponentsAddComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(BannerComponentsAddComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,241 @@
import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { EAEnvironmentService } from '@shared';
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
import format from 'date-fns/format';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { NzUploadFile } from 'ng-zorro-antd/upload';
import { Observable, Observer, of } from 'rxjs';
import { BannerService } from '../../services/banner.service';
import { apiConf } from '@conf/api.conf';
@Component({
selector: 'app-ad-components-add',
templateUrl: './add.component.html',
styleUrls: ['./add.less']
})
export class BannerComponentsAddComponent implements OnInit {
@ViewChild('sf', { static: false }) sf!: SFComponent;
record: any = {};
i: any;
schema: SFSchema = {};
contentListData = [];
queryParams: any = {};
oldTakeEffectTime = '';
maxSort = 0;
isVisible = false;
validFalg = true;
detailData: any = {
advertisementContentDTOList: []
};
changeTimeFlag = false;
currentIndex = 0;
addFlag = true;
addId = 1;
inputPoint: any = {
lng: 0,
lat: 0
};
today = new Date();
navData: any = [];
navigationName = '';
ui: SFUISchema = {
'*': {
spanLabelFixed: 200,
grid: { span: 24 },
},
};
constructor(
public msgSrv: NzMessageService,
public http: _HttpClient,
public service: BannerService,
private route: ActivatedRoute,
private router: Router,
private cdr: ChangeDetectorRef,
private envSrv: EAEnvironmentService,
) { }
ngOnInit(): void {
this.queryParams = this.route.snapshot.queryParams;
if (this.queryParams.type !== 'add') {
this.initDetailData();
}
this.initSF();
}
initDetailData() {
}
initSF() {
this.schema = {
properties: {
name: {
type: 'string',
title: 'banner名称',
maxLength: 10,
ui: {
showRequired: true,
placeholder: '请不要超过10个字',
}
},
licensePhotoWatermark: {
type: 'string',
title: 'banner图',
ui: {
action: apiConf.fileUpload,
accept: 'image/png,image/jpeg,image/jpg,image/gif',
limit: 1,
limitFileCount: 1,
resReName: 'data.fullFileWatermarkPath',
urlReName: 'data.fullFileWatermarkPath',
widget: 'upload',
descriptionI18n: '支持JPG、PNG格式文件小于2M建议尺寸 700px * 286px。',
data: {
appId: this.envSrv.env.appId,
},
name: 'multipartFile',
multiple: false,
listType: 'picture-card',
change: (args: any) => {
if (args.type === 'success') {
this.detailData.enterpriseBaseDTO.licensePhoto = args.file.response.data.fullFilePath
}
},
beforeUpload: (file: any, _fileList: any) => {
return new Observable((observer: Observer<boolean>) => {
const isLt4M = file.size / 1024 / 1024 < 2;
if (!isLt4M) {
this.service.msgSrv.warning('图片大小超过2M!');
observer.complete();
return;
}
observer.next(isLt4M);
observer.complete();
});
},
previewFile: (file: NzUploadFile) => of(file.url),
},
},
sortId: {
type: 'string',
title: '顺序',
ui: {
showRequired: true,
widget: '=',
placeholder: '请输入0~99数字越大排序越靠前',
serverSearch: true,
} as SFSelectWidgetSchema,
},
linkType: {
type: 'string',
title: '跳转路径',
ui: {
widget: 'radio',
showRequired: true,
} as SFRadioWidgetSchema,
enum: [
{ label: '文章ID', value: 1 },
{ label: '分类ID', value: 2 },
{ label: '自编辑', value: 3 },
],
},
content: {
type: 'string',
title: '内容',
ui: {
widget: 'tinymce',
loadingTip: 'loading...',
config: {
height: 450
},
visibleIf: { name5: (value: string) => value === '1' }
},
},
},
required: [],
};
if (this.queryParams.type === 'add'){
setTimeout(() => {
this.sf.setValue('/takeEffectType', 1);
this.sf.setValue('/style', 1);
}, 500);
}
}
get reqParams() {
return {};
}
disabledDate = (current: Date): boolean => {
// Can not select days before today and today
return differenceInCalendarDays(current, this.today) < 0;
}
changeTime(){
this.changeTimeFlag = true;
}
checkSort(){
const params: any = {
navigationId: this.sf?.value.navigationId,
sortId: this.sf?.value.sortId,
takeEffectType: this.sf?.value.takeEffectType,
};
if (this.queryParams.id !== '0'){
params.advertisementId = this.queryParams.id;
}
if (this.sf.value.takeEffectType === 2){
if (this.changeTimeFlag) {
params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm');
} else {
params.takeEffectTime = this.detailData.takeEffectTime;
}
}
}
save() {
const params: any = {
...this.sf?.value,
latitude: this.inputPoint.lat,
longitude: this.inputPoint.lng,
id: this.queryParams.id
};
this.detailData.advertisementContentDTOList.forEach((item: any) => {
delete item.addId;
});
if (this.queryParams.type === 'add') {
delete params.id;
}
if (this.sf.value.takeEffectType === 2){
if (this.changeTimeFlag) {
params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm');
} else {
params.takeEffectTime = this.detailData.takeEffectTime;
}
} else {
delete params.takeEffectTime;
}
this.service.request(this.service.$api_add_one, params).subscribe(res => {
if (res) {
this.service.msgSrv.success('保存成功');
this.router.navigate(['../list'], {relativeTo: this.route});
}
});
}
goBack() {
window.history.go(-1);
}
gotoMap() {
this.isVisible = true;
}
handleOk(): void {
this.isVisible = false;
}
handleCancel(): void {
this.isVisible = false;
}
}

View File

@ -0,0 +1,119 @@
:host {
.styleBox {
display: flex;
align-items: flex-end;
margin: 10px 0 0 0;
}
.imgBox {
position: relative;
width: 200px;
padding: 6px 0;
text-align: center;
border: solid 1px #eee;
.leftBox,
.rightBox {
position: absolute;
top: 50%;
transform: translate(0, -50%);
}
img {
width: 170px;
height: 40px;
}
.leftBox {
left: 3px;
}
.rightBox {
right: 3px;
}
}
.imgBox_two {
width: 200px;
padding: 6px;
text-align: center;
border: solid 1px #eee;
img {
width: 100%;
height: 40px;
}
}
.imgBox_three {
width: 200px;
padding: 6px 0;
text-align: center;
border: solid 1px #eee;
img {
width: 25%;
height: 40px;
margin: 0 6% 0 0;
&:first-child {
margin: 0 6%;
}
}
}
.imgBox_four {
width: 200px;
padding: 6px 0;
text-align: center;
border: solid 1px #eee;
img {
width: 22%;
height: 40px;
margin: 0 2% 0 0;
&:first-child {
margin: 0 2%;
}
}
}
.imgBox_one {
width: 60px;
padding: 6px;
text-align: center;
border: solid 1px #eee;
img {
width: 100%;
height: 40px;
}
}
.imgBox_info {
width: 200px;
padding: 6px;
overflow: hidden;
border: solid 1px #eee;
.title {
width: 100%;
line-height: 30px;
text-align: center;
}
.infoBox {
.name {
line-height: 28px;
}
.map {
width: 100%;
text-align: center;
img {
width: 90%;
}
}
}
}
.hint {
margin: 0 0 0 10px;
color: #f00;
}
.addBtn {
margin: 0 0 10px 0;
}
}
.overflowText {
display: -webkit-box;
max-width: 200px;
overflow: hidden;
text-align: left;
text-overflow: -o-ellipsis-lastline;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
}

View File

@ -0,0 +1,62 @@
<!-- 页头 -->
<page-header-wrapper [title]="''"></page-header-wrapper>
<nz-card>
<!-- 搜索表单 -->
<div nz-row [nzGutter]="16">
<!-- 查询字段小于或等于3个时不显示伸缩按钮 -->
<div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
<sf #sf [schema]="schema" [ui]="ui" [mode]="'search'" [disabled]="!sf?.valid" [loading]="false"></sf>
</div>
<!-- 查询字段大于3个时根据展开状态调整布局 -->
<ng-container *ngIf="queryFieldCount > 4">
<div nz-col [nzSpan]="_$expand ? 24 : 18">
<sf #sf [schema]="schema" [ui]="ui" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="false" (click)="st.load()">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</ng-container>
</div>
<!-- 工具栏 -->
<div nz-row>
<div nz-col nzSpan="24">
<button nz-button nzType="primary" (click)="add()">新增banner</button>
</div>
</div>
<!-- 提示栏 -->
<div nz-row>
<div nz-col nzSpan="24">
<nz-alert
nzType="info"
[nzMessage]="'当前共' + (st?.total || 0) + '行记录选中' + selectedRows.length + ''"
nzShowIcon
[ngStyle]="{ margin: '1rem 0' }"
>
</nz-alert>
</div>
</div>
<!-- 数据列表 -->
<st
#st
multiSort
size="small"
[bordered]="true"
[scroll]="{ x: '2000px' }"
[data]="service.$api_get_page"
[columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loadingDelay]="500"
[loading]="service.http.loading"
></st>
</nz-card>

View File

@ -0,0 +1 @@
@import '~@delon/theme/index';

View File

@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BannerComponentsListComponent } from './list.component';
describe('BannerComponentsListComponent', () => {
let component: BannerComponentsListComponent;
let fixture: ComponentFixture<BannerComponentsListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BannerComponentsListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(BannerComponentsListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,237 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STColumn, STComponent, STData } from '@delon/abc/st';
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { BannerService } from '../../services/banner.service';
@Component({
selector: 'app-banner-components-list',
templateUrl: './list.component.html',
styleUrls: ['./list.component.less']
})
export class BannerComponentsListComponent implements OnInit {
schema: SFSchema = {};
columns: STColumn[] = [];
ui: SFUISchema = {};
appList: any[] = [];
_$expand = false;
selectApp = {
appName: '',
appId: ''
};
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
constructor(public service: BannerService, private modal: ModalHelper, private msg: NzMessageService, private router: Router, private modalSrv: NzModalService, private ar: ActivatedRoute) { }
/**
* 查询字段个数
*/
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
/**
* 查询参数
*/
get reqParams() {
const params = Object.assign({}, this.sf?.value || {});
delete params._$expand;
if (params.status === '') {
delete params.status;
}
if (params.style === '') {
delete params.style;
}
if (params.navigationId === '') {
delete params.navigationId;
}
return { ...params};
}
/**
* 选中行
*/
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
}
ngOnInit() {
this.initSF();
this.initST();
}
selectAppFun(item: any) {
this.selectApp = item;
this.st.load(1);
}
dataProcess(data: STData[]): STData[] {
return data.map((i, index) => {
i.showSortFlag = false;
return i;
});
}
initSF() {
this.schema = {
properties: {
_$expand: {
type: 'boolean',
ui: {
hidden: true,
},
},
name: {
type: 'string',
title: 'banner名称',
maxLength: 10,
ui: {
widget: '',
placeholder: '请输入',
}
},
status: {
type: 'string',
title: '状态',
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
} as SFSelectWidgetSchema,
enum: [
{ label: '全部', value: 1 },
{ label: '正常', value: 2 },
{ label: '禁用', value: 3 }
]
},
},
};
this.ui = {
'*': {
spanLabelFixed: 110,
grid: { span: 8 },
},
};
}
initST() {
this.columns = [
{
title: 'banner名称', // 位:px
index: 'name',
className: 'text-center'
},
{
title: 'banner',
index: 'navigationName',
className: 'text-center'
},
{
title: '排序', // 位 px
index: 'sortId',
className: 'text-center'
},
{
title: '状态', // 位 px
index: 'style',
className: 'text-center',
type: 'enum',
enum: {
1: '正常',
2: '禁用',
}
},
{
title: '最后修改时间', // 位 px
index: 'createTime',
className: 'text-center'
},
{
title: '操作',
fixed: 'right',
className: 'text-center',
width: 280,
buttons: [
{
text: '修改',
click: (item) => {
this.router.navigate(['../detail'], { queryParams: { id: item.id, type: 'edit' }, relativeTo: this.ar });
}
},
{
text: '禁用',
pop: {
title: `确定禁用此banner图吗`,
okType: 'danger',
icon: 'alert',
},
click: (item) => {
this.changeStatus(item.id);
},
iif: (item) => item.status === 1
},
{
text: '启用',
pop: {
title: `确定启用此banner图吗`,
okType: 'danger',
icon: 'success',
},
click: (item) => {
this.changeStatus(item);
},
iif: (item) => item.status === 2
},
],
},
];
}
changeStatus(item: any) {
const params = {
status,
idList: [item.id]
};
// this.service.request(this.service.$api_openOrClose, params).subscribe(res => {
// if (res) {
// this.st.reload();
// }
// });
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
this._$expand = false;
}
/**
* 新增单个实例
*/
add() {
this.router.navigate(['../banner/detail'], { queryParams: { id: 0, type: 'add' }, relativeTo: this.ar });
}
/**
* 删除单个实例
*/
del(item: any) {
const ids = [];
ids.push(item.id);
this.service.request(this.service.$api_del_many, ids).subscribe(res => {
if (res) {
this.service.msgSrv.success('删除成功');
this.st.reload();
}
});
}
}

View File

@ -0,0 +1,9 @@
.selectApp {
display: flex;
.appTitle {
font-size: 14px;
}
}
.redfont{
color: #f00;
}

View File

@ -0,0 +1,12 @@
import { Injectable, Injector } from '@angular/core';
import { BaseService } from '@shared';
@Injectable({
providedIn: 'root',
})
export class BannerService extends BaseService {
constructor(public injector: Injector) {
super(injector);
}
}

View File

@ -38,9 +38,13 @@ import { AddPersonalPartnerComponent } from './partner-list/components/add-perso
import { PartnerDetailComponent } from './partner-list/components/partner-detail/partner-detail.component';
import { PartnerListComponent } from './partner-list/components/index/partner-list.component';
import { ParterRebateManageMentAddComponent } from './rebate-management/components/rebate-setting/add/add.component';
import { PartnerKnowledgeClassificationListComponent } from './knowledge/classification/components/list/list.component';
import { ParterArticleManagementListComponent } from './article-management/components/list/list.component';
import { ParterArticleManagementEditComponent } from './article-management/components/edit/edit.component';
import { PartnerKnowledgeClassificationListComponent } from './knowledge/classification/components/list/list.component';
import { ScrollImgComponentsListComponent } from './scrollimg/components/list/list.component';
import { BannerComponentsListComponent } from './knowledge/banner/components/list/list.component';
import { ScrollimgComponentsAddComponent } from './scrollimg/components/add/add.component';
import { BannerComponentsAddComponent } from './knowledge/banner/components/add/add.component';
const routes: Routes = [
{
@ -121,6 +125,14 @@ const routes: Routes = [
{ path: 'partner-detail', component: ParterClaimAuditListPartnerDetailComponent }
]
},
{
path: 'scroll-img',
children: [
{ path: '', component: ScrollImgComponentsListComponent },
{ path: 'list', component: ScrollImgComponentsListComponent },
{ path: 'detail', component: ScrollimgComponentsAddComponent },
]
},
{
path: 'recorded',
children: [
@ -132,9 +144,11 @@ const routes: Routes = [
path: 'knowledge',
children: [
{ path: 'classification', component: PartnerKnowledgeClassificationListComponent },
{ path: 'article-management-list', component: ParterArticleManagementListComponent},
{ path: 'article-management-add', component: ParterArticleManagementEditComponent},
{ path: 'article-management-edit', component: ParterArticleManagementEditComponent},
{ path: 'article-management-list', component: ParterArticleManagementListComponent },
{ path: 'article-management-add', component: ParterArticleManagementEditComponent },
{ path: 'article-management-edit', component: ParterArticleManagementEditComponent },
{ path: 'banner', component: BannerComponentsListComponent},
{ path: 'banner/detail', component: BannerComponentsAddComponent },
]
},
];

View File

@ -54,6 +54,10 @@ import { ParterArticleManagementEditComponent } from './article-management/compo
import { ParterArticleManagementListComponent } from './article-management/components/list/list.component';
import { PartnerKnowledgeClassificationListComponent } from './knowledge/classification/components/list/list.component';
import { PartnerEditComponent } from './knowledge/classification/components/edit/edit.component';
import { ScrollimgComponentsAddComponent } from './scrollimg/components/add/add.component';
import { ScrollImgComponentsListComponent } from './scrollimg/components/list/list.component';
import { BannerComponentsListComponent } from './knowledge/banner/components/list/list.component';
import { BannerComponentsAddComponent } from './knowledge/banner/components/add/add.component';
const COMPONENTS: any[] = [
PartnerBusinessStatisticsIndexComponent,
@ -94,11 +98,15 @@ const COMPONENTS: any[] = [
ParterRebateManageMentAddComponent,
AddEtpPartnerComponent,
AddPersonalPartnerComponent,
ScrollImgComponentsListComponent,
ScrollimgComponentsAddComponent,
ParterArticleManagementEditComponent,
ParterArticleManagementListComponent,
PartnerKnowledgeClassificationListComponent
,
PartnerEditComponent];
PartnerKnowledgeClassificationListComponent,
PartnerEditComponent,
BannerComponentsListComponent,
BannerComponentsAddComponent
];
@NgModule({
declarations: [...COMPONENTS],

View File

@ -0,0 +1,24 @@
<!-- 页头 -->
<page-header-wrapper [title]="''" [logo]="logo">
<ng-template #logo>
<button nz-button nz-tooltip nzTooltipTitle="返回上一页" (click)="goBack()">
<i nz-icon nzType="left" nzTheme="outline"></i>
</button>
</ng-template>
</page-header-wrapper>
<nz-card>
<div class="modal-header">
<div class="modal-title" *ngIf="queryParams.type === 'add'">新建广告</div>
<div class="modal-title" *ngIf="queryParams.type === 'edit'">编辑广告</div>
<div class="modal-title" *ngIf="queryParams.type === 'view'">查看广告</div>
</div>
<sf #sf [schema]="schema" [ui]="ui" [button]="'none'" [formData]="detailData">
</sf>
<div class="modal-footer" *ngIf="queryParams.type !== 'view'">
<button nz-button type="button" (click)="checkSort()" nzType="primary" [disabled]="validFalg">保存</button>
<button nz-button type="button" (click)="goBack()">取消</button>
</div>
</nz-card>
<!-- <nz-modal [(nzVisible)]="isVisible" nzTitle="The first Modal" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<baidu-map [inputAddress]="detailData.companyAddress" [inputPoint]="inputPoint" (outputPointAddress)="outputPointAddress($event)"></baidu-map>
</nz-modal> -->

View File

@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AdComponentsAddComponent } from './add.component';
describe('AdComponentsAddComponent', () => {
let component: AdComponentsAddComponent;
let fixture: ComponentFixture<AdComponentsAddComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AdComponentsAddComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AdComponentsAddComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,243 @@
import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { SFComponent, SFRadioWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { _HttpClient } from '@delon/theme';
import { EAEnvironmentService } from '@shared';
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
import format from 'date-fns/format';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzUploadFile } from 'ng-zorro-antd/upload';
import { Observable, Observer, of } from 'rxjs';
import { apiConf } from '@conf/api.conf';
import { ScrollImgService } from '../../services/scrollimg.service';
@Component({
selector: 'app-ad-components-add',
templateUrl: './add.component.html',
styleUrls: ['./add.less']
})
export class ScrollimgComponentsAddComponent implements OnInit {
@ViewChild('sf', { static: false }) sf!: SFComponent;
record: any = {};
i: any;
schema: SFSchema = {};
contentListData = [];
queryParams: any = {};
oldTakeEffectTime = '';
maxSort = 0;
isVisible = false;
validFalg = true;
detailData: any = {
advertisementContentDTOList: []
};
changeTimeFlag = false;
currentIndex = 0;
addFlag = true;
addId = 1;
inputPoint: any = {
lng: 0,
lat: 0
};
today = new Date();
navData: any = [];
navigationName = '';
ui: SFUISchema = {
'*': {
spanLabelFixed: 200,
grid: { span: 24 },
},
};
constructor(
public msgSrv: NzMessageService,
public http: _HttpClient,
public service: ScrollImgService,
private route: ActivatedRoute,
private router: Router,
private envSrv: EAEnvironmentService,
) { }
ngOnInit(): void {
this.queryParams = this.route.snapshot.queryParams;
if (this.queryParams.type !== 'add') {
this.initDetailData();
}
this.initSF();
}
initDetailData() {
}
initSF() {
this.schema = {
properties: {
name: {
type: 'string',
title: '轮播图名称',
maxLength: 10,
ui: {
showRequired: true,
placeholder: '请不要超过10个字',
}
},
licensePhotoWatermark: {
type: 'string',
title: '轮播图',
ui: {
action: apiConf.fileUpload,
accept: 'image/png,image/jpeg,image/jpg,image/gif',
limit: 1,
limitFileCount: 1,
resReName: 'data.fullFileWatermarkPath',
urlReName: 'data.fullFileWatermarkPath',
widget: 'upload',
descriptionI18n: '图片支持JPG、PNG格式文件小于2M建议尺寸 702px * 280px',
data: {
appId: this.envSrv.env.appId,
},
name: 'multipartFile',
multiple: false,
listType: 'picture-card',
change: (args: any) => {
if (args.type === 'success') {
this.detailData.enterpriseBaseDTO.licensePhoto = args.file.response.data.fullFilePath
}
},
beforeUpload: (file: any, _fileList: any) => {
return new Observable((observer: Observer<boolean>) => {
const isLt4M = file.size / 1024 / 1024 < 2;
if (!isLt4M) {
this.service.msgSrv.warning('图片大小超过2M!');
observer.complete();
return;
}
observer.next(isLt4M);
observer.complete();
});
},
previewFile: (file: NzUploadFile) => of(file.url),
},
},
linkType: {
type: 'string',
title: '可见范围',
ui: {
widget: 'radio',
showRequired: true,
} as SFRadioWidgetSchema,
enum: [
{ label: '全部可见', value: 1 },
{ label: '合伙人可见', value: 2 },
{ label: '销售渠道可见', value: 3 },
],
},
sortId: {
type: 'string',
title: '顺序',
ui: {
showRequired: true,
widget: '=',
placeholder: '请输入0~99数字越大排序越靠前',
serverSearch: true,
} as SFSelectWidgetSchema,
},
content: {
type: 'string',
title: '内容',
ui: {
widget: 'tinymce',
loadingTip: 'loading...',
config: {
height: 450
},
visibleIf: { name5: (value: string) => value === '1' }
},
},
},
required: [],
};
if (this.queryParams.type === 'add') {
setTimeout(() => {
this.sf.setValue('/takeEffectType', 1);
this.sf.setValue('/style', 1);
}, 500);
}
}
get reqParams() {
return {};
}
disabledDate = (current: Date): boolean => {
// Can not select days before today and today
return differenceInCalendarDays(current, this.today) < 0;
}
changeTime() {
this.changeTimeFlag = true;
}
checkSort() {
const params: any = {
navigationId: this.sf?.value.navigationId,
sortId: this.sf?.value.sortId,
takeEffectType: this.sf?.value.takeEffectType,
};
if (this.queryParams.id !== '0') {
params.advertisementId = this.queryParams.id;
}
if (this.sf.value.takeEffectType === 2) {
if (this.changeTimeFlag) {
params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm');
} else {
params.takeEffectTime = this.detailData.takeEffectTime;
}
}
}
save() {
const params: any = {
...this.sf?.value,
latitude: this.inputPoint.lat,
longitude: this.inputPoint.lng,
id: this.queryParams.id
};
this.detailData.advertisementContentDTOList.forEach((item: any) => {
delete item.addId;
});
if (this.queryParams.type === 'add') {
delete params.id;
}
if (this.sf.value.takeEffectType === 2) {
if (this.changeTimeFlag) {
params.takeEffectTime = format(this.detailData.takeEffectTime, 'yyyy-MM-dd HH:mm');
} else {
params.takeEffectTime = this.detailData.takeEffectTime;
}
} else {
delete params.takeEffectTime;
}
this.service.request(this.service.$api_add_one, params).subscribe(res => {
if (res) {
this.service.msgSrv.success('保存成功');
this.router.navigate(['../list'], { relativeTo: this.route });
}
});
}
goBack() {
window.history.go(-1);
}
gotoMap() {
this.isVisible = true;
}
handleOk(): void {
this.isVisible = false;
}
handleCancel(): void {
this.isVisible = false;
}
outputPointAddress(data: any) {
this.sf.setValue('/companyAddress', data.address);
this.inputPoint = data.inputPoint;
}
}

View File

@ -0,0 +1,119 @@
:host {
.styleBox {
display: flex;
align-items: flex-end;
margin: 10px 0 0 0;
}
.imgBox {
position: relative;
width: 200px;
padding: 6px 0;
text-align: center;
border: solid 1px #eee;
.leftBox,
.rightBox {
position: absolute;
top: 50%;
transform: translate(0, -50%);
}
img {
width: 170px;
height: 40px;
}
.leftBox {
left: 3px;
}
.rightBox {
right: 3px;
}
}
.imgBox_two {
width: 200px;
padding: 6px;
text-align: center;
border: solid 1px #eee;
img {
width: 100%;
height: 40px;
}
}
.imgBox_three {
width: 200px;
padding: 6px 0;
text-align: center;
border: solid 1px #eee;
img {
width: 25%;
height: 40px;
margin: 0 6% 0 0;
&:first-child {
margin: 0 6%;
}
}
}
.imgBox_four {
width: 200px;
padding: 6px 0;
text-align: center;
border: solid 1px #eee;
img {
width: 22%;
height: 40px;
margin: 0 2% 0 0;
&:first-child {
margin: 0 2%;
}
}
}
.imgBox_one {
width: 60px;
padding: 6px;
text-align: center;
border: solid 1px #eee;
img {
width: 100%;
height: 40px;
}
}
.imgBox_info {
width: 200px;
padding: 6px;
overflow: hidden;
border: solid 1px #eee;
.title {
width: 100%;
line-height: 30px;
text-align: center;
}
.infoBox {
.name {
line-height: 28px;
}
.map {
width: 100%;
text-align: center;
img {
width: 90%;
}
}
}
}
.hint {
margin: 0 0 0 10px;
color: #f00;
}
.addBtn {
margin: 0 0 10px 0;
}
}
.overflowText {
display: -webkit-box;
max-width: 200px;
overflow: hidden;
text-align: left;
text-overflow: -o-ellipsis-lastline;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
}

View File

@ -0,0 +1,62 @@
<!-- 页头 -->
<page-header-wrapper [title]="''"></page-header-wrapper>
<nz-card>
<!-- 搜索表单 -->
<div nz-row [nzGutter]="16">
<!-- 查询字段小于或等于3个时不显示伸缩按钮 -->
<div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
<sf #sf [schema]="schema" [ui]="ui" [mode]="'search'" [disabled]="!sf?.valid" [loading]="false"></sf>
</div>
<!-- 查询字段大于3个时根据展开状态调整布局 -->
<ng-container *ngIf="queryFieldCount > 4">
<div nz-col [nzSpan]="_$expand ? 24 : 18">
<sf #sf [schema]="schema" [ui]="ui" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
<button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="false" (click)="st.load()">查询</button>
<button nz-button (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</ng-container>
</div>
<!-- 工具栏 -->
<div nz-row>
<div nz-col nzSpan="24">
<button nz-button nzType="primary" (click)="add()">新增轮播图</button>
</div>
</div>
<!-- 提示栏 -->
<div nz-row>
<div nz-col nzSpan="24">
<nz-alert
nzType="info"
[nzMessage]="'当前共' + (st?.total || 0) + '行记录选中' + selectedRows.length + ''"
nzShowIcon
[ngStyle]="{ margin: '1rem 0' }"
>
</nz-alert>
</div>
</div>
<!-- 数据列表 -->
<st
#st
multiSort
size="small"
[bordered]="true"
[scroll]="{ x: '2000px' }"
[data]="service.$api_get_page"
[columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loadingDelay]="500"
[loading]="service.http.loading"
></st>
</nz-card>

View File

@ -0,0 +1 @@
@import '~@delon/theme/index';

View File

@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AdComponentsListComponent } from './list.component';
describe('AdComponentsListComponent', () => {
let component: AdComponentsListComponent;
let fixture: ComponentFixture<AdComponentsListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AdComponentsListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(AdComponentsListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,281 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STColumn, STComponent, STData } from '@delon/abc/st';
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalService } from 'ng-zorro-antd/modal';
import { ScrollImgService } from '../../services/scrollimg.service';
@Component({
selector: 'app-scrollimg-components-list',
templateUrl: './list.component.html',
styleUrls: ['./list.component.less']
})
export class ScrollImgComponentsListComponent implements OnInit {
schema: SFSchema = {};
columns: STColumn[] = [];
ui: SFUISchema = {};
appList: any[] = [];
_$expand = false;
selectApp = {
appName: '',
appId: ''
};
@ViewChild('st', { static: false }) st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
constructor(public service: ScrollImgService, private modal: ModalHelper, private msg: NzMessageService, private router: Router, private modalSrv: NzModalService, private ar: ActivatedRoute) { }
/**
* 查询字段个数
*/
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
/**
* 查询参数
*/
get reqParams() {
const params = Object.assign({}, this.sf?.value || {});
delete params._$expand;
if (params.status === '') {
delete params.status;
}
if (params.style === '') {
delete params.style;
}
if (params.navigationId === '') {
delete params.navigationId;
}
return { ...params};
}
/**
* 选中行
*/
get selectedRows() {
return this.st?.list.filter((item) => item.checked) || [];
}
ngOnInit() {
this.initSF();
this.initST();
}
selectAppFun(item: any) {
this.selectApp = item;
this.st.load(1);
}
dataProcess(data: STData[]): STData[] {
return data.map((i, index) => {
i.showSortFlag = false;
return i;
});
}
initSF() {
this.schema = {
properties: {
_$expand: {
type: 'boolean',
ui: {
hidden: true,
},
},
name: {
type: 'string',
title: '轮播图名称',
maxLength: 10,
ui: {
widget: '',
placeholder: '请输入',
}
},
status1: {
type: 'string',
title: '可见范围',
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
} as SFSelectWidgetSchema,
enum: [
{ label: '全部', value: 1 },
{ label: '全部可见', value: 2 },
{ label: '渠道销售可见', value: 3 },
{ label: '合伙人可见', value: 4 },
]
},
status: {
type: 'string',
title: '状态',
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
} as SFSelectWidgetSchema,
enum: [
{ label: '全部', value: 1 },
{ label: '正常', value: 2 },
{ label: '禁用', value: 3 }
]
},
},
};
this.ui = {
'*': {
spanLabelFixed: 110,
grid: { span: 8 },
},
};
}
initST() {
this.columns = [
{
title: '轮播图名称', // 位:px
index: 'name',
className: 'text-center'
},
{
title: '轮播图',
index: 'navigationName',
className: 'text-center'
},
{
title: '可见范围',
index: 'navigationName',
className: 'text-center'
},
{
title: '排序', // 位 px
index: 'sortId',
className: 'text-center'
},
{
title: '状态', // 位 px
index: 'style',
className: 'text-center',
type: 'enum',
enum: {
1: '正常',
2: '禁用',
}
},
{
title: '最后修改时间', // 位 px
index: 'createTime',
className: 'text-center'
},
{
title: '操作',
fixed: 'right',
className: 'text-center',
width: 280,
buttons: [
{
text: '修改',
click: (item) => {
this.router.navigate(['../detail'], { queryParams: { id: item.id, type: 'edit' }, relativeTo: this.ar });
}
},
{
text: '禁用',
pop: {
title: `是否确认禁用?`,
okType: 'danger',
icon: 'alert',
},
click: (item) => {
this.changeStatus(item.id);
},
iif: (item) => item.status === 1
},
{
text: '启用',
pop: {
title: `是否确认启用?`,
okType: 'danger',
icon: 'alert',
},
click: (item) => {
this.changeStatus(item);
},
iif: (item) => item.status === 2
},
{
text: '查看',
click: (item) => {
this.router.navigate(['../view'], { queryParams: { id: item.id, type: 'view' }, relativeTo: this.ar });
}
},
{
text: '删除',
pop: {
title: `确定删除吗?`,
okType: 'danger',
icon: 'alert',
},
click: (item) => {
this.del(item);
},
iif: (item) => item.status === 2
},
{
text: '操作记录',
click: (item) => {
this.router.navigate(['../operatordata'], { queryParams: { id: item.id }, relativeTo: this.ar });
}
},
],
},
];
}
changeStatus(item: any) {
const params = {
status,
idList: [item.id]
};
// this.service.request(this.service.$api_openOrClose, params).subscribe(res => {
// if (res) {
// this.st.reload();
// }
// });
}
/**
* 伸缩查询条件
*/
expandToggle() {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
this._$expand = false;
}
/**
* 新增单个实例
*/
add() {
this.router.navigate(['../detail'], { queryParams: { id: 0, type: 'add' }, relativeTo: this.ar });
}
/**
* 删除单个实例
*/
del(item: any) {
const ids = [];
ids.push(item.id);
this.service.request(this.service.$api_del_many, ids).subscribe(res => {
if (res) {
this.service.msgSrv.success('删除成功');
this.st.reload();
}
});
}
}

View File

@ -0,0 +1,9 @@
.selectApp {
display: flex;
.appTitle {
font-size: 14px;
}
}
.redfont{
color: #f00;
}

View File

@ -0,0 +1,12 @@
import { Injectable, Injector } from '@angular/core';
import { BaseService } from '@shared';
@Injectable({
providedIn: 'root',
})
export class ScrollImgService extends BaseService {
constructor(public injector: Injector) {
super(injector);
}
}

View File

@ -0,0 +1,13 @@
<button nz-button (click)="refresh()" nzType="primary">Refresh</button>
<g2-pie
#pie
[hasLegend]="true"
title="销售额"
subTitle="销售额"
[total]="total"
[valueFormat]="format"
[data]="salesPieData"
height="294"
repaint="false"
(clickItem)="handleClick($event)"
></g2-pie>

View File

@ -0,0 +1,66 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { G2PieClickItem, G2PieComponent, G2PieData } from '@delon/chart/pie';
import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.less']
})
export class DashboardComponent implements OnInit {
@ViewChild('pie', { static: false }) readonly pie!: G2PieComponent;
salesPieData: G2PieData[] = [];
total = '';
constructor(private msg: NzMessageService) {
this.refresh();
}
ngOnInit(): void {
throw new Error('Method not implemented.');
}
refresh(): void {
const rv = (min: number = 0, max: number = 5000) => Math.floor(Math.random() * (max - min + 1) + min);
this.salesPieData = [
{
x: '家用电器',
y: rv()
},
{
x: '食用酒水',
y: rv()
},
{
x: '个护健康',
y: rv()
},
{
x: '服饰箱包',
y: rv()
},
{
x: '母婴产品',
y: rv()
}
];
if (Math.random() > 0.5) {
this.salesPieData.push({
x: '其他',
y: rv()
});
}
this.total = `&yen ${this.salesPieData.reduce((pre, now) => now.y + pre, 0).toFixed(2)}`;
if (this.pie) {
// 等待组件渲染
setTimeout(() => this.pie.changeData());
}
}
format(val: number): string {
return `&yen ${val.toFixed(2)}`;
}
handleClick(data: G2PieClickItem): void {
this.msg.info(`${data.item.x} - ${data.item.y}`);
}
}

View File

@ -0,0 +1,12 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { DashboardComponent } from './components/dashboard/dashboard.component';
const routes: Routes = [{ path: 'dashboard', component: DashboardComponent }];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class RegulatoryDataRoutingModule {}

View File

@ -0,0 +1,14 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SharedModule, SHARED_G2_MODULES } from '@shared';
import { DashboardComponent } from './components/dashboard/dashboard.component';
import { RegulatoryDataRoutingModule } from './regulatory-data-routing.module';
const COMPONENTS: any = [DashboardComponent];
const NOTROUTECOMPONENTS: any = [];
@NgModule({
declarations: [...COMPONENTS, ...NOTROUTECOMPONENTS],
imports: [CommonModule, RegulatoryDataRoutingModule, SharedModule, SHARED_G2_MODULES]
})
export class RegulatoryDataModule {}

View File

@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class RegulatoryDataService {
constructor() { }
}

View File

@ -15,6 +15,7 @@ import { RouterModule, Routes } from '@angular/router';
import { LayoutProComponent } from '@brand';
import { EATokenGuard } from '@core';
import { environment } from '@env/environment';
import { AuthGuard } from '../core/guards/auth.guard';
// dashboard pages
@ -68,6 +69,7 @@ const routes: Routes = [
},
{ path: 'menu-management', loadChildren: () => import('./menu-manager/menu-manager.module').then(m => m.MenuManagerModule) },
{ path: 'partner', loadChildren: () => import('./partner/partner.module').then(m => m.PartnerModule) },
{ path: 'regulatory-data', loadChildren: () => import('./regulatory-data/regulatory-data.module').then(m => m.RegulatoryDataModule) },
{
path: 'download',
loadChildren: () => import('./download/download.module').then(m => m.DownloadModule)
@ -92,4 +94,4 @@ const routes: Routes = [
],
exports: [RouterModule]
})
export class RouteRoutingModule { }
export class RouteRoutingModule {}

View File

@ -0,0 +1,34 @@
<div class="modal-header">
<div class="modal-title" *ngIf="i.flag === 'add'">车辆协助认证</div>
<div class="modal-title" *ngIf="i.flag !== 'add'">添加车辆</div>
</div>
<!-- <nz-spin *ngIf="!i" class="modal-spin"></nz-spin> -->
<div class="sfBox">
<sf #sf [compact]="true" [ui]="ui" [schema]="schema" [button]="'none'" *ngIf="schema" [formData]="detailData">
<ng-template sf-template="tipsA" let-me let-ui="ui" let-schema="schema">
<div class="pr">
<dl class="tips">
<dt>行驶证首页</dt>
<dd>示例</dd>
</dl>
<div class="pa"><img width="190" src="/assets/images/driverfront.png" /></div>
</div>
</ng-template>
<ng-template sf-template="tipsB" let-me let-ui="ui" let-schema="schema">
<div class="pr">
<dl class="tips">
<dt>行驶证副页</dt>
<dd>示例</dd>
</dl>
<div class="pa"><img width="190" src="/assets/images/driverback.png" /></div>
</div>
</ng-template>
</sf>
<img class="drivercard" height="104" src="/assets/images/car.png" />
<img class="agreement" height="104" src="/assets/images/agreement.png" />
<img class="jopcard" height="104" src="/assets/images/road.png" />
</div>
<div class="modal-footer">
<button nz-button type="button" (click)="close()">关闭</button>
<button nz-button type="button" nzType="primary" (click)="submitForm()" [disabled]="!sf?.valid" [nzLoading]="checked">确定</button>
</div>

View File

@ -0,0 +1,123 @@
.sfBox {
position: relative;
.example {
position: absolute;
top: 215px;
right: 265px;
color: #1890ff;
cursor: pointer;
.popBox {
position: absolute;
top: -170px;
left: -125px;
width: 300px;
padding: 20px;
text-align: center;
background: #fff;
border: solid 1px #eee;
border-radius: 6px;
box-shadow: 0 1px 5px 1px #ececec;
&::before {
position: absolute;
bottom: -5px;
left: 50%;
width: 10px;
height: 10px;
margin-left: -5px;
background: #fff;
box-shadow: 0 1px 5px 1px #ececec;
transform: rotate(45deg);
content: '';
}
&::after {
position: absolute;
bottom: 0;
left: 0;
z-index: 10;
width: 100%;
height: 10px;
background: #fff;
content: '';
}
img {
max-width: 100%;
max-height: 200px;
}
}
}
.positionSet{
top: 356px;
right: 235px;
}
.positionSet01{
top: 500px;
right: 200px;
}
.positionSet02{
top: 664px;
right: 265px;
}
.positionSet03{
top: 808px;
right: 205px;
}
}
.exaA{
position: absolute;
top: 0;
left: 300px
}
.pr {
position: relative;
}
.pa {
position: absolute;
top: 35px;
left: 150px;
}
.tips {
display: flex;
margin-bottom: 0;
color: #333;
dt {
width: 150px;
}
dd {
width: 190px;
margin-bottom: 0;
text-align: center;
}
}
.drivercard{
position: absolute;
top: 0;
left: 330px;
border: solid 1px #ebf0fb;
}
.jopcard{
position: absolute;
top: 1356px;
left: 330px;
border: solid 1px #ebf0fb;
}
.agreement{
position: absolute;
top: 425px;
left: 330px;
border: solid 1px #ebf0fb;
}
:host{
::ng-deep {
.ant-input-borderless{
padding: 0;
padding-top: 4px;
color: black;
resize:none;
}
}
}

View File

@ -0,0 +1,24 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { CarCarauthComponent } from './carauth.component';
describe('CarCarauthComponent', () => {
let component: CarCarauthComponent;
let fixture: ComponentFixture<CarCarauthComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ CarCarauthComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CarCarauthComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,654 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { apiConf } from '@conf/api.conf';
import { cacheConf } from '@conf/cache.conf';
import { SFUISchema, SFSchema, SFUploadWidgetSchema, SFComponent, SFSelectWidgetSchema } from '@delon/form';
import { _HttpClient } from '@delon/theme';
import { EACacheService, EAEnvironmentService } from '@shared';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { NzUploadFile } from 'ng-zorro-antd/upload';
import { Observable, Observer, of } from 'rxjs';
import { ListService } from '../../services/list.service';
@Component({
selector: 'app-car-carauth',
templateUrl: './carauth.component.html',
styleUrls: ['./carauth.component.less']
})
export class CarCarauthComponent implements OnInit {
@ViewChild('sf', { static: false }) sf!: SFComponent;
record: any = {};
i: any;
ui: SFUISchema = {};
schema: SFSchema = {};
showCardFlag = false;
showJopFlag = false;
companyData: any = {};
detailData: any = {};
carNo = ''
checked = false
constructor(
private modal: NzModalRef,
public service: ListService,
private envSrv: EAEnvironmentService,
private eaCacheSrv: EACacheService,
) { }
ngOnInit(): void {
this.initData()
this.initSF()
}
initData() {
if(this.i.id){
this.companyData = this.eaCacheSrv.get(cacheConf.env)
const params = {
id: this.i.id
}
this.service.request(this.service.$api_getShipperCar, params).subscribe(res => {
this.detailData = res
this.detailData.isSelf = res.isSelf ? 1 : 0
this.detailData.isTrailer = res.isTrailer ? 1 : 0
this.detailData.carFrontPhotoWatermark = [
{
uid: -1,
name: 'LOGO',
status: 'done',
url: this.detailData.carFrontPhotoWatermark,
response:this.detailData.carFrontPhotoWatermark,
},
];
this.detailData.carProtocalWatermark = [
{
uid: -1,
name: 'LOGO',
status: 'done',
url: this.detailData.carProtocalWatermark,
response: this.detailData.carProtocalWatermark,
},
];
this.detailData.certificatePhotoFrontWatermark = [
{
uid: -1,
name: 'LOGO',
status: 'done',
url: this.detailData.certificatePhotoFrontWatermark,
response: this.detailData.certificatePhotoFrontWatermark,
},
];
this.detailData.certificatePhotoBackWatermark = [
{
uid: -1,
name: 'LOGO',
status: 'done',
url: this.detailData.certificatePhotoBackWatermark,
response: this.detailData.certificatePhotoBackWatermark,
},
];
if(this.detailData.roadTransportPhotoWatermark !== null) {
this.detailData.roadTransportPhotoWatermark = [
{
uid: -1,
name: 'LOGO',
status: 'done',
url: this.detailData.roadTransportPhotoWatermark,
response: this.detailData.roadTransportPhotoWatermark,
},
];
}
})
}
}
initSF() {
this.schema = {
properties: {
carFrontPhotoWatermark: {
type: 'string',
title: '车头照照片',
ui: {
action: apiConf.fileUpload,
accept: 'image/png,image/jpeg,image/jpg,image/gif',
limit: 1,
limitFileCount: 1,
resReName: 'data.fullFileWatermarkPath',
urlReName: 'data.fullFileWatermarkPath',
widget: 'upload',
descriptionI18n: '请上传车头照照片支持JPG、PNG格式文件小于5M。',
data: {
appId: this.envSrv.env.appId,
},
name: 'multipartFile',
multiple: false,
listType: 'picture-card',
change: (args: any) => {
if (args.type === 'success') {
this.detailData.carFrontPhoto = args.file.response.data.fullFilePath
}
},
beforeUpload: (file: any, _fileList: any) => {
return new Observable((observer: Observer<boolean>) => {
const isLt2M = file.size / 1024 / 1024 < 5;
if (!isLt2M) {
this.service.msgSrv.warning('图片大小超过5M!');
observer.complete();
return;
}
observer.next(isLt2M);
observer.complete();
});
},
previewFile: (file: NzUploadFile) => of(file.url),
},
},
carNo: {
title: '车牌号',
type: 'string',
maxLength: 9,
ui: {
placeholder: '请输入',
},
},
carNoColor: {
title: '车牌颜色',
type: 'string',
ui: {
widget: 'dict-select',
params: { dictKey: 'car:color' },
placeholder: '请选择车牌颜色',
containsAllLabel:false,
} as SFSelectWidgetSchema,
},
carModel: {
title: '车型',
type: 'string',
ui: {
widget: 'dict-select',
params: { dictKey: 'car:model' },
placeholder: '请选择车型',
containsAllLabel:false,
} as SFSelectWidgetSchema,
},
carLength: {
title: '车长',
type: 'string',
ui: {
widget: 'dict-select',
params: { dictKey: 'car:length' },
placeholder: '请选择车长',
containsAllLabel:false,
} as SFSelectWidgetSchema,
},
carLoad: {
title: '载重',
type: 'string',
ui: {
placeholder: '请输入',
change: (val: any) =>{
const value = val.replace(/\D/g,'')
this.sf.setValue('/carLoad', value)
},
}
},
isSelf: {
title: '是否挂靠',
type: 'string',
enum: [
{ label: '否', value: 0 },
{ label: '是', value: 1 },
],
ui: {
widget: 'select',
placeholder: '请选择',
}
},
isTrailer: {
title: '是否为挂车',
type: 'string',
enum: [
{ label: '否', value: 0 },
{ label: '是', value: 1 },
],
ui: {
widget: 'select',
placeholder: '请选择',
}
},
carProtocalWatermark: {
type: 'string',
title: '挂靠协议',
ui: {
action: apiConf.fileUpload,
accept: 'image/png,image/jpeg,image/jpg,image/gif',
limit: 1,
limitFileCount: 1,
resReName: 'data.fullFileWatermarkPath',
urlReName: 'data.fullFileWatermarkPath',
widget: 'upload',
descriptionI18n: '请上传挂靠协议支持JPG、PNG格式文件小于5M。',
data: {
appId: this.envSrv.env.appId,
},
name: 'multipartFile',
multiple: false,
listType: 'picture-card',
change: (args: any) => {
if (args.type === 'success') {
this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath
}
},
beforeUpload: (file: any, _fileList: any) => {
return new Observable((observer: Observer<boolean>) => {
const isLt2M = file.size / 1024 / 1024 < 5;
if (!isLt2M) {
this.service.msgSrv.warning('图片大小超过5M!');
observer.complete();
return;
}
observer.next(isLt2M);
observer.complete();
});
},
previewFile: (file: NzUploadFile) => of(file.url),
},
},
titleA: {
title: '行驶证信息(必填)',
type: 'string',
ui: {
widget: 'textarea',
borderless:true,
},
default: '照片上传后会自动识别文字并填充下列内容栏',
},
tipsA: {
title: '',
type: 'string',
ui: {
widget: 'custom',
offsetControl: 6,
},
},
certificatePhotoFrontWatermark: {
type: 'string',
title: '行驶证首页照片',
ui: {
action: apiConf.fileUpload,
accept: 'image/png,image/jpeg,image/jpg,image/gif',
limit: 1,
limitFileCount: 1,
resReName: 'data.fullFileWatermarkPath',
urlReName: 'data.fullFileWatermarkPath',
widget: 'upload',
descriptionI18n: '请上传行驶证首页照片支持JPG、PNG格式文件小于5M。照片信息缺失、拼凑、过度PS、模糊不清都不会通过审核。',
data: {
appId: this.envSrv.env.appId,
},
name: 'multipartFile',
multiple: false,
listType: 'picture-card',
change: (args: any) => {
if (args.type === 'success') {
this.detailData.certificatePhotoFront = args.file.response.data.fullFilePath
this.checkCarCard(args.file.response.data.fullFilePath, 'front');
}
},
beforeUpload: (file: any, _fileList: any) => {
return new Observable((observer: Observer<boolean>) => {
const isLt2M = file.size / 1024 / 1024 < 5;
if (!isLt2M) {
this.service.msgSrv.warning('图片大小超过5M!');
observer.complete();
return;
}
observer.next(isLt2M);
observer.complete();
});
},
},
},
tipsB: {
title: '',
type: 'string',
ui: {
widget: 'custom',
offsetControl: 6,
},
},
certificatePhotoBackWatermark: {
type: 'string',
title: '行驶证副页照片',
ui: {
action: apiConf.fileUpload,
accept: 'image/png,image/jpeg,image/jpg,image/gif',
limit: 1,
limitFileCount: 1,
resReName: 'data.fullFileWatermarkPath',
urlReName: 'data.fullFileWatermarkPath',
widget: 'upload',
descriptionI18n: '请上传行驶证副业照片支持JPG、PNG格式文件小于5M。',
data: {
appId: this.envSrv.env.appId,
},
name: 'multipartFile',
multiple: false,
listType: 'picture-card',
change: (args: any) => {
if (args.type === 'success') {
this.detailData.certificatePhotoBack = args.file.response.data.fullFilePath
this.checkCarCard(args.file.response.data.fullFilePath, 'back');
}
},
beforeUpload: (file: any, _fileList: any) => {
return new Observable((observer: Observer<boolean>) => {
const isLt2M = file.size / 1024 / 1024 < 5;
if (!isLt2M) {
this.service.msgSrv.warning('图片大小超过5M!');
observer.complete();
return;
}
observer.next(isLt2M);
observer.complete();
});
},
previewFile: (file: NzUploadFile) => of(file.url),
},
},
driverLicenseRegisterTime: {
title: '行驶证注册日期',
type: 'string',
format: 'date',
ui: {
placeholder: '请输入',
},
},
driverLicenseGetTime: {
title: '行驶证发证日期',
type: 'string',
format: 'date',
ui: {
placeholder: '请输入',
},
},
driverLicenseEndTime: {
title: '行驶证到期日期',
type: 'string',
format: 'date',
maxLength: 30,
ui: {
placeholder: '请输入',
},
},
driverLicenseSigningOrg: {
title: '行驶证签发机关',
type: 'string',
maxLength: 30,
ui: {
placeholder: '请输入',
},
},
carDistinguishCode: {
title: '车辆识别代码',
type: 'string',
maxLength: 30,
ui: {
placeholder: '请输入',
},
},
useNature: {
title: '使用性质',
type: 'string',
maxLength: 30,
enum: [
{label: '非营运', value: 0},
{label: '营运', value: 1},
],
ui: {
widget: 'select',
placeholder: '请选择',
},
},
curbWeight: {
title: '整备质量',
type: 'string',
ui: {
placeholder: '请输入',
},
},
carOwner: {
title: '所有人',
type: 'string',
maxLength: 30,
ui: {
placeholder: '请输入',
},
},
titleB: {
title: '道运证(选填)',
type: 'string',
ui: {
widget: 'text',
},
default: '照片上传后会自动识别文字并填充下列内容栏',
},
roadTransportPhotoWatermark: {
type: 'string',
title: '道运证照片',
ui: {
action: apiConf.fileUpload,
accept: 'image/png,image/jpeg,image/jpg,image/gif',
limit: 1,
limitFileCount: 1,
resReName: 'data.fullFileWatermarkPath',
urlReName: 'data.fullFileWatermarkPath',
widget: 'upload',
descriptionI18n: '请上传道运证照片支持JPG、PNG格式文件小于5M。蓝牌绿牌车辆可不用传道运证',
data: {
appId: this.envSrv.env.appId,
},
name: 'multipartFile',
multiple: false,
listType: 'picture-card',
change: (args: any) => {
if (args.type === 'success') {
this.detailData.roadTransportPhoto = args.file.response.data.fullFilePath
this.checkTransCard(args.file.response.data.fullFilePath);
} else {
this.detailData.roadTransportPhoto = ''
}
},
beforeUpload: (file: any, _fileList: any) => {
return new Observable((observer: Observer<boolean>) => {
const isLt2M = file.size / 1024 / 1024 < 5;
if (!isLt2M) {
this.service.msgSrv.warning('图片大小超过5M!');
observer.complete();
return;
}
observer.next(isLt2M);
observer.complete();
});
},
previewFile: (file: NzUploadFile) => of(file.url),
},
},
roadTransportNo: {
title: '道运证号码',
type: 'string',
maxLength: 30,
ui: {
// widget: this.detailData.commitFlag !== 0 ? 'text' : '',
placeholder: '请输入',
},
},
roadTransportLicenceNo: {
title: '经营许可证号',
type: 'string',
maxLength: 30,
ui: {
// widget: this.detailData.commitFlag !== 0 ? 'text' : '',
placeholder: '请输入',
},
},
roadTransportStartTime: {
title: '发证日期',
type: 'string',
format: 'date',
ui: {
placeholder: '请输入',
},
},
roadTransportEndTime: {
title: '有效期至',
type: 'string',
format: 'date',
ui: {
placeholder: '请输入',
},
},
remarks: {
title: '备注',
type: 'string',
ui: {
placeholder: '请输入',
},
},
},
required: [
'carFrontPhotoWatermark',
'carNo',
'carNoColor',
'carModel',
'carLength',
'carLoad',
'isSelf',
'isTrailer',
'certificatePhotoFrontWatermark',
'certificatePhotoBackWatermark',
'driverLicenseRegisterTime',
'driverLicenseGetTime',
'driverLicenseEndTime',
'driverLicenseSigningOrg',
'carDistinguishCode',
'useNature',
'carOwner'
],
};
this.ui = {
'*': {
spanLabelFixed: 180,
grid: { span: 18 },
width: 600,
},
$title1: {
spanLabelFixed: 0,
},
$title2: {
spanLabelFixed: 0,
},
$title3: {
spanLabelFixed: 0,
},
$enterpriseRegistrationTime: {
width: 680,
},
$operatingEndTime: {
grid: { span: 9 },
},
$dateType: {
grid: { span: 4 },
},
$validEndTime: {
grid: { span: 9 },
},
$dateType01: {
grid: { span: 4 },
},
$registrationCapital: {
grid: { span: 12 },
},
$unit: {
spanLabelFixed: 20,
grid: { span: 3 },
},
};
}
// 道路运输证识别
checkTransCard(imgurl: any) {
const params = {
transportationLicenseUrl: imgurl,
};
this.service.request(this.service.$api_recognizeTransportationLicense, params).subscribe((res) => {
if (res) {
this.sf.setValue('/roadTransportNo', res.number);
this.sf.setValue('/roadTransportLicenceNo', res.businessCertificate);
this.sf.setValue('/roadTransportStartTime', res.issueDate);
if(this.carNo === '') {
this.carNo = res.number
} else if(this.carNo && res.vehicleNumber.indexOf(this.carNo) === -1) {
this.service.msgSrv.warning('请上传同一认证车辆的相关证件')
}
}
});
}
// 行驶证识别
checkCarCard(imgurl: any, side: any) {
const params = {
vehicleLicenseUrl: imgurl,
side,
};
this.service.request(this.service.$api_recognizeVehicleLicense, params).subscribe((res) => {
if (res) {
if (side === 'front') { // 正面
this.sf.setValue('/driverLicenseRegisterTime', res.registerDate);
this.sf.setValue('/carNo', res.number);
this.sf.setValue('/driverLicenseGetTime', res.issueDate);
this.sf.setValue('/driverLicenseSigningOrg', res.issuingAuthority);
this.sf.setValue('/carDistinguishCode', res.vin);
this.sf.setValue('/carOwner', res.name);
this.sf.setValue('/useNature', res.useCharacter === '非营运' ? 0 : 1 );
} else {
this.sf.setValue('/curbWeight', res.unladenMass);
this.sf.setValue('/remarks', res.remarks);
}
if(this.carNo === '') {
this.carNo = res.number
} else if(this.carNo && this.carNo !== res.number) {
this.service.msgSrv.warning('请上传同一认证车辆的相关证件')
}
}
});
}
close(): void {
this.modal.close(true)
}
showExample() {
this.showCardFlag = !this.showCardFlag
}
showJopExample() {
this.showJopFlag = !this.showJopFlag
}
submitForm(){
const params:any = {
appUserId: this.i.appUserId,
...this.sf.value,
bindType: this.i.bindType
};
params.carFrontPhoto = this.detailData.carFrontPhoto
params.carProtocal = this.detailData.carProtocal
params.certificatePhotoFront = this.detailData.certificatePhotoFront
params.certificatePhotoBack = this.detailData.certificatePhotoBack
params.roadTransportPhoto = this.detailData.roadTransportPhoto
delete params.titleA
delete params.titleB
this.checked = true
this.service.request(this.service.$api_updateAssistCertification, params).subscribe(res => {
this.checked = false
if(res){
this.service.msgSrv.success('添加成功')
this.modal.close(true)
}
})
}
}

View File

@ -90,7 +90,54 @@ export class FreightComponentsListComponent implements OnInit {
nzFooter: null
});
}
showService(record: any) {
const modalRef = this.modal.create({
nzTitle: '分配客服人员',
//nzContent: PartnerEditComponent,
nzWidth: 600,
nzComponentParams: {
i: record
},
nzFooter: null
});
modalRef.afterClose.subscribe((res: any) => {
if (res) {
this.st.load(1);
}
});
}
editPartner(record: any) {
const modalRef = this.modal.create({
nzTitle: '修改合伙人',
//nzContent: PartnerEditComponent,
nzWidth: 600,
nzComponentParams: {
i: record
},
nzFooter: null
});
modalRef.afterClose.subscribe((res: any) => {
if (res) {
this.st.load(1);
}
});
}
editSale(record: any) {
const modalRef = this.modal.create({
nzTitle: '修改渠道销售',
//nzContent: PartnerEditComponent,
nzWidth: 600,
nzComponentParams: {
i: record
},
nzFooter: null
});
modalRef.afterClose.subscribe((res: any) => {
if (res) {
this.st.load(1);
}
});
}
initSF() {
this.schema = {
properties: {
@ -350,7 +397,7 @@ export class FreightComponentsListComponent implements OnInit {
className: 'text-center',
buttons: [
{
text: '查看<br/>',
text: '查看',
acl: { ability: ['USERCENTER-FREIGHT-LIST-view'] },
click: item => {
this.router.navigate(['./detail', item.id], { relativeTo: this.ar });
@ -366,6 +413,21 @@ export class FreightComponentsListComponent implements OnInit {
acl: { ability: ['USERCENTER-FREIGHT-LIST-balance'] },
text: '资金账户',
click: item => this.showAccountDetail(item)
},
{
acl: { ability: ['USERCENTER-FREIGHT-LIST-balance'] },
text: '分配客服人员',
click: item => this.showService(item)
},
{
acl: { ability: ['USERCENTER-FREIGHT-LIST-balance'] },
text: '修改合伙人',
click: item => this.editPartner(item)
},
{
acl: { ability: ['USERCENTER-FREIGHT-LIST-balance'] },
text: '修改渠道销售',
click: item => this.editSale(item)
}
]
}

View File

@ -33,4 +33,5 @@ export * from './shared.module';
export * from './shared-delon.module';
export * from './shared-zorro.module';
export * from './shared-third.module';
export * from './shared-g2.module';
export * from './widget/st-widget.module';

View File

@ -0,0 +1,6 @@
import { G2BarModule } from '@delon/chart/bar';
import { G2MiniAreaModule } from '@delon/chart/mini-area';
import { G2PieModule } from '@delon/chart/pie';
import { G2TimelineModule } from '@delon/chart/timeline';
export const SHARED_G2_MODULES = [G2BarModule, G2PieModule, G2TimelineModule, G2MiniAreaModule];

View File

@ -594,8 +594,7 @@
},
{
"text": "轮播图管理",
"link": "/partner/scroll-img/list",
"hide": true
"link": "/partner/scroll-img/list"
},
{
"text": "知识库管理",
@ -603,7 +602,11 @@
"group": true,
"children": [{
"text": "banner管理",
"link": "/knowledge/banner"
"link": "/partner/knowledge/banner",
"children": [{
"text": "新增banner",
"link": "/partner/knowledge/banner/detail"
}]
},
{
"text": "文章管理",
@ -627,6 +630,16 @@
}
]
},
{
"text": "数据监管",
"icon": "iconfont icon-hetong-copy",
"group": true,
"children": [{
"text": "数据报表",
"link": "/regulatory-data/dashboard"
}
]
}
]
}]