This commit is contained in:
Taric Xin
2022-02-21 16:22:35 +08:00
parent f5f682b2ed
commit f855154875
10 changed files with 96 additions and 125 deletions

View File

@ -24,26 +24,29 @@
<h2 style="font-weight: 800;">{{selectedTab?.name}}</h2>
<div nz-row nzGutter="8">
<div nz-col nzSpan="24" se-container [labelWidth]="labelWidth">
<se [label]="item.name" *ngFor="let item of configList" col="1" [required]="item.requiredField" >
<se [label]="item.name" *ngFor="let item of configList" col="1" [required]="item.requiredField">
<ng-container [ngSwitch]="item.itemType">
<!-- 整型输入框 -->
<ng-container *ngSwitchCase="1">
<nz-input-group [nzAddOnAfter]="item.remark?.afterLable" style="width: 155px;"
class="ml-md mr-xl">
<input type="number" nz-input [(ngModel)]="item.itemValue" placeholder="请输入" />
</nz-input-group>
</ng-container>
<!-- 0-1单选框 -->
<ng-container *ngSwitchCase="2">
<nz-radio-group [(ngModel)]="item.itemValue" class="mr-xl">
<label nz-radio [nzValue]="0" class="ml-xl">{{item.remark?.[0] || '否'}}</label>
<label nz-radio [nzValue]="1" class="ml-xl">{{item.remark?.[1] || '是'}}</label>
</nz-radio-group>
</ng-container>
<!-- 时间选择器 -->
<ng-container *ngSwitchCase="3">
<nz-time-picker nzFormat="HH:mm" nzPlaceHolder="请选择时间" [(ngModel)]="item.itemValue"
class="ml-md mr-xl">
</nz-time-picker>
</ng-container>
<!-- 时间段选择器 -->
<ng-container *ngSwitchCase="5">
<div class="d-flex" style="align-items: center;justify-content: space-between;">
<input type="time" [(ngModel)]="item.itemValue.startTime" placeHolder="开始时间"
@ -53,6 +56,7 @@
style="margin-left: 0;" class=" mr-xl">
</div>
</ng-container>
<!-- 单选加配置 -->
<ng-container *ngSwitchCase="6">
<div class="d-flex" style="align-items: center;justify-content: space-between;">
@ -70,30 +74,34 @@
style="margin-left: 0;" class=" mr-xl">
</div>
</ng-container>
<!-- 运费列表 -->
<ng-container *ngSwitchCase="7">
<app-freight-table></app-freight-table>
</ng-container>
<!-- 文本输入框 -->
<ng-container *ngSwitchCase="8">
<nz-input-group style="width: 155px;"
class="ml-md mr-xl">
<nz-input-group style="width: 155px;" class="ml-md mr-xl">
<input nz-input placeholder="请输入" [(ngModel)]="item.itemValue" />
</nz-input-group>
</ng-container>
<!-- 文件上传 -->
<ng-container *ngSwitchCase="9">
<nz-upload
[nzAction]="service.$api_upload_url"
[nzName]="'multipartFile'"
[nzHeaders]="{ authorization: 'authorization-text' }"
[(nzFileList)]="item.itemValue"
>
<button nz-button>
<i nz-icon nzType="upload"></i>
上传文件
</button>
</nz-upload>
<nz-upload [nzAction]="service.$api_upload_url" [nzName]="'multipartFile'"
[nzHeaders]="{ authorization: 'authorization-text' }"
[(nzFileList)]="item.itemValue">
<button nz-button>
<i nz-icon nzType="upload"></i>
上传文件
</button>
</nz-upload>
</ng-container>
<!-- 开关选项 -->
<ng-container *ngSwitchCase="10">
<nz-switch [(ngModel)]="item.itemValue"></nz-switch>
<nz-switch [(ngModel)]="item.itemValue"></nz-switch>
</ng-container>
<!-- 开关选项 -->
<ng-container *ngSwitchCase="99">
<nz-switch [(ngModel)]="item.itemValue"></nz-switch>
</ng-container>
</ng-container>
</se>

View File

@ -1,27 +1,37 @@
:host {
::ng-deep {
.card-height {
min-height: 600px;
}
.save-btn {
width : 100%;
text-align: right;
}
.block-radio {
display : flex;
min-height: 32px;
}
input {
width : 100px;
margin-left: 10px;
}
.ant-form-item-control-input-content {
display: flex;
}
::ng-deep {
.card-height {
min-height: 600px;
}
}
.save-btn {
width : 100%;
text-align: right;
}
.block-radio {
display : flex;
min-height: 32px;
}
input {
width : 100px;
margin-left: 10px;
}
.ant-form-item-control-input-content {
display: flex;
}
.ant-form-item-label>label {
height: 36px;
}
.se__horizontal>.se__item .se__label-text {
overflow : auto;
text-overflow: unset;
white-space : normal;
}
}
}

View File

@ -11,7 +11,7 @@
import { Component, OnInit, EventEmitter, Input, Output } from '@angular/core';
import { BaseService } from '@shared';
const JSONTYPE = new Set([5, 6, 9]);
const JSONTYPE = new Set([5, 6, 9, 999]);
@Component({
selector: 'app-dynamic-setting-h5',
templateUrl: './dynamic-setting-h5.component.html',
@ -39,14 +39,13 @@ export class DynamicSettingH5Component implements OnInit {
listUrls: any;
constructor(public service: BaseService) {}
ngOnInit() {
}
ngOnInit() {}
changeType(type: any): void {
this.selectedTab = type;
this.selectedEvent.emit(this.selectedTab);
}
saveAction() {
if (this.configList?.length < 0) {
return;
@ -54,7 +53,7 @@ export class DynamicSettingH5Component implements OnInit {
let params = [...this.configList];
params = params.map((item: any) => {
if (item.itemType == 9) {
const files = item.itemValue?.map(({ response, name }: any) => ({ url:response?.data?.fullFilePath, name }));
const files = item.itemValue?.map(({ response, name }: any) => ({ url: response?.data?.fullFilePath, name }));
return {
...item,
remark: item.remark ? JSON.stringify(item.remark) : null,

View File

@ -35,7 +35,6 @@ export class DynamicSettingModalComponent implements OnInit {
ngOnInit() {
if(this.configvalue) {
console.log(this.configvalue)
this.configFullKey = this.configvalue
}
this.getTypeList();

View File

@ -1,5 +1,5 @@
/*
* @Description :
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-01-25 13:10:49
@ -13,14 +13,14 @@ import { CommonModule } from '@angular/common';
import { DynamicSettingH5Component } from './dynamic-setting-h5/dynamic-setting-h5.component';
import { SHARED_ZORRO_MODULES } from '../../shared-zorro.module';
import { SHARED_DELON_MODULES } from '../../shared-delon.module';
import { NzSwitchModule } from 'ng-zorro-antd/switch';
import { FormsModule } from '@angular/forms';
import { DynamicSettingModalComponent } from './dynamic-setting-modal/dynamic-setting-modal.component';
import { FreightTableComponent } from './freight-table/freight-table.component';
import { SEModule } from '@delon/abc/se';
const COMPONENTS = [DynamicSettingH5Component, DynamicSettingModalComponent, FreightTableComponent];
@NgModule({
declarations: [...COMPONENTS],
imports: [CommonModule, FormsModule, NzSwitchModule,SHARED_ZORRO_MODULES, SHARED_DELON_MODULES],
imports: [CommonModule, FormsModule, SHARED_ZORRO_MODULES, SEModule],
exports: [...COMPONENTS]
})
export class DynamicSettingModule {}