cloud-web-corejs 1.0.54-dev.255 → 1.0.54-dev.257

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.
@@ -0,0 +1,258 @@
1
+ <template>
2
+ <div class="detail-wrap">
3
+ <el-form ref="editForm" :model="requestSetting">
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 colspan="5">
28
+ <el-form-item prop="reqCode" :rules="[{ required: true, trigger: 'blur' }]">
29
+ <el-input type="text" autocomplete="off" v-model="requestSetting.reqCode" clearable/>
30
+ </el-form-item>
31
+ </td>
32
+ </tr>
33
+ <tr>
34
+ <th>
35
+ <em class="f-red">*</em>
36
+ {{ $t1('请求名称') }}
37
+ </th>
38
+ <td colspan="5">
39
+ <el-form-item prop="reqName" :rules="[{ required: true, trigger: 'blur' }]">
40
+ <el-input type="text" autocomplete="off" v-model="requestSetting.reqName" clearable/>
41
+ </el-form-item>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <th>
46
+ <em class="f-red">*</em>
47
+ {{ $t1('执行组织编码') }}
48
+ </th>
49
+ <td colspan="5">
50
+ <el-form-item prop="exeCompanyCode" :rules="[{ required: true, trigger: 'blur' }]">
51
+ <el-input type="text" autocomplete="off" v-model="requestSetting.exeCompanyCode" clearable/>
52
+ </el-form-item>
53
+ </td>
54
+ <td colspan="2"><span class="tips_1">{{ $t1('注:多个用逗号","隔开') }}</span></td>
55
+ </tr>
56
+ <tr>
57
+ <th>
58
+ <em class="f-red">*</em>
59
+ {{ $t1('请求Url') }}
60
+ </th>
61
+ <td colspan="7">
62
+ <el-form-item prop="url" :rules="[{ required: true, trigger: 'blur' }]">
63
+ <el-input type="text" autocomplete="off" v-model="requestSetting.url" clearable/>
64
+ </el-form-item>
65
+ </td>
66
+ </tr>
67
+ <tr>
68
+ <th>
69
+ {{ $t1('请求头') }}
70
+ </th>
71
+ <td colspan="7">
72
+ <el-form-item prop="header" :rules="[{ required: false, trigger: 'blur' }]">
73
+ <el-input type="textarea" :rows="2" :placeholder="$t1('请输入内容')" size="small"
74
+ v-model="requestSetting.header"
75
+ clearable></el-input>
76
+ </el-form-item>
77
+ </td>
78
+ </tr>
79
+ <tr>
80
+ <th>
81
+ {{ $t1('连接超时(ms)') }}
82
+ </th>
83
+ <td>
84
+ <el-form-item prop="connectTimeout" :rules="[{ required: false, trigger: 'blur' }]">
85
+ <base-input-number v-model="requestSetting.connectTimeout" clearable/>
86
+ </el-form-item>
87
+ </td>
88
+ <td colspan="2"><span class="tips_1">{{ $t1('注:不填默认10000毫秒') }}</span></td>
89
+ <th>
90
+ {{ $t1('读取超时(ms)') }}
91
+ </th>
92
+ <td>
93
+ <el-form-item prop="readTimeout" :rules="[{ required: false, trigger: 'blur' }]">
94
+ <base-input-number v-model="requestSetting.readTimeout" clearable/>
95
+ </el-form-item>
96
+ </td>
97
+ <td colspan="2"><span class="tips_1">{{ $t1('注:不填默认60000毫秒') }}</span></td>
98
+ </tr>
99
+ <tr>
100
+ <th>
101
+ <em class="f-red">*</em>
102
+ {{ $t1('是否启用') }}
103
+ </th>
104
+ <td>
105
+ <el-form-item prop="enabled" :rules="[{ required: true, trigger: 'blur' }]">
106
+ <el-radio-group v-model="requestSetting.enabled">
107
+ <el-radio :label="true">{{ $t1('启用') }}</el-radio>
108
+ <el-radio :label="false">{{ $t1('禁用') }}</el-radio>
109
+ </el-radio-group>
110
+ </el-form-item>
111
+ </td>
112
+ </tr>
113
+ <tr>
114
+ <th>
115
+ {{ $t1('备注') }}
116
+ </th>
117
+ <td colspan="7">
118
+ <el-form-item prop="remark" :rules="[{ required: false, trigger: 'blur' }]">
119
+ <el-input type="textarea" :rows="2" :placeholder="$t1('请输入内容')" size="small"
120
+ v-model="requestSetting.remark"
121
+ clearable></el-input>
122
+ </el-form-item>
123
+ </td>
124
+ </tr>
125
+ <!-- <tr>
126
+ <th>
127
+ {{ $t1('前置脚本') }}
128
+ <scriptTestButton :script.sync="requestSetting.preScript"></scriptTestButton>
129
+ </th>
130
+ <td colspan="7">
131
+ <el-form-item prop="preScript" :rules="[{ required: false, trigger: 'blur' }]">
132
+ <code-editor mode="java" :readonly="!1" v-model="requestSetting.preScript"
133
+ v-if="showCodeEditor"></code-editor>
134
+ </el-form-item>
135
+ </td>
136
+ </tr>-->
137
+ <tr>
138
+ <th>
139
+ {{ $t1('后置脚本') }}
140
+ <scriptTestButton :script.sync="requestSetting.postScript"></scriptTestButton>
141
+ </th>
142
+ <td colspan="7">
143
+ <el-form-item prop="postScript" :rules="[{ required: false, trigger: 'blur' }]">
144
+ <code-editor mode="java" :readonly="!1" v-model="requestSetting.postScript"
145
+ v-if="showCodeEditor"></code-editor>
146
+ </el-form-item>
147
+ </td>
148
+ </tr>
149
+ <tr>
150
+ <th>{{ $t1('创建人') }}</th>
151
+ <td>{{ requestSetting.createBy }}</td>
152
+ <th>{{ $t1('创建时间') }}</th>
153
+ <td>{{ requestSetting.createDate }}</td>
154
+ <th>{{ $t1('更新人') }}</th>
155
+ <td>{{ requestSetting.modifyBy }}</td>
156
+ <th>{{ $t1('更新时间') }}</th>
157
+ <td>{{ requestSetting.modifyDate }}</td>
158
+ </tr>
159
+ </tbody>
160
+ </table>
161
+ </div>
162
+ </div>
163
+ </el-form>
164
+ </div>
165
+ </template>
166
+
167
+ <script>
168
+ export default {
169
+ name: 'request_setttingEdit',
170
+ props: {
171
+ _dataId: [String, Number],
172
+ copyId: [String, Number]
173
+ },
174
+ components: {},
175
+ data() {
176
+ return {
177
+ isEdit: false,
178
+ tabIndex: 'first',
179
+ dataId: '',
180
+ requestSetting: {
181
+ enabled: true,
182
+ connectTimeout: 10000,
183
+ readTimeout: 60000,
184
+ preScript: null,
185
+ postScript: null,
186
+ exeCompanyCode: null
187
+ },
188
+ showCodeEditor: false
189
+ };
190
+ },
191
+ created() {
192
+ if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
193
+ },
194
+ mounted() {
195
+ this.getData();
196
+ },
197
+ methods: {
198
+ getData() {
199
+ if (this.copyId) {
200
+ return;
201
+ }
202
+ if (this.dataId && !isNaN(this.dataId)) {
203
+ this.isEdit = true;
204
+ this.$commonHttp({
205
+ url: USER_PREFIX + `/request_setting/get`,
206
+ method: `post`,
207
+ data: {
208
+ id: this.dataId
209
+ },
210
+ isLoading: true,
211
+ modalStrictly: true,
212
+ success: res => {
213
+ this.requestSetting = res.objx || {};
214
+ this.showCodeEditor = true;
215
+ }
216
+ });
217
+ } else {
218
+ this.showCodeEditor = true;
219
+ }
220
+ },
221
+ saveData() {
222
+ this.$refs.editForm.$baseValidate(valid => {
223
+ if (valid) {
224
+ this.$baseConfirm(this.$t1('您确定要保存吗?')).then(() => {
225
+ var url = USER_PREFIX + (this.isEdit ? `/request_setting/update` : `/request_setting/save`);
226
+ this.$http({
227
+ url: url,
228
+ method: `post`,
229
+ data: this.requestSetting,
230
+ isLoading: true,
231
+ success: res => {
232
+ this.$message({
233
+ message: res.content,
234
+ type: 'success',
235
+ duration: 500,
236
+ onClose: t => {
237
+ if (this.isEdit) {
238
+ this.$baseReload();
239
+ } else {
240
+ this.$baseReload({
241
+ updateParam: {
242
+ _dataId: res.objx,
243
+ copyId: null
244
+ }
245
+ });
246
+ }
247
+ }
248
+ });
249
+ }
250
+ });
251
+ });
252
+ }
253
+ });
254
+ }
255
+ }
256
+ };
257
+
258
+ </script>
@@ -0,0 +1,248 @@
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" :copyId.sync="copyId"
6
+ :parent-target="_self" @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">{{ $t1('新增') }}
16
+ </vxe-button>
17
+ </div>
18
+ <div class="fr">
19
+ <vxe-button icon="el-icon-brush" class="button-sty" @click="resetEvent" type="text" status="primary"
20
+ plain>{{$t1('重置')}}
21
+ </vxe-button>
22
+ <vxe-button status="warning" icon="el-icon-search" class="button-sty" @click="searchEvent">
23
+ {{$t1('搜索')}}
24
+ </vxe-button>
25
+ </div>
26
+ </div>
27
+ <vxe-form ref="form" class="screen-box" title-width="92px" title-align="right" :data="formData"
28
+ @submit="searchEvent" @reset="searchEvent">
29
+ <vxe-form-item title="请求编码:" field="reqCode">
30
+ <template v-slot>
31
+ <el-input v-model="formData.reqCode" size="small" clearable/>
32
+ </template>
33
+ </vxe-form-item>
34
+ <vxe-form-item title="请求名称:" field="reqName">
35
+ <template v-slot>
36
+ <el-input v-model="formData.reqName" size="small" clearable/>
37
+ </template>
38
+ </vxe-form-item>
39
+ <vxe-form-item title="是否启用:" field="enabled">
40
+ <template v-slot>
41
+ <el-select v-model="formData.enabled" clearable>
42
+ <el-option :value="true" label="启用"></el-option>
43
+ <el-option :value="false" label="禁用"></el-option>
44
+ </el-select>
45
+ </template>
46
+ </vxe-form-item>
47
+ </vxe-form>
48
+ </template>
49
+ </vxe-grid>
50
+ </div>
51
+ </el-tab-pane>
52
+ </el-tabs>
53
+ </div>
54
+ </template>
55
+
56
+ <script>
57
+ import editView from './edit.vue';
58
+
59
+ export default {
60
+ name: 'request_setting:list',
61
+ components: {editView},
62
+ data() {
63
+ return {
64
+ activeName: 'second',
65
+ dataId: 0,
66
+ copyId: 0,
67
+ showEdit: false,
68
+ showAdvancedSearch: false,
69
+ vxeOption: {},
70
+ formData: {},
71
+ advancedFormData: {},
72
+ };
73
+ },
74
+ mounted() {
75
+ this.initTableList();
76
+ },
77
+ methods: {
78
+ searchEvent() {
79
+ this.$refs['table-m1'].commitProxy('reload');
80
+ },
81
+ resetEvent() {
82
+ this.formData = {};
83
+ this.advancedFormData = {};
84
+ this.$refs['table-m1'].commitProxy('reload');
85
+ },
86
+ openEditDialog(id) {
87
+ this.copyId = 0;
88
+ this.dataId = !id || typeof id == 'object' ? 0 : id;
89
+ this.activeName = 'first';
90
+ this.$openEditView('showEdit');
91
+ },
92
+ initTableList() {
93
+ let that = this;
94
+ let pushTypeMap = {0: '异步推送', 1: '同步调用'};
95
+ let tableOption = {
96
+ vue: this,
97
+ tableRef: 'table-m1',
98
+ tableName: 'user_requestSetting_list-m1',
99
+ path: USER_PREFIX + '/request_setting/listPage',
100
+ param: () => {
101
+ return {
102
+ ...this.formData,
103
+ ...this.advancedFormData
104
+ }
105
+ },
106
+ columns: [
107
+ {type: 'checkbox', width: 48, resizable: false, fixed: 'left'},
108
+ {
109
+ title: '请求名称',
110
+ field: 'reqName',
111
+ width: 150,
112
+ fixed: 'left'
113
+ },
114
+ {
115
+ title: '请求编码',
116
+ field: 'reqCode',
117
+ width: 150,
118
+ fixed: 'left'
119
+ },
120
+ {
121
+ title: '请求Url',
122
+ field: 'url',
123
+ width: 150
124
+ },
125
+ {
126
+ title: '请求头',
127
+ field: 'header',
128
+ width: 150
129
+ },
130
+ {
131
+ title: '连接超时',
132
+ field: 'connectTimeout',
133
+ width: 150
134
+ },
135
+ {
136
+ title: '读取超时',
137
+ field: 'readTimeout',
138
+ width: 150
139
+ },
140
+ {
141
+ field: 'enabled',
142
+ title: this.$t1('是否启用'),
143
+ width: 150,
144
+ slots: {
145
+ default: ({row}) => {
146
+ if (row.enabled) {
147
+ return [
148
+ <div class="txt-status">
149
+ <span>启用</span>
150
+ </div>
151
+ ];
152
+ } else {
153
+ return [
154
+ <div class="txt-status disable">
155
+ <span>禁用</span>
156
+ </div>
157
+ ];
158
+ }
159
+ }
160
+ }
161
+ },
162
+ {
163
+ title: '备注',
164
+ field: 'remark',
165
+ width: 150
166
+ },
167
+ {
168
+ title: '执行组织编码',
169
+ field: 'exeCompanyCode',
170
+ width: 150
171
+ },
172
+ {
173
+ field: 'enabled',
174
+ title: this.$t1('是否启用'),
175
+ width: 150,
176
+ slots: {
177
+ default: ({row}) => {
178
+ if (row.enabled) {
179
+ return [
180
+ <div class="txt-status">
181
+ <span>启用</span>
182
+ </div>
183
+ ];
184
+ } else {
185
+ return [
186
+ <div class="txt-status disable">
187
+ <span>禁用</span>
188
+ </div>
189
+ ];
190
+ }
191
+ }
192
+ }
193
+ },
194
+ {
195
+ field: 'createBy',
196
+ title: this.$t1('创建人'),
197
+ width: 150
198
+ },
199
+ {
200
+ field: 'createDate',
201
+ title: this.$t1('创建时间'),
202
+ width: 150
203
+ },
204
+ {
205
+ field: 'modifyBy',
206
+ title: this.$t1('更新人'),
207
+ width: 150
208
+ },
209
+ {
210
+ field: 'modifyDate',
211
+ title: this.$t1('更新时间'),
212
+ width: 150
213
+ },
214
+ {
215
+ width: 47,
216
+ fixed: 'right',
217
+ title: '',
218
+ sortable: false,
219
+ slots: {
220
+ default: ({row}) => {
221
+ return [
222
+ <div>
223
+ <a
224
+ href="javascript:void(0);"
225
+ class="a-link"
226
+ onclick={() => {
227
+ this.openEditDialog(row.id);
228
+ }}
229
+ >
230
+ <el-tooltip enterable={false} effect="dark" content={ this.$t1('查看') } placement="top"
231
+ popper-class="tooltip-skin">
232
+ <i class="el-icon-edit"/>
233
+ </el-tooltip>
234
+ </a>
235
+ </div>
236
+ ];
237
+ }
238
+ }
239
+ }
240
+ ]
241
+ };
242
+ this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
243
+ this.vxeOption = opts;
244
+ });
245
+ }
246
+ }
247
+ };
248
+ </script>