|
@@ -13,8 +13,8 @@
|
13
|
13
|
<div class="flex">
|
14
|
14
|
<div class="tree-wrap">
|
15
|
15
|
<el-button-group v-if="activeName === 'fourth'">
|
16
|
|
- <el-button :type="serviceType === 'API' ? 'primary' : ''" @click="serviceType = 'API'" size="small">API服务</el-button>
|
17
|
|
- <el-button :type="serviceType === 'MQ' ? 'primary' : ''" @click="serviceType = 'MQ'" size="small">消息队列</el-button>
|
|
16
|
+ <el-button :type="serviceType === 'API' ? 'primary' : ''" @click="() => serviceBtnClick('API')" size="small">API服务</el-button>
|
|
17
|
+ <el-button :type="serviceType === 'MQ' ? 'primary' : ''" @click="() => serviceBtnClick('MQ')" size="small">消息队列</el-button>
|
18
|
18
|
</el-button-group>
|
19
|
19
|
<div>{{item.name}}</div>
|
20
|
20
|
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
|
@@ -24,7 +24,8 @@
|
24
|
24
|
<el-button :type="'primary'" @click="batchListing" size="small">批量上架</el-button>
|
25
|
25
|
<el-button :type="'primary'" @click="batchOffShelf" size="small">批量下架</el-button>
|
26
|
26
|
</div>
|
27
|
|
- <div :class="getCardClass()" v-for="(item, idx) in list" :key="idx" @click="jumpToDetailPage(item.id)">
|
|
27
|
+ <div v-if="list.length === 0" class="empty-block">暂无数据</div>
|
|
28
|
+ <div v-else :class="getCardClass()" v-for="(item, idx) in list" :key="idx" @click="jumpToDetailPage(item.id)">
|
28
|
29
|
<!-- 主题库和专题库块 -->
|
29
|
30
|
<div v-if="activeName === 'first' || activeName === 'second'" class="title title-block clearfix">
|
30
|
31
|
<p class="left">
|
|
@@ -35,22 +36,22 @@
|
35
|
36
|
实体名称:{{item.logicTbName}}
|
36
|
37
|
</p>
|
37
|
38
|
<div class="right">
|
38
|
|
- <span v-if="item.isListing" class="right-item">
|
|
39
|
+ <span v-if="item.shelvesType" class="right-item">
|
39
|
40
|
<img src="../../../assets/image/u1723.png" alt="">
|
40
|
41
|
已上架
|
41
|
42
|
</span>
|
42
|
43
|
<span @click.stop="">
|
43
|
|
- <span v-if="!item.isListing" class="active right-item" @click="handleUp(item.id)">
|
|
44
|
+ <span v-if="!item.shelvesType" class="active right-item" @click="handleUp(item.id)">
|
44
|
45
|
<img src="../../../assets/image/u1723.png" alt="">
|
45
|
46
|
上架
|
46
|
47
|
</span>
|
47
|
48
|
</span>
|
48
|
|
- <span v-if="!item.isListing" class="right-item">
|
|
49
|
+ <span v-if="!item.shelvesType" class="right-item">
|
49
|
50
|
<img src="../../../assets/image/u1720.png" alt="">
|
50
|
51
|
已下架
|
51
|
52
|
</span>
|
52
|
53
|
<span @click.stop="">
|
53
|
|
- <span v-if="item.isListing" class="active right-item" @click="handleDown(item.id)">
|
|
54
|
+ <span v-if="item.shelvesType" class="active right-item" @click="handleDown(item.id)">
|
54
|
55
|
<img src="../../../assets/image/u1720.png" alt="">
|
55
|
56
|
下架
|
56
|
57
|
</span>
|
|
@@ -58,27 +59,51 @@
|
58
|
59
|
</div>
|
59
|
60
|
</div>
|
60
|
61
|
<el-row v-if="activeName === 'first' || activeName === 'second'" style="color: rgb(91,91,91);line-height: 40px;">
|
61
|
|
- <el-col :span="12">
|
|
62
|
+ <el-col :span="12" class="text-overflow" :title="item.tbName">
|
62
|
63
|
英文名称:{{item.tbName}}
|
63
|
64
|
</el-col>
|
64
|
65
|
<el-col :span="12">
|
65
|
66
|
更新时间:{{item.updateTime}}
|
66
|
67
|
</el-col>
|
67
|
68
|
<el-col :span="12">
|
68
|
|
- 所属主题:{{item.topic}}
|
|
69
|
+ 所属主题:{{item.l1}}
|
69
|
70
|
</el-col>
|
70
|
71
|
</el-row>
|
71
|
72
|
<!-- 指标编码块 -->
|
72
|
|
- <p v-if="activeName === 'third'" class="title">
|
73
|
|
- <span @click.stop="">
|
74
|
|
- <el-checkbox class="checkbox" v-model="item.checked" @click.stop="" @change="(e) => checkboxChange(e, item.id)"></el-checkbox>
|
75
|
|
- </span>
|
76
|
|
- <img src="../../../assets/image/u652.svg" alt="">
|
77
|
|
- 指标名称:{{item.logicTbName}}
|
78
|
|
- </p>
|
|
73
|
+ <div v-if="activeName === 'third'" class="title title-block clearfix">
|
|
74
|
+ <p class="left">
|
|
75
|
+ <span @click.stop="">
|
|
76
|
+ <el-checkbox class="checkbox" v-model="item.checked" @click.stop="" @change="(e) => checkboxChange(e, item.id)"></el-checkbox>
|
|
77
|
+ </span>
|
|
78
|
+ <img src="../../../assets/image/u652.svg" alt="">
|
|
79
|
+ 指标名称:{{item.name}}
|
|
80
|
+ </p>
|
|
81
|
+ <div class="right">
|
|
82
|
+ <span v-if="item.shelvesType" class="right-item">
|
|
83
|
+ <img src="../../../assets/image/u1723.png" alt="">
|
|
84
|
+ 已上架
|
|
85
|
+ </span>
|
|
86
|
+ <span @click.stop="">
|
|
87
|
+ <span v-if="!item.shelvesType" class="active right-item" @click="handleUp(item.id)">
|
|
88
|
+ <img src="../../../assets/image/u1723.png" alt="">
|
|
89
|
+ 上架
|
|
90
|
+ </span>
|
|
91
|
+ </span>
|
|
92
|
+ <span v-if="!item.shelvesType" class="right-item">
|
|
93
|
+ <img src="../../../assets/image/u1720.png" alt="">
|
|
94
|
+ 已下架
|
|
95
|
+ </span>
|
|
96
|
+ <span @click.stop="">
|
|
97
|
+ <span v-if="item.shelvesType" class="active right-item" @click="handleDown(item.id)">
|
|
98
|
+ <img src="../../../assets/image/u1720.png" alt="">
|
|
99
|
+ 下架
|
|
100
|
+ </span>
|
|
101
|
+ </span>
|
|
102
|
+ </div>
|
|
103
|
+ </div>
|
79
|
104
|
<el-row v-if="activeName === 'third'" style="color: rgb(91,91,91);line-height: 40px;">
|
80
|
105
|
<el-col :span="12">
|
81
|
|
- 所属目录:{{item.tbName}}
|
|
106
|
+ 所属目录:{{item.l1}}
|
82
|
107
|
</el-col>
|
83
|
108
|
<el-col :span="12">
|
84
|
109
|
更新时间:{{item.updateTime}}
|
|
@@ -86,49 +111,81 @@
|
86
|
111
|
</el-row>
|
87
|
112
|
<el-row v-if="activeName === 'third'" style="color: rgb(91,91,91);line-height: 40px;">
|
88
|
113
|
<el-col :span="12">
|
89
|
|
- 所属部门:{{item.depart}}
|
|
114
|
+ 所属部门:{{item.ownerDepartment}}
|
90
|
115
|
</el-col>
|
91
|
116
|
</el-row>
|
92
|
117
|
<el-row v-if="activeName === 'third'" style="color: rgb(91,91,91);line-height: 40px;">
|
93
|
118
|
<el-col :span="12">
|
94
|
|
- 指标编码:{{item.indexCode}}
|
|
119
|
+ 指标编码:{{item.code}}
|
95
|
120
|
</el-col>
|
96
|
121
|
</el-row>
|
97
|
122
|
<!-- 服务块 -->
|
98
|
|
- <p v-if="activeName === 'fourth'" class="title">
|
99
|
|
- <span @click.stop="">
|
100
|
|
- <el-checkbox class="checkbox" v-model="item.checked" @click.stop="" @change="(e) => checkboxChange(e, item.id)"></el-checkbox>
|
101
|
|
- </span>
|
102
|
|
- <img src="../../../assets/image/u652.svg" alt="">
|
103
|
|
- {{ serviceType === 'API' ? '序号:' : 'Topic名称:'}}{{item.logicTbName}}
|
104
|
|
- </p>
|
|
123
|
+ <div v-if="activeName === 'fourth'" class="title title-block clearfix">
|
|
124
|
+ <p class="left">
|
|
125
|
+ <span @click.stop="">
|
|
126
|
+ <el-checkbox class="checkbox" v-model="item.checked" @click.stop="" @change="(e) => checkboxChange(e, item.id)"></el-checkbox>
|
|
127
|
+ </span>
|
|
128
|
+ <img src="../../../assets/image/u652.svg" alt="">
|
|
129
|
+ <span v-if="serviceType === 'API'">序号:{{item.id}}</span>
|
|
130
|
+ <span v-if="serviceType === 'MQ'">Topic名称:{{item.name}}</span>
|
|
131
|
+ </p>
|
|
132
|
+ <div class="right">
|
|
133
|
+ <span v-if="item.shelvesType" class="right-item">
|
|
134
|
+ <img src="../../../assets/image/u1723.png" alt="">
|
|
135
|
+ 已上架
|
|
136
|
+ </span>
|
|
137
|
+ <span @click.stop="">
|
|
138
|
+ <span v-if="!item.shelvesType" class="active right-item" @click="handleUp(item.id)">
|
|
139
|
+ <img src="../../../assets/image/u1723.png" alt="">
|
|
140
|
+ 上架
|
|
141
|
+ </span>
|
|
142
|
+ </span>
|
|
143
|
+ <span v-if="!item.shelvesType" class="right-item">
|
|
144
|
+ <img src="../../../assets/image/u1720.png" alt="">
|
|
145
|
+ 已下架
|
|
146
|
+ </span>
|
|
147
|
+ <span @click.stop="">
|
|
148
|
+ <span v-if="item.shelvesType" class="active right-item" @click="handleDown(item.id)">
|
|
149
|
+ <img src="../../../assets/image/u1720.png" alt="">
|
|
150
|
+ 下架
|
|
151
|
+ </span>
|
|
152
|
+ </span>
|
|
153
|
+ </div>
|
|
154
|
+ </div>
|
105
|
155
|
<el-row v-if="activeName === 'fourth'" style="color: rgb(91,91,91);line-height: 40px;">
|
106
|
|
- <el-col :span="12">
|
107
|
|
- {{ serviceType === 'API' ? 'API名称:' : '集成应用:'}}{{item.tbName}}
|
|
156
|
+ <el-col v-if="serviceType === 'API'" :span="12">
|
|
157
|
+ API名称:{{item.NAME}}
|
108
|
158
|
</el-col>
|
109
|
|
- <el-col :span="12">
|
110
|
|
- {{ serviceType === 'API' ? '更新时间:' : '提供部门:'}}{{item.updateTime}}
|
|
159
|
+ <el-col v-if="serviceType === 'MQ'" :span="12">
|
|
160
|
+ 集成应用:{{item.appName}}
|
111
|
161
|
</el-col>
|
112
|
|
- </el-row>
|
113
|
|
- <el-row v-if="activeName === 'fourth'" style="color: rgb(91,91,91);line-height: 40px;">
|
114
|
|
- <el-col :span="12">
|
115
|
|
- {{ serviceType === 'API' ? 'API描述:' : 'topic分区数:'}}{{item.apiDesc}}
|
|
162
|
+ <el-col v-if="serviceType === 'API'" :span="12">
|
|
163
|
+ 更新时间:{{item.updateTime}}
|
116
|
164
|
</el-col>
|
117
|
|
- <el-col :span="12">
|
118
|
|
- {{ serviceType === 'API' ? '提供部门:' : '使用部门:'}}{{item.depart}}
|
|
165
|
+ <el-col v-if="serviceType === 'MQ'" :span="12">
|
|
166
|
+ topic分区数:{{item.partitions}}
|
119
|
167
|
</el-col>
|
120
|
168
|
</el-row>
|
121
|
169
|
<el-row v-if="activeName === 'fourth'" style="color: rgb(91,91,91);line-height: 40px;">
|
122
|
|
- <el-col :span="12">
|
123
|
|
- {{ serviceType === 'API' ? '服务归属系统名称:' : '副本数:'}}{{item.sysName}}
|
|
170
|
+ <el-col v-if="serviceType === 'API'" :span="12">
|
|
171
|
+ API描述:{{item.remark}}
|
124
|
172
|
</el-col>
|
125
|
|
- <el-col :span="12">
|
126
|
|
- {{ serviceType === 'API' ? '使用部门:' : '老化时间(小时):'}}{{item.useDepart}}
|
|
173
|
+ <el-col v-if="serviceType === 'MQ'" :span="12">
|
|
174
|
+ 老化时间(小时):{{item.retentionTime}}
|
|
175
|
+ </el-col>
|
|
176
|
+ <el-col v-if="serviceType === 'API'" :span="12">
|
|
177
|
+ 使用系统:{{item.apiBindedAppNames}}
|
|
178
|
+ </el-col>
|
|
179
|
+ <el-col v-if="serviceType === 'MQ'" :span="12">
|
|
180
|
+ 副本数:{{item.replication}}
|
127
|
181
|
</el-col>
|
128
|
182
|
</el-row>
|
129
|
|
- <el-row v-if="activeName === 'fourth' && serviceType === 'MQ'" style="color: rgb(91,91,91);line-height: 40px;">
|
130
|
|
- <el-col :span="12">
|
131
|
|
- 描述:{{item.desc}}
|
|
183
|
+ <el-row v-if="activeName === 'fourth'" style="color: rgb(91,91,91);line-height: 40px;">
|
|
184
|
+ <el-col v-if="serviceType === 'API'" :span="12">
|
|
185
|
+ 服务归属系统名称:{{item.romaAppName}}
|
|
186
|
+ </el-col>
|
|
187
|
+ <el-col v-if="serviceType === 'MQ'" :span="12">
|
|
188
|
+ 描述:{{item.description}}
|
132
|
189
|
</el-col>
|
133
|
190
|
</el-row>
|
134
|
191
|
</div>
|
|
@@ -150,6 +207,8 @@
|
150
|
207
|
</template>
|
151
|
208
|
|
152
|
209
|
<script>
|
|
210
|
+import api from "@/api/homepage/search.js";
|
|
211
|
+import backApi from "@/api/index/search.js";
|
153
|
212
|
export default {
|
154
|
213
|
data() {
|
155
|
214
|
return {
|
|
@@ -174,140 +233,45 @@ export default {
|
174
|
233
|
id: 'fourth',
|
175
|
234
|
num: 0}
|
176
|
235
|
],
|
177
|
|
- data: [{
|
178
|
|
- label: '一级 1',
|
179
|
|
- children: [{
|
180
|
|
- label: '二级 1-1',
|
181
|
|
- children: [{
|
182
|
|
- label: '三级 1-1-1'
|
183
|
|
- }]
|
184
|
|
- }]
|
185
|
|
- }, {
|
186
|
|
- label: '一级 2',
|
187
|
|
- children: [{
|
188
|
|
- label: '二级 2-1',
|
189
|
|
- children: [{
|
190
|
|
- label: '三级 2-1-1'
|
191
|
|
- }]
|
192
|
|
- }, {
|
193
|
|
- label: '二级 2-2',
|
194
|
|
- children: [{
|
195
|
|
- label: '三级 2-2-1'
|
196
|
|
- }]
|
197
|
|
- }]
|
198
|
|
- }, {
|
199
|
|
- label: '一级 3',
|
200
|
|
- children: [{
|
201
|
|
- label: '二级 3-1',
|
202
|
|
- children: [{
|
203
|
|
- label: '三级 3-1-1'
|
204
|
|
- }]
|
205
|
|
- }, {
|
206
|
|
- label: '二级 3-2',
|
207
|
|
- children: [{
|
208
|
|
- label: '三级 3-2-1'
|
209
|
|
- }]
|
210
|
|
- }]
|
211
|
|
- }],
|
|
236
|
+ data: [],
|
212
|
237
|
defaultProps: {
|
213
|
|
- children: 'children',
|
214
|
|
- label: 'label'
|
|
238
|
+ children: 'childrens',
|
|
239
|
+ label: 'name'
|
215
|
240
|
},
|
216
|
|
- list: [
|
217
|
|
- {
|
218
|
|
- id: '111',
|
219
|
|
- logicTbName: '周期性维护计划注销信息',
|
220
|
|
- tbName: 'periodic_maintenance_plan_cancel',
|
221
|
|
- updateTime: '2022-07-06 09:23:44',
|
222
|
|
- topic: '人力资源管理',
|
223
|
|
- indexCode: 'ZB001080',
|
224
|
|
- depart: 'sunpu',
|
225
|
|
- apiDesc: 'degegwgwgwg',
|
226
|
|
- useDepart: '部门XXX',
|
227
|
|
- sysName: 'app-tfs',
|
228
|
|
- desc: '暂无',
|
229
|
|
- isListing: true
|
230
|
|
- },
|
231
|
|
- {
|
232
|
|
- id: '222',
|
233
|
|
- logicTbName: '周期性维护计划注销信息',
|
234
|
|
- tbName: 'periodic_maintenance_plan_cancel',
|
235
|
|
- updateTime: '2022-07-06 09:23:44',
|
236
|
|
- topic: '人力资源管理',
|
237
|
|
- indexCode: 'ZB001080',
|
238
|
|
- depart: 'sunpu',
|
239
|
|
- apiDesc: 'degegwgwgwg',
|
240
|
|
- useDepart: '部门XXX',
|
241
|
|
- sysName: 'app-tfs',
|
242
|
|
- desc: '暂无',
|
243
|
|
- isListing: false
|
244
|
|
- },
|
245
|
|
- {
|
246
|
|
- id: '333',
|
247
|
|
- logicTbName: '周期性维护计划注销信息',
|
248
|
|
- tbName: 'periodic_maintenance_plan_cancel',
|
249
|
|
- updateTime: '2022-07-06 09:23:44',
|
250
|
|
- topic: '人力资源管理',
|
251
|
|
- indexCode: 'ZB001080',
|
252
|
|
- depart: 'sunpu',
|
253
|
|
- apiDesc: 'degegwgwgwg',
|
254
|
|
- useDepart: '部门XXX',
|
255
|
|
- sysName: 'app-tfs',
|
256
|
|
- desc: '暂无',
|
257
|
|
- isListing: true
|
258
|
|
- },
|
259
|
|
- {
|
260
|
|
- id: '444',
|
261
|
|
- logicTbName: '周期性维护计划注销信息',
|
262
|
|
- tbName: 'periodic_maintenance_plan_cancel',
|
263
|
|
- updateTime: '2022-07-06 09:23:44',
|
264
|
|
- topic: '人力资源管理',
|
265
|
|
- indexCode: 'ZB001080',
|
266
|
|
- depart: 'sunpu',
|
267
|
|
- apiDesc: 'degegwgwgwg',
|
268
|
|
- useDepart: '部门XXX',
|
269
|
|
- sysName: 'app-tfs',
|
270
|
|
- desc: '暂无',
|
271
|
|
- isListing: true
|
272
|
|
- },
|
273
|
|
- {
|
274
|
|
- id: '555',
|
275
|
|
- logicTbName: '周期性维护计划注销信息',
|
276
|
|
- tbName: 'periodic_maintenance_plan_cancel',
|
277
|
|
- updateTime: '2022-07-06 09:23:44',
|
278
|
|
- topic: '人力资源管理',
|
279
|
|
- indexCode: 'ZB001080',
|
280
|
|
- depart: 'sunpu',
|
281
|
|
- apiDesc: 'degegwgwgwg',
|
282
|
|
- useDepart: '部门XXX',
|
283
|
|
- sysName: 'app-tfs',
|
284
|
|
- desc: '暂无',
|
285
|
|
- isListing: true
|
286
|
|
- },
|
287
|
|
- ],
|
|
241
|
+ list: [],
|
288
|
242
|
currentPage: 1,
|
289
|
243
|
pageSize: 5,
|
290
|
|
- total: 1000,
|
|
244
|
+ total: 0,
|
291
|
245
|
serviceType: 'API', // API-API服务,MQ-消息队列
|
292
|
246
|
pageType: this.$route.query.pageType || 'all', // all-全量搜索,theme-只有主题库搜索,topic-只有专题库搜索,index-只有指标搜索,service-只有服务搜索,background-后台管理搜索
|
|
247
|
+ menuId: undefined,
|
|
248
|
+ selectIds: []
|
293
|
249
|
};
|
294
|
250
|
},
|
295
|
251
|
created() {},
|
296
|
252
|
mounted() {
|
297
|
253
|
document.documentElement.scrollTop = 0;
|
|
254
|
+ this.getMenu()
|
|
255
|
+ this.getSearchData()
|
298
|
256
|
},
|
299
|
257
|
methods: {
|
300
|
258
|
handleClick(tab, event) {
|
301
|
259
|
this.activeName = tab.name;
|
|
260
|
+ this.resetValue()
|
|
261
|
+ this.getMenu()
|
|
262
|
+ this.getSearchData()
|
302
|
263
|
},
|
303
|
264
|
handleNodeClick(data) {
|
304
|
|
- console.log(data);
|
|
265
|
+ // console.log(data);
|
|
266
|
+ this.menuId = data.id
|
|
267
|
+ this.getSearchData()
|
305
|
268
|
},
|
306
|
269
|
handleSizeChange(val) {
|
307
|
270
|
console.log(`每页 ${val} 条`);
|
308
|
271
|
},
|
309
|
272
|
handleCurrentChange(val) {
|
310
|
273
|
console.log(`当前页: ${val}`);
|
|
274
|
+ this.getSearchData()
|
311
|
275
|
},
|
312
|
276
|
jumpToDetailPage(id) {
|
313
|
277
|
let type = 'theme'
|
|
@@ -330,7 +294,7 @@ export default {
|
330
|
294
|
});
|
331
|
295
|
},
|
332
|
296
|
handleSearch() {
|
333
|
|
-
|
|
297
|
+ this.getSearchData()
|
334
|
298
|
},
|
335
|
299
|
getCardClass() {
|
336
|
300
|
let ret = 'entity-card'
|
|
@@ -342,18 +306,136 @@ export default {
|
342
|
306
|
}
|
343
|
307
|
return ret
|
344
|
308
|
},
|
345
|
|
- // 批量上架
|
346
|
|
- batchListing() {},
|
347
|
|
- // 批量下架
|
348
|
|
- batchOffShelf() {},
|
349
|
309
|
checkboxChange(e, id) {
|
350
|
|
- console.log('e', e, 'id', id)
|
|
310
|
+ if (e) {
|
|
311
|
+ this.selectIds.push(id)
|
|
312
|
+ } else {
|
|
313
|
+ this.selectIds = this.selectIds.filter(item => item !== id)
|
|
314
|
+ }
|
|
315
|
+ console.log('selectIds', this.selectIds)
|
351
|
316
|
},
|
352
|
317
|
handleDown() {
|
353
|
318
|
console.log('down')
|
354
|
319
|
},
|
355
|
320
|
handleUp() {
|
356
|
321
|
console.log('up')
|
|
322
|
+ },
|
|
323
|
+ getMenu() {
|
|
324
|
+ const params = {resourceType: 'theme'}
|
|
325
|
+ if (this.$route.query.pageType === 'topic' || this.activeName === 'second') {
|
|
326
|
+ params.resourceType = 'specialSubject'
|
|
327
|
+ }
|
|
328
|
+ if (this.$route.query.pageType === 'index' || this.activeName === 'third') {
|
|
329
|
+ params.resourceType = 'index'
|
|
330
|
+ }
|
|
331
|
+ if (this.$route.query.pageType === 'service' || this.activeName === 'fourth') {
|
|
332
|
+ params.resourceType = 'service'
|
|
333
|
+ }
|
|
334
|
+ api.menuInfo(params).then(res => {
|
|
335
|
+ if (res.success) {
|
|
336
|
+ this.data = res.data
|
|
337
|
+ }
|
|
338
|
+ })
|
|
339
|
+ if (this.activeName === 'fourth') {
|
|
340
|
+ this.getServiceStatNum()
|
|
341
|
+ }
|
|
342
|
+ },
|
|
343
|
+ serviceBtnClick(key) {
|
|
344
|
+ this.serviceType = key
|
|
345
|
+ this.resetValue()
|
|
346
|
+ this.getMenu()
|
|
347
|
+ this.getSearchData()
|
|
348
|
+ },
|
|
349
|
+ getSearchData() {
|
|
350
|
+ const params = {
|
|
351
|
+ resourceType: 'theme', pageNum: this.currentPage,
|
|
352
|
+ pageSize: this.pageSize, menuId: this.menuId,
|
|
353
|
+ keyword: this.searchWords
|
|
354
|
+ }
|
|
355
|
+ if (this.$route.query.pageType === 'topic' || this.activeName === 'second') {
|
|
356
|
+ params.resourceType = 'specialSubject'
|
|
357
|
+ }
|
|
358
|
+ if (this.$route.query.pageType === 'index' || this.activeName === 'third') {
|
|
359
|
+ params.resourceType = 'index'
|
|
360
|
+ }
|
|
361
|
+ if (this.$route.query.pageType === 'service' || this.activeName === 'fourth') {
|
|
362
|
+ params.resourceType = this.serviceType === 'API' ? 'api' : 'mqs'
|
|
363
|
+ }
|
|
364
|
+ api.searchData(params).then(res => {
|
|
365
|
+ if(res.success) {
|
|
366
|
+ this.total = res.data.total
|
|
367
|
+ this.list = []
|
|
368
|
+ res.data.records.map((item, index) => {
|
|
369
|
+ const newItem = {...item}
|
|
370
|
+ if (this.selectIds.indexOf(item.id) !== -1) {
|
|
371
|
+ newItem.checked = true
|
|
372
|
+ } else {
|
|
373
|
+ newItem.checked = false
|
|
374
|
+ }
|
|
375
|
+ this.list.push(newItem)
|
|
376
|
+ })
|
|
377
|
+ console.log('list', this.list)
|
|
378
|
+ }
|
|
379
|
+ })
|
|
380
|
+ },
|
|
381
|
+ getServiceStatNum() {
|
|
382
|
+ let params = {resourceType: 'api'}
|
|
383
|
+ if (this.serviceType === 'MQ') {
|
|
384
|
+ params.resourceType = 'mqs'
|
|
385
|
+ }
|
|
386
|
+ api.menuStatNum(params).then(res => {
|
|
387
|
+ if (res.success) {
|
|
388
|
+ this.data.map((item, index) => {
|
|
389
|
+ const findObj = res.data.find(fItem => fItem.menuId === item.id)
|
|
390
|
+ if (findObj) {
|
|
391
|
+ item.name = `${item.name}(${findObj.docCount})`
|
|
392
|
+ } else {
|
|
393
|
+ item.name = `${item.name}(0)`
|
|
394
|
+ }
|
|
395
|
+ })
|
|
396
|
+ // console.log('this.data', this.data)
|
|
397
|
+ }
|
|
398
|
+ })
|
|
399
|
+ },
|
|
400
|
+ getListingParam() {
|
|
401
|
+ const params = {resourceType: 'theme', resourceIds: this.selectIds,}
|
|
402
|
+ if (this.activeName === 'second') {
|
|
403
|
+ params.resourceType = 'specialSubject'
|
|
404
|
+ }
|
|
405
|
+ if (this.activeName === 'third') {
|
|
406
|
+ params.resourceType = 'index'
|
|
407
|
+ }
|
|
408
|
+ if (this.activeName === 'fourth') {
|
|
409
|
+ params.resourceType = 'service'
|
|
410
|
+ }
|
|
411
|
+ return params
|
|
412
|
+ },
|
|
413
|
+ // 批量上架
|
|
414
|
+ batchListing() {
|
|
415
|
+ const params = this.getListingParam()
|
|
416
|
+ backApi.batchUpShelves(params).then(res => {
|
|
417
|
+ if (res.success) {
|
|
418
|
+ this.$message({ type: 'success', message: '上架成功!' })
|
|
419
|
+ this.selectIds = []
|
|
420
|
+ this.getSearchData()
|
|
421
|
+ }
|
|
422
|
+ })
|
|
423
|
+ },
|
|
424
|
+ // 批量下架
|
|
425
|
+ batchOffShelf() {
|
|
426
|
+ const params = this.getListingParam()
|
|
427
|
+ backApi.batchDownShelves(params).then(res => {
|
|
428
|
+ if (res.success) {
|
|
429
|
+ this.$message({ type: 'success', message: '下架成功!' })
|
|
430
|
+ this.selectIds = []
|
|
431
|
+ this.getSearchData()
|
|
432
|
+ }
|
|
433
|
+ })
|
|
434
|
+ },
|
|
435
|
+ resetValue() {
|
|
436
|
+ this.selectIds = []
|
|
437
|
+ this.menuId = undefined
|
|
438
|
+ this.currentPage = 1
|
357
|
439
|
}
|
358
|
440
|
}
|
359
|
441
|
};
|