kz-ui-base 1.0.153 → 1.0.155

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.
@@ -175,7 +175,12 @@ export default {
175
175
  created() {
176
176
  this.$store.dispatch("LogOut").then(() => {
177
177
  this.$store.dispatch("tagsView/delAllViews");
178
+ // 清空localStorage但保留语言设置
179
+ const locale = localStorage.getItem("locale");
178
180
  localStorage.clear();
181
+ if (locale) {
182
+ localStorage.setItem("locale", locale);
183
+ }
179
184
  localforage.clear();
180
185
  removeToken();
181
186
  let enterpriseName = Cookies.get("enterpriseName");
@@ -174,7 +174,12 @@ export default {
174
174
  created() {
175
175
  this.$store.dispatch("LogOut").then(() => {
176
176
  this.$store.dispatch("tagsView/delAllViews");
177
+ // 清空localStorage但保留语言设置
178
+ const locale = localStorage.getItem("locale");
177
179
  localStorage.clear();
180
+ if (locale) {
181
+ localStorage.setItem("locale", locale);
182
+ }
178
183
  localforage.clear();
179
184
  removeToken();
180
185
  this.axios.get("/config.json").then((res) => {
@@ -132,10 +132,10 @@
132
132
  icon="el-icon-search"
133
133
  size="mini"
134
134
  @click="handleQuery"
135
- >{{ this.t('common.search') }}</el-button
135
+ >{{ t('common.search') }}</el-button
136
136
  >
137
137
  <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
138
- >{{ this.t('common.reset') }}</el-button
138
+ >{{ t('common.reset') }}</el-button
139
139
  >
140
140
  <AdvancedQuery
141
141
  style="margin-left: 10px"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kz-ui-base",
3
- "version": "1.0.153",
3
+ "version": "1.0.155",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -13,46 +13,9 @@ export default class CustomerList extends ListBasePage {
13
13
  //表格是否自动加载数据
14
14
  isAutoLoad = false;
15
15
  // 列表列信息
16
- listColumns = [
17
- //{key: 0, label: "序号", visible: true},
18
- { text: "客户编号", property: "customerNo", width: 100 },
19
- { text: "客户名称", property: "customerName", width: 260 },
20
- { text: "客户简称", property: "customerAbbr", width: 200 },
21
- { text: "国家", property: "countryCode" },
22
- { text: "地区", property: "areaCode" },
23
- { text: "省份", property: "provinceCode" },
24
- { text: "城市", property: "cityCode" },
25
- { text: "电话", property: "telNo", width: 120 },
26
- { text: "传真", property: "faxNo", width: 120 },
27
- { text: "邮编", property: "postalNo" },
28
- { text: "地址", property: "address", width: 220 },
29
- { text: "纳税登记号", property: "taxRegistrationNo", width: 160 },
30
- { text: "注册资本", property: "registeredCapital", width: 100 },
31
- { text: "公司类别", property: "companyCategoryCode" },
32
- { text: "公司性质", property: "companyNatureCode" },
33
- { text: "公司规模", property: "companySizeCode" },
34
- { text: "客户行业ID", property: "customerIndustryId" },
35
- { text: "客户区域ID", property: "customerAreaId" },
36
- { text: "经营状况", property: "businessStatus" },
37
- { text: "客户等级", property: "customerGradeCode" },
38
- { text: "销售类型", property: "salesTypeCode" },
39
- { text: "纳税分类", property: "taxClassCode" },
40
- { text: "发票类型", property: "invoiceTypeCode" },
41
- { text: "税率类型", property: "taxrateTypeCode" },
42
- ];
16
+ listColumns = [];
43
17
  // 查询条件
44
- searchRules = [
45
- { text: "客户编号", op: "LI", property: "customerNo", displayType: "TextBox" },
46
- { text: "客户名称", op: "LI", property: "customerName", displayType: "TextBox",principal:true, },
47
- { text: "负责销售组织", op: "EQ", property: "salesSiteId", displayType: "DropDownList", disabled: false, setting: {
48
- url: "/fd/fd/getUserSitesByParam",
49
- //指定显示字段和取值字段
50
- displayField: "componentName",
51
- valueField: "id",
52
- parameter: { isSales: 1 },
53
- }
54
- },
55
- ];
18
+ searchRules = [];
56
19
  isMultiple = true;
57
20
  listSetting = {
58
21
  //获取列表数据的api方法名
@@ -64,18 +27,57 @@ export default class CustomerList extends ListBasePage {
64
27
  isShowIndexColumn: true, // 显示行号
65
28
  multipleChoice: false,
66
29
  };
67
- opMenus = [
68
- ];
30
+ opMenus = [];
69
31
  // 表单校验
70
- editRules = {
71
- customerNo: [
72
- { required: true, message: "客户编号不能为空", trigger: "blur" }
73
- ],
74
- customerName: [
75
- { required: true, message: "客户名称不能为空", trigger: "blur" }
76
- ]
77
- };
32
+ editRules = {};
78
33
  created(){
34
+ this.listColumns = [
35
+ //{key: 0, label: "序号", visible: true},
36
+ { text: this.t('customerModal.customerNo'), property: "customerNo", width: 100 },
37
+ { text: this.t('customerModal.customerName'), property: "customerName", width: 260 },
38
+ { text: this.t('customerModal.customerAbbr'), property: "customerAbbr", width: 200 },
39
+ { text: this.t('customerModal.countryCode'), property: "countryCode" },
40
+ { text: this.t('customerModal.areaCode'), property: "areaCode" },
41
+ { text: this.t('customerModal.provinceCode'), property: "provinceCode" },
42
+ { text: this.t('customerModal.cityCode'), property: "cityCode" },
43
+ { text: this.t('customerModal.telNo'), property: "telNo", width: 120 },
44
+ { text: this.t('customerModal.faxNo'), property: "faxNo", width: 120 },
45
+ { text: this.t('customerModal.postalNo'), property: "postalNo" },
46
+ { text: this.t('customerModal.address'), property: "address", width: 220 },
47
+ { text: this.t('customerModal.taxRegistrationNo'), property: "taxRegistrationNo", width: 160 },
48
+ { text: this.t('customerModal.registeredCapital'), property: "registeredCapital", width: 100 },
49
+ { text: this.t('customerModal.companyCategoryCode'), property: "companyCategoryCode" },
50
+ { text: this.t('customerModal.companyNatureCode'), property: "companyNatureCode" },
51
+ { text: this.t('customerModal.companySizeCode'), property: "companySizeCode" },
52
+ { text: this.t('customerModal.customerIndustryId'), property: "customerIndustryId" },
53
+ { text: this.t('customerModal.customerAreaId'), property: "customerAreaId" },
54
+ { text: this.t('customerModal.businessStatus'), property: "businessStatus" },
55
+ { text: this.t('customerModal.customerGradeCode'), property: "customerGradeCode" },
56
+ { text: this.t('customerModal.salesTypeCode'), property: "salesTypeCode" },
57
+ { text: this.t('customerModal.taxClassCode'), property: "taxClassCode" },
58
+ { text: this.t('customerModal.invoiceTypeCode'), property: "invoiceTypeCode" },
59
+ { text: this.t('customerModal.taxrateTypeCode'), property: "taxrateTypeCode" },
60
+ ];
61
+ this.searchRules = [
62
+ { text: this.t('customerModal.customerNo'), op: "LI", property: "customerNo", displayType: "TextBox" },
63
+ { text: this.t('customerModal.customerName'), op: "LI", property: "customerName", displayType: "TextBox",principal:true, },
64
+ { text: this.t('customerModal.salesSiteId'), op: "EQ", property: "salesSiteId", displayType: "DropDownList", disabled: false, setting: {
65
+ url: "/fd/fd/getUserSitesByParam",
66
+ //指定显示字段和取值字段
67
+ displayField: "componentName",
68
+ valueField: "id",
69
+ parameter: { isSales: 1 },
70
+ }
71
+ },
72
+ ];
73
+ this.editRules = {
74
+ customerNo: [
75
+ { required: true, message: this.t('customerModal.required.customerNo'), trigger: "blur" }
76
+ ],
77
+ customerName: [
78
+ { required: true, message: this.t('customerModal.required.customerName'), trigger: "blur" }
79
+ ]
80
+ };
79
81
  if(this.setting?.data?.isMultipleStatus!=undefined){
80
82
  this.isMultiple = this.setting.data.isMultipleStatus
81
83
  }
@@ -2,7 +2,7 @@
2
2
  <div class="app-container">
3
3
  <div class="wrapper-container" v-show="showSearch">
4
4
  <el-form :model="queryParams" ref="queryForm" :inline="true">
5
- <el-form-item label="业务组织" prop="siteId" required>
5
+ <el-form-item :label="t('deptModal.siteId')" prop="siteId" required>
6
6
  <entity-select
7
7
  v-model="queryParams.siteId"
8
8
  clearable
@@ -16,20 +16,20 @@
16
16
  ></entity-select>
17
17
  </el-form-item>
18
18
 
19
- <el-form-item label="部门编码" prop="deptCode">
19
+ <el-form-item :label="t('deptModal.deptCode')" prop="deptCode">
20
20
  <el-input
21
21
  v-model="queryParams.deptCode"
22
- placeholder="请输入部门编码"
22
+ :placeholder="t('deptModal.placeholder.deptCode')"
23
23
  clearable
24
24
  size="small"
25
25
  @keyup.native="filterData"
26
26
  @clear="filterData"
27
27
  />
28
28
  </el-form-item>
29
- <el-form-item label="部门名称" prop="deptName">
29
+ <el-form-item :label="t('deptModal.deptName')" prop="deptName">
30
30
  <el-input
31
31
  v-model="queryParams.deptName"
32
- placeholder="请输入部门名称"
32
+ :placeholder="t('deptModal.placeholder.deptName')"
33
33
  clearable
34
34
  size="small"
35
35
  @keyup.native="filterData"
@@ -50,13 +50,13 @@
50
50
  @current-change="handleCurrentChange"
51
51
  :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
52
52
  <el-table-column type="index" width="50" />
53
- <el-table-column prop="label" label="部门名称" min-width="120"/>
54
- <el-table-column prop="code" label="部门编码" min-width="120"/>
53
+ <el-table-column prop="label" :label="t('deptModal.deptName')" min-width="120"/>
54
+ <el-table-column prop="code" :label="t('deptModal.deptCode')" min-width="120"/>
55
55
  </el-table>
56
56
  <div class="table-container-supplement"/>
57
57
  <div slot="footer" class="dialog-footer">
58
- <el-button type="primary" :loading="submitLoading" @click="submitForm">确 定</el-button>
59
- <el-button @click="cancel">取 消</el-button>
58
+ <el-button type="primary" :loading="submitLoading" @click="submitForm">{{ t('deptModal.confirm') }}</el-button>
59
+ <el-button @click="cancel">{{ t('deptModal.cancel') }}</el-button>
60
60
  </div>
61
61
  </div>
62
62
  </div>
@@ -118,7 +118,7 @@ export default class DeptModal extends Vue {
118
118
  let deptId = site.relatedDeptId;
119
119
  this.relatedSiteId = siteId
120
120
  if(!deptId){
121
- this.msgError("业务组织未关联部门");
121
+ this.msgError(this.t('deptModal.siteNotRelatedDept'));
122
122
  this.loading = false;
123
123
  return;
124
124
  }
@@ -2,7 +2,7 @@
2
2
  <base-dialog
3
3
  :visible.sync="visible"
4
4
  width="960px"
5
- title="人员选择"
5
+ :title="t('employeeModal.title')"
6
6
  append-to-body
7
7
  @on-confirm="handleConfirm"
8
8
  @on-cancel="handleCancel"
@@ -18,8 +18,8 @@
18
18
  >
19
19
  <el-row class="mb8">
20
20
  <el-col :span="8">
21
- <el-form-item label="业务组织" prop="siteId">
22
- <el-select v-model="listQueryParams.siteId" placeholder="请选择" @change="siteChangeEvent" :disabled="siteDisabled">
21
+ <el-form-item :label="t('employeeModal.siteId')" prop="siteId">
22
+ <el-select v-model="listQueryParams.siteId" :placeholder="t('employeeModal.placeholder.siteId')" @change="siteChangeEvent" :disabled="siteDisabled">
23
23
  <el-option
24
24
  v-for="item in siteOptions"
25
25
  :key="item.id"
@@ -31,7 +31,7 @@
31
31
  </el-form-item>
32
32
  </el-col>
33
33
  <el-col :span="8">
34
- <el-form-item label="部门名称" prop="deptId">
34
+ <el-form-item :label="t('employeeModal.deptId')" prop="deptId">
35
35
  <el-cascader
36
36
  v-model="listQueryParams.deptId"
37
37
  :options="deptOptions"
@@ -45,8 +45,8 @@
45
45
  </el-form-item>
46
46
  </el-col>
47
47
  <el-col :span="8">
48
- <el-form-item label="岗位名称" prop="postId">
49
- <el-select v-model="listQueryParams.postId" placeholder="请选择" clearable>
48
+ <el-form-item :label="t('employeeModal.postId')" prop="postId">
49
+ <el-select v-model="listQueryParams.postId" :placeholder="t('employeeModal.placeholder.postId')" clearable>
50
50
  <el-option
51
51
  v-for="item in postOptions"
52
52
  :key="item.postId"
@@ -60,12 +60,12 @@
60
60
  </el-row>
61
61
  <el-row class="mb8">
62
62
  <el-col :span="8">
63
- <el-form-item label="员工编号" prop="employeeNo">
63
+ <el-form-item :label="t('employeeModal.employeeNo')" prop="employeeNo">
64
64
  <el-input v-model="listQueryParams.employeeNo" clearable/>
65
65
  </el-form-item>
66
66
  </el-col>
67
67
  <el-col :span="8">
68
- <el-form-item label="员工名称" prop="employeeName">
68
+ <el-form-item :label="t('employeeModal.employeeName')" prop="employeeName">
69
69
  <el-input v-model="listQueryParams.employeeName" clearable/>
70
70
  </el-form-item>
71
71
  </el-col>
@@ -76,13 +76,13 @@
76
76
  icon="el-icon-search"
77
77
  size="mini"
78
78
  @click="handleQuery"
79
- >查询
79
+ >{{ t('employeeModal.search') }}
80
80
  </el-button>
81
81
  <el-button
82
82
  icon="el-icon-refresh"
83
83
  size="mini"
84
84
  @click="resetQuery"
85
- >重置
85
+ >{{ t('employeeModal.reset') }}
86
86
  </el-button>
87
87
  </el-form-item>
88
88
  </el-col>
@@ -103,10 +103,10 @@
103
103
  @selection-change="onSelectionChange"
104
104
  >
105
105
  <el-table-column type="selection" min-width="50" align="center" />
106
- <el-table-column prop="employeeNo" label="员工编号" min-width="100" align="left" show-overflow-tooltip />
107
- <el-table-column prop="employeeName" label="员工名称" min-width="100" align="left" show-overflow-tooltip />
108
- <el-table-column prop="deptName" label="部门名称" min-width="100" align="left" show-overflow-tooltip/>
109
- <el-table-column prop="postName" label="岗位名称" min-width="100" align="left" show-overflow-tooltip/>
106
+ <el-table-column prop="employeeNo" :label="t('employeeModal.employeeNo')" min-width="100" align="left" show-overflow-tooltip />
107
+ <el-table-column prop="employeeName" :label="t('employeeModal.employeeName')" min-width="100" align="left" show-overflow-tooltip />
108
+ <el-table-column prop="deptName" :label="t('employeeModal.deptId')" min-width="100" align="left" show-overflow-tooltip/>
109
+ <el-table-column prop="postName" :label="t('employeeModal.postId')" min-width="100" align="left" show-overflow-tooltip/>
110
110
  </el-table>
111
111
  <pagination
112
112
  :total="listQueryParams.total"
@@ -186,7 +186,7 @@ export default {
186
186
  postOptions: [],
187
187
  rules: {
188
188
  siteId: [
189
- { required: true, message: '请选择业务组织', trigger: 'blur' }
189
+ { required: true, message: this.t('employeeModal.placeholder.siteId'), trigger: 'blur' }
190
190
  ]
191
191
  },
192
192
  relatedDeptId: undefined
@@ -261,7 +261,7 @@ export default {
261
261
  },
262
262
  getList() {
263
263
  if (!this.relatedDeptId) {
264
- this.msgError("该业务组织未关联部门,请先设置关联部门。");
264
+ this.msgError(this.t('employeeModal.siteNotRelatedDept'));
265
265
  return
266
266
  }
267
267
  this.loading = true
@@ -295,7 +295,7 @@ export default {
295
295
  },
296
296
  handleConfirm() {
297
297
  if (!this.multipleSelection || this.multipleSelection.length === 0) {
298
- this.msgError("请选择一笔员工数据!");
298
+ this.msgError(this.t('employeeModal.selectEmployeeTip'));
299
299
  } else {
300
300
  if(this.multipleChoice) {
301
301
  this.confirm(this.multipleSelection)
@@ -315,7 +315,7 @@ export default {
315
315
  if(!selectOption) return;
316
316
  this.relatedDeptId = selectOption.relatedDeptId;
317
317
  if(!this.relatedDeptId){
318
- this.msgError("该业务组织未关联部门,请先设置关联部门。");
318
+ this.msgError(this.t('employeeModal.siteNotRelatedDept'));
319
319
  return;
320
320
  }
321
321
  this.getDept(this.relatedDeptId);
@@ -9,26 +9,15 @@ export default class VendorList extends ListBasePage {
9
9
  serviceName = "Vendor";
10
10
  pkField = "id";
11
11
  // 列表列信息
12
- listColumns = [
13
- //{key: 0, label: "序号", visible: true},
14
- {text: "供应商编号", property: "vendorNo"},
15
- {text: "供应商名称", property: "vendorName"},
16
- ];
12
+ listColumns = [];
17
13
  //是否多选
18
14
  isMultiple = true;
19
15
  // 查询条件
20
- searchRules = [
21
- {text: "供应商编号", op: "LI", property: "vendorNo", displayType: "TextBox"},
22
- {text: "供应商名称", op: "LI", property: "vendorName", displayType: "TextBox"},
23
- ];
16
+ searchRules = [];
24
17
  // 列信息
25
- editColumns = [
26
- {text: "供应商编号", property: "vendorNo", displayType: "TextBox"},
27
- {text: "供应商名称", property: "vendorName", displayType: "TextBox"},
28
- ];
29
- opMenus = [
30
- ];
31
- listSetting = {
18
+ editColumns = [];
19
+ opMenus = [];
20
+ listSetting = {
32
21
  //获取列表数据的api方法名
33
22
  getListAction: "list",
34
23
  //主键字段
@@ -49,14 +38,29 @@ export default class VendorList extends ListBasePage {
49
38
  ];
50
39
 
51
40
  // 表单校验
52
- editRules = {
53
- vendorNo: [
54
- {required: true, message: "供应商编号不能为空", trigger: "blur"}
55
- ],
56
- vendorName: [
57
- {required: true, message: "供应商名称不能为空", trigger: "blur"}
58
- ],
59
- };
41
+ editRules = {};
42
+ created() {
43
+ this.listColumns = [
44
+ {text: this.t('vendorModal.vendorNo'), property: "vendorNo"},
45
+ {text: this.t('vendorModal.vendorName'), property: "vendorName"},
46
+ ];
47
+ this.searchRules = [
48
+ {text: this.t('vendorModal.vendorNo'), op: "LI", property: "vendorNo", displayType: "TextBox"},
49
+ {text: this.t('vendorModal.vendorName'), op: "LI", property: "vendorName", displayType: "TextBox"},
50
+ ];
51
+ this.editColumns = [
52
+ {text: this.t('vendorModal.vendorNo'), property: "vendorNo", displayType: "TextBox"},
53
+ {text: this.t('vendorModal.vendorName'), property: "vendorName", displayType: "TextBox"},
54
+ ];
55
+ this.editRules = {
56
+ vendorNo: [
57
+ {required: true, message: this.t('vendorModal.required.vendorNo'), trigger: "blur"}
58
+ ],
59
+ vendorName: [
60
+ {required: true, message: this.t('vendorModal.required.vendorName'), trigger: "blur"}
61
+ ],
62
+ };
63
+ }
60
64
  mounted() {
61
65
  // 根据传参:multipleChoice 判断是否可以多选,不设值则基类默认false(单选)
62
66
  if (!!this.value?.hasOwnProperty('multipleChoice')) {
@@ -9,42 +9,15 @@ export default class WorkGroupList extends ListBasePage {
9
9
  serviceName = "WorkGroup";
10
10
  pkField = "id";
11
11
  // 列表列信息
12
- listColumns = [
13
- //{key: 0, label: "序号", visible: true},
14
- {text: "组织", property: "siteId", setting: { type: "Site" } },
15
- {text: "班组编号", property: "workGroupNo"},
16
- {text: "班组名称", property: "workGroupName"},
17
- ];
12
+ listColumns = [];
18
13
  //是否多选
19
14
  isMultiple = true;
20
15
  // 查询条件
21
- searchRules = [
22
- {
23
- text: `组织`,
24
- property: "siteId",
25
- displayType: "DropDownList",
26
- op:"EQ",
27
- setting: {
28
- type: "site",
29
- url: "fd/fd/getUserSites",
30
- displayField: "componentName",
31
- valueField: "id",
32
- isShowPleaseChoose: false,
33
- },
34
- siteId: this.value?.siteId,
35
- disabled: !!this.value?.siteId
36
- },
37
- {text: "班组编号", op: "LI", property: "workGroupNo", displayType: "TextBox"},
38
- {text: "班组名称", op: "LI", property: "workGroupName", displayType: "TextBox"},
39
- ];
16
+ searchRules = [];
40
17
  // 列信息
41
- editColumns = [
42
- {text: "班组编号", property: "workGroupNo", displayType: "TextBox"},
43
- {text: "班组名称", property: "workGroupName", displayType: "TextBox"},
44
- ];
45
- opMenus = [
46
- ];
47
- listSetting = {
18
+ editColumns = [];
19
+ opMenus = [];
20
+ listSetting = {
48
21
  //获取列表数据的api方法名
49
22
  getListAction: "list",
50
23
  //主键字段
@@ -65,14 +38,45 @@ export default class WorkGroupList extends ListBasePage {
65
38
  ];
66
39
 
67
40
  // 表单校验
68
- editRules = {
69
- vendorNo: [
70
- {required: true, message: "班组编号不能为空", trigger: "blur"}
71
- ],
72
- vendorName: [
73
- {required: true, message: "班组名称不能为空", trigger: "blur"}
74
- ],
75
- };
41
+ editRules = {};
42
+ created() {
43
+ this.listColumns = [
44
+ {text: this.t('workGroupModal.siteId'), property: "siteId", setting: { type: "Site" } },
45
+ {text: this.t('workGroupModal.workGroupNo'), property: "workGroupNo"},
46
+ {text: this.t('workGroupModal.workGroupName'), property: "workGroupName"},
47
+ ];
48
+ this.searchRules = [
49
+ {
50
+ text: this.t('workGroupModal.siteId'),
51
+ property: "siteId",
52
+ displayType: "DropDownList",
53
+ op:"EQ",
54
+ setting: {
55
+ type: "site",
56
+ url: "fd/fd/getUserSites",
57
+ displayField: "componentName",
58
+ valueField: "id",
59
+ isShowPleaseChoose: false,
60
+ },
61
+ siteId: this.value?.siteId,
62
+ disabled: !!this.value?.siteId
63
+ },
64
+ {text: this.t('workGroupModal.workGroupNo'), op: "LI", property: "workGroupNo", displayType: "TextBox"},
65
+ {text: this.t('workGroupModal.workGroupName'), op: "LI", property: "workGroupName", displayType: "TextBox"},
66
+ ];
67
+ this.editColumns = [
68
+ {text: this.t('workGroupModal.workGroupNo'), property: "workGroupNo", displayType: "TextBox"},
69
+ {text: this.t('workGroupModal.workGroupName'), property: "workGroupName", displayType: "TextBox"},
70
+ ];
71
+ this.editRules = {
72
+ workGroupNo: [
73
+ {required: true, message: this.t('workGroupModal.required.workGroupNo'), trigger: "blur"}
74
+ ],
75
+ workGroupName: [
76
+ {required: true, message: this.t('workGroupModal.required.workGroupName'), trigger: "blur"}
77
+ ],
78
+ };
79
+ }
76
80
  mounted() {
77
81
  // 根据传参:multipleChoice 判断是否可以多选,不设值则基类默认false(单选)
78
82
  if (!!this.value?.hasOwnProperty('multipleChoice')) {
@@ -7,7 +7,7 @@
7
7
  <div class="head-container">
8
8
  <el-input
9
9
  v-model="deptName"
10
- placeholder="请输入部门|岗位名称"
10
+ :placeholder="t('userModal.placeholder.deptPostName')"
11
11
  clearable
12
12
  size="small"
13
13
  prefix-icon="el-icon-search"
@@ -34,50 +34,50 @@
34
34
  <el-col :span="20" :xs="24">
35
35
  <div class="wrapper-container" v-show="showSearch">
36
36
  <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
37
- <el-form-item label="用户编码" prop="userCode">
37
+ <el-form-item :label="t('userModal.userCode')" prop="userCode">
38
38
  <el-input
39
39
  v-model="queryParams.userCode"
40
- placeholder="请输入用户编码"
40
+ :placeholder="t('userModal.placeholder.userCode')"
41
41
  clearable
42
42
  size="small"
43
43
  style="width: 240px"
44
44
  @keyup.enter.native="handleQuery"
45
45
  />
46
46
  </el-form-item>
47
- <el-form-item label="用户账号" prop="userName">
47
+ <el-form-item :label="t('userModal.userName')" prop="userName">
48
48
  <el-input
49
49
  v-model="queryParams.userName"
50
- placeholder="请输入用户账号"
50
+ :placeholder="t('userModal.placeholder.userName')"
51
51
  clearable
52
52
  size="small"
53
53
  style="width: 240px"
54
54
  @keyup.enter.native="handleQuery"
55
55
  />
56
56
  </el-form-item>
57
- <el-form-item label="用户名称" prop="nickName">
57
+ <el-form-item :label="t('userModal.nickName')" prop="nickName">
58
58
  <el-input
59
59
  v-model="queryParams.nickName"
60
- placeholder="请输入用户名称"
60
+ :placeholder="t('userModal.placeholder.nickName')"
61
61
  clearable
62
62
  size="small"
63
63
  style="width: 240px"
64
64
  @keyup.enter.native="handleQuery"
65
65
  />
66
66
  </el-form-item>
67
- <el-form-item label="手机号码" prop="phone">
67
+ <el-form-item :label="t('userModal.phone')" prop="phone">
68
68
  <el-input
69
69
  v-model="queryParams.phone"
70
- placeholder="请输入手机号码"
70
+ :placeholder="t('userModal.placeholder.phone')"
71
71
  clearable
72
72
  size="small"
73
73
  style="width: 240px"
74
74
  @keyup.enter.native="handleQuery"
75
75
  />
76
76
  </el-form-item>
77
- <el-form-item label="在职状态" prop="status">
77
+ <el-form-item :label="t('userModal.status')" prop="status">
78
78
  <el-select
79
79
  v-model="queryParams.status"
80
- placeholder="在职状态"
80
+ :placeholder="t('userModal.placeholder.status')"
81
81
  clearable
82
82
  size="small"
83
83
  style="width: 240px"
@@ -90,7 +90,7 @@
90
90
  />
91
91
  </el-select>
92
92
  </el-form-item>
93
- <el-form-item label="创建时间">
93
+ <el-form-item :label="t('userModal.createTime')">
94
94
  <el-date-picker
95
95
  v-model="dateRange"
96
96
  size="small"
@@ -98,13 +98,13 @@
98
98
  value-format="yyyy-MM-dd"
99
99
  type="daterange"
100
100
  range-separator="-"
101
- start-placeholder="开始日期"
102
- end-placeholder="结束日期"
101
+ :start-placeholder="t('userModal.placeholder.startDate')"
102
+ :end-placeholder="t('userModal.placeholder.endDate')"
103
103
  ></el-date-picker>
104
104
  </el-form-item>
105
105
  <el-form-item>
106
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
107
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
106
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ t('userModal.search') }}</el-button>
107
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ t('userModal.reset') }}</el-button>
108
108
  </el-form-item>
109
109
  </el-form>
110
110
  </div>
@@ -119,20 +119,20 @@
119
119
  @select="handleSelect"
120
120
  @selection-change="handleSelectionChange">
121
121
  <el-table-column type="selection" width="50" align="center" />
122
- <el-table-column label="用户编码" align="center" key="userCode" prop="userCode" v-if="columns[0].visible" min-width="120" />
123
- <el-table-column label="用户账号" align="center" key="userName" prop="userName" v-if="columns[1].visible"
122
+ <el-table-column :label="t('userModal.userCode')" align="center" key="userCode" prop="userCode" v-if="columns[0].visible" min-width="120" />
123
+ <el-table-column :label="t('userModal.userName')" align="center" key="userName" prop="userName" v-if="columns[1].visible"
124
124
  :show-overflow-tooltip="true" min-width="120" />
125
- <el-table-column label="用户名称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible"
125
+ <el-table-column :label="t('userModal.nickName')" align="center" key="nickName" prop="nickName" v-if="columns[2].visible"
126
126
  :show-overflow-tooltip="true" min-width="120" />
127
- <el-table-column label="部门|岗位" align="center" key="post.postName" v-if="columns[3].visible"
127
+ <el-table-column :label="t('userModal.deptPost')" align="center" key="post.postName" v-if="columns[3].visible"
128
128
  :show-overflow-tooltip="true" min-width="120">
129
129
  <template slot-scope="scope">
130
130
  <span>{{ scope.row.dept.deptName }}/{{ scope.row.post.postName }}</span>
131
131
  </template>
132
132
  </el-table-column>
133
- <el-table-column label="手机号码" align="center" key="phone" prop="phone" v-if="columns[4].visible"
133
+ <el-table-column :label="t('userModal.phone')" align="center" key="phone" prop="phone" v-if="columns[4].visible"
134
134
  min-width="120" />
135
- <el-table-column label="在职状态" align="center" key="status" v-if="columns[5].visible" min-width="120">
135
+ <el-table-column :label="t('userModal.status')" align="center" key="status" v-if="columns[5].visible" min-width="120">
136
136
  <template slot-scope="scope">
137
137
  <el-switch v-model="scope.row.status"
138
138
  active-value="0"
@@ -140,12 +140,12 @@
140
140
  @change="handleStatusChange(scope.row)"></el-switch>
141
141
  </template>
142
142
  </el-table-column>
143
- <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" min-width="160">
143
+ <el-table-column :label="t('userModal.createTime')" align="center" prop="createTime" v-if="columns[6].visible" min-width="160">
144
144
  <template slot-scope="scope">
145
145
  <span>{{ parseTime(scope.row.createTime) }}</span>
146
146
  </template>
147
147
  </el-table-column>
148
- <el-table-column label="创建人" align="center" prop="createBy" v-if="columns[7].visible" min-width="160" :formatter="userDisplayFormat">
148
+ <el-table-column :label="t('userModal.createBy')" align="center" prop="createBy" v-if="columns[7].visible" min-width="160" :formatter="userDisplayFormat">
149
149
  </el-table-column>
150
150
  </el-table>
151
151
  <pagination
@@ -158,8 +158,8 @@
158
158
  </div>
159
159
  </el-col>
160
160
  <div v-if="value && value.btnShow" class="dialog-footer" style="margin-top: 10px;position:static;">
161
- <el-button type="primary" @click="submitForm">确 定</el-button>
162
- <el-button @click="cancel">取 消</el-button>
161
+ <el-button type="primary" @click="submitForm">{{ t('userModal.confirm') }}</el-button>
162
+ <el-button @click="cancel">{{ t('userModal.cancel') }}</el-button>
163
163
  </div>
164
164
  </el-row>
165
165
  </div>
@@ -280,49 +280,9 @@ export default {
280
280
  postId: undefined
281
281
  },
282
282
  // 列信息
283
- columns: [
284
- {key: 0, label: `用户编码`, visible: true},
285
- {key: 1, label: `用户账号`, visible: true},
286
- {key: 2, label: `用户名称`, visible: true},
287
- {key: 3, label: `部门|岗位`, visible: true},
288
- {key: 4, label: `手机号码`, visible: true},
289
- {key: 5, label: `状态`, visible: true},
290
- { key: 6, label: `创建时间`, visible: true },
291
- { key: 7, label: `创建人`, visible: true }
292
- ],
283
+ columns: [],
293
284
  // 表单校验
294
- rules: {
295
- postId: [
296
- {required: true, message: "部门|岗位不能为空", trigger: "blur"}
297
- ],
298
- userCode: [
299
- {required: true, message: "用户编码不能为空", trigger: "blur"}
300
- ],
301
- userName: [
302
- {required: true, message: "用户账号不能为空", trigger: "blur"}
303
- ],
304
- nickName: [
305
- {required: true, message: "用户名称不能为空", trigger: "blur"}
306
- ],
307
- password: [
308
- {required: true, message: "用户密码不能为空", trigger: "blur"},
309
- {min: 6, max: 20, message: '用户密码长度必须介于 6 和 20 之间', trigger: 'blur'}
310
- ],
311
- email: [
312
- {
313
- type: "email",
314
- message: "'请输入正确的邮箱地址",
315
- trigger: ["blur", "change"]
316
- }
317
- ],
318
- phone: [
319
- {
320
- pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
321
- message: "请输入正确的手机号码",
322
- trigger: "blur"
323
- }
324
- ]
325
- }
285
+ rules: {}
326
286
  }
327
287
  },
328
288
  watch: {
@@ -341,6 +301,48 @@ export default {
341
301
  }
342
302
  },
343
303
  created() {
304
+ this.columns = [
305
+ {key: 0, label: this.t('userModal.userCode'), visible: true},
306
+ {key: 1, label: this.t('userModal.userName'), visible: true},
307
+ {key: 2, label: this.t('userModal.nickName'), visible: true},
308
+ {key: 3, label: this.t('userModal.deptPost'), visible: true},
309
+ {key: 4, label: this.t('userModal.phone'), visible: true},
310
+ {key: 5, label: this.t('userModal.status'), visible: true},
311
+ {key: 6, label: this.t('userModal.createTime'), visible: true},
312
+ {key: 7, label: this.t('userModal.createBy'), visible: true}
313
+ ];
314
+ this.rules = {
315
+ postId: [
316
+ {required: true, message: this.t('userModal.required.deptPost'), trigger: "blur"}
317
+ ],
318
+ userCode: [
319
+ {required: true, message: this.t('userModal.required.userCode'), trigger: "blur"}
320
+ ],
321
+ userName: [
322
+ {required: true, message: this.t('userModal.required.userName'), trigger: "blur"}
323
+ ],
324
+ nickName: [
325
+ {required: true, message: this.t('userModal.required.nickName'), trigger: "blur"}
326
+ ],
327
+ password: [
328
+ {required: true, message: this.t('userModal.required.password'), trigger: "blur"},
329
+ {min: 6, max: 20, message: this.t('userModal.required.passwordLength'), trigger: 'blur'}
330
+ ],
331
+ email: [
332
+ {
333
+ type: "email",
334
+ message: this.t('userModal.required.email'),
335
+ trigger: ["blur", "change"]
336
+ }
337
+ ],
338
+ phone: [
339
+ {
340
+ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
341
+ message: this.t('userModal.required.phone'),
342
+ trigger: "blur"
343
+ }
344
+ ]
345
+ };
344
346
  this.getList()
345
347
  this.getTreeSelect()
346
348
  this.getDicts("sys_normal_disable").then(response => {
@@ -468,13 +470,13 @@ export default {
468
470
  debugger
469
471
  if (this.isReturnEntity) {
470
472
  if (!this.multipleSelection || this.multipleSelection.length === 0) {
471
- this.msgError("请选择一笔用户数据!");
473
+ this.msgError(this.t('userModal.selectUserTip'));
472
474
  } else {
473
475
  this.$emit("confirm", this.multipleChoice ? this.multipleSelection : this.multipleSelection?.[0])
474
476
  }
475
477
  } else {
476
478
  if (! this.ids || this.ids.length === 0) {
477
- this.msgError("请选择一笔用户数据!");
479
+ this.msgError(this.t('userModal.selectUserTip'));
478
480
  } else {
479
481
  this.$emit("confirm", this.ids);
480
482
  }