tianheng-ui 0.1.62 → 0.1.63
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/lib/tianheng-ui.js +6 -6
- package/package.json +1 -1
- package/packages/FormMaking/GenerateForm.vue +12 -5
- package/packages/FormMaking/WidgetConfig.vue +54 -53
- package/packages/FormMaking/custom/config.js +1 -1
- package/packages/FormMaking/custom/mixins/index.js +1 -2
- package/packages/TableMaking/custom/config.js +1 -1
- package/packages/TableMaking/widgetConfig.vue +28 -24
package/package.json
CHANGED
@@ -285,8 +285,9 @@ export default {
|
|
285
285
|
this.models = Object.assign(this.models, resultData);
|
286
286
|
});
|
287
287
|
},
|
288
|
-
handleButtonSubmit(
|
289
|
-
|
288
|
+
handleButtonSubmit(element) {
|
289
|
+
console.log(element);
|
290
|
+
const api = this.formConfig.config.network[element.options.remoteFunc];
|
290
291
|
if (!api) return this.$message.warning("未知的接口,请检查配置信息");
|
291
292
|
|
292
293
|
let params = {};
|
@@ -318,9 +319,15 @@ export default {
|
|
318
319
|
|
319
320
|
this.$refs.generateForm.validate(valid => {
|
320
321
|
if (!valid) return;
|
321
|
-
|
322
|
-
|
323
|
-
|
322
|
+
element.options.loading = true;
|
323
|
+
this.axios(requestConfig)
|
324
|
+
.then(res => {
|
325
|
+
element.options.loading = false;
|
326
|
+
this.$emit("button-submit", element);
|
327
|
+
})
|
328
|
+
.catch(err => {
|
329
|
+
element.options.loading = false;
|
330
|
+
});
|
324
331
|
});
|
325
332
|
},
|
326
333
|
getData() {
|
@@ -172,45 +172,36 @@
|
|
172
172
|
<el-radio-button label="api">接口导入</el-radio-button>
|
173
173
|
</el-radio-group>
|
174
174
|
</el-form-item>
|
175
|
-
<
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
<el-
|
197
|
-
v-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
clearable
|
202
|
-
filterable
|
175
|
+
<el-form-item
|
176
|
+
v-if="config.fields.type === 'api'"
|
177
|
+
prop="fields.api"
|
178
|
+
required
|
179
|
+
>
|
180
|
+
<el-tooltip
|
181
|
+
slot="label"
|
182
|
+
effect="light"
|
183
|
+
content="使用接口的出参配置可选字段"
|
184
|
+
placement="top"
|
185
|
+
>
|
186
|
+
<span style="color: #409EFF;">字段接口</span>
|
187
|
+
</el-tooltip>
|
188
|
+
<el-select
|
189
|
+
v-model="config.fields.api"
|
190
|
+
style="width:100%"
|
191
|
+
placeholder="请选择"
|
192
|
+
no-data-text="暂无接口,请前往【数据源模块】创建"
|
193
|
+
clearable
|
194
|
+
filterable
|
195
|
+
>
|
196
|
+
<el-option
|
197
|
+
v-for="item in apiOptions"
|
198
|
+
:key="item.id"
|
199
|
+
:label="item.name"
|
200
|
+
:value="item.id"
|
203
201
|
>
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
:label="item.name"
|
208
|
-
:value="item.id"
|
209
|
-
>
|
210
|
-
</el-option>
|
211
|
-
</el-select>
|
212
|
-
</el-form-item>
|
213
|
-
</template>
|
202
|
+
</el-option>
|
203
|
+
</el-select>
|
204
|
+
</el-form-item>
|
214
205
|
<el-form-item label="表单标题" prop="title" required>
|
215
206
|
<el-input
|
216
207
|
v-model="config.title"
|
@@ -221,6 +212,17 @@
|
|
221
212
|
<el-form-item label="表单宽度">
|
222
213
|
<el-input v-model="config.width"></el-input>
|
223
214
|
</el-form-item>
|
215
|
+
<el-form-item>
|
216
|
+
<el-tooltip
|
217
|
+
slot="label"
|
218
|
+
effect="light"
|
219
|
+
content="开启后,选择数据接口会触发 remote-params 回调,用于从服务器查询字段"
|
220
|
+
placement="top"
|
221
|
+
>
|
222
|
+
<span style="color: #409EFF;">远程字段</span>
|
223
|
+
</el-tooltip>
|
224
|
+
<el-switch v-model="config.fields.remote"> </el-switch>
|
225
|
+
</el-form-item>
|
224
226
|
<el-form-item label="组件库">
|
225
227
|
<el-radio-group v-model="config.ui">
|
226
228
|
<el-radio-button label="element">Element</el-radio-button>
|
@@ -248,9 +250,10 @@
|
|
248
250
|
<el-select
|
249
251
|
v-model="config.mounted.api"
|
250
252
|
value-key="id"
|
251
|
-
clearable
|
252
253
|
placeholder="请选择数据方法"
|
253
254
|
no-data-text="暂无接口,请前往【接口模块】创建"
|
255
|
+
clearable
|
256
|
+
filterable
|
254
257
|
>
|
255
258
|
<el-option
|
256
259
|
v-for="item in apiOptions"
|
@@ -588,12 +591,10 @@ export default {
|
|
588
591
|
return;
|
589
592
|
}
|
590
593
|
|
591
|
-
const initParams = (paramsList, pAlias
|
594
|
+
const initParams = (paramsList, pAlias) => {
|
592
595
|
paramsList.forEach(item => {
|
593
|
-
|
594
|
-
|
595
|
-
item.align = "left";
|
596
|
-
}
|
596
|
+
item.elType = "input";
|
597
|
+
item.align = "left";
|
597
598
|
item.pAlias = pAlias ? `${pAlias}.${item.alias}` : item.alias;
|
598
599
|
if (item.children && item.children.length) {
|
599
600
|
initParams(item.children, item.pAlias);
|
@@ -605,25 +606,25 @@ export default {
|
|
605
606
|
const callback = res => {
|
606
607
|
api.inParams = deepClone(res.inParams);
|
607
608
|
api.outParams = deepClone(res.outParams);
|
608
|
-
initParams(api.inParams
|
609
|
-
initParams(api.outParams
|
609
|
+
initParams(api.inParams);
|
610
|
+
initParams(api.outParams);
|
610
611
|
|
611
612
|
if (isFields) {
|
612
613
|
this.fieldsData.inParams = deepClone(res.inParams || []);
|
613
|
-
initParams(this.fieldsData.inParams
|
614
|
+
initParams(this.fieldsData.inParams);
|
614
615
|
this.fieldsData.outParams = deepClone(res.outParams || []);
|
615
|
-
initParams(this.fieldsData.outParams
|
616
|
+
initParams(this.fieldsData.outParams);
|
616
617
|
}
|
617
618
|
};
|
618
619
|
this.$emit("remote-params", apiId, callback);
|
619
|
-
} else {
|
620
|
-
initParams(api.inParams
|
621
|
-
initParams(api.outParams
|
620
|
+
} else if (api.inParams) {
|
621
|
+
initParams(api.inParams);
|
622
|
+
initParams(api.outParams);
|
622
623
|
if (isFields) {
|
623
624
|
this.fieldsData.inParams = deepClone(api.inParams || []);
|
624
|
-
initParams(this.fieldsData.inParams
|
625
|
+
initParams(this.fieldsData.inParams);
|
625
626
|
this.fieldsData.outParams = deepClone(api.outParams || []);
|
626
|
-
initParams(this.fieldsData.outParams
|
627
|
+
initParams(this.fieldsData.outParams);
|
627
628
|
}
|
628
629
|
}
|
629
630
|
},
|
@@ -75,17 +75,6 @@
|
|
75
75
|
<el-radio-button label="api">接口导入</el-radio-button>
|
76
76
|
</el-radio-group>
|
77
77
|
</el-form-item>
|
78
|
-
<el-form-item>
|
79
|
-
<el-tooltip
|
80
|
-
slot="label"
|
81
|
-
effect="light"
|
82
|
-
content="开启后,列表接口值修改,会触发 remote-params 回调,用于从服务器查询字段"
|
83
|
-
placement="top"
|
84
|
-
>
|
85
|
-
<span style="color: #409EFF;">远程字段</span>
|
86
|
-
</el-tooltip>
|
87
|
-
<el-switch v-model="config.table.fields.remote"> </el-switch>
|
88
|
-
</el-form-item>
|
89
78
|
<el-form-item required prop="table.mounted.api">
|
90
79
|
<el-tooltip
|
91
80
|
slot="label"
|
@@ -119,6 +108,17 @@
|
|
119
108
|
placeholder="请输入"
|
120
109
|
></el-input>
|
121
110
|
</el-form-item>
|
111
|
+
<el-form-item>
|
112
|
+
<el-tooltip
|
113
|
+
slot="label"
|
114
|
+
effect="light"
|
115
|
+
content="开启后,选择数据接口会触发 remote-params 回调,用于从服务器查询字段"
|
116
|
+
placement="top"
|
117
|
+
>
|
118
|
+
<span style="color: #409EFF;">远程字段</span>
|
119
|
+
</el-tooltip>
|
120
|
+
<el-switch v-model="config.table.fields.remote"> </el-switch>
|
121
|
+
</el-form-item>
|
122
122
|
<el-form-item label="列表序号">
|
123
123
|
<el-switch v-model="config.table.sequence"> </el-switch>
|
124
124
|
</el-form-item>
|
@@ -175,10 +175,16 @@
|
|
175
175
|
</el-radio-group>
|
176
176
|
</el-form-item>
|
177
177
|
<el-form-item label="分页参数">
|
178
|
-
<el-input
|
178
|
+
<el-input
|
179
|
+
placeholder="请输入"
|
180
|
+
v-model="config.table.pageInfo.options.currentPageName"
|
181
|
+
>
|
179
182
|
<template slot="prepend">页码</template>
|
180
183
|
</el-input>
|
181
|
-
<el-input
|
184
|
+
<el-input
|
185
|
+
placeholder="请输入"
|
186
|
+
v-model="config.table.pageInfo.options.pageSizeName"
|
187
|
+
>
|
182
188
|
<template slot="prepend">条数</template>
|
183
189
|
</el-input>
|
184
190
|
</el-form-item>
|
@@ -817,12 +823,10 @@ export default {
|
|
817
823
|
return;
|
818
824
|
}
|
819
825
|
|
820
|
-
const initParams = (paramsList, pAlias
|
826
|
+
const initParams = (paramsList, pAlias) => {
|
821
827
|
paramsList.forEach(item => {
|
822
|
-
|
823
|
-
|
824
|
-
item.align = "left";
|
825
|
-
}
|
828
|
+
item.elType = "input";
|
829
|
+
item.align = "left";
|
826
830
|
item.pAlias = pAlias ? `${pAlias}.${item.alias}` : item.alias;
|
827
831
|
if (item.children && item.children.length) {
|
828
832
|
initParams(item.children, item.pAlias);
|
@@ -834,13 +838,13 @@ export default {
|
|
834
838
|
const callback = res => {
|
835
839
|
api.inParams = deepClone(res.inParams);
|
836
840
|
api.outParams = deepClone(res.outParams);
|
837
|
-
initParams(api.inParams
|
838
|
-
initParams(api.outParams
|
841
|
+
initParams(api.inParams);
|
842
|
+
initParams(api.outParams);
|
839
843
|
if (isFields) {
|
840
844
|
this.fieldsData.inParams = deepClone(res.inParams || []);
|
841
|
-
initParams(this.fieldsData.inParams
|
845
|
+
initParams(this.fieldsData.inParams);
|
842
846
|
this.fieldsData.outParams = deepClone(res.outParams || []);
|
843
|
-
initParams(this.fieldsData.outParams
|
847
|
+
initParams(this.fieldsData.outParams);
|
844
848
|
}
|
845
849
|
};
|
846
850
|
this.$emit("remote-params", apiId, callback);
|
@@ -849,9 +853,9 @@ export default {
|
|
849
853
|
initParams(api.outParams, null, false);
|
850
854
|
if (isFields) {
|
851
855
|
this.fieldsData.inParams = deepClone(api.inParams || []);
|
852
|
-
initParams(this.fieldsData.inParams
|
856
|
+
initParams(this.fieldsData.inParams);
|
853
857
|
this.fieldsData.outParams = deepClone(api.outParams || []);
|
854
|
-
initParams(this.fieldsData.outParams
|
858
|
+
initParams(this.fieldsData.outParams);
|
855
859
|
}
|
856
860
|
}
|
857
861
|
},
|