Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop
This commit is contained in:
@ -0,0 +1,39 @@
|
||||
<page-header-wrapper [title]="'协议配置'"></page-header-wrapper>
|
||||
|
||||
<nz-card>
|
||||
<div nz-row [nzGutter]="8">
|
||||
<div nz-col nzSpan="4">
|
||||
<ul nz-menu nzMode="inline" class="card-height">
|
||||
<li nz-menu-item [nzSelected]="idx === 0" (click)="changeType(idx)" *ngFor="let item of tabs; let idx = index">
|
||||
{{ item.name }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div nz-col nzSpan="20" style="overflow: scroll">
|
||||
<nz-card class="card-height" *ngIf="!isUpdate">
|
||||
<div class="mb-md">
|
||||
<strong>{{ tabItem.typeName }}</strong>
|
||||
<!-- <button class="btn-right" nz-button nzSize="large" nzType="default" (click)="update()">修改</button> -->
|
||||
</div>
|
||||
<div class="mb-lg">
|
||||
更新时间: {{ tabItem.modifyTime }}
|
||||
<a style="margin-left: 8px" target="_blank" [queryParams]="{ type: idx }" [routerLink]="['/agreement']">预览</a>
|
||||
<button nz-button nzType="link" (click)="update()">修改</button>
|
||||
</div>
|
||||
<div [innerHTML]="tabItem.content"></div>
|
||||
</nz-card>
|
||||
|
||||
<nz-card class="card-height" *ngIf="isUpdate">
|
||||
<div nz-row nzGutter="8">
|
||||
<div nz-col nzSpan="24">
|
||||
<sf #sf1 mode="edit" [schema]="schema1" [ui]="ui1" button="none"> </sf>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-md save-btn">
|
||||
<button nz-button nzSize="large" nzType="default" (click)="cancel()">取消</button>
|
||||
<button class="ml-lg" nz-button nzSize="large" nzType="primary" (click)="save()">保存</button>
|
||||
</div>
|
||||
</nz-card>
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
@ -0,0 +1,90 @@
|
||||
:host {
|
||||
// [nz-menu] {
|
||||
// float: left;
|
||||
// width: 254px;
|
||||
// min-height: 810px;
|
||||
// }
|
||||
::ng-deep {
|
||||
.ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
|
||||
// background: transparent;
|
||||
}
|
||||
.ant-menu-inline .ant-menu-item::after {
|
||||
border-right: none;
|
||||
}
|
||||
.ant-menu-item-selected {
|
||||
background: transparent;
|
||||
}
|
||||
.ant-menu-inline .ant-menu-submenu-title {
|
||||
margin: 0;
|
||||
}
|
||||
.console-menu-icon {
|
||||
width: 20px;
|
||||
}
|
||||
.console-menu-title {
|
||||
margin-left: 9px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.ant-menu-item:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
.tabset-container {
|
||||
height: 450px;
|
||||
margin-top: 16px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
h3 {
|
||||
margin-left: 15px;
|
||||
padding: 8px 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.times {
|
||||
display: inline-block;
|
||||
padding-right: 15px;
|
||||
}
|
||||
.width100 {
|
||||
width: 100px;
|
||||
margin: 0 5px;
|
||||
}
|
||||
.width200 {
|
||||
width: 200px;
|
||||
margin: 0 5px;
|
||||
}
|
||||
.sales-order {
|
||||
margin-left: 15px;
|
||||
padding: 8px 40px;
|
||||
font-size: 18px;
|
||||
}
|
||||
.general-box {
|
||||
height: 750px;
|
||||
overflow: auto;
|
||||
}
|
||||
.card-height {
|
||||
height: 800px;
|
||||
}
|
||||
.btn-right {
|
||||
float: right;
|
||||
}
|
||||
.save-btn {
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
}
|
||||
.ant-menu-vertical .ant-menu-item::after,
|
||||
.ant-menu-vertical-left .ant-menu-item::after,
|
||||
.ant-menu-vertical-right .ant-menu-item::after,
|
||||
.ant-menu-inline .ant-menu-item::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border-right: 3px solid #202886;
|
||||
content: '';
|
||||
}
|
||||
.but_rigth {
|
||||
margin-left: 16% !important;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,125 @@
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { SFComponent, SFSchema, SFUISchema, SFUploadWidgetSchema } from '@delon/form';
|
||||
import { _HttpClient } from '@delon/theme';
|
||||
import { Observable, Observer } from 'rxjs';
|
||||
import { Router } from '@angular/router';
|
||||
import { SystemService } from '../../services/system.service';
|
||||
import { EnvironmentService } from '@env/environment.service';
|
||||
@Component({
|
||||
selector: 'app-agreement-config-components-base',
|
||||
styleUrls: ['./agreement-config.component.less'],
|
||||
templateUrl: './agreement-config.component.html'
|
||||
})
|
||||
export class AgreementConfigComponentsBaseComponent implements OnInit {
|
||||
@ViewChild('sf1', { static: false }) sf1!: SFComponent;
|
||||
|
||||
i: any;
|
||||
formDate: any = {};
|
||||
schema1!: SFSchema;
|
||||
ui1: SFUISchema = {};
|
||||
idx: any = 0;
|
||||
isUpdate = false;
|
||||
type = 0;
|
||||
tabItem = {
|
||||
content: '',
|
||||
id: 0,
|
||||
modifyTime: '',
|
||||
type: '',
|
||||
typeName: ''
|
||||
};
|
||||
tabs = [
|
||||
{
|
||||
name: '《货主端用户注册协议》'
|
||||
},
|
||||
{
|
||||
name: '《司机端用户注册协议》'
|
||||
},
|
||||
{
|
||||
name: '《服务协议》'
|
||||
},
|
||||
{
|
||||
name: '《隐私政策》'
|
||||
},
|
||||
{
|
||||
name: '《人脸识别协议》'
|
||||
}
|
||||
];
|
||||
|
||||
constructor(private service: SystemService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.loadAgreement();
|
||||
this.initSF();
|
||||
}
|
||||
initSF() {
|
||||
this.schema1 = {
|
||||
properties: {
|
||||
content: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
widget: 'tinymce',
|
||||
loadingTip: 'loading...',
|
||||
config: {
|
||||
height: 650
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
this.ui1 = {
|
||||
'*': {
|
||||
spanLabelFixed: 10,
|
||||
grid: { span: 24 }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
changeType(type: number): void {
|
||||
this.idx = type;
|
||||
if (type > 0) {
|
||||
this.isUpdate = false;
|
||||
this.type = +type;
|
||||
|
||||
this.loadAgreement();
|
||||
}
|
||||
}
|
||||
|
||||
loadAgreement() {
|
||||
// this.service.request(`${this.service.$api_general_getAgreement}`, { type: this.type }).subscribe((res) => {
|
||||
// console.log('🚀 ~ this.service.request ~ res', res);
|
||||
// if (res) {
|
||||
// this.tabItem = res;
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
update() {
|
||||
this.isUpdate = true;
|
||||
console.log('🚀 ~ update ~ isUpdate', this.tabItem);
|
||||
|
||||
this.formDate.content = this.tabItem.content;
|
||||
this.initSF();
|
||||
}
|
||||
save() {
|
||||
const params = {
|
||||
id: this.tabItem.id,
|
||||
content: encodeURIComponent(this.sf1?.value.content),
|
||||
type: this.type
|
||||
};
|
||||
this.isUpdate = false;
|
||||
// this.service.request(`${this.service.$api_general_updateAgreement}`, params).subscribe((res) => {
|
||||
// if (res) {
|
||||
// this.service.msgSrv.success('保存成功');
|
||||
// this.changeType(this.type);
|
||||
// this.isUpdate = false;
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
cancel() {
|
||||
this.isUpdate = false;
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { AgreementConfigComponentsBaseComponent } from './components/agreement-config/agreement-config.component';
|
||||
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';
|
||||
@ -18,6 +19,7 @@ const routes: Routes = [
|
||||
{ path: 'version-logs', component: VersionLogsComponent },
|
||||
{ path: 'audit-reason-config', component: AuditReasonConfigComponent },
|
||||
{ path: 'cart-config', component: CartConfigComponent },
|
||||
{ path: 'agreement-config', component: AgreementConfigComponentsBaseComponent },
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
@ -15,6 +15,7 @@ import { BasicConfigActionModalComponent } from './components/basic-config/basic
|
||||
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';
|
||||
import { AgreementConfigComponentsBaseComponent } from './components/agreement-config/agreement-config.component';
|
||||
|
||||
const COMPONENTS = [
|
||||
StaffManagementComponent,
|
||||
@ -24,7 +25,8 @@ const COMPONENTS = [
|
||||
UserLogsComponent,
|
||||
VersionLogsComponent,
|
||||
AuditReasonConfigComponent,
|
||||
CartConfigComponent
|
||||
CartConfigComponent,
|
||||
AgreementConfigComponentsBaseComponent
|
||||
];
|
||||
const NOTROUTECOMPONENTS = [
|
||||
BuyerTranspowerComponent,
|
||||
|
||||
Reference in New Issue
Block a user