cloud-web-corejs 1.0.164 → 1.0.166

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.
@@ -35,6 +35,9 @@ import logic_param_list from "@base/views/bd/setting/logic_param/list.vue";
35
35
  import logic_param_list1 from "@base/views/bd/setting/logic_param/list1.vue";
36
36
  import logic_param_list2 from "@base/views/bd/setting/logic_param/list2.vue";
37
37
 
38
+ import country_list from "@base/views/user/country/list.vue";
39
+ import area_list from "@base/views/user/area/list.vue";
40
+
38
41
  export default {
39
42
  name: "list",
40
43
  components: {
@@ -45,6 +48,8 @@ export default {
45
48
  logic_param_list,
46
49
  logic_param_list1,
47
50
  logic_param_list2,
51
+ country_list,
52
+ area_list,
48
53
  },
49
54
  data() {
50
55
  return {
@@ -61,6 +66,8 @@ export default {
61
66
  { label: this.$t1("逻辑参数"), name: "logic_param_list", inited: false },
62
67
  // {label: this.$t1("操作日志编码"), name: "logic_param_list1", inited: false},
63
68
  { label: this.$t1("上传文件服务"), name: "logic_param_list2", inited: false },
69
+ { label: this.$t1("国家维护"), name: "country_list", inited: false },
70
+ { label: this.$t1("国家地区"), name: "area_list", inited: false },
64
71
  ],
65
72
  };
66
73
  },
@@ -12,91 +12,142 @@
12
12
  v-el-drag-dialog
13
13
  v-el-dialog-center
14
14
  >
15
- <div class="cont" style="height:450px">
15
+ <template #title>
16
+ <span class="el-dialog__title"
17
+ >{{ $t1("地区列表")
18
+ }}<span style="margin-left: 10px; margin-right: 10px">—</span> {{ $t1("国家") }}:
19
+ <el-input
20
+ class="search-input"
21
+ max="200"
22
+ v-model="countryName"
23
+ @clear="cleaerCountry"
24
+ placeholder="默认中国"
25
+ v-el-readonly
26
+ clearable
27
+ >
28
+ <i
29
+ slot="suffix"
30
+ class="el-input__icon el-icon-search"
31
+ @click="showCountryDialog = true"
32
+ ></i> </el-input
33
+ ></span>
34
+ </template>
35
+ <div class="cont" style="height: 450px">
16
36
  <el-tabs v-model="activeName" class="tab-box">
17
37
  <el-tab-pane :label="$t1('下拉选择')" name="first">
18
- <el-popover
19
- placement="bottom"
20
- width="630"
21
- trigger="click"
22
- ref="select1"
23
- >
38
+ <el-popover placement="bottom" width="630" trigger="click" ref="select1">
24
39
  <div class="adr-select-box">
25
- <div class="item" v-for="(item,index) in provinces" :key="index"
26
- :class="[value1 == item.id ? 'on':'']" @click="checkItem(item,1)"><span>{{ item.name }}</span>
40
+ <div
41
+ class="item"
42
+ v-for="(item, index) in provinces"
43
+ :key="index"
44
+ :class="[value1 == item.id ? 'on' : '']"
45
+ @click="checkItem(item, 1)"
46
+ >
47
+ <span>{{ item.name }}</span>
27
48
  </div>
28
49
  </div>
29
- <label class="adr-select-txt" :class="{noNone:(!!value1)}" slot="reference">
50
+ <label class="adr-select-txt" :class="{ noNone: !!value1 }" slot="reference">
30
51
  <!-- <i :class="row.menuImg" class="iconfont"></i>-->
31
52
  <span v-if="!!value1">{{ getItemLabel(provinces, value1) }}</span>
32
- <span v-if="!value1" style="color: #e8e8e8;">{{ $t1('请选择') }}</span>
53
+ <span v-if="!value1" style="color: #e8e8e8">{{ $t1("请选择") }}</span>
33
54
  <i class="el-icon-arrow-down"></i>
34
- <i class="el-icon-circle-close icon-box_del" @click.stop="clearCheckItem(1)"></i>
55
+ <i
56
+ class="el-icon-circle-close icon-box_del"
57
+ @click.stop="clearCheckItem(1)"
58
+ ></i>
35
59
  </label>
36
60
  </el-popover>
37
61
  <el-popover
38
- :disabled="selectTopLevel || (!value1 || cities.length==0)"
62
+ :disabled="selectTopLevel || !value1 || cities.length == 0"
39
63
  placement="bottom"
40
64
  width="486"
41
65
  trigger="click"
42
66
  ref="select2"
43
67
  >
44
68
  <div class="adr-select-box">
45
- <div class="item" v-for="(item,index) in cities" :key="index"
46
- :class="[value2 == item.id ? 'on':'']" @click="checkItem(item,2)"><span>{{ item.name }}</span>
69
+ <div
70
+ class="item"
71
+ v-for="(item, index) in cities"
72
+ :key="index"
73
+ :class="[value2 == item.id ? 'on' : '']"
74
+ @click="checkItem(item, 2)"
75
+ >
76
+ <span>{{ item.name }}</span>
47
77
  </div>
48
78
  </div>
49
- <label class="adr-select-txt" :class="{noNone:(!!value2)}" slot="reference">
79
+ <label class="adr-select-txt" :class="{ noNone: !!value2 }" slot="reference">
50
80
  <!-- <i :class="row.menuImg" class="iconfont"></i>-->
51
81
  <span v-if="!!value2">{{ getItemLabel(cities, value2) }}</span>
52
- <span v-if="!value2" style="color: #e8e8e8;">{{ $t1('请选择') }}</span>
82
+ <span v-if="!value2" style="color: #e8e8e8">{{ $t1("请选择") }}</span>
53
83
  <i class="el-icon-arrow-down"></i>
54
- <i class="el-icon-circle-close icon-box_del" @click.stop="clearCheckItem(2)"></i>
84
+ <i
85
+ class="el-icon-circle-close icon-box_del"
86
+ @click.stop="clearCheckItem(2)"
87
+ ></i>
55
88
  </label>
56
89
  </el-popover>
57
90
  <el-popover
58
- :disabled="selectTopLevel || (!value2 || districts.length==0)"
91
+ :disabled="selectTopLevel || !value2 || districts.length == 0"
59
92
  placement="bottom"
60
93
  width="486"
61
94
  trigger="click"
62
95
  ref="select3"
63
96
  >
64
97
  <div class="adr-select-box">
65
- <div class="item" v-for="(item,index) in districts" :key="index"
66
- :class="[value3 == item.id ? 'on':'']" @click="checkItem(item,3)"><span>{{ item.name }}</span>
98
+ <div
99
+ class="item"
100
+ v-for="(item, index) in districts"
101
+ :key="index"
102
+ :class="[value3 == item.id ? 'on' : '']"
103
+ @click="checkItem(item, 3)"
104
+ >
105
+ <span>{{ item.name }}</span>
67
106
  </div>
68
107
  </div>
69
- <label class="adr-select-txt" :class="{noNone:(!!value3)}" slot="reference">
108
+ <label class="adr-select-txt" :class="{ noNone: !!value3 }" slot="reference">
70
109
  <!-- <i :class="row.menuImg" class="iconfont"></i>-->
71
110
  <span v-if="!!value3">{{ getItemLabel(districts, value3) }}</span>
72
- <span v-if="!value3" style="color: #e8e8e8;">{{ $t1('请选择') }}</span>
111
+ <span v-if="!value3" style="color: #e8e8e8">{{ $t1("请选择") }}</span>
73
112
  <i class="el-icon-arrow-down"></i>
74
- <i class="el-icon-circle-close icon-box_del" @click.stop="clearCheckItem(3)"></i>
113
+ <i
114
+ class="el-icon-circle-close icon-box_del"
115
+ @click.stop="clearCheckItem(3)"
116
+ ></i>
75
117
  </label>
76
118
  </el-popover>
77
119
  <el-popover
78
- :disabled="selectTopLevel || (!value3 || counties.length == 0)"
120
+ :disabled="selectTopLevel || !value3 || counties.length == 0"
79
121
  placement="bottom"
80
122
  width="486"
81
123
  trigger="click"
82
124
  ref="select4"
83
125
  >
84
126
  <div class="adr-select-box">
85
- <div class="item" v-for="(item,index) in counties" :key="index"
86
- :class="[value4 == item.id ? 'on':'']" @click="checkItem(item,4)"><span>{{ item.name }}</span>
127
+ <div
128
+ class="item"
129
+ v-for="(item, index) in counties"
130
+ :key="index"
131
+ :class="[value4 == item.id ? 'on' : '']"
132
+ @click="checkItem(item, 4)"
133
+ >
134
+ <span>{{ item.name }}</span>
87
135
  </div>
88
136
  </div>
89
- <label class="adr-select-txt" :class="{noNone:(!!value4)}" slot="reference">
137
+ <label class="adr-select-txt" :class="{ noNone: !!value4 }" slot="reference">
90
138
  <!-- <i :class="row.menuImg" class="iconfont"></i>-->
91
139
  <span v-if="!!value4">{{ getItemLabel(counties, value4) }}</span>
92
- <span v-if="!value4" style="color: #e8e8e8;">{{ $t1('请选择') }}</span>
140
+ <span v-if="!value4" style="color: #e8e8e8">{{ $t1("请选择") }}</span>
93
141
  <i class="el-icon-arrow-down"></i>
94
- <i class="el-icon-circle-close icon-box_del" @click.stop="clearCheckItem(4)"></i>
142
+ <i
143
+ class="el-icon-circle-close icon-box_del"
144
+ @click.stop="clearCheckItem(4)"
145
+ ></i>
95
146
  </label>
96
147
  </el-popover>
97
148
  </el-tab-pane>
98
149
  <el-tab-pane :label="$t1('列表选择')" name="second">
99
- <div style="height:400px">
150
+ <div style="height: 400px">
100
151
  <vxe-grid
101
152
  class="is-pointer"
102
153
  ref="table-m1"
@@ -110,35 +161,54 @@
110
161
  <template #form v-if="!(param && param.onlySearchTopLevel)">
111
162
  <div class="clearfix screen-btns">
112
163
  <div class="fr">
113
- <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
114
- plain>{{ $t1('重置') }}
164
+ <vxe-button
165
+ icon="el-icon-brush"
166
+ class="button-sty"
167
+ @click="resetEvent"
168
+ type="text"
169
+ status="primary"
170
+ plain
171
+ >{{ $t1("重置") }}
115
172
  </vxe-button>
116
- <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
117
- {{ $t1('搜索') }}
173
+ <vxe-button
174
+ status="warning"
175
+ icon="el-icon-search"
176
+ class="button-sty"
177
+ @click="searchEvent"
178
+ >
179
+ {{ $t1("搜索") }}
118
180
  </vxe-button>
119
181
  </div>
120
182
  </div>
121
- <vxe-form class="screen-box" title-width="92px" title-align="right" :data="formData"
122
- @submit="searchEvent"
123
- @reset="resetEvent">
124
- <vxe-form-item :title="$t1('地区名称')+':'" field="name">
183
+ <vxe-form
184
+ class="screen-box"
185
+ title-width="92px"
186
+ title-align="right"
187
+ :data="formData"
188
+ @submit="searchEvent"
189
+ @reset="resetEvent"
190
+ >
191
+ <vxe-form-item :title="$t1('地区名称') + ':'" field="name">
125
192
  <template v-slot>
126
- <el-input v-model="formData.name" size="small" clearable/>
193
+ <el-input v-model="formData.name" size="small" clearable />
127
194
  </template>
128
195
  </vxe-form-item>
129
- <vxe-form-item :title="$t1('地区全称')+':'" field="fullName">
196
+ <vxe-form-item :title="$t1('地区全称') + ':'" field="fullName">
130
197
  <template v-slot>
131
- <el-input v-model="formData.fullName" size="small" clearable/>
198
+ <el-input v-model="formData.fullName" size="small" clearable />
132
199
  </template>
133
200
  </vxe-form-item>
134
- <vxe-button type="submit" @click="searchEvent" v-show="false"></vxe-button>
201
+ <vxe-button
202
+ type="submit"
203
+ @click="searchEvent"
204
+ v-show="false"
205
+ ></vxe-button>
135
206
  </vxe-form>
136
207
  </template>
137
208
  </vxe-grid>
138
209
  </div>
139
210
  </el-tab-pane>
140
211
  </el-tabs>
141
-
142
212
  </div>
143
213
  <label id="labBtn" class="transverse">
144
214
  <div class="icon">
@@ -147,8 +217,13 @@
147
217
  </div>
148
218
  </label>
149
219
  <div class="multipleChoice">
150
- <el-tooltip :enterable="false" effect="dark" :content="$t1('全部删除')" placement="top"><a
151
- class="allDel icon-quanbushanchu" @click="clearChecked()"></a></el-tooltip>
220
+ <el-tooltip
221
+ :enterable="false"
222
+ effect="dark"
223
+ :content="$t1('全部删除')"
224
+ placement="top"
225
+ ><a class="allDel icon-quanbushanchu" @click="clearChecked()"></a
226
+ ></el-tooltip>
152
227
  <div class="list">
153
228
  <div class="item" v-for="(checkRow, index) in checkRows" :key="index">
154
229
  <p>{{ checkRow.fullName }}</p>
@@ -157,31 +232,41 @@
157
232
  </div>
158
233
  </div>
159
234
  <span slot="footer" class="dialog-footer">
160
- <span class="fl tips" v-if="!selectMulti">{{ $t1('注:双击确认选择(单选)') }}</span>
161
- <el-button type="primary" plain class="button-sty" @click="dialogClose">
162
- <i class="el-icon-close el-icon"></i>
163
- {{ $t1('取 消') }}
164
- </el-button>
165
- <el-button type="primary" @click="dialogPrimary" class="button-sty">
166
- <i class="el-icon-check el-icon"></i>
167
- {{ $t1('确 定') }}
168
- </el-button>
169
- </span>
235
+ <span class="fl tips" v-if="!selectMulti">{{
236
+ $t1("注:双击确认选择(单选)")
237
+ }}</span>
238
+ <el-button type="primary" plain class="button-sty" @click="dialogClose">
239
+ <i class="el-icon-close el-icon"></i>
240
+ {{ $t1(" ") }}
241
+ </el-button>
242
+ <el-button type="primary" @click="dialogPrimary" class="button-sty">
243
+ <i class="el-icon-check el-icon"></i>
244
+ {{ $t1("确 定") }}
245
+ </el-button>
246
+ </span>
247
+ <countryDialog
248
+ v-if="showCountryDialog"
249
+ :visiable.sync="showCountryDialog"
250
+ :multi="false"
251
+ @confirm="countryDialogConfirm"
252
+ ></countryDialog>
170
253
  </el-dialog>
171
254
  </template>
172
255
 
173
256
  <script>
174
- import {selectDialogMixins} from '@base/mixins/selectDialog/index.js';
257
+ import { selectDialogMixins } from "@base/mixins/selectDialog/index.js";
258
+ import countryDialog from "@base/views/user/country/dialog.vue";
175
259
 
176
260
  export default {
177
- name: 'areaDialog',
178
- props: ['visiable', 'multi', 'rows', 'param', 'selectTopLevel'],
261
+ name: "areaDialog",
262
+ props: ["visiable", "multi", "rows", "param", "selectTopLevel"],
179
263
  mixins: [selectDialogMixins],
264
+ components: { countryDialog },
180
265
  created() {
181
266
  this.initSetting();
182
267
  },
183
268
  mounted() {
184
- this.getAreaData(null, 1);
269
+ this.getAreaData(0, 1);
185
270
  this.initTableM1();
186
271
  },
187
272
  data() {
@@ -202,16 +287,19 @@ export default {
202
287
  value2: null,
203
288
  value3: null,
204
289
  value4: null,
205
- tableInited: false
290
+ tableInited: false,
291
+ showCountryDialog: false,
292
+ countryName: null,
293
+ locale: null,
206
294
  };
207
295
  },
208
296
  watch: {
209
297
  activeName(val) {
210
- if (val == 'second') {
298
+ if (val == "second") {
211
299
  if (!this.tableInited) {
212
300
  this.$nextTick(() => {
213
301
  this.initTableM1();
214
- })
302
+ });
215
303
  this.tableInited = true;
216
304
  } else {
217
305
  this.searchEvent();
@@ -220,8 +308,7 @@ export default {
220
308
  this.clearCheckItem(1);
221
309
  }
222
310
  this.checkRows = [];
223
-
224
- }
311
+ },
225
312
  },
226
313
  methods: {
227
314
  clearCheckItem(level) {
@@ -241,32 +328,32 @@ export default {
241
328
  this.districts = [];
242
329
  this.counties = [];
243
330
  let value = this.value1;
244
- let item = this.provinces.find(item => item.id == value);
331
+ let item = this.provinces.find((item) => item.id == value);
245
332
  if (item) {
246
- this.checkRows.push(item)
333
+ this.checkRows.push(item);
247
334
  }
248
335
  } else if (level == 3) {
249
336
  this.value3 = null;
250
337
  this.value4 = null;
251
338
  this.counties = [];
252
339
  let value = this.value2;
253
- let item = this.cities.find(item => item.id == value);
340
+ let item = this.cities.find((item) => item.id == value);
254
341
  if (item) {
255
- this.checkRows.push(item)
342
+ this.checkRows.push(item);
256
343
  }
257
344
  } else if (level == 4) {
258
345
  this.value4 = null;
259
346
  let value = this.value3;
260
- let item = this.districts.find(item => item.id == value);
347
+ let item = this.districts.find((item) => item.id == value);
261
348
  if (item) {
262
- this.checkRows.push(item)
349
+ this.checkRows.push(item);
263
350
  }
264
351
  }
265
352
 
266
- this.$refs['select1'].showPopper = false;
267
- this.$refs['select2'].showPopper = false;
268
- this.$refs['select3'].showPopper = false;
269
- this.$refs['select4'].showPopper = false;
353
+ this.$refs["select1"].showPopper = false;
354
+ this.$refs["select2"].showPopper = false;
355
+ this.$refs["select3"].showPopper = false;
356
+ this.$refs["select4"].showPopper = false;
270
357
  },
271
358
  checkItem(row, level) {
272
359
  if (level == 1) {
@@ -299,45 +386,44 @@ export default {
299
386
  this.getAreaData(row.id, level + 1);
300
387
  this.checkRows = [row];
301
388
  }
302
-
303
389
  } else if (level == 4) {
304
390
  if (this.value4 !== row.id) {
305
391
  this.value4 = row.id;
306
392
  this.checkRows = [row];
307
393
  }
308
394
  }
309
- this.$refs['select' + level].showPopper = false;
395
+ this.$refs["select" + level].showPopper = false;
310
396
  },
311
397
  getItemLabel(items, value) {
312
398
  if (value) {
313
- let currentItem = items.find(item => item.id == value);
399
+ let currentItem = items.find((item) => item.id == value);
314
400
  if (currentItem) {
315
401
  return currentItem.name;
316
402
  } else {
317
- return null
403
+ return null;
318
404
  }
319
405
  } else {
320
406
  return null;
321
407
  }
322
408
  },
323
- changeSelect(value, level) {
324
-
325
- },
409
+ changeSelect(value, level) {},
326
410
  getAreaData(id, level) {
411
+ let locale = this.locale || null;
327
412
  this.$http({
328
- url: USER_PREFIX + '/area/getChildren',
413
+ url: USER_PREFIX + "/area/getChildren",
329
414
  method: "post",
330
415
  data: {
331
416
  id: id,
332
- enabled: true
417
+ locale: locale,
418
+ enabled: true,
333
419
  },
334
- success: res => {
420
+ success: (res) => {
335
421
  // const {level} = node;
336
422
  let isLeaf = level >= 4;
337
423
  let rows = res.objx || [];
338
- rows.forEach(row => {
424
+ rows.forEach((row) => {
339
425
  rows.leaf = isLeaf;
340
- })
426
+ });
341
427
  if (level == 1) {
342
428
  this.provinces = rows;
343
429
  } else if (level == 2) {
@@ -347,58 +433,60 @@ export default {
347
433
  } else if (level == 4) {
348
434
  this.counties = rows;
349
435
  }
350
- }
351
- })
436
+ },
437
+ });
352
438
  },
353
439
  initTableM1() {
354
440
  let that = this;
355
441
  let tableOption = {
356
442
  vue: that,
357
- tableRef: 'table-m1',
358
- tableName: 'basicAreaDialogList',
359
- path: USER_PREFIX + '/area/list',
360
- treeNodeUrl: USER_PREFIX + '/area/getChildren',
443
+ tableRef: "table-m1",
444
+ tableName: "basicAreaDialogList",
445
+ path: USER_PREFIX + "/area/list",
446
+ treeNodeUrl: USER_PREFIX + "/area/getChildren",
361
447
  treeNodeParam(row) {
362
448
  return {
363
449
  id: row.id,
364
- enabled: true
450
+ enabled: true,
365
451
  };
366
452
  },
367
453
  param: () => {
454
+ let locale = this.locale || null;
368
455
  return {
369
456
  enabled: true,
370
457
  ...this.formData,
371
- ...this.param
372
- }
458
+ ...this.param,
459
+ locale: locale,
460
+ };
373
461
  },
374
462
  columns: [
375
- {type: 'checkbox', fixed: 'left', width: 48, resizable: false},
463
+ { type: "checkbox", fixed: "left", width: 48, resizable: false },
376
464
  {
377
- title: this.$t1('地区名称'),
378
- field: 'name',
465
+ title: this.$t1("地区名称"),
466
+ field: "name",
379
467
  width: 250,
380
- fixed: 'left',
468
+ fixed: "left",
381
469
  // treeNode: true,
382
- treeNode: !(this.param && this.param.onlySearchTopLevel)
470
+ treeNode: !(this.param && this.param.onlySearchTopLevel),
383
471
  },
384
472
  {
385
- field: 'fullName',
386
- title: this.$t1('地区全称'),
387
- width: 250
473
+ field: "fullName",
474
+ title: this.$t1("地区全称"),
475
+ width: 250,
388
476
  },
389
477
  {
390
478
  width: 47,
391
- fixed: 'right',
392
- title: '',
393
- sortable: false
394
- }
479
+ fixed: "right",
480
+ title: "",
481
+ sortable: false,
482
+ },
395
483
  ],
396
484
  config: {
397
485
  checkboxConfig: {
398
486
  checkStrictly: true,
399
487
  showHeader: this.selectMulti,
400
- trigger: 'row',
401
- checkMethod: ({row}) => {
488
+ trigger: "row",
489
+ checkMethod: ({ row }) => {
402
490
  if (this.selectTopLevel) {
403
491
  if (row.parent) {
404
492
  return false;
@@ -408,15 +496,34 @@ export default {
408
496
  }
409
497
 
410
498
  return true;
411
- }
412
- }
413
- }
499
+ },
500
+ },
501
+ },
414
502
  };
415
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
503
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
416
504
  that.vxeOption = opts;
417
505
  });
418
- }
419
- }
506
+ },
507
+ cleaerCountry() {
508
+ this.countryName = null;
509
+ this.locale = null;
510
+
511
+ this.clearCheckItem(1);
512
+ this.getAreaData(0, 1);
513
+ this.searchEvent();
514
+ },
515
+ countryDialogConfirm(rows) {
516
+ if (rows.length > 0) {
517
+ let row = rows[0];
518
+ this.locale = row.countryCode;
519
+ this.countryName = row.simpleName;
520
+
521
+ this.clearCheckItem(1);
522
+ this.getAreaData(0, 1);
523
+ this.resetEvent();
524
+ }
525
+ },
526
+ },
420
527
  };
421
528
  </script>
422
529
  <style scoped lang="scss">