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.
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="containt">
|
|
3
|
+
<el-tabs v-model="activeName" class="tab-box">
|
|
4
|
+
<el-tab-pane :label="$t1('列表')" name="second">
|
|
5
|
+
<div class="grid-height">
|
|
6
|
+
<vxe-grid
|
|
7
|
+
class="is-pointer"
|
|
8
|
+
ref="table-m1"
|
|
9
|
+
v-bind="vxeOption"
|
|
10
|
+
@resizable-change="$vxeTableUtil.onColumnWitchChange"
|
|
11
|
+
@custom="$vxeTableUtil.customHandle"
|
|
12
|
+
>
|
|
13
|
+
<template #form>
|
|
14
|
+
<div class="clearfix screen-btns">
|
|
15
|
+
<div class="fl">
|
|
16
|
+
<vxe-button
|
|
17
|
+
status="primary"
|
|
18
|
+
class="button-sty"
|
|
19
|
+
icon="el-icon-plus"
|
|
20
|
+
@click="addTopItem"
|
|
21
|
+
><i></i>
|
|
22
|
+
{{ $t1("新增一级地区") }}
|
|
23
|
+
</vxe-button>
|
|
24
|
+
<!-- <vxe-button
|
|
25
|
+
status="primary"
|
|
26
|
+
class="button-sty"
|
|
27
|
+
icon="el-icon-plus"
|
|
28
|
+
@click="showAreaDialog = true"
|
|
29
|
+
><i></i>
|
|
30
|
+
{{ $t1("测试") }}
|
|
31
|
+
</vxe-button> -->
|
|
32
|
+
</div>
|
|
33
|
+
<div class="fr">
|
|
34
|
+
<vxe-button
|
|
35
|
+
icon="el-icon-brush"
|
|
36
|
+
class="button-sty"
|
|
37
|
+
@click="resetEvent"
|
|
38
|
+
type="text"
|
|
39
|
+
status="primary"
|
|
40
|
+
plain
|
|
41
|
+
>{{ $t1("重置") }}
|
|
42
|
+
</vxe-button>
|
|
43
|
+
<vxe-button
|
|
44
|
+
status="warning"
|
|
45
|
+
icon="el-icon-search"
|
|
46
|
+
class="button-sty"
|
|
47
|
+
@click="searchEvent"
|
|
48
|
+
>
|
|
49
|
+
{{ $t1("搜索") }}
|
|
50
|
+
</vxe-button>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<vxe-form
|
|
54
|
+
class="screen-box"
|
|
55
|
+
title-width="92px"
|
|
56
|
+
title-align="right"
|
|
57
|
+
:data="formData"
|
|
58
|
+
@submit="searchEvent"
|
|
59
|
+
@reset="resetEvent"
|
|
60
|
+
>
|
|
61
|
+
<vxe-form-item :title="$t1('地区名称') + ':'" field="name">
|
|
62
|
+
<template v-slot>
|
|
63
|
+
<el-input v-model="formData.name" size="small" clearable />
|
|
64
|
+
</template>
|
|
65
|
+
</vxe-form-item>
|
|
66
|
+
<vxe-form-item :title="$t1('地区全称') + ':'" field="fullName">
|
|
67
|
+
<template v-slot>
|
|
68
|
+
<el-input v-model="formData.fullName" size="small" clearable />
|
|
69
|
+
</template>
|
|
70
|
+
</vxe-form-item>
|
|
71
|
+
<vxe-form-item :title="$t1('国家名称') + ':'" field="countryName">
|
|
72
|
+
<template v-slot>
|
|
73
|
+
<el-input
|
|
74
|
+
class="search-input"
|
|
75
|
+
max="200"
|
|
76
|
+
v-model="formData.countryName"
|
|
77
|
+
@clear="formData.locale = null"
|
|
78
|
+
placeholder="默认中国"
|
|
79
|
+
v-el-readonly
|
|
80
|
+
clearable
|
|
81
|
+
>
|
|
82
|
+
<i
|
|
83
|
+
slot="suffix"
|
|
84
|
+
class="el-input__icon el-icon-search"
|
|
85
|
+
@click="showCountryDialog = true"
|
|
86
|
+
></i>
|
|
87
|
+
</el-input>
|
|
88
|
+
</template>
|
|
89
|
+
</vxe-form-item>
|
|
90
|
+
<vxe-button
|
|
91
|
+
type="submit"
|
|
92
|
+
@click="searchEvent"
|
|
93
|
+
v-show="false"
|
|
94
|
+
></vxe-button>
|
|
95
|
+
</vxe-form>
|
|
96
|
+
</template>
|
|
97
|
+
<template #operate="obj">
|
|
98
|
+
<div class="cell-operate">
|
|
99
|
+
<template v-if="$refs['table-m1'].isActiveByRow(obj.row)">
|
|
100
|
+
<a @click="saveRowEvent(obj)" class="a-link">
|
|
101
|
+
<el-tooltip
|
|
102
|
+
:enterable="false"
|
|
103
|
+
effect="dark"
|
|
104
|
+
:content="$t1('保存')"
|
|
105
|
+
placement="top"
|
|
106
|
+
popper-class="tooltip-skin"
|
|
107
|
+
><i class="el-icon-circle-check"></i
|
|
108
|
+
></el-tooltip>
|
|
109
|
+
</a>
|
|
110
|
+
<a
|
|
111
|
+
@click="cancleRowEvent(obj)"
|
|
112
|
+
class="a-link"
|
|
113
|
+
v-if="hasSaveRow(obj.row)"
|
|
114
|
+
>
|
|
115
|
+
<el-tooltip
|
|
116
|
+
:enterable="false"
|
|
117
|
+
effect="dark"
|
|
118
|
+
:content="$t1('取消行编辑')"
|
|
119
|
+
placement="top"
|
|
120
|
+
popper-class="tooltip-skin"
|
|
121
|
+
><i class="el-icon-circle-close"></i
|
|
122
|
+
></el-tooltip>
|
|
123
|
+
</a>
|
|
124
|
+
<a
|
|
125
|
+
@click="removeRowEvent(obj)"
|
|
126
|
+
class="a-link"
|
|
127
|
+
v-if="!hasSaveRow(obj.row)"
|
|
128
|
+
>
|
|
129
|
+
<el-tooltip
|
|
130
|
+
:enterable="false"
|
|
131
|
+
effect="dark"
|
|
132
|
+
:content="$t1('删除')"
|
|
133
|
+
placement="top"
|
|
134
|
+
popper-class="tooltip-skin"
|
|
135
|
+
><i class="el-icon-delete"></i
|
|
136
|
+
></el-tooltip>
|
|
137
|
+
</a>
|
|
138
|
+
</template>
|
|
139
|
+
<template v-else>
|
|
140
|
+
<a class="a-link" @click="insertChildEvent(obj)">
|
|
141
|
+
<el-tooltip
|
|
142
|
+
:enterable="false"
|
|
143
|
+
effect="dark"
|
|
144
|
+
:content="$t1('新增')"
|
|
145
|
+
placement="top"
|
|
146
|
+
popper-class="tooltip-skin"
|
|
147
|
+
><i class="el-icon-circle-plus-outline"></i
|
|
148
|
+
></el-tooltip>
|
|
149
|
+
</a>
|
|
150
|
+
<a @click="editRowEvent(obj)" class="a-link" v-if="obj.row">
|
|
151
|
+
<el-tooltip
|
|
152
|
+
:enterable="false"
|
|
153
|
+
effect="dark"
|
|
154
|
+
:content="$t1('行编辑')"
|
|
155
|
+
placement="top"
|
|
156
|
+
popper-class="tooltip-skin"
|
|
157
|
+
><i class="el-icon-edit-outline"></i
|
|
158
|
+
></el-tooltip>
|
|
159
|
+
</a>
|
|
160
|
+
</template>
|
|
161
|
+
</div>
|
|
162
|
+
</template>
|
|
163
|
+
</vxe-grid>
|
|
164
|
+
</div>
|
|
165
|
+
</el-tab-pane>
|
|
166
|
+
</el-tabs>
|
|
167
|
+
<countryDialog
|
|
168
|
+
v-if="showCountryDialog"
|
|
169
|
+
:visiable.sync="showCountryDialog"
|
|
170
|
+
:multi="false"
|
|
171
|
+
@confirm="countryDialogConfirm"
|
|
172
|
+
></countryDialog>
|
|
173
|
+
<!-- <areaDialog
|
|
174
|
+
v-if="showAreaDialog"
|
|
175
|
+
:visiable.sync="showAreaDialog"
|
|
176
|
+
:multi="false"
|
|
177
|
+
></areaDialog> -->
|
|
178
|
+
</div>
|
|
179
|
+
</template>
|
|
180
|
+
|
|
181
|
+
<script>
|
|
182
|
+
import { tableTreeMixins } from "@base/mixins/tableTree/index.js";
|
|
183
|
+
import countryDialog from "@base/views/user/country/dialog.vue";
|
|
184
|
+
// import areaDialog from "@base/views/user/area/dialog.vue";
|
|
185
|
+
|
|
186
|
+
export default {
|
|
187
|
+
name: "menu:in_list",
|
|
188
|
+
components: { countryDialog /* , areaDialog */ },
|
|
189
|
+
mixins: [tableTreeMixins],
|
|
190
|
+
mounted() {
|
|
191
|
+
this.initTableList();
|
|
192
|
+
},
|
|
193
|
+
data() {
|
|
194
|
+
let that = this;
|
|
195
|
+
return {
|
|
196
|
+
activeName: "second",
|
|
197
|
+
dataId: "",
|
|
198
|
+
formData: {
|
|
199
|
+
countryName: null,
|
|
200
|
+
locale: null,
|
|
201
|
+
},
|
|
202
|
+
vxeOption: {},
|
|
203
|
+
showCountryDialog: false,
|
|
204
|
+
showAreaDialog: false,
|
|
205
|
+
};
|
|
206
|
+
},
|
|
207
|
+
methods: {
|
|
208
|
+
searchEvent() {
|
|
209
|
+
this.$refs["table-m1"].commitProxy("reload");
|
|
210
|
+
},
|
|
211
|
+
resetEvent() {
|
|
212
|
+
this.formData = {};
|
|
213
|
+
this.$refs["table-m1"].commitProxy("reload");
|
|
214
|
+
},
|
|
215
|
+
initTableList() {
|
|
216
|
+
let that = this;
|
|
217
|
+
let tableOption = {
|
|
218
|
+
vue: this,
|
|
219
|
+
tableRef: "table-m1",
|
|
220
|
+
tableName: "user_area_list-m1",
|
|
221
|
+
path: USER_PREFIX + "/area/list",
|
|
222
|
+
treeNodeUrl: USER_PREFIX + "/area/getChildren",
|
|
223
|
+
editSaveUrl: USER_PREFIX + "/area/save",
|
|
224
|
+
editDefaultRow: ({ row }) => {
|
|
225
|
+
let locale = row?.locale || null;
|
|
226
|
+
return { enabled: true };
|
|
227
|
+
},
|
|
228
|
+
param: () => {
|
|
229
|
+
let locale = this.formData.locale || null;
|
|
230
|
+
return {
|
|
231
|
+
...this.formData,
|
|
232
|
+
locale,
|
|
233
|
+
};
|
|
234
|
+
},
|
|
235
|
+
treeNodeParam: (row) => {
|
|
236
|
+
return {
|
|
237
|
+
id: row.id,
|
|
238
|
+
// enabled: this.formData.enabled,
|
|
239
|
+
};
|
|
240
|
+
},
|
|
241
|
+
config: {
|
|
242
|
+
treeConfig: {
|
|
243
|
+
parentField: "parent",
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
columns: [
|
|
247
|
+
{ type: "checkbox", width: 48, resizable: false, fixed: "left" },
|
|
248
|
+
{
|
|
249
|
+
title: this.$t1("地区名称"),
|
|
250
|
+
field: "name",
|
|
251
|
+
width: 250,
|
|
252
|
+
fixed: "left",
|
|
253
|
+
treeNode: true,
|
|
254
|
+
editRender: {},
|
|
255
|
+
slots: {
|
|
256
|
+
edit: ({ row }) => {
|
|
257
|
+
return [<el-input v-model={row.name} clearable />];
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
field: "code",
|
|
263
|
+
title: this.$t1("地区编码"),
|
|
264
|
+
width: 250,
|
|
265
|
+
editRender: {},
|
|
266
|
+
slots: {
|
|
267
|
+
edit: ({ row }) => {
|
|
268
|
+
return [<el-input v-model={row.code} clearable />];
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
field: "fullName",
|
|
274
|
+
title: this.$t1("地区全称"),
|
|
275
|
+
width: 250,
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
field: "locale",
|
|
279
|
+
title: this.$t1("国家编码"),
|
|
280
|
+
width: 250,
|
|
281
|
+
editRender: {},
|
|
282
|
+
slots: {
|
|
283
|
+
edit: ({ row }) => {
|
|
284
|
+
return [<el-input v-model={row.locale} clearable />];
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
{ title: this.$t1("创建人"), field: "createBy", width: 150 },
|
|
289
|
+
{ title: this.$t1("创建时间"), field: "createDate", width: 150 },
|
|
290
|
+
{ title: this.$t1("更新人"), field: "modifyBy", width: 100 },
|
|
291
|
+
{ title: this.$t1("更新时间"), field: "modifyDate", width: 150 },
|
|
292
|
+
{
|
|
293
|
+
width: 100,
|
|
294
|
+
title: "",
|
|
295
|
+
fixed: "right",
|
|
296
|
+
sortable: false,
|
|
297
|
+
slots: { default: "operate" },
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
};
|
|
301
|
+
this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
|
|
302
|
+
this.vxeOption = opts;
|
|
303
|
+
});
|
|
304
|
+
},
|
|
305
|
+
addTopItem(type, parentParam) {
|
|
306
|
+
this.insertTopRow(this.$refs["table-m1"]);
|
|
307
|
+
},
|
|
308
|
+
countryDialogConfirm(rows) {
|
|
309
|
+
if (rows.length > 0) {
|
|
310
|
+
let row = rows[0];
|
|
311
|
+
this.formData.locale = row.countryCode;
|
|
312
|
+
this.formData.countryName = row.simpleName;
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
};
|
|
317
|
+
</script>
|
|
318
|
+
<style scoped lang="scss"></style>
|