File tree 3 files changed +18
-12
lines changed
3 files changed +18
-12
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " element-pro-crud" ,
3
- "version" : " 0.5.5 " ,
3
+ "version" : " 0.6.0 " ,
4
4
"main" : " lib/ProCrud.umd.min.js" ,
5
5
"files" : [
6
6
" lib" ,
Original file line number Diff line number Diff line change 242
242
:value="item.TABLE_NAME"
243
243
></el-option>
244
244
</el-select>
245
- <el-tooltip title="根据数据库字段初始化,默认一行两列">
246
245
<el-button
247
246
type="success"
248
247
size="small"
249
248
style="float: right;margin-top: 10px"
250
249
@click="handleGenerateKey(true)"
251
250
>自动生成表单</el-button
252
251
>
253
- </el-tooltip>
254
252
</cus-dialog>
255
253
</el-container>
256
254
</el-dialog>
257
255
</template>
258
256
259
257
<script>
260
258
import SvgIcon from '@/icons/SvgIcon.vue';
259
+ import { DML } from '@/types/common';
261
260
import Draggable from 'vuedraggable';
262
261
import Icon from 'vue-awesome/components/Icon.vue';
263
262
import WidgetConfig from './WidgetConfig.vue';
@@ -584,10 +583,10 @@ export default {
584
583
let msg;
585
584
// 根据对话框状态判断保存或编辑
586
585
if (this.dialogStatus === STATUS.CREATE) {
587
- type = this.$PROCRUD.crud. DML.INSERT;
586
+ type = DML.INSERT;
588
587
msg = '添加成功';
589
588
} else {
590
- type = this.$PROCRUD.crud. DML.UPDATE;
589
+ type = DML.UPDATE;
591
590
msg = '编辑成功';
592
591
}
593
592
let promise;
@@ -601,7 +600,6 @@ export default {
601
600
} else {
602
601
promise = this.$PROCRUD.crud(type, 'form', opt);
603
602
}
604
-
605
603
promise
606
604
.then(() => {
607
605
this.btnSaveIsLoading = false;
@@ -619,7 +617,8 @@ export default {
619
617
this.btnSaveIsLoading = false;
620
618
});
621
619
})
622
- .catch(() => {
620
+ .catch((err) => {
621
+ console.log(err);
623
622
// 数据校验失败
624
623
this.btnSaveIsLoading = false;
625
624
});
Original file line number Diff line number Diff line change @@ -156,11 +156,6 @@ export default {
156
156
// 默认必须为null用于后期判断是否传入
157
157
default: null,
158
158
},
159
- // 远程数据方法
160
- remoteFuncs: {
161
- type: Object,
162
- default: () => ({}),
163
- },
164
159
},
165
160
data() {
166
161
return {
@@ -182,6 +177,18 @@ export default {
182
177
minColumnWidth: 140,
183
178
// 获取表单实体
184
179
entity: {},
180
+ remoteFuncs: {
181
+ getTablesOfDB: (resolve) => {
182
+ // 请求表名列表
183
+ this.$PROCRUD.getTables().then((res) => {
184
+ const options = res.data.map(item => ({
185
+ label: item.TABLE_NAME,
186
+ value: item.TABLE_NAME,
187
+ }));
188
+ resolve(options);
189
+ });
190
+ },
191
+ },
185
192
};
186
193
},
187
194
methods: {
You can’t perform that action at this time.
0 commit comments