1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
| <template>
| <el-container>
| <el-main>
| <basic-container>
| <avue-crud v-model="form" ref="crud" :option="option" :data="data" @on-load="onLoad" :page.sync="page"
| @search-change="searchChange"
| @search-reset="searchReset"
| @selection-change="selectionChange"
| @current-change="currentChange"
| @size-change="sizeChange"
| @refresh-change="refreshChange" @row-click="rowClick">
| <template slot="menu" slot-scope="{row,index}">
| <el-button icon="el-icon-edit" size="small" type="text" @click="updateSave(row,index)">编辑</el-button>
| <el-button icon="el-icon-delete" size="small" type="text" @click="deleteSave(row,index)">删除</el-button>
| <el-button v-if="row.usedflag=='false'" icon="el-icon-position" size="small" type="text" @click="ENABLE(row,index)">启用</el-button>
| <el-button v-else icon="el-icon-finished" size="small" type="text" @click="DISABLE(row,index)">停用</el-button>
| </template>
| <template slot="menuLeft">
| <el-button size="small" type="primary" icon="el-icon-plus" @click="addSave">新 增
| </el-button>
| <el-button size="small" icon="el-icon-share" @click="PUSH">同 步
| </el-button>
| <el-button size="small" icon="el-icon-search" @click="openAdvancedQuery">查 询
| </el-button>
| </template>
| </avue-crud>
| </basic-container>
| </el-main>
| <infoForm ref="infoForm" @refreshTable="refreshChange" :formData="editAttribute"></infoForm>
| <!-- 高级查询对话框 -->
| <advanced-query
| :ref="advancedQueryParam.ref"
| :options="advancedQueryParam.options"
| :visible.sync="advancedQueryParam.advancedQuerySettingBox"
| @echoContion="echoSeniorContionMap">
| </advanced-query>
| </el-container>
| </template>
|
| <script>
| import {
| getList,add,edit,del,push,updateStatus
| } from "@/api/docking/info";
| import {getDictionary} from "@/api/omd/enum";
| import infoForm from "./infoForm.vue";
|
| export default {
| name: "info",
| components:{infoForm},
| data() {
| return {
| //接口类型下拉
| interfaceTypeList: [{
| label: 'webService', value: 'webService'
| }, {
| label: '类路径', value: 'classPath'
| }, {
| label: 'Http', value: 'http'
| }],
| //参数类型下拉
| paramTypeList: [{
| label: 'xml', value: 'xml'
| }, {
| label: 'Json', value: 'json'
| }],
| //返回值类型下拉
| returnTypeList: [{
| label: 'xml', value: 'xml'
| }, {
| label: 'Json', value: 'json'
| }],
| //推送类型
| pushTypeList: [{value: '1', label: '数据推送'},
| {value: '2', label: '分类推送'},
| {value: '3', label: '编码申请'},
| {value: '4', label: '编码更改(状态、回收)'},
| {value: '5', label: '分类查询'},
| {value: '6', label: '含规则信息的分类查询'},
| {value: '7', label: '数据查询'}],
| page: {
| pageSize: 10,
| currentPage: 1,
| total: 100
| },
| selectRow: {},
| data: [],
| form: {},
| editAttribute: {},
| selectionList: [],
| option: {
| height: "auto",
| calcHeight: 20,
| tip: false,
| headerAlign: "center",
| border: true,
| index: true,
| selection: true,
| searchShow: false,
| searchMenuSpan: 6,
| rowKey: "id",
| tabs: true,
| stripe: true,
| indexFixed: false,
| menuWidth: 180,
| highlightCurrentRow: true,
| addBtn: false,
| editBtn: false,
| delBtn: false,
| columnBtn: false,
| column: [{
| label: '推送类型',
| prop: 'pushType',
| sortable: true,
| width: 150,
| formatter:function (d){
| return this.pushTypeList[d.pushType]
| }
| }, {
| label: '系统编号',
| prop: 'id',
| sortable: true,
| width: 150
| }, {
| label: '系统名称',
| prop: 'name',
| sortable: true,
| width: 150
| }, {
| label: '接口函数',
| prop: 'interfaceFunction',
| sortable: true,
| width: 150
| }, {
| label: '命名空间',
| prop: 'nameSpace',
| sortable: true,
| width: 150
| }, {
| label: 'soapAction',
| prop: 'soapAction',
| sortable: true,
| width: 150
| }, {
| label: '参数名称',
| prop: 'targName',
| sortable: true,
| width: 150
| }, {
| label: '调用方式',
| prop: 'cxfaxis',
| sortable: true,
| width: 150
| }, {
| label: '请求地址',
| prop: 'requestUrl',
| sortable: true,
| width: 150
| }, {
| label: '参数类型',
| prop: 'paramType',
| sortable: true,
| width: 150,
| formatter:function (d){
| return this.paramTypeList[d.paramType]
| }
| }, {
| label: '返回值类型',
| prop: 'returnType',
| sortable: true,
| width: 150,
| formatter:function (d){
| return this.returnTypeList[d.returnType]
| }
| }, {
| label: '系统描述',
| prop: 'description',
| width: 150
| }]
| },
| // 高级查询对话框相关参数
| advancedQueryParam: {
| ref: 'advancedQuery',
| advancedQuerySettingBox: false,
| options: [],
| currentOpen: '', //当前打开高级查询的窗口是
| //conditionMapParams: {},
| }
| };
| },
| created() {
| },
| computed: {
| oids() {
| let oids = [];
| this.selectionList.forEach(ele => {
| oids.push(ele.oid);
| });
| return oids.join(",");
| }
| },
| methods: {
| searchReset() {
| this.query = {};
| this.onLoad(this.page);
| },
| searchChange(params, done) {
| this.query = params;
| this.page.currentPage = 1;
| this.onLoad(this.page);
| done();
| },
| selectionChange(list) {
| this.selectionList = list;
| if(this.selectionList.length <= 0){
| this.selectRow = null
| }
| if (this.selectionList.length > 0) {
| this.selectRow = this.selectionList[list.length-1].$index;
| }
| },
| selectionClear() {
| this.selectionList = [];
| this.$refs.crud.toggleSelection();
| },
| currentChange(currentPage) {
| this.page.currentPage = currentPage;
| },
| sizeChange(pageSize) {
| this.page.pageSize = pageSize;
| },
| refreshChange() {
| this.onLoad(this.page, this.query);
| },
| addSave() {
| this.$refs.infoForm.showSubmitDialog = true;
| this.$refs.infoForm.formData = {
| dataFlowType:'push',
| pushType:'1',
| sourceSystemName:'编码系统',
| sourceSystemOid:'code00000001',
| sourceSystemId:'CODE',
| targetSystemName:'',
| targetSystemOid:'',
| targetSystemId:'',
| sysIntParamVOs:[],
| sysIntHeaderVOs:[]
| };
| },
| updateSave(row,index) {
| this.selectRow = row;
| this.editAttribute = row;
| this.editAttribute.sysIntParamVOs = row.sysIntParamVOs||[];
| this.editAttribute.sysIntHeaderVOs = row.sysIntHeaderVOs||[];
| this.$refs.infoForm.formData = this.editAttribute;
| this.$refs.infoForm.showSubmitDialog = true;
| },
| deleteSave(row,index) {
| this.$confirm("删除数据将无法被恢复, 是否继续?", "提示", {
| iconClass: 'el-icon-question',
| confirmButtonText: "确定",
| cancelButtonText: "取消",
| showClose: true,
| type: "warning"
| }).then(() => {
| remove(row.oid).then(res => {
| this.$message.success("删除成功");
| this.refreshChange();
| });
| });
| },
| ENABLE(row,index){
| //启用
| this.updateStatus(row,"enable");
| },
| DISABLE(row,index){
| //停用
| this.updateStatus(row,"disable");
| },
| updateStatus(selectRow,able){
| var that = this;
| var paramTemp = {
| update:able,
| oid:selectRow.oid,
| ts:selectRow.ts
| };
| this.$confirm("是否要"+(able == "enbale" ? "启用" : (able == "disable" ? "停用": "发布")) +"这条数据?", {
| confirmButtonText: "确定",
| cancelButtonText: "取消",
| type: "warning"
| })
| .then(() => {
| return updateStatus(paramTemp);
| })
| .then(() => {
| this.onLoad(this.page);
| this.$message({
| type: "success",
| message:(able == "enbale" ? "启用成功" : (able == "disable" ? "停用成功": "发布成功"))
| });
| });
| },
| PUSH(){
| if (this.selectionList.length != 1) {
| this.$message.error('请选择数据')
| return false;
| }
| this.$confirm("是否要"+ (this.selectionList[0].pushType == "1" ? "推送数据" : "推送分类"), {
| confirmButtonText: "确定",
| cancelButtonText: "取消",
| type: "warning"
| })
| .then(() => {
| return push(this.oids.split(','));
| })
| .then(() => {
| this.onLoad(this.page);
| this.$message({
| type: "success",
| message: "操作成功!"
| });
| this.$refs.crud.toggleSelection();
| });
| },
| onLoad(page, params = {}) {
| this.loading = true;
| getList(this.page.currentPage, this.page.pageSize, Object.assign(params, this.query)).then(res => {
| const data = res.data.data;
| debugger;
| this.page.total = data.total;
| this.data = data.records;
| this.loading = false;
| });
| },
| rowClick(row) {
| this.selectRow = row;
| this.$refs.crud.toggleSelection();
| this.$refs.crud.toggleRowSelection(row); //选中当前行
| },
| /** 高级查询对话框组件,组件返回的值是condtionMap[field]形式的查询条件,保留了和之前一样的方式 */
| echoSeniorContionMap(conditionMaps){
| if(JSON.stringify(conditionMaps)!='{}'){
| this.query = conditionMaps;
| this.onLoad(this.page);
| }
| },
| openAdvancedQuery(){
| this.advancedQueryParam.options = [{
| data: this.pushTypeList,
| title: '推送类型',
| queryField: 'pushType',
| fieldType: 'combox',
| comboxKey: 'searchPushType'
| }, {
| title: '系统名称',
| queryField: 'sysBaseName',
| fieldType: 'text'
| }, {
| title: '系统编号',
| queryField: 'sysBaseId',
| fieldType: 'text'
| }, {
| title: '接口函数',
| queryField: 'interfaceFunction',
| fieldType: 'text'
| }, {
| title: '命名空间',
| queryField: 'nameSpace',
| fieldType: 'text'
| }, {
| title: 'soapAction',
| queryField: 'soapAction',
| fieldType: 'text'
| }, {
| title: '参数名称',
| queryField: 'targName',
| fieldType: 'text'
| }, {
| title: '调用方式',
| queryField: 'cxfaxis',
| fieldType: 'text'
| }, {
| title: '请求地址',
| queryField: 'requestUrl',
| fieldType: 'text'
| }, {
| title: '参数类型',
| queryField: 'paramType',
| fieldType: 'combox',
| comboxKey: 'searchparamType',
| data:this.paramTypeList
| }, {
| title: '返回值类型',
| queryField: 'returnType',
| fieldType: 'combox',
| comboxKey: 'searchreturnType',
| data:this.returnTypeList
| }]
|
| this.advancedQueryParam.currentOpen = 'info';
| this.advancedQueryParam.advancedQuerySettingBox = true;
| },
| }
| }
| </script>
|
| <style lang="scss">
| .applyRangeTable>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu {
| display: none !important;
| }
| </style>
|
|