解决冲突

This commit is contained in:
wangshiming
2022-04-27 15:34:00 +08:00
parent 527d8305c1
commit 741b5e4f8e
10 changed files with 135 additions and 124 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-04-21 13:49:22
* @LastEditors : Shiming
* @LastEditTime : 2022-04-27 11:29:10
* @LastEditTime : 2022-04-27 15:17:08
* @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\components\\basic-setting\\basic-setting.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -17,6 +17,6 @@
[labelWidth]="labelWidth"
>
<custom-element>
<app-parterl-config></app-parterl-config>
<app-parterl-config [configList]="configList"></app-parterl-config>
</custom-element>
</app-dynamic-setting-h5>

View File

@ -1,4 +1,4 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, Input, OnInit, ViewChild, OnChanges, SimpleChanges } from '@angular/core';
import { SFComponent, SFSchema, SFUploadWidgetSchema } from '@delon/form';
import { NzUploadFile } from 'ng-zorro-antd/upload';
import { Observable, Observer, of } from 'rxjs';
@ -23,9 +23,13 @@ const IMAGECONFIG = {
templateUrl: './config.component.html',
styleUrls: ['./config.component.less']
})
export class PartnerSystemConfigComponent implements OnInit {
export class PartnerSystemConfigComponent implements OnInit, OnChanges {
@ViewChild('sf', { static: false }) sf!: SFComponent;
@ViewChild('sf2', { static: false }) sf2!: SFComponent;
@Input()
configList: any[] = [];
formDate: any = {
isAudit: false,
isEveryDay: false,
@ -35,9 +39,9 @@ export class PartnerSystemConfigComponent implements OnInit {
enterpriseValue!: number;
auditValue!: number;
auditTime!: any;
auditTimeStatus: boolean = false
everyDay: boolean = false
MonthDay: boolean = false
auditTimeStatus: boolean = false;
everyDay: boolean = false;
MonthDay: boolean = false;
time: Date | null = null;
defaultOpenValue = new Date(0, 0, 0, 0, 0, 0);
tabs = [
@ -49,22 +53,27 @@ export class PartnerSystemConfigComponent implements OnInit {
}
];
selectedTab = 0;
TimeStatus: boolean = true
everyDayData: Array<any> =[];
TimeStatus: boolean = true;
everyDayData: Array<any> = [];
MonthDayData: any = [
{month: [
{ label: '周一', value: '周一', },
{ label: '周', value: '周' },
{ label: '周', value: '周' },
{ label: '周', value: '周' },
{ label: '周', value: '周' },
{ label: '周', value: '周' },
{ label: '周', value: '周' }
], Times:[ {
startTime: [],
endTime: [],
}]}
]
{
month: [
{ label: '周', value: '周' },
{ label: '周', value: '周' },
{ label: '周', value: '周' },
{ label: '周', value: '周' },
{ label: '周', value: '周' },
{ label: '周', value: '周' },
{ label: '周日', value: '周日' }
],
Times: [
{
startTime: [],
endTime: []
}
]
}
];
checkOptionsOne = [
{ label: '周一', value: '周一', checked: true },
@ -94,83 +103,83 @@ export class PartnerSystemConfigComponent implements OnInit {
// listType: 'picture-card',
// showRequired: true
// };
constructor(private service: SystemService) {}
ngOnChanges(changes: SimpleChanges): void {
if (changes.configList) {
console.log(changes.configList.currentValue);
}
}
ngOnInit() {
this.initSF();
this.everyDayData = [
{
startTime: '',
endTime: '',
}
]
}
addEvery() {
this.everyDayData.push(
{
startTime: [],
endTime: [],
}
)
}
delEvery(index: number) {
this.everyDayData.splice(index, 1)
}
addMonthEvery(value: any) {
this.MonthDayData[value].Times.push(
{
startTime: '',
endTime: ''
}
)
];
}
addEvery() {
this.everyDayData.push({
startTime: [],
endTime: []
});
}
delEvery(index: number) {
this.everyDayData.splice(index, 1);
}
addMonthEvery(value: any) {
this.MonthDayData[value].Times.push({
startTime: '',
endTime: ''
});
}
addMonth() {
this.MonthDayData.push(
{month: [
{ label: '周一', value: '周一', },
this.MonthDayData.push({
month: [
{ label: '周一', value: '周一' },
{ label: '周二', value: '周二' },
{ label: '周三', value: '周三' },
{ label: '周四', value: '周四' },
{ label: '周五', value: '周五' },
{ label: '周六', value: '周六' },
{ label: '周日', value: '周日' }
], Times:[{
startTime: '',
endTime: ''
}]}
)
],
Times: [
{
startTime: '',
endTime: ''
}
]
});
}
delMonth(value: number,index: number) {
this.MonthDayData[value].Times.splice(index, 1)
delMonth(value: number, index: number) {
this.MonthDayData[value].Times.splice(index, 1);
}
changeType(type: number): void {
this.selectedTab = type;
}
changeMonth(type: any): void {
console.log(type);
console.log( this.MonthDayData);
console.log(this.MonthDayData);
}
everyDayChange(type: any): void {
console.log(type);
if(type) {
this.MonthDay = false
this.TimeStatus = true
if (type) {
this.MonthDay = false;
this.TimeStatus = true;
}
}
MonthDayChange(type: any): void {
console.log(type);
if(type) {
this.everyDay = false
this.TimeStatus = false
if (type) {
this.everyDay = false;
this.TimeStatus = false;
}
}
initSF() {
this.schema = {
properties: {
roadTransportPhoto: { title: '', type: 'string', ui: { hidden: true } },
@ -184,7 +193,7 @@ export class PartnerSystemConfigComponent implements OnInit {
if (args.type === 'success') {
this.sf.setValue('/roadTransportPhoto', args.fileList[0].response.data.fullFilePath);
}
},
}
} as SFUploadWidgetSchema
},
share: { title: '', type: 'string', ui: { hidden: true } },
@ -198,7 +207,7 @@ export class PartnerSystemConfigComponent implements OnInit {
if (args.type === 'success') {
this.sf.setValue('/share', args.fileList[0].response.data.fullFilePath);
}
},
}
} as SFUploadWidgetSchema
},
take: { title: '', type: 'string', ui: { hidden: true } },
@ -212,7 +221,7 @@ export class PartnerSystemConfigComponent implements OnInit {
if (args.type === 'success') {
this.sf.setValue('/take', args.fileList[0].response.data.fullFilePath);
}
},
}
} as SFUploadWidgetSchema
},
complianceRemark: {
@ -241,7 +250,7 @@ export class PartnerSystemConfigComponent implements OnInit {
if (args.type === 'success') {
this.sf2.setValue('/roadTransportPhoto', args.fileList[0].response.data.fullFilePath);
}
},
}
} as SFUploadWidgetSchema
},
share: { title: '', type: 'string', ui: { hidden: true } },
@ -255,7 +264,7 @@ export class PartnerSystemConfigComponent implements OnInit {
if (args.type === 'success') {
this.sf2.setValue('/share', args.fileList[0].response.data.fullFilePath);
}
},
}
} as SFUploadWidgetSchema
},
take: { title: '', type: 'string', ui: { hidden: true } },
@ -269,7 +278,7 @@ export class PartnerSystemConfigComponent implements OnInit {
if (args.type === 'success') {
this.sf2.setValue('/take', args.fileList[0].response.data.fullFilePath);
}
},
}
} as SFUploadWidgetSchema
},
complianceRemark: {
@ -307,10 +316,10 @@ export class PartnerSystemConfigComponent implements OnInit {
};
changeAuto(value: any) {
console.log(value);
if(value == '2') {
this.auditTimeStatus = true
if (value == '2') {
this.auditTimeStatus = true;
} else {
this.auditTimeStatus = false
this.auditTimeStatus = false;
}
}
private getImageModel(args: any, key: any) {