iT邦幫忙

2023 iThome 鐵人賽

DAY 17
0
SideProject30

Electron Angular軟體架構與簡易功能實作學習路程實記系列 第 17

Day 17- 功能開發-2-使用者資料建立測試

  • 分享至 

  • xImage
  •  

UI介面Layout測試

<h2>使用者資料UI測試</h2>
  <div class="card justify-content-center">
    <div class="field">
      <label class="p-2">IdUser:</label>
      <input type="text" pInputText [(ngModel)]="IdUser" />
    </div>
    <div class="field">
      <label class="p-2">Password:</label>
      <input type="text" pInputText [(ngModel)]="Password" />
    </div>
    <div class="field">
      <label class="p-2">Permission:</label>
      <p-dropdown [options]="permissionOptions" [(ngModel)]="selectedPermission" optionLabel="name"></p-dropdown>
    </div>
    <div class="field">
      <label class="p-2">UserName:</label>
      <input type="text" pInputText [(ngModel)]="UserName" />
    </div>
    <div class="field">
      <label class="p-2">NickName:</label>
      <input type="text" pInputText [(ngModel)]="NickName" />
    </div>
    <div class="field">
      <label class="p-2">Gender:</label>
      <p-dropdown [options]="genderOptions" [(ngModel)]="selectedGender" optionLabel="name"></p-dropdown>
    </div>
    <div class="field">
      <label class="p-2">Birthday:</label>
      <p-calendar [(ngModel)]="Birthday" [showIcon]="true"></p-calendar>
    </div>
    <div class="field">
      <label class="p-2">Email:</label>
      <input type="text" pInputText [(ngModel)]="Email" />
    </div>
  </div>

UI參數宣告

userData: any;
  fileName: string | undefined;
  file:File | undefined;

  IdUser: string | undefined;
  Password: string | undefined;
  permissionOptions: Option[] = [{name: '使用者', code: 0}, {name: '管理者', code: 1}];
  selectedPermission: Option = {name: '使用者', code: 0};
  UserName: string | undefined;
  NickName: string | undefined;
  genderOptions: Option[] = [{name: '男', code: 0}, {name: '女', code: 1}];
  selectedGender: Option = {name: '男', code: 0};
  Birthday: string | undefined;
  Email: string | undefined;

使用者物件宣告

export class User {
  IdUser?: string;
  Password?: string;
  Permission?: number;
  UserName?: string;
  NickName?: string;
  Gender?: number;
  Birthday?: string;
  Email?: string;
  CreatedTime?: Date;
  UpdatedTime?: Date;
}

上一篇
Day16-功能開發-1-登入頁面
下一篇
Day 18- 功能開發-2-使用者資料建立測試-2
系列文
Electron Angular軟體架構與簡易功能實作學習路程實記30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言