Jelajahi Sumber

【商客行业档案】中文使用 翻译 ‘json文件’ 替代

liangyan0105 3 tahun lalu
induk
melakukan
e56f75bbb4

+ 35 - 16
src/app/routes/basedata/merchants-industry/add/add.component.html

@@ -1,26 +1,36 @@
 <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
+  <!-- 客商编码 -->
   <nz-form-item>
-    <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="code">客商编码</nz-form-label>
+    <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="code">
+      {{ 'quotation.merchants' | translate }}{{ 'numbering' | translate }}</nz-form-label
+    >
+    <!-- 自动生成 -->
     <nz-form-control [nzSm]="14" [nzXs]="24">
-      <input placeholder="自动生成" nz-input formControlName="code" id="code" [(ngModel)]="baseCustomerIndustry.code" />
-      <!-- <nz-form-explain *ngIf="validateForm.get('code')?.dirty && validateForm.get('code')?.errors">
-        请输入项目编码   BaseCustomerIndustry
-      </nz-form-explain> -->
+      <input
+        placeholder="{{ 'aoto.create' | translate }}"
+        nz-input
+        formControlName="code"
+        id="code"
+        [(ngModel)]="baseCustomerIndustry.code"
+      />
     </nz-form-control>
   </nz-form-item>
 
   <nz-form-item>
-    <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="name">客商名称</nz-form-label>
+    <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="name">
+      {{ 'quotation.merchants.name' | translate }}</nz-form-label
+    >
     <nz-form-control [nzSm]="14" [nzXs]="24">
       <input nz-input formControlName="name" id="name" [(ngModel)]="baseCustomerIndustry.name" maxlength="20" />
       <nz-form-explain *ngIf="validateForm.get('name')?.dirty && validateForm.get('name')?.errors">
-        请输入客商名称
+        {{ 'placeholder' | translate }}{{ 'quotation.merchants.name' | translate }}
       </nz-form-explain>
     </nz-form-control>
   </nz-form-item>
 
+  <!-- 是否启用 -->
   <nz-form-item>
-    <nz-form-label nzRequired [nzSm]="6" [nzXs]="24">是否启用 </nz-form-label>
+    <nz-form-label nzRequired [nzSm]="6" [nzXs]="24">{{ 'is.status' | translate }} </nz-form-label>
     <nz-form-control [nzSm]="14" [nzXs]="24">
       <nz-switch
         [ngModelOptions]="{ standalone: true }"
@@ -32,18 +42,27 @@
     </nz-form-control>
   </nz-form-item>
 
+  <!-- 序号 -->
   <nz-form-item>
-    <nz-form-label nzRequired [nzSm]="6" [nzXs]="24" nzRequired nzFor="sort">序号</nz-form-label>
+    <nz-form-label nzRequired [nzSm]="6" [nzXs]="24" nzRequired nzFor="sort">
+      {{ 'quotation.merchants' | translate }}{{ 'milestone.serial.number' | translate }}
+    </nz-form-label>
     <nz-form-control [nzSm]="14" [nzXs]="24">
-      <nz-input-number
-        [(ngModel)]="baseCustomerIndustry.sort"
-        [nzMin]="1"
-        [nzMax]="120"
-        [nzStep]="1"
-        [nzPlaceHolder]="'请输入该商客序号'"
+      <input
         formControlName="sort"
         id="sort"
-      ></nz-input-number>
+        [(ngModel)]="baseCustomerIndustry.sort"
+        name="sort"
+        nz-input
+        placeholder="{{ 'placeholder' | translate }}{{ 'quotation.merchants' | translate }}{{
+          'milestone.serial.number' | translate
+        }}"
+      />
+      <!-- 客商序号报错 -->
+      <nz-form-explain *ngIf="validateForm.get('sort')?.dirty && validateForm.get('sort')?.errors">
+        {{ 'placeholder' | translate }}{{ 'quotation.merchants' | translate
+        }}{{ 'milestone.serial.number' | translate }}
+      </nz-form-explain>
     </nz-form-control>
   </nz-form-item>
 </form>

+ 0 - 16
src/app/routes/basedata/merchants-industry/add/add.component.ts

@@ -80,20 +80,4 @@ export class BasedataMerchantsIndustryAddComponent implements OnInit {
   }
   //实例化函数
   baseCustomerIndustry: BaseCustomerIndustry = {};
-
-  onInput($event) {
-    // if (!$event) {
-    //   console.log($event);
-    //   return;
-    // }
-    // const target = $event.target;
-    // console.log(target);
-    // const reg = /^(\d)+$/;
-    // target.value = target.value.replace(reg, '');
-    // console.log(target.value);
-  }
-  // 数值改变时回调
-  changeMethod() {
-    console.log('?/?');
-  }
 }

+ 43 - 24
src/app/routes/basedata/merchants-industry/merchants-industry.component.html

@@ -12,7 +12,7 @@
         <div nz-row [nzGutter]="24" style="margin-bottom: 10px;">
           <div nz-col nzMd="24" nzLg="24">
             <button (click)="add()" nz-button nzType="primary">
-              添加一级
+              {{ 'button.leve.one' | translate }}
             </button>
           </div>
         </div>
@@ -21,7 +21,7 @@
         <div nz-row [nzGutter]="24">
           <div nz-col nzMd="24" nzLg="24">
             <nz-input-group [nzSuffix]="suffixIcon" style="width:100%">
-              <input type="text" nz-input placeholder="请输入" [(ngModel)]="searchValue" />
+              <input type="text" nz-input placeholder="{{ 'placeholder' | translate }}" [(ngModel)]="searchValue" />
             </nz-input-group>
             <ng-template #suffixIcon>
               <i nz-icon type="search"></i>
@@ -41,8 +41,10 @@
               <ng-template #contextTemplate>
                 <ul nz-menu nzInDropDown>
                   <li nz-menu-item (click)="addChild()">
+                    <!-- 增加 -->
                     {{ 'button.add' | translate }}
                   </li>
+                  <!-- 删除 -->
                   <li nz-menu-item (click)="delete()">
                     {{ 'table.delete' | translate }}
                   </li>
@@ -65,25 +67,32 @@
       </nz-card>
     </div>
 
-    <!-- 右 card -->
+    <!-- 右 card -->
     <div nz-col nzMd="24" nzLg="12">
       <nz-card>
         <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
           <nz-form-item>
-            <nz-form-label nzRequired [nzSm]="8" [nzXs]="24">客商编码</nz-form-label>
+            <!-- 客商编号 -->
+            <nz-form-label nzRequired [nzSm]="8" [nzXs]="24">
+              {{ 'quotation.merchants' | translate }}{{ 'numbering' | translate }}
+            </nz-form-label>
             <nz-form-control [nzSm]="14" [nzXs]="24">
+              <!-- 自动生成客户编号 -->
               <input
                 formControlName="code"
                 id="code"
                 [(ngModel)]="baseCustomerIndustry.code"
                 name="code"
                 nz-input
-                placeholder="自动生成"
+                placeholder="{{ 'aoto.create' | translate }}"
               />
             </nz-form-control>
           </nz-form-item>
+          <!-- 客商名称 -->
           <nz-form-item>
-            <nz-form-label nzRequired [nzSm]="8" [nzXs]="24">客商名称</nz-form-label>
+            <nz-form-label nzRequired [nzSm]="8" [nzXs]="24">
+              {{ 'quotation.merchants.name' | translate }}
+            </nz-form-label>
             <nz-form-control [nzSm]="14" [nzXs]="24">
               <input
                 formControlName="name"
@@ -91,52 +100,62 @@
                 [(ngModel)]="baseCustomerIndustry.name"
                 name="name"
                 nz-input
-                placeholder="{{ 'placeholder' | translate }}项目名称"
+                placeholder="{{ 'placeholder' | translate }}{{ 'quotation.merchants.name' | translate }}"
                 maxlength="20"
               />
-              <nz-form-explain *ngIf="validateForm.get('title')?.dirty && validateForm.get('title')?.errors">
-                请输入客商名称
+              <nz-form-explain *ngIf="validateForm.get('name')?.dirty && validateForm.get('name')?.errors">
+                <!-- 客商名称 报错提示文字 -->
+                {{ 'placeholder' | translate }}{{ 'quotation.merchants.name' | translate }}
               </nz-form-explain>
             </nz-form-control>
           </nz-form-item>
 
+          <!-- 是否启用 -->
           <nz-form-item>
-            <nz-form-label nzRequired [nzSm]="8" [nzXs]="24">是否启用 </nz-form-label>
+            <nz-form-label nzRequired [nzSm]="8" [nzXs]="24">{{ 'is.status' | translate }} </nz-form-label>
             <nz-form-control [nzSm]="14" [nzXs]="24">
               <nz-switch
                 [ngModelOptions]="{ standalone: true }"
                 [(ngModel)]="status"
                 name="status"
-                nzCheckedChildren=""
-                nzUnCheckedChildren=""
+                nzCheckedChildren="{{ 'yes' | translate }}"
+                nzUnCheckedChildren="{{ 'no' | translate }}"
               ></nz-switch>
             </nz-form-control>
           </nz-form-item>
 
+          <!-- 客商序号 -->
           <nz-form-item>
-            <nz-form-label nzRequired [nzSm]="8" [nzXs]="24">当前序号</nz-form-label>
+            <nz-form-label nzRequired [nzSm]="8" [nzXs]="24"
+              >{{ 'quotation.merchants' | translate }}{{ 'milestone.serial.number' | translate }}</nz-form-label
+            >
             <nz-form-control [nzSm]="14" [nzXs]="24">
               <input
-              formControlName="sort"
-              id="sort"
-              [(ngModel)]="baseCustomerIndustry.sort"
-              name="sort"
-              nz-input
-              placeholder="{{ 'placeholder' | translate }}当前序号"
-            />
-            <nz-form-explain *ngIf="validateForm.get('sort')?.dirty && validateForm.get('sort')?.errors">
-              请修改商客序号
-            </nz-form-explain>
+                formControlName="sort"
+                id="sort"
+                [(ngModel)]="baseCustomerIndustry.sort"
+                name="sort"
+                nz-input
+                placeholder="{{ 'placeholder' | translate }}{{ 'quotation.merchants' | translate }}{{
+                  'milestone.serial.number' | translate
+                }}"
+              />
+              <!-- 客商序号报错 -->
+              <nz-form-explain *ngIf="validateForm.get('sort')?.dirty && validateForm.get('sort')?.errors">
+                {{ 'placeholder' | translate }}{{ 'quotation.merchants' | translate
+                }}{{ 'milestone.serial.number' | translate }}
+              </nz-form-explain>
             </nz-form-control>
           </nz-form-item>
 
+          <!-- 保存 重置 -->
           <nz-form-item>
             <nz-form-label [nzSm]="8" [nzXs]="24" [nzNoColon]="true"> </nz-form-label>
             <nz-form-control [nzSm]="14" [nzXs]="24">
               <button nzType="primary" (click)="reset()" nz-button>
                 <span>{{ 'button.reset' | translate }}</span>
               </button>
-              <button nz-button nzType="primary">保存</button>
+              <button nz-button nzType="primary">{{ 'store.save' | translate }}</button>
             </nz-form-control>
           </nz-form-item>
         </form>

+ 5 - 0
src/assets/tmp/i18n/zh-CN.json

@@ -2025,4 +2025,9 @@
   ,"implementation":"实施"
   ,"development":"开发"
   ,"service":"服务"
+
+  ,"quotation.merchants.name": "客商名称"
+  ,"quotation.merchants": "客商"
+  ,"is.status": "是否启用"
+  ,"aoto.create": "自动生成"
 }