fix bug
This commit is contained in:
10
src/app/shared/widget/dict-select/dict-select.widget.html
Normal file
10
src/app/shared/widget/dict-select/dict-select.widget.html
Normal file
@ -0,0 +1,10 @@
|
||||
<sf-item-wrap [id]="id" [schema]="schema" [ui]="ui" [showError]="showError" [error]="error" [showTitle]="schema.title">
|
||||
<app-dict-select [url]="ui?.url" [ngModel]="value" [params]="ui?.params" (ngModelChange)="change($event)"
|
||||
name="sf.dict.select">
|
||||
</app-dict-select>
|
||||
</sf-item-wrap>
|
||||
<!-- <sf-item-wrap [id]="id" [schema]="schema" [ui]="ui" [showError]="showError" [error]="error" [showTitle]="schema.title">
|
||||
<nz-select [(ngModel)]="schema.default">
|
||||
<nz-option [nzValue]="item.value" [nzLabel]="item.label" *ngFor="let item of dictList"></nz-option>
|
||||
</nz-select>
|
||||
</sf-item-wrap> -->
|
||||
30
src/app/shared/widget/dict-select/dict-select.widget.ts
Normal file
30
src/app/shared/widget/dict-select/dict-select.widget.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { ControlWidget } from "@delon/form";
|
||||
|
||||
@Component({
|
||||
selector: 'sf-dict-select',
|
||||
templateUrl: './dict-select.widget.html',
|
||||
preserveWhitespaces: false,
|
||||
})
|
||||
|
||||
export class DictSelectWidget extends ControlWidget implements OnInit {
|
||||
|
||||
|
||||
static readonly KEY = 'dict-select';
|
||||
/**
|
||||
* 字典数据数组
|
||||
*/
|
||||
|
||||
|
||||
dictList: any[] = [];
|
||||
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
}
|
||||
|
||||
change(value: string) {
|
||||
if (this.ui.change) this.ui.change(value);
|
||||
this.setValue(value);
|
||||
}
|
||||
}
|
||||
@ -1,3 +1,11 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-01 15:07:23
|
||||
* @LastEditTime: 2021-12-13 10:37:39
|
||||
* @LastEditors: your name
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath: \tms-obc-web\src\app\shared\widget\st-widget.module.ts
|
||||
*/
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
@ -15,6 +23,7 @@ import { NgxTinymceModule } from 'ngx-tinymce';
|
||||
// import { STWidgetRegistry } from '@delon/abc/st';
|
||||
import { SharedModule } from '../shared.module';
|
||||
import { AddressWidget } from './address/address.widget';
|
||||
import { DictSelectWidget } from './dict-select/dict-select.widget';
|
||||
import { EditorWidget } from './editor/editor.widget';
|
||||
import { SLFromToSearchWidget } from './from-to-search/from-to-search.widget';
|
||||
import { EAFromToWidget } from './from-to/from-to.widget';
|
||||
@ -33,7 +42,8 @@ export const STWIDGET_COMPONENTS = [
|
||||
EAFromToWidget,
|
||||
SpecValuesWidget,
|
||||
PropertyValuesWidget,
|
||||
SLFromToSearchWidget
|
||||
SLFromToSearchWidget,
|
||||
DictSelectWidget
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
@ -68,5 +78,6 @@ export class STWidgetModule {
|
||||
widgetRegistry.register(SpecValuesWidget.KEY, SpecValuesWidget);
|
||||
widgetRegistry.register(PropertyValuesWidget.KEY, PropertyValuesWidget);
|
||||
widgetRegistry.register(SLFromToSearchWidget.KEY, SLFromToSearchWidget);
|
||||
widgetRegistry.register(DictSelectWidget.KEY, DictSelectWidget)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user