cloud-web-corejs 1.0.42-dev.1 → 1.0.42

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.42-dev.1",
4
+ "version": "1.0.42",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <el-dialog
3
- :title="$t1('提交内容')"
3
+ :title="$t1('表单提交')"
4
4
  :visible.sync="showDialog"
5
5
  :modal-append-to-body="false"
6
6
  :close-on-click-modal="false"
@@ -18,7 +18,7 @@
18
18
  <th>
19
19
  <span class="t">
20
20
  <em class="f-red">*</em>
21
- {{ $t1('内容') }}
21
+ {{ $t1('说明内容') }}
22
22
  </span>
23
23
  </th>
24
24
  <td>
@@ -16,7 +16,7 @@
16
16
  </el-button>
17
17
 
18
18
  <el-button type="success" class="button-sty" icon="el-icon-check"
19
- @click="createModifyTable()" v-if="!szTaMb.systems && menuKindAuth.editAuth===1"> {{ $t1('创建/更新数据表') }}
19
+ @click="createModifyTable()" v-if="!szTaMb.systems"> {{ $t1('创建/更新数据表') }}
20
20
  </el-button>
21
21
  </div>
22
22
  </div>
@@ -1,115 +1,122 @@
1
- <template>
2
- <div class="detail-wrap">
3
- <el-form ref="editForm" :model="userLog">
4
- <div class="d-header clearfix">
5
- <div class="fl">
6
- <i class="el-icon-info"/>
7
- {{ dataId ? $t1('查看访问统计') : $t1('新增访问统计') }}
8
- </div>
9
- <div class="fr">
10
- <el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">
11
- {{ $t1('重置') }}
12
- </el-button>
13
- </div>
14
- </div>
15
- <div class="d-cont">
16
- <div class="d-item">
17
- <div class="title first"><b>{{ $t1('基本信息') }}</b></div>
18
- <table class="table-detail">
19
- <tbody>
20
- <tr>
21
- <th>{{ $t1('操作类型') }}</th>
22
- <td>{{ userLog.logTypeName }}</td>
23
- </tr>
24
- <tr>
25
- <th>{{ $t1('操作内容') }}</th>
26
- <td colspan="7">{{ userLog.content }}</td>
27
- </tr>
28
- <tr>
29
- <th>{{ $t1('请求地址') }}</th>
30
- <td colspan="7">{{ userLog.path }}</td>
31
- </tr>
32
- <tr>
33
- <th>{{ $t1('客户端') }}</th>
34
- <td colspan="7">{{ userLog.client }}</td>
35
- </tr>
36
- <tr>
37
- <th>{{ $t1('冗余字段1') }}</th>
38
- <td>{{ userLog.param1 }}</td>
39
- <th>{{ $t1('冗余字段2') }}</th>
40
- <td>{{ userLog.param2 }}</td>
41
- </tr>
42
- <tr>
43
- <th>{{ $t1('操作人') }}</th>
44
- <td>{{ userLog.nickName }}</td>
45
- <th>{{ $t1('请求IP') }}</th>
46
- <td>{{ userLog.ip }}</td>
47
- <th>{{ $t1('服务名') }}</th>
48
- <td colspan="3">{{ userLog.serverName }}</td>
49
- </tr>
50
- <tr>
51
- <th>{{ $t1('内部信息数据') }}</th>
52
- <td colspan="7">{{ userLog.msg }}</td>
53
- </tr>
54
- <tr>
55
- <th>{{ $t1('创建人') }}</th>
56
- <td>{{ userLog.createBy }}</td>
57
- <th>{{ $t1('创建时间') }}</th>
58
- <td>{{ userLog.createDate }}</td>
59
- <th class="no"></th>
60
- <td></td>
61
- <th class="no"></th>
62
- <td></td>
63
- </tr>
64
- </tbody>
65
- </table>
66
- </div>
67
- </div>
68
- </el-form>
69
- </div>
70
- </template>
71
-
72
- <script>
73
- export default {
74
- name: 'userLogEdit',
75
- props: {
76
- _dataId: [String, Number]
77
- },
78
- components: {},
79
- data() {
80
- return {
81
- tabIndex: 0,
82
- isEdit: false,
83
- dataId: '',
84
- userLog: {}
85
- };
86
- },
87
- created() {
88
- if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
89
- },
90
- mounted() {
91
- this.getData();
92
- },
93
- methods: {
94
- getData() {
95
- if (this.dataId && !isNaN(this.dataId)) {
96
- this.isEdit = true;
97
- this.$commonHttp({
98
- url: USER_PREFIX + `/user_log/get`,
99
- method: `post`,
100
- data: {
101
- id: this.dataId
102
- },
103
- isLoading: true,
104
- modalStrictly: true,
105
- success: res => {
106
- this.userLog = res.objx || {};
107
- }
108
- });
109
- }
110
- }
111
- }
112
- };
113
- </script>
114
-
115
- <style></style>
1
+ <template>
2
+ <div class="detail-wrap">
3
+ <el-form ref="editForm" :model="userLog">
4
+ <div class="d-header clearfix">
5
+ <div class="fl">
6
+ <i class="el-icon-info"/>
7
+ {{ dataId ? $t1('查看访问统计') : $t1('新增访问统计') }}
8
+ </div>
9
+ <div class="fr">
10
+ <el-button type="primary" plain class="button-sty" @click="$baseReload()" icon="el-icon-refresh-right">
11
+ {{ $t1('重置') }}
12
+ </el-button>
13
+ </div>
14
+ </div>
15
+ <div class="d-cont">
16
+ <div class="d-item">
17
+ <div class="title first"><b>{{ $t1('基本信息') }}</b></div>
18
+ <table class="table-detail">
19
+ <tbody>
20
+ <tr>
21
+ <th>{{ $t1('操作类型') }}</th>
22
+ <td>{{ logTypeMap[userLog.logType] }}</td>
23
+ </tr>
24
+ <tr>
25
+ <th>{{ $t1('操作内容') }}</th>
26
+ <td colspan="7">{{ userLog.content }}</td>
27
+ </tr>
28
+ <tr>
29
+ <th>{{ $t1('请求地址') }}</th>
30
+ <td colspan="7">{{ userLog.path }}</td>
31
+ </tr>
32
+ <tr>
33
+ <th>{{ $t1('客户端') }}</th>
34
+ <td colspan="7">{{ userLog.client }}</td>
35
+ </tr>
36
+ <tr>
37
+ <th>{{ $t1('冗余字段1') }}</th>
38
+ <td>{{ userLog.param1 }}</td>
39
+ <th>{{ $t1('冗余字段2') }}</th>
40
+ <td>{{ userLog.param2 }}</td>
41
+ </tr>
42
+ <tr>
43
+ <th>{{ $t1('操作人') }}</th>
44
+ <td>{{ userLog.nickName }}</td>
45
+ <th>{{ $t1('请求IP') }}</th>
46
+ <td>{{ userLog.ip }}</td>
47
+ <th>{{ $t1('服务名') }}</th>
48
+ <td colspan="3">{{ userLog.serverName }}</td>
49
+ </tr>
50
+ <tr>
51
+ <th>{{ $t1('内部信息数据') }}</th>
52
+ <td colspan="7">{{ userLog.msg }}</td>
53
+ </tr>
54
+ <tr>
55
+ <th>{{ $t1('创建人') }}</th>
56
+ <td>{{ userLog.createBy }}</td>
57
+ <th>{{ $t1('创建时间') }}</th>
58
+ <td>{{ userLog.createDate }}</td>
59
+ <th class="no"></th>
60
+ <td></td>
61
+ <th class="no"></th>
62
+ <td></td>
63
+ </tr>
64
+ </tbody>
65
+ </table>
66
+ </div>
67
+ </div>
68
+ </el-form>
69
+ </div>
70
+ </template>
71
+
72
+ <script>
73
+ export default {
74
+ name: 'userLogEdit',
75
+ props: {
76
+ _dataId: [String, Number]
77
+ },
78
+ components: {},
79
+ data() {
80
+ return {
81
+ tabIndex: 0,
82
+ isEdit: false,
83
+ dataId: '',
84
+ userLog: {},
85
+ logTypeMap: {
86
+ 'login': this.$t1('登录成功'),
87
+ 'loginFailed': this.$t1('登录失败'),
88
+ 'logout': this.$t1('退出登录'),
89
+ 'accessMenu': this.$t1('访问菜单'),
90
+ 'changePassword': this.$t1('修改密码')
91
+ }
92
+ };
93
+ },
94
+ created() {
95
+ if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
96
+ },
97
+ mounted() {
98
+ this.getData();
99
+ },
100
+ methods: {
101
+ getData() {
102
+ if (this.dataId && !isNaN(this.dataId)) {
103
+ this.isEdit = true;
104
+ this.$commonHttp({
105
+ url: USER_PREFIX + `/user_log/get`,
106
+ method: `post`,
107
+ data: {
108
+ id: this.dataId
109
+ },
110
+ isLoading: true,
111
+ modalStrictly: true,
112
+ success: res => {
113
+ this.userLog = res.objx || {};
114
+ }
115
+ });
116
+ }
117
+ }
118
+ }
119
+ };
120
+ </script>
121
+
122
+ <style></style>
@@ -1,349 +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
- };
150
- },
151
- watch: {
152
- activeName(val) {
153
- if (this.showStatisticsList === false && val === "third") {
154
- this.showStatisticsList = true;
155
- }
156
- }
157
- },
158
- computed: {
159
- checkNodeData() {
160
- return this.checkNode && this.checkNode.data ? this.checkNode.data : {};
161
- },
162
- logType() {
163
- let checkNodeData = this.checkNode && this.checkNode.data ? this.checkNode.data : {};
164
- return checkNodeData.value ?? null
165
- }
166
- },
167
- async mounted() {
168
- treeScollx({target: this, type: 'default'});
169
- this.initTableList();
170
- },
171
- methods: {
172
- searchEvent() {
173
- this.$refs['table-m1'].commitProxy('reload');
174
- },
175
- resetEvent() {
176
- this.formData = {};
177
- this.advancedFormData = {};
178
- this.checkFirstNode();
179
- this.$refs['table-m1'].commitProxy('reload');
180
- },
181
- openEditDialog(id) {
182
- this.dataId = !id || typeof id == 'object' ? 0 : id;
183
- this.activeName = 'first';
184
- this.$openEditView('showEdit');
185
- },
186
- initTableList() {
187
- let that = this;
188
- let logTypeMap = this.logTypeMap;
189
- let tableOption = {
190
- vue: this,
191
- tableRef: 'table-m1',
192
- tableName: 'user_access_log_list-m1',
193
- path: USER_PREFIX + '/access_log/listPage',
194
- param: () => {
195
- return {
196
- ...this.formData,
197
- ...this.advancedFormData,
198
- logType: this.logType
199
- // ...checkParam
200
- };
201
- },
202
- columns: [
203
- {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
204
- {
205
- title: this.$t1('操作类型'),
206
- field: 'logTypeName',
207
- fixed: 'left',
208
- width: 150
209
- },
210
- {
211
- title: this.$t1('操作内容'),
212
- field: 'content',
213
- width: 200
214
- },
215
- {
216
- title: this.$t1('请求地址'),
217
- field: 'path',
218
- width: 200
219
- },
220
- {
221
- title: this.$t1('客户端'),
222
- field: 'client',
223
- width: 150
224
- },
225
- {
226
- title: this.$t1('冗余字段1'),
227
- field: 'param1',
228
- width: 150
229
- },
230
- {
231
- title: this.$t1('冗余字段2'),
232
- field: 'param2',
233
- width: 150
234
- },
235
- {
236
- title: this.$t1('操作人'),
237
- field: 'nickName',
238
- width: 150
239
- },
240
- {
241
- title: this.$t1('服务名'),
242
- field: 'serverName',
243
- width: 250
244
- },
245
- {
246
- title: this.$t1('请求IP'),
247
- field: 'ip',
248
- width: 150
249
- },
250
- {
251
- title: this.$t1('创建时间'),
252
- field: 'createDate',
253
- width: 150
254
- },
255
- {
256
- width: 47,
257
- fixed: 'right',
258
- title: '',
259
- sortable: false,
260
- slots: {
261
- default: ({row, rowIndex}) => {
262
- return [
263
- <div>
264
- <a
265
- href="javascript:void(0);"
266
- class="a-link"
267
- onclick={() => {
268
- this.openEditDialog(row.id);
269
- }}
270
- >
271
- <el-tooltip enterable={false} effect="dark" content={this.$t1('查看')} placement="top"
272
- popper-class="tooltip-skin">
273
- <i class="el-icon-edit"/>
274
- </el-tooltip>
275
- </a>
276
- </div>
277
- ];
278
- }
279
- }
280
- }
281
- ]
282
- };
283
- this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
284
- this.vxeOption = opts;
285
- });
286
- },
287
- clearNodeClick() {
288
- this.checkNode = null;
289
- this.formData.startTime = null;
290
- this.formData.endTime = null;
291
- this.$refs.tree.setCurrentKey();
292
- this.searchEvent();
293
- },
294
- handleNodeClick(data, node, v) {
295
- this.checkNode = node;
296
- this.formData.startTime = data.all ? null : data.logDate;
297
- this.formData.endTime = data.all ? null : data.logDate;
298
- this.$forceUpdate();
299
- this.searchEvent();
300
- },
301
- // 异步树叶子节点懒加载逻辑
302
- loadNode(node, resolve) {
303
- this.$http({
304
- url: USER_PREFIX + `/user_log_classify/listPage`,
305
- method: `post`,
306
- data: {
307
- enabled: true
308
- },
309
- success: res => {
310
- let logTypeMap = {};
311
- let rows = res.objx?.records || [];
312
- let items = rows.map(item => {
313
- logTypeMap[item.classifyCode] = item.classifyName;
314
- return {
315
- label: item.classifyName,
316
- value: item.classifyCode,
317
- id: item.classifyCode,
318
- leaf: true,
319
- }
320
- })
321
- this.logTypeMap = logTypeMap;
322
- let data = [
323
- {
324
- label: this.$t1('全部类型'),
325
- all: true,
326
- id: -1,
327
- leaf: true,
328
- },
329
- ...items
330
- ]
331
- resolve(data);
332
- this.$nextTick(() => {
333
- if (node.childNodes.length) {
334
- this.checkFirstNode();
335
- this.$forceUpdate();
336
- }
337
- });
338
- }
339
- });
340
-
341
- },
342
- checkFirstNode() {
343
- let node = this.$refs.tree.getNode(-1);
344
- this.$refs.tree.setCurrentKey(node);
345
- this.checkNode = node;
346
- }
347
- }
348
- };
349
- </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>
@@ -51,7 +51,7 @@
51
51
  </el-select>
52
52
  </template>
53
53
  </vxe-form-item>
54
- <vxe-form-item :title="$t1('是否启用')+':'" field="enable">
54
+ <vxe-form-item title="$t1('是否启用')+':'" field="enable">
55
55
  <template v-slot>
56
56
  <el-select v-model="formData.enable" clearable>
57
57
  <el-option :value="true" :label="$t1('启用')"></el-option>