Skip to content

Commit

Permalink
feat: Category upload icon
Browse files Browse the repository at this point in the history
  • Loading branch information
xjh22222228 committed Sep 5, 2024
1 parent 8d7c74c commit e589226
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/view/system/web/index.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,20 @@
<nz-form-item>
<nz-form-label [nzSpan]="6">图标地址</nz-form-label>
<nz-form-control [nzSpan]="18">
<nz-input-group>
<nz-input-group [nzPrefix]="prefixIcon" [nzSuffix]="suffixIconSearch">
<input
formControlName="icon"
nz-input
placeholder="用于某些主题icon"
/>
</nz-input-group>

<ng-template #prefixIcon>
<app-logo [src]="iconUrl" [size]="25" *ngIf="iconUrl"></app-logo>
</ng-template>
<ng-template #suffixIconSearch>
<app-upload (onChange)="onChangeFile($event)"></app-upload>
</ng-template>
</nz-form-control>
</nz-form-item>
</form>
Expand Down
8 changes: 8 additions & 0 deletions src/view/system/web/index.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,14 @@ export default class WebpComponent {
this.validateForm.get('ownVisible')!.setValue(!!ownVisible)
}

onChangeFile(data: any) {
this.validateForm.get('icon')!.setValue(data.cdn)
}

get iconUrl(): string {
return this.validateForm.get('icon')?.value || ''
}

handleSync() {
this.modal.info({
nzTitle: $t('_syncDataOut'),
Expand Down

0 comments on commit e589226

Please sign in to comment.