@@ -8,8 +18,7 @@
-
+
diff --git a/src/app/shared/components/dynamic-setting/dynamic-setting-h5/dynamic-setting-h5.component.ts b/src/app/shared/components/dynamic-setting/dynamic-setting-h5/dynamic-setting-h5.component.ts
index d22bc5f1..2a48a64a 100644
--- a/src/app/shared/components/dynamic-setting/dynamic-setting-h5/dynamic-setting-h5.component.ts
+++ b/src/app/shared/components/dynamic-setting/dynamic-setting-h5/dynamic-setting-h5.component.ts
@@ -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
diff --git a/src/app/shared/components/dynamic-setting/dynamic-setting-modal/dynamic-setting-modal.component.ts b/src/app/shared/components/dynamic-setting/dynamic-setting-modal/dynamic-setting-modal.component.ts
index 97880c4f..3da6b5e9 100644
--- a/src/app/shared/components/dynamic-setting/dynamic-setting-modal/dynamic-setting-modal.component.ts
+++ b/src/app/shared/components/dynamic-setting/dynamic-setting-modal/dynamic-setting-modal.component.ts
@@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-10 16:06:17
* @LastEditors : Shiming
- * @LastEditTime : 2022-02-14 16:19:54
+ * @LastEditTime : 2022-02-15 11:23:29
* @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.
*/
@@ -101,7 +101,7 @@ export class DynamicSettingModalComponent implements OnInit {
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 ? item?.itemType === 1? JSON.parse(item?.itemValue) : item?.itemValue : item?.itemValue
+ itemValue: item?.itemValue ? item?.itemType !== 8? JSON.parse(item?.itemValue) : item?.itemValue : item?.itemValue
}));
}
return [];
diff --git a/src/app/shared/components/dynamic-setting/dynamic-setting.module.ts b/src/app/shared/components/dynamic-setting/dynamic-setting.module.ts
index 7154dc0e..e3306a56 100644
--- a/src/app/shared/components/dynamic-setting/dynamic-setting.module.ts
+++ b/src/app/shared/components/dynamic-setting/dynamic-setting.module.ts
@@ -1,15 +1,26 @@
+/*
+ * @Description :
+ * @Version : 1.0
+ * @Author : Shiming
+ * @Date : 2022-01-25 13:10:49
+ * @LastEditors : Shiming
+ * @LastEditTime : 2022-02-15 10:09:24
+ * @FilePath : \\tms-obc-web\\src\\app\\shared\\components\\dynamic-setting\\dynamic-setting.module.ts
+ * Copyright (C) 2022 huzhenhong. All rights reserved.
+ */
import { NgModule } from '@angular/core';
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';
const COMPONENTS = [DynamicSettingH5Component, DynamicSettingModalComponent, FreightTableComponent];
@NgModule({
declarations: [...COMPONENTS],
- imports: [CommonModule, FormsModule, SHARED_ZORRO_MODULES, SHARED_DELON_MODULES],
+ imports: [CommonModule, FormsModule, NzSwitchModule,SHARED_ZORRO_MODULES, SHARED_DELON_MODULES],
exports: [...COMPONENTS]
})
export class DynamicSettingModule {}
diff --git a/src/app/shared/services/core/base.service.ts b/src/app/shared/services/core/base.service.ts
index 6d636413..210b97ed 100644
--- a/src/app/shared/services/core/base.service.ts
+++ b/src/app/shared/services/core/base.service.ts
@@ -1,8 +1,8 @@
/*
* @Author: Maple
* @Date: 2021-03-20 16:38:44
- * @LastEditors: Do not edit
- * @LastEditTime: 2021-06-17 15:06:37
+ * @LastEditors : Shiming
+ * @LastEditTime : 2022-02-15 09:41:48
* @Description: 全局基础服务:
* 所有实体类服务必须使用extends扩展此类
* 几个特别的Get参数:
@@ -63,7 +63,8 @@ export class BaseService implements IBase {
public $api_import_download_tpl!: string;
// 获取字典选项
public $api_get_dict!: string;
-
+ // 上传图片
+ public $api_upload_url = `/api/mdc/pbc/upload/multipartFile/file`;
constructor(public injector: Injector) {}
get http(): _HttpClient {