cloud-web-corejs 1.0.49 → 1.0.50-dev.2

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.
@@ -1,346 +1,346 @@
1
- <template>
2
- <div id="containt">
3
- <el-tabs v-model="activeName" class="tab-box">
4
- <el-tab-pane :label="$t1('常规')" name="first">
5
- <editView v-if="showEdit" visible-key="showEdit" :_dataId.sync="dataId" :parent-target="_self"
6
- @reload="$reloadHandle"></editView>
7
- </el-tab-pane>
8
- <el-tab-pane :label="$t1('列表')" name="second">
9
- <div class="tree-box fl">
10
- <div class="tit"><b>{{ $t1('操作类型') }}</b></div>
11
- <el-tree
12
- :props="defaultProps"
13
- :load="loadNode"
14
- node-key="id"
15
- ref="tree"
16
- highlight-current
17
- lazy
18
- :expand-on-click-node="false"
19
- @node-click="handleNodeClick"
20
- class="tree-list"
21
- icon-class="el-icon-arrow-down"
22
- ></el-tree>
23
- </div>
24
- <label id="labBtn">
25
- <div class="icon">
26
- <i class="el-icon-more"></i>
27
- <i class="el-icon-more"></i>
28
- </div>
29
- </label>
30
- <div class="main-right fr" style="padding-left:6px;">
31
- <div class="grid-height">
32
- <vxe-grid ref="table-m1" v-bind="vxeOption" @resizable-change="$vxeTableUtil.onColumnWitchChange"
33
- @custom="$vxeTableUtil.customHandle">
34
- <template #form>
35
- <div class="clearfix screen-btns">
36
- <div class="fl">
37
- <base-table-export :option="{ title: $t1('访问统计导出'), targetRef: 'table-m1'}"
38
- :parent-target="_self"/>
39
- </div>
40
- <div class="fr">
41
- <vxe-button status="warning" icon="iconfont icon-shaixuan" class="button-sty orgn"
42
- @click="showAdvancedSearch = true">{{ $t1('高级筛选') }}
43
- </vxe-button>
44
- <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
45
- plain>{{ $t1('重置') }}
46
- </vxe-button>
47
- <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
48
- {{ $t1('搜索') }}
49
- </vxe-button>
50
- </div>
51
- </div>
52
- <vxe-form ref="form" class="screen-box" title-width="92px" title-align="right" :data="formData"
53
- @submit="searchEvent" @reset="searchEvent">
54
- <vxe-form-item :title="$t1('操作类型')+':'">
55
- <template v-slot>
56
- <el-input v-model="checkNode.label" :disabled="true"></el-input>
57
- </template>
58
- </vxe-form-item>
59
- <vxe-form-item :title="$t1('访问日期')+':'">
60
- <template v-slot>
61
- <el-date-picker
62
- v-model="formData.startTime"
63
- type="date"
64
- placeholder=""
65
- size="small"
66
- clearable
67
- value-format="yyyy-MM-dd"
68
- :picker-options="$baseStartPickerOptions(formData.endTime)"
69
- ></el-date-picker>
70
- <span>-</span>
71
- <el-date-picker
72
- v-model="formData.endTime"
73
- type="date"
74
- placeholder=""
75
- size="small"
76
- clearable
77
- value-format="yyyy-MM-dd"
78
- :picker-options="$baseEndPickerOptions(formData.startTime)"
79
- ></el-date-picker>
80
- </template>
81
- </vxe-form-item>
82
- </vxe-form>
83
- </template>
84
- </vxe-grid>
85
- </div>
86
- </div>
87
- </el-tab-pane>
88
- <el-tab-pane :label="$t1('统计')" name="third">
89
- <statistics_list v-if="showStatisticsList"></statistics_list>
90
- </el-tab-pane>
91
- </el-tabs>
92
- <advancedSearchDialog v-if="showAdvancedSearch" :visiable.sync="showAdvancedSearch"
93
- :formData.sync="advancedFormData" @confirm="searchEvent">
94
- <template #form>
95
- <vxe-form :model="advancedFormData" title-width="102px" :inline="true" class="adSearchForm">
96
- <vxe-form-item :title="$t1('操作内容') + ':'" class-name="block">
97
- <template v-slot>
98
- <el-input v-model="advancedFormData.content" size="small" clearable></el-input>
99
- </template>
100
- </vxe-form-item>
101
- <vxe-form-item :title="$t1('冗余字段1') +':'">
102
- <template v-slot>
103
- <el-input v-model="advancedFormData.param1" size="small" clearable></el-input>
104
- </template>
105
- </vxe-form-item>
106
- <vxe-form-item :title="$t1('冗余字段2') +':'">
107
- <template v-slot>
108
- <el-input v-model="advancedFormData.param2" size="small" clearable></el-input>
109
- </template>
110
- </vxe-form-item>
111
- </vxe-form>
112
- </template>
113
- </advancedSearchDialog>
114
-
115
- </div>
116
- </template>
117
-
118
- <script>
119
- import {treeScollx} from '@base/utils/global.js';
120
- import editView from './edit.vue';
121
- import statistics_list from "./statistics_list.vue";
122
-
123
-
124
- export default {
125
- name: 'access_log:list',
126
- components: {editView, statistics_list},
127
- data() {
128
- return {
129
- activeName: 'second',
130
- dataId: 0,
131
- showEdit: false,
132
- vxeOption: {},
133
- formData: {
134
- startTime: null,
135
- endTime: null
136
- },
137
- checkNode: {},
138
- defaultProps: {
139
- label: 'label', //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
140
- children: [],
141
- isLeaf: 'leaf'
142
- },
143
- showWfDialog: false,
144
- wfContentOption: {},
145
- showAdvancedSearch: false,
146
- advancedFormData: {},
147
- showStatisticsList: false,
148
- logTypeMap: {
149
- 'login': this.$t1('登录成功'),
150
- 'loginFailed': this.$t1('登录失败'),
151
- 'logout': this.$t1('退出登录'),
152
- 'accessMenu': this.$t1('访问菜单'),
153
- 'changePassword': this.$t1('修改密码')
154
- }
155
- };
156
- },
157
- watch: {
158
- activeName(val) {
159
- if (this.showStatisticsList === false && val === "third") {
160
- this.showStatisticsList = true;
161
- }
162
- }
163
- },
164
- computed: {
165
- checkNodeData() {
166
- return this.checkNode && this.checkNode.data ? this.checkNode.data : {};
167
- },
168
- logType() {
169
- let checkNodeData = this.checkNode && this.checkNode.data ? this.checkNode.data : {};
170
- return checkNodeData.value ?? null
171
- }
172
- },
173
- async mounted() {
174
- treeScollx({target: this, type: 'default'});
175
- this.initTableList();
176
- },
177
- methods: {
178
- searchEvent() {
179
- this.$refs['table-m1'].commitProxy('reload');
180
- },
181
- resetEvent() {
182
- this.formData = {};
183
- this.advancedFormData = {};
184
- this.checkFirstNode();
185
- this.$refs['table-m1'].commitProxy('reload');
186
- },
187
- openEditDialog(id) {
188
- this.dataId = !id || typeof id == 'object' ? 0 : id;
189
- this.activeName = 'first';
190
- this.$openEditView('showEdit');
191
- },
192
- initTableList() {
193
- let that = this;
194
- let logTypeMap = this.logTypeMap;
195
- let tableOption = {
196
- vue: this,
197
- tableRef: 'table-m1',
198
- tableName: 'user_access_log_list-m1',
199
- path: USER_PREFIX + '/access_log/listPage',
200
- param: () => {
201
- return {
202
- ...this.formData,
203
- ...this.advancedFormData,
204
- logType: this.logType
205
- // ...checkParam
206
- };
207
- },
208
- columns: [
209
- {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
210
- {
211
- title: this.$t1('操作类型'),
212
- field: 'logType',
213
- fixed: 'left',
214
- width: 150,
215
- slots: {
216
- default: ({row, rowIndex}) => {
217
- return logTypeMap[row.logType] || '';
218
- }
219
- }
220
- },
221
- {
222
- title: this.$t1('操作内容'),
223
- field: 'content',
224
- width: 200
225
- },
226
- {
227
- title: this.$t1('请求地址'),
228
- field: 'path',
229
- width: 200
230
- },
231
- {
232
- title: this.$t1('客户端'),
233
- field: 'client',
234
- width: 150
235
- },
236
- {
237
- title: this.$t1('冗余字段1'),
238
- field: 'param1',
239
- width: 150
240
- },
241
- {
242
- title: this.$t1('冗余字段2'),
243
- field: 'param2',
244
- width: 150
245
- },
246
- {
247
- title: this.$t1('操作人'),
248
- field: 'nickName',
249
- width: 150
250
- },
251
- {
252
- title: this.$t1('服务名'),
253
- field: 'serverName',
254
- width: 250
255
- },
256
- {
257
- title: this.$t1('请求IP'),
258
- field: 'ip',
259
- width: 150
260
- },
261
- {
262
- title: this.$t1('创建时间'),
263
- field: 'createDate',
264
- width: 150
265
- },
266
- {
267
- width: 47,
268
- fixed: 'right',
269
- title: '',
270
- sortable: false,
271
- slots: {
272
- default: ({row, rowIndex}) => {
273
- return [
274
- <div>
275
- <a
276
- href="javascript:void(0);"
277
- class="a-link"
278
- onclick={() => {
279
- this.openEditDialog(row.id);
280
- }}
281
- >
282
- <el-tooltip enterable={false} effect="dark" content={this.$t1('查看')} placement="top"
283
- popper-class="tooltip-skin">
284
- <i class="el-icon-edit"/>
285
- </el-tooltip>
286
- </a>
287
- </div>
288
- ];
289
- }
290
- }
291
- }
292
- ]
293
- };
294
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
295
- this.vxeOption = opts;
296
- });
297
- },
298
- clearNodeClick() {
299
- this.checkNode = null;
300
- this.formData.startTime = null;
301
- this.formData.endTime = null;
302
- this.$refs.tree.setCurrentKey();
303
- this.searchEvent();
304
- },
305
- handleNodeClick(data, node, v) {
306
- this.checkNode = node;
307
- this.formData.startTime = data.all ? null : data.logDate;
308
- this.formData.endTime = data.all ? null : data.logDate;
309
- this.$forceUpdate();
310
- this.searchEvent();
311
- },
312
- // 异步树叶子节点懒加载逻辑
313
- loadNode(node, resolve) {
314
- let logTypeMap = this.logTypeMap;
315
- let data = [
316
- {
317
- label: this.$t1('全部类型'),
318
- all: true,
319
- id: -1,
320
- leaf: true,
321
- },
322
- ...Object.keys(logTypeMap).map(key => {
323
- return {
324
- label: logTypeMap[key],
325
- value: key,
326
- id: key,
327
- leaf: true,
328
- }
329
- })
330
- ]
331
- resolve(data);
332
- this.$nextTick(() => {
333
- if (node.childNodes.length) {
334
- this.checkFirstNode();
335
- this.$forceUpdate();
336
- }
337
- });
338
- },
339
- checkFirstNode() {
340
- let node = this.$refs.tree.getNode(-1);
341
- this.$refs.tree.setCurrentKey(node);
342
- this.checkNode = node;
343
- }
344
- }
345
- };
346
- </script>
1
+ <template>
2
+ <div id="containt">
3
+ <el-tabs v-model="activeName" class="tab-box">
4
+ <el-tab-pane :label="$t1('常规')" name="first">
5
+ <editView v-if="showEdit" visible-key="showEdit" :_dataId.sync="dataId" :parent-target="_self"
6
+ @reload="$reloadHandle"></editView>
7
+ </el-tab-pane>
8
+ <el-tab-pane :label="$t1('列表')" name="second">
9
+ <div class="tree-box fl">
10
+ <div class="tit"><b>{{ $t1('操作类型') }}</b></div>
11
+ <el-tree
12
+ :props="defaultProps"
13
+ :load="loadNode"
14
+ node-key="id"
15
+ ref="tree"
16
+ highlight-current
17
+ lazy
18
+ :expand-on-click-node="false"
19
+ @node-click="handleNodeClick"
20
+ class="tree-list"
21
+ icon-class="el-icon-arrow-down"
22
+ ></el-tree>
23
+ </div>
24
+ <label id="labBtn">
25
+ <div class="icon">
26
+ <i class="el-icon-more"></i>
27
+ <i class="el-icon-more"></i>
28
+ </div>
29
+ </label>
30
+ <div class="main-right fr" style="padding-left:6px;">
31
+ <div class="grid-height">
32
+ <vxe-grid ref="table-m1" v-bind="vxeOption" @resizable-change="$vxeTableUtil.onColumnWitchChange"
33
+ @custom="$vxeTableUtil.customHandle">
34
+ <template #form>
35
+ <div class="clearfix screen-btns">
36
+ <div class="fl">
37
+ <base-table-export :option="{ title: $t1('访问统计导出'), targetRef: 'table-m1'}"
38
+ :parent-target="_self"/>
39
+ </div>
40
+ <div class="fr">
41
+ <vxe-button status="warning" icon="iconfont icon-shaixuan" class="button-sty orgn"
42
+ @click="showAdvancedSearch = true">{{ $t1('高级筛选') }}
43
+ </vxe-button>
44
+ <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
45
+ plain>{{ $t1('重置') }}
46
+ </vxe-button>
47
+ <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
48
+ {{ $t1('搜索') }}
49
+ </vxe-button>
50
+ </div>
51
+ </div>
52
+ <vxe-form ref="form" class="screen-box" title-width="92px" title-align="right" :data="formData"
53
+ @submit="searchEvent" @reset="searchEvent">
54
+ <vxe-form-item :title="$t1('操作类型')+':'">
55
+ <template v-slot>
56
+ <el-input v-model="checkNode.label" :disabled="true"></el-input>
57
+ </template>
58
+ </vxe-form-item>
59
+ <vxe-form-item :title="$t1('访问日期')+':'">
60
+ <template v-slot>
61
+ <el-date-picker
62
+ v-model="formData.startTime"
63
+ type="date"
64
+ placeholder=""
65
+ size="small"
66
+ clearable
67
+ value-format="yyyy-MM-dd"
68
+ :picker-options="$baseStartPickerOptions(formData.endTime)"
69
+ ></el-date-picker>
70
+ <span>-</span>
71
+ <el-date-picker
72
+ v-model="formData.endTime"
73
+ type="date"
74
+ placeholder=""
75
+ size="small"
76
+ clearable
77
+ value-format="yyyy-MM-dd"
78
+ :picker-options="$baseEndPickerOptions(formData.startTime)"
79
+ ></el-date-picker>
80
+ </template>
81
+ </vxe-form-item>
82
+ </vxe-form>
83
+ </template>
84
+ </vxe-grid>
85
+ </div>
86
+ </div>
87
+ </el-tab-pane>
88
+ <el-tab-pane :label="$t1('统计')" name="third">
89
+ <statistics_list v-if="showStatisticsList"></statistics_list>
90
+ </el-tab-pane>
91
+ </el-tabs>
92
+ <advancedSearchDialog v-if="showAdvancedSearch" :visiable.sync="showAdvancedSearch"
93
+ :formData.sync="advancedFormData" @confirm="searchEvent">
94
+ <template #form>
95
+ <vxe-form :model="advancedFormData" title-width="102px" :inline="true" class="adSearchForm">
96
+ <vxe-form-item :title="$t1('操作内容') + ':'" class-name="block">
97
+ <template v-slot>
98
+ <el-input v-model="advancedFormData.content" size="small" clearable></el-input>
99
+ </template>
100
+ </vxe-form-item>
101
+ <vxe-form-item :title="$t1('冗余字段1') +':'">
102
+ <template v-slot>
103
+ <el-input v-model="advancedFormData.param1" size="small" clearable></el-input>
104
+ </template>
105
+ </vxe-form-item>
106
+ <vxe-form-item :title="$t1('冗余字段2') +':'">
107
+ <template v-slot>
108
+ <el-input v-model="advancedFormData.param2" size="small" clearable></el-input>
109
+ </template>
110
+ </vxe-form-item>
111
+ </vxe-form>
112
+ </template>
113
+ </advancedSearchDialog>
114
+
115
+ </div>
116
+ </template>
117
+
118
+ <script>
119
+ import {treeScollx} from '@base/utils/global.js';
120
+ import editView from './edit.vue';
121
+ import statistics_list from "./statistics_list.vue";
122
+
123
+
124
+ export default {
125
+ name: 'access_log:list',
126
+ components: {editView, statistics_list},
127
+ data() {
128
+ return {
129
+ activeName: 'second',
130
+ dataId: 0,
131
+ showEdit: false,
132
+ vxeOption: {},
133
+ formData: {
134
+ startTime: null,
135
+ endTime: null
136
+ },
137
+ checkNode: {},
138
+ defaultProps: {
139
+ label: 'label', //这里是树结构中需显示的数据(即接口返回的需展示在页面上的参数)
140
+ children: [],
141
+ isLeaf: 'leaf'
142
+ },
143
+ showWfDialog: false,
144
+ wfContentOption: {},
145
+ showAdvancedSearch: false,
146
+ advancedFormData: {},
147
+ showStatisticsList: false,
148
+ logTypeMap: {
149
+ 'login': this.$t1('登录成功'),
150
+ 'loginFailed': this.$t1('登录失败'),
151
+ 'logout': this.$t1('退出登录'),
152
+ 'accessMenu': this.$t1('访问菜单'),
153
+ 'changePassword': this.$t1('修改密码')
154
+ }
155
+ };
156
+ },
157
+ watch: {
158
+ activeName(val) {
159
+ if (this.showStatisticsList === false && val === "third") {
160
+ this.showStatisticsList = true;
161
+ }
162
+ }
163
+ },
164
+ computed: {
165
+ checkNodeData() {
166
+ return this.checkNode && this.checkNode.data ? this.checkNode.data : {};
167
+ },
168
+ logType() {
169
+ let checkNodeData = this.checkNode && this.checkNode.data ? this.checkNode.data : {};
170
+ return checkNodeData.value ?? null
171
+ }
172
+ },
173
+ async mounted() {
174
+ treeScollx({target: this, type: 'default'});
175
+ this.initTableList();
176
+ },
177
+ methods: {
178
+ searchEvent() {
179
+ this.$refs['table-m1'].commitProxy('reload');
180
+ },
181
+ resetEvent() {
182
+ this.formData = {};
183
+ this.advancedFormData = {};
184
+ this.checkFirstNode();
185
+ this.$refs['table-m1'].commitProxy('reload');
186
+ },
187
+ openEditDialog(id) {
188
+ this.dataId = !id || typeof id == 'object' ? 0 : id;
189
+ this.activeName = 'first';
190
+ this.$openEditView('showEdit');
191
+ },
192
+ initTableList() {
193
+ let that = this;
194
+ let logTypeMap = this.logTypeMap;
195
+ let tableOption = {
196
+ vue: this,
197
+ tableRef: 'table-m1',
198
+ tableName: 'user_access_log_list-m1',
199
+ path: USER_PREFIX + '/access_log/listPage',
200
+ param: () => {
201
+ return {
202
+ ...this.formData,
203
+ ...this.advancedFormData,
204
+ logType: this.logType
205
+ // ...checkParam
206
+ };
207
+ },
208
+ columns: [
209
+ {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
210
+ {
211
+ title: this.$t1('操作类型'),
212
+ field: 'logType',
213
+ fixed: 'left',
214
+ width: 150,
215
+ slots: {
216
+ default: ({row, rowIndex}) => {
217
+ return logTypeMap[row.logType] || '';
218
+ }
219
+ }
220
+ },
221
+ {
222
+ title: this.$t1('操作内容'),
223
+ field: 'content',
224
+ width: 200
225
+ },
226
+ {
227
+ title: this.$t1('请求地址'),
228
+ field: 'path',
229
+ width: 200
230
+ },
231
+ {
232
+ title: this.$t1('客户端'),
233
+ field: 'client',
234
+ width: 150
235
+ },
236
+ {
237
+ title: this.$t1('冗余字段1'),
238
+ field: 'param1',
239
+ width: 150
240
+ },
241
+ {
242
+ title: this.$t1('冗余字段2'),
243
+ field: 'param2',
244
+ width: 150
245
+ },
246
+ {
247
+ title: this.$t1('操作人'),
248
+ field: 'nickName',
249
+ width: 150
250
+ },
251
+ {
252
+ title: this.$t1('服务名'),
253
+ field: 'serverName',
254
+ width: 250
255
+ },
256
+ {
257
+ title: this.$t1('请求IP'),
258
+ field: 'ip',
259
+ width: 150
260
+ },
261
+ {
262
+ title: this.$t1('创建时间'),
263
+ field: 'createDate',
264
+ width: 150
265
+ },
266
+ {
267
+ width: 47,
268
+ fixed: 'right',
269
+ title: '',
270
+ sortable: false,
271
+ slots: {
272
+ default: ({row, rowIndex}) => {
273
+ return [
274
+ <div>
275
+ <a
276
+ href="javascript:void(0);"
277
+ class="a-link"
278
+ onclick={() => {
279
+ this.openEditDialog(row.id);
280
+ }}
281
+ >
282
+ <el-tooltip enterable={false} effect="dark" content={this.$t1('查看')} placement="top"
283
+ popper-class="tooltip-skin">
284
+ <i class="el-icon-edit"/>
285
+ </el-tooltip>
286
+ </a>
287
+ </div>
288
+ ];
289
+ }
290
+ }
291
+ }
292
+ ]
293
+ };
294
+ this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
295
+ this.vxeOption = opts;
296
+ });
297
+ },
298
+ clearNodeClick() {
299
+ this.checkNode = null;
300
+ this.formData.startTime = null;
301
+ this.formData.endTime = null;
302
+ this.$refs.tree.setCurrentKey();
303
+ this.searchEvent();
304
+ },
305
+ handleNodeClick(data, node, v) {
306
+ this.checkNode = node;
307
+ this.formData.startTime = data.all ? null : data.logDate;
308
+ this.formData.endTime = data.all ? null : data.logDate;
309
+ this.$forceUpdate();
310
+ this.searchEvent();
311
+ },
312
+ // 异步树叶子节点懒加载逻辑
313
+ loadNode(node, resolve) {
314
+ let logTypeMap = this.logTypeMap;
315
+ let data = [
316
+ {
317
+ label: this.$t1('全部类型'),
318
+ all: true,
319
+ id: -1,
320
+ leaf: true,
321
+ },
322
+ ...Object.keys(logTypeMap).map(key => {
323
+ return {
324
+ label: logTypeMap[key],
325
+ value: key,
326
+ id: key,
327
+ leaf: true,
328
+ }
329
+ })
330
+ ]
331
+ resolve(data);
332
+ this.$nextTick(() => {
333
+ if (node.childNodes.length) {
334
+ this.checkFirstNode();
335
+ this.$forceUpdate();
336
+ }
337
+ });
338
+ },
339
+ checkFirstNode() {
340
+ let node = this.$refs.tree.getNode(-1);
341
+ this.$refs.tree.setCurrentKey(node);
342
+ this.checkNode = node;
343
+ }
344
+ }
345
+ };
346
+ </script>