This commit is contained in:
wangshiming
2022-02-14 16:13:58 +08:00
parent f2e04197c4
commit eda51eb741
6 changed files with 131 additions and 58 deletions

View File

@ -1,3 +1,13 @@
<!--
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-01-25 16:03:45
* @LastEditors : Shiming
* @LastEditTime : 2022-02-14 16:13:53
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\dynamic-setting\\dynamic-setting-h5\\dynamic-setting-h5.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<nz-card [nzLoading]="service.http.loading">
<div nz-row [nzGutter]="8">
<div nz-col [nzSpan]="tabSpan">
@ -63,6 +73,12 @@
<app-freight-table></app-freight-table>
</ng-container>
</ng-container>
<ng-container *ngSwitchCase="8">
<nz-input-group style="width: 155px;"
class="ml-md mr-xl">
<input nz-input placeholder="请输入" [(ngModel)]="item.itemValue" />
</nz-input-group>
</ng-container>
</se>
</div>

View File

@ -1,3 +1,13 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-01-25 16:03:45
* @LastEditors : Shiming
* @LastEditTime : 2022-02-14 14:54:08
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\dynamic-setting\\dynamic-setting-h5\\dynamic-setting-h5.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
import { Component, OnInit, EventEmitter, Input, Output } from '@angular/core';
import { BaseService } from '@shared';
@ -29,7 +39,9 @@ export class DynamicSettingH5Component implements OnInit {
constructor(public service: BaseService) {}
ngOnInit() {}
ngOnInit() {
console.log(this.tabs)
}
changeType(type: any): void {
this.selectedTab = type;
@ -42,7 +54,7 @@ export class DynamicSettingH5Component implements OnInit {
if (this.configList?.length < 0) {
return;
}
console.log(this.configList)
let params = [...this.configList];
params = params.map((item: any) => {
if (JSONTYPE.has(item.itemType)) {

View File

@ -1,3 +1,13 @@
/*
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-01-10 16:06:17
* @LastEditors : Shiming
* @LastEditTime : 2022-02-14 15:28:16
* @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\dynamic-setting\\dynamic-setting-modal\\dynamic-setting-modal.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
import { Component, Input, OnInit } from '@angular/core';
import { ModalHelper } from '@delon/theme';
import { NzModalRef } from 'ng-zorro-antd/modal';
@ -11,30 +21,37 @@ import { BaseService } from 'src/app/shared/services';
export class DynamicSettingModalComponent implements OnInit {
tabs: any[] = [];
selectedTab: any = null;
configFullKey = 'sys.config'
configList: any = [];
@Input()
extendType!: string;
@Input()
businessId!: string;
@Input()
configvalue!: string;
constructor(public service: BaseService, private modalHelp: NzModalRef) {}
ngOnInit() {
if(this.configvalue) {
console.log(this.configvalue)
this.configFullKey = this.configvalue
}
this.getTypeList();
}
getTypeList() {
this.service
.request('/api/mdc/pbc/sysConfigItemExtend/getSysConfigExtend', {
configFullKey: 'sys.config',
configFullKey: this.configFullKey,
extendType: this.extendType,
businessId: this.businessId
})
.subscribe((res: Array<any>) => {
if (res?.length > 0) {
const typeData = res.find(config => config.configFullKey === 'sys.config');
const typeData = res.find(config => config.configFullKey === this.configFullKey);
if (typeData) {
this.tabs = typeData.children;
this.selectedTab = typeData.children[0];
@ -78,12 +95,13 @@ export class DynamicSettingModalComponent implements OnInit {
itemData: item.extendItemData || item.itemData,
itemValue: item.extendItemValue || item.itemValue
}))
.map(item => ({
.map(item => (
{
...item,
remark: item.remark ? JSON.parse(item.remark) : null,
extend: item.extend ? JSON.parse(item.extend) : [],
remark: item?.remark ? JSON.parse(item?.remark) : null,
extend: item?.extend ? JSON.parse(item?.extend) : [],
// itemData: item.itemData ? JSON.parse(item.itemData) : item.itemData,
itemValue: item.itemValue ? JSON.parse(item.itemValue) : item.itemValue
itemValue: item?.itemValue ? JSON.parse(item?.itemValue) : item?.itemValue
}));
}
return [];