mooho-base-admin-plus 2.1.6 → 2.2.0

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": "mooho-base-admin-plus",
3
3
  "description": "MOOHO basic framework for admin by Vue3",
4
- "version": "2.1.6",
4
+ "version": "2.2.0",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -63,13 +63,23 @@
63
63
  created() {},
64
64
  methods: {
65
65
  openRequest(row) {
66
- this.json = JSON.stringify(JSON.parse(row.requestBody), null, 2);
66
+ try {
67
+ this.json = JSON.stringify(JSON.parse(row.requestBody), null, 2);
68
+ } catch {
69
+ this.json = row.requestBody;
70
+ }
71
+
67
72
  this.title = this.$t('Front_Label_Request');
68
73
  this.description = this.$t('Front_Label_Request_Desc');
69
74
  this.isShow = true;
70
75
  },
71
76
  openResponse(row) {
72
- this.json = JSON.stringify(JSON.parse(row.responseBody), null, 2);
77
+ try {
78
+ this.json = JSON.stringify(JSON.parse(row.responseBody), null, 2);
79
+ } catch {
80
+ this.json = row.responseBody;
81
+ }
82
+
73
83
  this.title = this.$t('Front_Label_Response');
74
84
  this.description = this.$t('Front_Label_Response_Desc');
75
85
  this.isShow = true;
@@ -0,0 +1,89 @@
1
+ <template>
2
+ <div>
3
+ <div class="i-layout-page-header">
4
+ <PageHeader :title="$route.meta.title" :content="$route.meta.description" hidden-breadcrumb />
5
+ </div>
6
+ <Card :bordered="false" dis-hover class="ivu-mt">
7
+ <view-table ref="table" view-code="ApiOutLog">
8
+ <template #command="{ row }">
9
+ <Button size="small" :title="$t('Front_Btn_Request')" type="info" custom-icon="fa fa-cloud-upload-alt" @click="openRequest(row)"></Button>
10
+ <Button size="small" :title="$t('Front_Btn_Response')" type="info" custom-icon="fa fa-cloud-download-alt" @click="openResponse(row)"></Button>
11
+ </template>
12
+ </view-table>
13
+ </Card>
14
+ <Modal
15
+ v-model="isShow"
16
+ scrollable
17
+ :mask-closable="layout.maskClosable"
18
+ :draggable="layout.draggable"
19
+ :sticky="true"
20
+ :reset-drag-position="true"
21
+ :width="800"
22
+ :styles="{ top: '4vh' }"
23
+ >
24
+ <template #header>
25
+ <div>
26
+ <slot name="header">
27
+ <span class="title">{{ title }}</span>
28
+ <span class="description">{{ description }}</span>
29
+ </slot>
30
+ </div>
31
+ </template>
32
+ <div class="ivu-ml-8 ivu-mr-8">
33
+ <Row :gutter="24" type="flex">
34
+ <Col span="12">
35
+ <pre>{{ json }}</pre>
36
+ </Col>
37
+ </Row>
38
+ </div>
39
+ <template #footer>
40
+ <div>
41
+ <Button type="default" custom-icon="fa fa-times" @click="isShow = false">{{ $t('Front_Btn_Close') }}</Button>
42
+ </div>
43
+ </template>
44
+ </Modal>
45
+ </div>
46
+ </template>
47
+ <script>
48
+ import mixinPage from '../../mixins/page';
49
+
50
+ export default {
51
+ name: 'system-apiOutLog',
52
+ mixins: [mixinPage],
53
+ components: {},
54
+ data() {
55
+ return {
56
+ isShow: false,
57
+ json: null,
58
+ title: null,
59
+ description: null
60
+ };
61
+ },
62
+ computed: {},
63
+ created() {},
64
+ methods: {
65
+ openRequest(row) {
66
+ try {
67
+ this.json = JSON.stringify(JSON.parse(row.requestBody), null, 2);
68
+ } catch {
69
+ this.json = row.requestBody;
70
+ }
71
+
72
+ this.title = this.$t('Front_Label_Request');
73
+ this.description = this.$t('Front_Label_Request_Desc');
74
+ this.isShow = true;
75
+ },
76
+ openResponse(row) {
77
+ try {
78
+ this.json = JSON.stringify(JSON.parse(row.responseBody), null, 2);
79
+ } catch {
80
+ this.json = row.responseBody;
81
+ }
82
+
83
+ this.title = this.$t('Front_Label_Response');
84
+ this.description = this.$t('Front_Label_Response_Desc');
85
+ this.isShow = true;
86
+ }
87
+ }
88
+ };
89
+ </script>
@@ -6,6 +6,7 @@
6
6
  <Card :bordered="false" dis-hover class="ivu-mt">
7
7
  <view-table ref="table" view-code="TaskQueue">
8
8
  <template #command="{ row }">
9
+ <Button size="small" :title="$t('Front_Btn_Detail')" type="info" custom-icon="fa fa-bars" @click="$refs.logTable.open({ taskQueueID: row.id })"></Button>
9
10
  <Button size="small" :title="$t('Front_Btn_Execute')" type="primary" custom-icon="fa fa-bolt" @click="execute(row)"></Button>
10
11
  <Button
11
12
  size="small"
@@ -18,18 +19,61 @@
18
19
  </template>
19
20
  </view-table>
20
21
  </Card>
22
+ <modal-table ref="logTable" view-code="TaskQueueLogModal">
23
+ <template #command="{ row }">
24
+ <Button v-if="row.apiOutLogID" size="small" :title="$t('Front_Btn_Request')" type="info" custom-icon="fa fa-cloud-upload-alt" @click="openRequest(row)"></Button>
25
+ <Button v-if="row.apiOutLogID" size="small" :title="$t('Front_Btn_Response')" type="info" custom-icon="fa fa-cloud-download-alt" @click="openResponse(row)"></Button>
26
+ </template>
27
+ </modal-table>
28
+ <Modal
29
+ v-model="isShow"
30
+ scrollable
31
+ :mask-closable="layout.maskClosable"
32
+ :draggable="layout.draggable"
33
+ :sticky="true"
34
+ :reset-drag-position="true"
35
+ :width="800"
36
+ :styles="{ top: '4vh' }"
37
+ >
38
+ <template #header>
39
+ <div>
40
+ <slot name="header">
41
+ <span class="title">{{ title }}</span>
42
+ <span class="description">{{ description }}</span>
43
+ </slot>
44
+ </div>
45
+ </template>
46
+ <div class="ivu-ml-8 ivu-mr-8">
47
+ <Row :gutter="24" type="flex">
48
+ <Col span="12">
49
+ <pre>{{ json }}</pre>
50
+ </Col>
51
+ </Row>
52
+ </div>
53
+ <template #footer>
54
+ <div>
55
+ <Button type="default" custom-icon="fa fa-times" @click="isShow = false">{{ $t('Front_Btn_Close') }}</Button>
56
+ </div>
57
+ </template>
58
+ </Modal>
21
59
  </div>
22
60
  </template>
23
61
  <script>
24
62
  import mixinPage from '../../mixins/page';
25
63
  import taskQueueApi from '../../api/taskQueue';
64
+ import modelApi from '../../api/model';
26
65
 
27
66
  export default {
28
67
  name: 'system-taskQueue',
29
68
  mixins: [mixinPage],
30
69
  components: {},
31
70
  data() {
32
- return {};
71
+ return {
72
+ isShow: false,
73
+ json: null,
74
+ title: null,
75
+ description: null
76
+ };
33
77
  },
34
78
  computed: {},
35
79
  created() {},
@@ -49,6 +93,32 @@
49
93
  this.success('Front_Msg_Success');
50
94
  this.$refs.table.loadData();
51
95
  });
96
+ },
97
+ async openRequest(row) {
98
+ const res = await modelApi.get('ApiOutLog', row.apiOutLogID);
99
+
100
+ try {
101
+ this.json = JSON.stringify(JSON.parse(res.requestBody), null, 2);
102
+ } catch {
103
+ this.json = res.requestBody;
104
+ }
105
+
106
+ this.title = this.$t('Front_Label_Request');
107
+ this.description = this.$t('Front_Label_Request_Desc');
108
+ this.isShow = true;
109
+ },
110
+ async openResponse(row) {
111
+ const res = await modelApi.get('ApiOutLog', row.apiOutLogID);
112
+
113
+ try {
114
+ this.json = JSON.stringify(JSON.parse(res.responseBody), null, 2);
115
+ } catch {
116
+ this.json = res.responseBody;
117
+ }
118
+
119
+ this.title = this.$t('Front_Label_Response');
120
+ this.description = this.$t('Front_Label_Response_Desc');
121
+ this.isShow = true;
52
122
  }
53
123
  }
54
124
  };