Skip to content

Commit 9a8be90

Browse files
committed
fix: 修复已知bug,版本升级至0.6.0
1 parent 8570702 commit 9a8be90

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "element-pro-crud",
3-
"version": "0.5.5",
3+
"version": "0.6.0",
44
"main": "lib/ProCrud.umd.min.js",
55
"files": [
66
"lib",

packages/form-designer/src/FormDesignerDialog.vue

+5-6
Original file line numberDiff line numberDiff line change
@@ -242,22 +242,21 @@
242242
:value="item.TABLE_NAME"
243243
></el-option>
244244
</el-select>
245-
<el-tooltip title="根据数据库字段初始化,默认一行两列">
246245
<el-button
247246
type="success"
248247
size="small"
249248
style="float: right;margin-top: 10px"
250249
@click="handleGenerateKey(true)"
251250
>自动生成表单</el-button
252251
>
253-
</el-tooltip>
254252
</cus-dialog>
255253
</el-container>
256254
</el-dialog>
257255
</template>
258256

259257
<script>
260258
import SvgIcon from '@/icons/SvgIcon.vue';
259+
import { DML } from '@/types/common';
261260
import Draggable from 'vuedraggable';
262261
import Icon from 'vue-awesome/components/Icon.vue';
263262
import WidgetConfig from './WidgetConfig.vue';
@@ -584,10 +583,10 @@ export default {
584583
let msg;
585584
// 根据对话框状态判断保存或编辑
586585
if (this.dialogStatus === STATUS.CREATE) {
587-
type = this.$PROCRUD.crud.DML.INSERT;
586+
type = DML.INSERT;
588587
msg = '添加成功';
589588
} else {
590-
type = this.$PROCRUD.crud.DML.UPDATE;
589+
type = DML.UPDATE;
591590
msg = '编辑成功';
592591
}
593592
let promise;
@@ -601,7 +600,6 @@ export default {
601600
} else {
602601
promise = this.$PROCRUD.crud(type, 'form', opt);
603602
}
604-
605603
promise
606604
.then(() => {
607605
this.btnSaveIsLoading = false;
@@ -619,7 +617,8 @@ export default {
619617
this.btnSaveIsLoading = false;
620618
});
621619
})
622-
.catch(() => {
620+
.catch((err) => {
621+
console.log(err);
623622
// 数据校验失败
624623
this.btnSaveIsLoading = false;
625624
});

packages/table-designer/src/TableDesignerDialog.vue

+12-5
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,6 @@ export default {
156156
// 默认必须为null用于后期判断是否传入
157157
default: null,
158158
},
159-
// 远程数据方法
160-
remoteFuncs: {
161-
type: Object,
162-
default: () => ({}),
163-
},
164159
},
165160
data() {
166161
return {
@@ -182,6 +177,18 @@ export default {
182177
minColumnWidth: 140,
183178
// 获取表单实体
184179
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+
},
185192
};
186193
},
187194
methods: {

0 commit comments

Comments
 (0)