arms-app 1.0.65 → 1.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/view/4.vue +68 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arms-app",
3
- "version": "1.0.65",
3
+ "version": "1.0.66",
4
4
  "description": "一个基于 Express 的 Web 应用1",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/view/4.vue CHANGED
@@ -1,9 +1,13 @@
1
1
  <template>
2
+ <!-- 人员信息表页面 -->
2
3
  <section class="person-table-page">
4
+ <!-- 页面标题 -->
3
5
  <h1>人员信息表</h1>
6
+ <!-- 工具栏:新增按钮 -->
4
7
  <div class="toolbar">
5
8
  <el-button type="primary" size="mini" @click="onOpenAdd">新增</el-button>
6
9
  </div>
10
+ <!-- 人员信息表格 -->
7
11
  <el-table
8
12
  :data="rows"
9
13
  border
@@ -11,7 +15,9 @@
11
15
  size="small"
12
16
  style="width: 100%"
13
17
  >
18
+ <!-- 序号列 -->
14
19
  <el-table-column type="index" label="序号" width="60" align="center" header-align="center" />
20
+ <!-- 基础信息列 -->
15
21
  <el-table-column prop="name" label="人员姓名" min-width="100" align="center" header-align="center" />
16
22
  <el-table-column label="性别" width="80" align="center" header-align="center">
17
23
  <template slot-scope="scope">
@@ -25,9 +31,10 @@
25
31
  <el-table-column prop="emergContactPersonName" label="紧急联系人" min-width="100" align="center" header-align="center" />
26
32
  <el-table-column prop="emergContactPhoneNo" label="紧急联系方式" min-width="130" align="center" header-align="center" />
27
33
  <el-table-column prop="birthDt" label="出生日期" min-width="110" align="center" header-align="center" />
28
- <el-table-column prop="highestEduDegreeDesc" label="最高学历" min-width="90" align="center" header-align="center" />
34
+ <el-table-column prop="最高EduDegreeDesc" label="最高学历" min-width="90" align="center" header-align="center" />
29
35
  <el-table-column prop="createTm" label="创建日期" min-width="110" align="center" header-align="center" />
30
36
  <el-table-column prop="rmk" label="备注" min-width="120" align="center" header-align="center" />
37
+ <!-- 操作列:详情、编辑、删除 -->
31
38
  <el-table-column label="操作" width="200" align="center" header-align="center">
32
39
  <template slot-scope="scope">
33
40
  <el-button type="text" size="mini" @click="onView(scope.row)">详情</el-button>
@@ -37,11 +44,13 @@
37
44
  </el-table-column>
38
45
  </el-table>
39
46
 
47
+ <!-- 新增/编辑/查看 弹窗 -->
40
48
  <el-dialog
41
49
  :title="dialogTitle"
42
50
  :visible.sync="dialogVisible"
43
51
  width="720px"
44
52
  >
53
+ <!-- 人员信息表单 -->
45
54
  <el-form
46
55
  ref="addForm"
47
56
  :model="form"
@@ -49,6 +58,7 @@
49
58
  label-width="90px"
50
59
  size="small"
51
60
  >
61
+ <!-- 第一行:姓名、岗位 -->
52
62
  <el-row :gutter="16">
53
63
  <el-col :span="12">
54
64
  <el-form-item label="人员姓名" prop="name">
@@ -68,6 +78,7 @@
68
78
  </el-form-item>
69
79
  </el-col>
70
80
  </el-row>
81
+ <!-- 第二行:入行日期、性别 -->
71
82
  <el-row :gutter="16">
72
83
  <el-col :span="12">
73
84
  <el-form-item label="入行日期" prop="happenPerio">
@@ -90,6 +101,7 @@
90
101
  </el-form-item>
91
102
  </el-col>
92
103
  </el-row>
104
+ <!-- 第三行:联系方式、出生日期 -->
93
105
  <el-row :gutter="16">
94
106
  <el-col :span="12">
95
107
  <el-form-item label="联系方式" prop="telNo">
@@ -109,6 +121,7 @@
109
121
  </el-form-item>
110
122
  </el-col>
111
123
  </el-row>
124
+ <!-- 第四行:家庭住址 -->
112
125
  <el-row :gutter="16">
113
126
  <el-col :span="24">
114
127
  <el-form-item label="家庭住址" prop="dtlAddr">
@@ -116,6 +129,7 @@
116
129
  </el-form-item>
117
130
  </el-col>
118
131
  </el-row>
132
+ <!-- 第五行:紧急联系人及联系方式 -->
119
133
  <el-row :gutter="16">
120
134
  <el-col :span="12">
121
135
  <el-form-item label="紧急联系人" prop="emergContactPersonName">
@@ -128,6 +142,7 @@
128
142
  </el-form-item>
129
143
  </el-col>
130
144
  </el-row>
145
+ <!-- 第六行:最高学历、备注 -->
131
146
  <el-row :gutter="16">
132
147
  <el-col :span="12">
133
148
  <el-form-item label="最高学历" prop="highestEduDegreeDesc">
@@ -155,6 +170,7 @@
155
170
  </el-form-item>
156
171
  </el-col>
157
172
  </el-row>
173
+ <!-- 第七行:附件上传 -->
158
174
  <el-row :gutter="16">
159
175
  <el-col :span="24">
160
176
  <el-form-item label="选择文件">
@@ -177,6 +193,7 @@
177
193
  </el-col>
178
194
  </el-row>
179
195
  </el-form>
196
+ <!-- 弹窗底部按钮 -->
180
197
  <span slot="footer" class="dialog-footer">
181
198
  <el-button @click="dialogVisible = false">取消</el-button>
182
199
  <el-button
@@ -196,42 +213,75 @@ export default {
196
213
  name: "PersonTableView",
197
214
  data() {
198
215
  return {
216
+ // 表格数据源:人员列表
199
217
  rows: [
200
218
  {
219
+ // 唯一标识
201
220
  id: 3286648151643648,
221
+ // 人员姓名
202
222
  name: "李白",
223
+ // 性别:1-男,2-女
203
224
  sex: "1",
225
+ // 岗位名称
204
226
  postName: "保洁",
227
+ // 入行日期(yyyy-MM-dd)
205
228
  happenPerio: "2002-02-02",
229
+ // 联系电话
206
230
  telNo: "18966541247",
231
+ // 现居住地
207
232
  dtlAddr: "北京",
233
+ // 紧急联系人姓名
208
234
  emergContactPersonName: "王安石",
235
+ // 紧急联系人电话
209
236
  emergContactPhoneNo: "15466257489",
237
+ // 出生日期(yyyy-MM-dd)
210
238
  birthDt: "2000-02-02",
239
+ // 最高学历说明
211
240
  highestEduDegreeDesc: "硕士",
241
+ // 创建日期(yyyy-MM-dd)
212
242
  createTm: "2025-12-25",
243
+ // 备注信息
213
244
  rmk: "好人",
245
+ // 所属机构号
214
246
  beloOrgNO: "000291",
247
+ // 创建人工号
215
248
  creatorNo: "022171",
249
+ // 删除标识:0-正常 1-删除
216
250
  delFlag: "0",
217
251
  },
218
252
  ],
253
+ // 弹窗显隐状态
219
254
  dialogVisible: false,
255
+ // 弹窗模式:add 新增 / edit 编辑 / view 查看
220
256
  dialogMode: "add",
257
+ // 当前编辑或查看的人员ID
221
258
  editingId: null,
259
+ // 表单数据模型
222
260
  form: {
261
+ // 人员姓名
223
262
  name: "",
263
+ // 性别:1-男,2-女
224
264
  sex: "",
265
+ // 岗位名称
225
266
  postName: "",
267
+ // 入行日期
226
268
  happenPerio: "",
269
+ // 联系电话
227
270
  telNo: "",
271
+ // 家庭住址
228
272
  dtlAddr: "",
273
+ // 紧急联系人姓名
229
274
  emergContactPersonName: "",
275
+ // 紧急联系人电话
230
276
  emergContactPhoneNo: "",
277
+ // 出生日期
231
278
  birthDt: "",
279
+ // 最高学历说明
232
280
  highestEduDegreeDesc: "",
281
+ // 备注信息
233
282
  rmk: "",
234
283
  },
284
+ // 表单校验规则
235
285
  rules: {
236
286
  name: [{ required: true, message: "请输入人员姓名", trigger: "blur" }],
237
287
  postName: [{ required: true, message: "请选择岗位", trigger: "change" }],
@@ -241,33 +291,41 @@ export default {
241
291
  emergContactPersonName: [{ required: true, message: "请输入紧急联系人", trigger: "blur" }],
242
292
  emergContactPhoneNo: [{ required: true, message: "请输入紧急联系方式", trigger: "blur" }],
243
293
  },
294
+ // 岗位下拉选项
244
295
  postOptions: ["保洁", "柜员", "客户经理", "运营专员"],
296
+ // 学历下拉选项
245
297
  eduOptions: ["大专", "本科", "硕士", "博士"],
298
+ // 上传的附件列表
246
299
  fileList: [],
247
300
  };
248
301
  },
249
302
  computed: {
303
+ // 弹窗标题文案
250
304
  dialogTitle() {
251
305
  if (this.dialogMode === "edit") return "编辑";
252
306
  if (this.dialogMode === "view") return "详情";
253
307
  return "新增";
254
308
  },
309
+ // 是否为只读查看模式
255
310
  isView() {
256
311
  return this.dialogMode === "view";
257
312
  },
258
313
  },
259
314
  methods: {
315
+ // 性别字段格式化显示
260
316
  formatSex(v) {
261
317
  if (v === "1" || v === 1) return "男";
262
318
  if (v === "2" || v === 2) return "女";
263
319
  return "";
264
320
  },
321
+ // 打开新增弹窗
265
322
  onOpenAdd() {
266
323
  this.dialogVisible = true;
267
324
  this.dialogMode = "add";
268
325
  this.editingId = null;
269
326
  this.resetForm();
270
327
  },
328
+ // 打开编辑弹窗并回显数据
271
329
  onEdit(row) {
272
330
  this.dialogMode = "edit";
273
331
  this.editingId = row.id;
@@ -291,6 +349,7 @@ export default {
291
349
  this.$refs.addForm.clearValidate();
292
350
  }
293
351
  },
352
+ // 打开详情弹窗(只读)
294
353
  onView(row) {
295
354
  this.dialogMode = "view";
296
355
  this.editingId = row.id;
@@ -314,6 +373,7 @@ export default {
314
373
  this.$refs.addForm.clearValidate();
315
374
  }
316
375
  },
376
+ // 重置表单数据及校验
317
377
  resetForm() {
318
378
  this.form = {
319
379
  name: "",
@@ -333,12 +393,15 @@ export default {
333
393
  this.$refs.addForm.clearValidate();
334
394
  }
335
395
  },
396
+ // 文件选择变更回调
336
397
  onFileChange(file, fileList) {
337
398
  this.fileList = fileList.slice();
338
399
  },
400
+ // 文件移除回调
339
401
  onFileRemove(file, fileList) {
340
402
  this.fileList = fileList.slice();
341
403
  },
404
+ // 保存(新增或编辑)人员信息
342
405
  onSave() {
343
406
  if (!this.$refs.addForm) return;
344
407
  this.$refs.addForm.validate((valid) => {
@@ -367,18 +430,21 @@ export default {
367
430
  delFlag: "0",
368
431
  };
369
432
  if (this.dialogMode === "edit" && this.editingId) {
433
+ // 编辑模式:更新原有记录
370
434
  this.rows = this.rows.map((r) =>
371
435
  r.id === this.editingId
372
436
  ? Object.assign({}, r, base, { id: r.id })
373
- : r
437
+ : r
374
438
  );
375
439
  } else {
440
+ // 新增模式:追加新记录
376
441
  const row = Object.assign({}, base, { id: Date.now() });
377
442
  this.rows = this.rows.concat(row);
378
443
  }
379
444
  this.dialogVisible = false;
380
445
  });
381
446
  },
447
+ // 删除人员信息
382
448
  onRemove(row) {
383
449
  if (!row || !row.id) return;
384
450
  this.$confirm("确认删除该人员吗?", "提示", { type: "warning" })