fix bug
This commit is contained in:
@ -1,17 +1,18 @@
|
||||
/*
|
||||
* @Description :
|
||||
* @Description :
|
||||
* @Version : 1.0
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-01-25 16:03:45
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-02-14 14:54:08
|
||||
* @LastEditTime : 2022-02-15 10:40:43
|
||||
* @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';
|
||||
import { NzUploadChangeParam } from 'ng-zorro-antd/upload';
|
||||
|
||||
const JSONTYPE = new Set([5,6]);
|
||||
const JSONTYPE = new Set([5, 6, 9]);
|
||||
@Component({
|
||||
selector: 'app-dynamic-setting-h5',
|
||||
templateUrl: './dynamic-setting-h5.component.html',
|
||||
@ -36,27 +37,37 @@ export class DynamicSettingH5Component implements OnInit {
|
||||
labelWidth = 250;
|
||||
@Input()
|
||||
itemValue = 'itemValue';
|
||||
|
||||
listUrls: any;
|
||||
constructor(public service: BaseService) {}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.tabs)
|
||||
console.log(this.tabs);
|
||||
}
|
||||
|
||||
changeType(type: any): void {
|
||||
this.selectedTab = type;
|
||||
console.log(type);
|
||||
|
||||
|
||||
this.selectedEvent.emit(this.selectedTab);
|
||||
}
|
||||
|
||||
|
||||
saveAction() {
|
||||
if (this.configList?.length < 0) {
|
||||
return;
|
||||
}
|
||||
console.log(this.configList)
|
||||
console.log(this.configList);
|
||||
let params = [...this.configList];
|
||||
params = params.map((item: any) => {
|
||||
console.log(item);
|
||||
if (item.itemType == 9) {
|
||||
const files = item.itemValue?.map(({ url, name }: any) => ({ url, name }));
|
||||
return {
|
||||
...item,
|
||||
remark: item.remark ? JSON.stringify(item.remark) : null,
|
||||
itemData: item.itemData ? JSON.stringify(item.itemData) : null,
|
||||
itemValue: item.itemValue ? JSON.stringify(files) : null
|
||||
};
|
||||
}
|
||||
if (JSONTYPE.has(item.itemType)) {
|
||||
item.itemValue = item.itemValue ? JSON.stringify(item.itemValue) : null;
|
||||
}
|
||||
@ -66,6 +77,8 @@ export class DynamicSettingH5Component implements OnInit {
|
||||
itemData: item.itemData ? JSON.stringify(item.itemData) : null
|
||||
};
|
||||
});
|
||||
console.log(params);
|
||||
this.saveEvent.emit(params);
|
||||
}
|
||||
}
|
||||
// [0]?.response?.data.fullFilePath
|
||||
|
||||
Reference in New Issue
Block a user