cloud-web-corejs 1.0.39 → 1.0.40

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.
@@ -19,7 +19,7 @@
19
19
  <tbody>
20
20
  <tr>
21
21
  <th>{{ $t1('操作类型') }}</th>
22
- <td>{{ logTypeMap[userLog.logType] }}</td>
22
+ <td>{{ userLog.logTypeName }}</td>
23
23
  </tr>
24
24
  <tr>
25
25
  <th>{{ $t1('操作内容') }}</th>
@@ -81,14 +81,7 @@ export default {
81
81
  tabIndex: 0,
82
82
  isEdit: false,
83
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
- }
84
+ userLog: {}
92
85
  };
93
86
  },
94
87
  created() {
@@ -145,13 +145,7 @@ export default {
145
145
  showAdvancedSearch: false,
146
146
  advancedFormData: {},
147
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
- }
148
+ logTypeMap: {}
155
149
  };
156
150
  },
157
151
  watch: {
@@ -166,6 +160,8 @@ export default {
166
160
  return this.checkNode && this.checkNode.data ? this.checkNode.data : {};
167
161
  },
168
162
  logType() {
163
+ debugger
164
+ let a = 2
169
165
  let checkNodeData = this.checkNode && this.checkNode.data ? this.checkNode.data : {};
170
166
  return checkNodeData.value ?? null
171
167
  }
@@ -209,14 +205,9 @@ export default {
209
205
  {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
210
206
  {
211
207
  title: this.$t1('操作类型'),
212
- field: 'logType',
208
+ field: 'logTypeName',
213
209
  fixed: 'left',
214
- width: 150,
215
- slots: {
216
- default: ({row, rowIndex}) => {
217
- return logTypeMap[row.logType] || '';
218
- }
219
- }
210
+ width: 150
220
211
  },
221
212
  {
222
213
  title: this.$t1('操作内容'),
@@ -303,6 +294,9 @@ export default {
303
294
  this.searchEvent();
304
295
  },
305
296
  handleNodeClick(data, node, v) {
297
+ debugger
298
+ let a = 1
299
+ let b = 3
306
300
  this.checkNode = node;
307
301
  this.formData.startTime = data.all ? null : data.logDate;
308
302
  this.formData.endTime = data.all ? null : data.logDate;
@@ -311,30 +305,44 @@ export default {
311
305
  },
312
306
  // 异步树叶子节点懒加载逻辑
313
307
  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,
308
+ this.$http({
309
+ url: USER_PREFIX + `/user_log_classify/listPage`,
310
+ method: `post`,
311
+ data: {
312
+ enabled: true
321
313
  },
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();
314
+ success: res => {
315
+ let logTypeMap = {};
316
+ let rows = res.objx?.records || [];
317
+ let items = rows.map(item => {
318
+ logTypeMap[item.classifyCode] = item.classifyName;
319
+ return {
320
+ label: item.classifyName,
321
+ value: item.classifyCode,
322
+ id: item.classifyCode,
323
+ leaf: true,
324
+ }
325
+ })
326
+ this.logTypeMap = logTypeMap;
327
+ let data = [
328
+ {
329
+ label: this.$t1('全部类型'),
330
+ all: true,
331
+ id: -1,
332
+ leaf: true,
333
+ },
334
+ ...items
335
+ ]
336
+ resolve(data);
337
+ this.$nextTick(() => {
338
+ if (node.childNodes.length) {
339
+ this.checkFirstNode();
340
+ this.$forceUpdate();
341
+ }
342
+ });
336
343
  }
337
344
  });
345
+
338
346
  },
339
347
  checkFirstNode() {
340
348
  let node = this.$refs.tree.getNode(-1);
@@ -107,12 +107,8 @@
107
107
  </td>
108
108
  </tr>
109
109
  <tr>
110
- <th>{{ $t1('创建人') }}</th>
111
- <td>{{ user.createBy }}</td>
112
110
  <th>{{ $t1('创建时间') }}</th>
113
111
  <td>{{ user.createDate }}</td>
114
- <th>{{ $t1('更新人') }}</th>
115
- <td>{{ user.modifyBy }}</td>
116
112
  <th>{{ $t1('更新时间') }}</th>
117
113
  <td>{{ user.modifyDate }}</td>
118
114
  </tr>
@@ -151,16 +151,6 @@ export default {
151
151
  }
152
152
  }
153
153
  },
154
- {
155
- field: 'createBy',
156
- title: this.$t1('创建人'),
157
- width: 150
158
- },
159
- {
160
- field: 'modifyBy',
161
- title: this.$t1('更新人'),
162
- width: 150
163
- },
164
154
  {
165
155
  field: 'modifyDate',
166
156
  title: this.$t1('更新时间'),
@@ -0,0 +1,144 @@
1
+ <template>
2
+ <div class="detail-wrap">
3
+ <el-form ref="editForm" :model="userLogClassify">
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
+ <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{ $t1('保存') }}
14
+ </el-button>
15
+ </div>
16
+ </div>
17
+ <div class="d-cont">
18
+ <div class="d-item">
19
+ <div class="title first"><b>{{ $t1('基本信息') }}</b></div>
20
+ <table class="table-detail">
21
+ <tbody>
22
+ <tr>
23
+ <th>
24
+ <em class="f-red">*</em>
25
+ {{ $t1('类型名称') }}
26
+ </th>
27
+ <td>
28
+ <el-form-item prop="classifyName" :rules="[{ required: true, trigger: 'blur' }]">
29
+ <el-input type="text" autocomplete="off" v-model="userLogClassify.classifyName" clearable/>
30
+ </el-form-item>
31
+ </td>
32
+ <th>
33
+ <em class="f-red">*</em>
34
+ {{ $t1('类型编码') }}
35
+ </th>
36
+ <td>
37
+ <el-form-item prop="classifyCode" :rules="[{ required: true, trigger: 'blur' }]">
38
+ <el-input type="text" autocomplete="off" v-model="userLogClassify.classifyCode" clearable/>
39
+ </el-form-item>
40
+ </td>
41
+ <th>{{ $t1('设置') }}</th>
42
+ <td>
43
+ <el-checkbox :label="$t1('是否启用')" v-model="userLogClassify.enabled"></el-checkbox>
44
+ </td>
45
+ </tr>
46
+ <tr>
47
+ <th>{{ $t1('创建人') }}</th>
48
+ <td>{{ userLogClassify._createBy }}</td>
49
+ <th>{{ $t1('创建时间') }}</th>
50
+ <td>{{ userLogClassify.createDate }}</td>
51
+ <th>{{ $t1('更新人') }}</th>
52
+ <td>{{ userLogClassify._modifyBy }}</td>
53
+ <th>{{ $t1('更新时间') }}</th>
54
+ <td>{{ userLogClassify.modifyDate }}</td>
55
+ </tr>
56
+ </tbody>
57
+ </table>
58
+ </div>
59
+ </div>
60
+ </el-form>
61
+ </div>
62
+ </template>
63
+
64
+ <script>
65
+ export default {
66
+ name: 'userLogClassifyEdit',
67
+ props: {
68
+ _dataId: [String, Number]
69
+ },
70
+ components: {},
71
+ data() {
72
+ return {
73
+ isEdit: false,
74
+ tabIndex: 'first',
75
+ dataId: '',
76
+ userLogClassify: {
77
+ enabled: true
78
+ }
79
+ };
80
+ },
81
+ created() {
82
+ if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
83
+ },
84
+ mounted() {
85
+ this.getData();
86
+ },
87
+ methods: {
88
+ getData() {
89
+ if (this.dataId && !isNaN(this.dataId)) {
90
+ this.isEdit = true;
91
+ this.$commonHttp({
92
+ url: USER_PREFIX + `/user_log_classify/get`,
93
+ method: `post`,
94
+ data: {
95
+ id: this.dataId
96
+ },
97
+ isLoading: true,
98
+ modalStrictly: true,
99
+ success: res => {
100
+ this.userLogClassify = res.objx || {};
101
+ }
102
+ });
103
+ } else {
104
+ this.userLogClassify = {
105
+ enabled: true
106
+ };
107
+ }
108
+ },
109
+ saveData() {
110
+ this.$refs.editForm.$baseValidate(valid => {
111
+ if (valid) {
112
+ this.$baseConfirm(this.$t1('您确定要保存吗?')).then(() => {
113
+ var url = USER_PREFIX + (this.isEdit ? `/user_log_classify/update` : `/user_log_classify/save`);
114
+ this.$http({
115
+ url: url,
116
+ method: `post`,
117
+ data: this.userLogClassify,
118
+ isLoading: true,
119
+ success: res => {
120
+ this.$message({
121
+ message: res.content,
122
+ type: 'success',
123
+ duration: 500,
124
+ onClose: t => {
125
+ if (this.isEdit) {
126
+ this.$baseReload();
127
+ } else {
128
+ this.$baseReload({
129
+ updateParam: {
130
+ _dataId: res.objx
131
+ }
132
+ });
133
+ }
134
+ }
135
+ });
136
+ }
137
+ });
138
+ });
139
+ }
140
+ });
141
+ }
142
+ }
143
+ };
144
+ </script>
@@ -0,0 +1,197 @@
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="grid-height">
10
+ <vxe-grid ref="table-m1" v-bind="vxeOption" @resizable-change="$vxeTableUtil.onColumnWitchChange"
11
+ @custom="$vxeTableUtil.customHandle">
12
+ <template #form>
13
+ <div class="clearfix screen-btns">
14
+ <div class="fl">
15
+ <vxe-button status="primary" class="button-sty" icon="el-icon-plus" @click="openEditDialog">
16
+ {{ $t1('新增') }}
17
+ </vxe-button>
18
+ <base-table-export :option="{ title: $t1('用户日志类型导出'), targetRef: 'table-m1'}"
19
+ :parent-target="_self"/>
20
+ </div>
21
+ <div class="fr">
22
+ <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
23
+ plain>{{ $t1('重置') }}
24
+ </vxe-button>
25
+ <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
26
+ {{ $t1('搜索') }}
27
+ </vxe-button>
28
+ </div>
29
+ </div>
30
+ <vxe-form ref="form" class="screen-box" title-width="92px" title-align="right" :data="formData"
31
+ @submit="searchEvent" @reset="searchEvent">
32
+ <vxe-form-item :title="$t1('类型名称')+':'" field="classifyName">
33
+ <template v-slot>
34
+ <el-input v-model="formData.classifyName" size="small" clearable/>
35
+ </template>
36
+ </vxe-form-item>
37
+ <vxe-form-item :title="$t1('类型编码')+':'" field="classifyCode">
38
+ <template v-slot>
39
+ <el-input v-model="formData.classifyCode" size="small" clearable/>
40
+ </template>
41
+ </vxe-form-item>
42
+ <vxe-form-item :title="$t1('是否启用')+':'" field="enabled">
43
+ <template v-slot>
44
+ <el-select v-model="formData.enabled" clearable>
45
+ <el-option :value="true" :label="$t1('启用')"></el-option>
46
+ <el-option :value="false" :label="$t1('禁用')"></el-option>
47
+ </el-select>
48
+
49
+ </template>
50
+ </vxe-form-item>
51
+ </vxe-form>
52
+ </template>
53
+ </vxe-grid>
54
+ </div>
55
+ </el-tab-pane>
56
+ </el-tabs>
57
+ </div>
58
+ </template>
59
+
60
+ <script>
61
+ import editView from './edit.vue';
62
+
63
+ export default {
64
+ name: 'user_log_classify:list',
65
+ components: {editView},
66
+ data() {
67
+ return {
68
+ activeName: 'second',
69
+ dataId: 0,
70
+ showEdit: false,
71
+ vxeOption: {},
72
+ formData: {}
73
+ };
74
+ },
75
+ mounted() {
76
+ this.initTableList();
77
+ },
78
+ methods: {
79
+ searchEvent() {
80
+ this.$refs['table-m1'].commitProxy('reload');
81
+ },
82
+ resetEvent() {
83
+ this.formData = {};
84
+ this.$refs['table-m1'].commitProxy('reload');
85
+ },
86
+ openEditDialog(id) {
87
+ this.dataId = !id || typeof id == 'object' ? 0 : id;
88
+ this.activeName = 'first';
89
+ this.$openEditView('showEdit');
90
+ },
91
+ initTableList() {
92
+ let that = this;
93
+ let tableOption = {
94
+ vue: this,
95
+ tableRef: 'table-m1',
96
+ tableName: 'user_userLogClassify_list-m1',
97
+ path: USER_PREFIX + '/user_log_classify/listPage',
98
+ param: () => {
99
+ return this.formData;
100
+ },
101
+ columns: [
102
+ {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
103
+ {
104
+ title: this.$t1('类型名称'),
105
+ field: 'classifyName',
106
+ width: 150,
107
+ fixed: 'left'
108
+ },
109
+ {
110
+ field: 'classifyCode',
111
+ title: this.$t1('类型编码'),
112
+ width: 250
113
+ },
114
+ {
115
+ field: 'enabled',
116
+ title: this.$t1('是否启用'),
117
+ width: 150,
118
+ slots: {
119
+ default: ({row}) => {
120
+ if (row.enabled) {
121
+ return [
122
+ <div class="txt-status">
123
+ <span>{this.$t1('启用')}</span>
124
+ </div>
125
+ ];
126
+ } else {
127
+ return [
128
+ <div class="txt-status disable">
129
+ <span>{this.$t1('禁用')}</span>
130
+ </div>
131
+ ];
132
+ }
133
+ }
134
+ }
135
+ },
136
+ {
137
+ field: 'createDate',
138
+ title: this.$t1('创建时间'),
139
+ width: 150
140
+ },
141
+ {
142
+ field: '_createBy',
143
+ title: this.$t1('创建人'),
144
+ width: 150
145
+ },
146
+ {
147
+ field: '_modifyBy',
148
+ title: this.$t1('更新人'),
149
+ width: 150
150
+ },
151
+ {
152
+ width: 47,
153
+ fixed: 'right',
154
+ title: '',
155
+ sortable: false,
156
+ slots: {
157
+ default: ({row}) => {
158
+ return [
159
+ <div>
160
+ <a
161
+ href="javascript:void(0);"
162
+ class="a-link"
163
+ onclick={() => {
164
+ this.openEditDialog(row.id);
165
+ }}
166
+ >
167
+ <el-tooltip enterable={false} effect="dark" content={this.$t1('查看')} placement="top"
168
+ popper-class="tooltip-skin">
169
+ <i class="el-icon-edit"/>
170
+ </el-tooltip>
171
+ </a>
172
+ </div>
173
+ ];
174
+ }
175
+ }
176
+ }
177
+ ]
178
+ };
179
+ this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
180
+ this.vxeOption = opts;
181
+ });
182
+ },
183
+ importExcel() {
184
+ let that = this;
185
+ that.$excelImport({
186
+ prefix: USER_PREFIX,
187
+ excel: USER_PREFIX + '/excelTemplate/user_log_classify/userLogClassify.xlsx',
188
+ multi: false,
189
+ saveUrl: USER_PREFIX + '/user_log_classify/save',
190
+ callback: () => {
191
+ that.searchEvent();
192
+ }
193
+ });
194
+ }
195
+ }
196
+ };
197
+ </script>