Skip to content

Commit

Permalink
fix: 修复已知bug,版本升级至0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Dec 20, 2020
1 parent 8570702 commit 9a8be90
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "element-pro-crud",
"version": "0.5.5",
"version": "0.6.0",
"main": "lib/ProCrud.umd.min.js",
"files": [
"lib",
Expand Down
11 changes: 5 additions & 6 deletions packages/form-designer/src/FormDesignerDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -242,22 +242,21 @@
:value="item.TABLE_NAME"
></el-option>
</el-select>
<el-tooltip title="根据数据库字段初始化,默认一行两列">
<el-button
type="success"
size="small"
style="float: right;margin-top: 10px"
@click="handleGenerateKey(true)"
>自动生成表单</el-button
>
</el-tooltip>
</cus-dialog>
</el-container>
</el-dialog>
</template>

<script>
import SvgIcon from '@/icons/SvgIcon.vue';
import { DML } from '@/types/common';
import Draggable from 'vuedraggable';
import Icon from 'vue-awesome/components/Icon.vue';
import WidgetConfig from './WidgetConfig.vue';
Expand Down Expand Up @@ -584,10 +583,10 @@ export default {
let msg;
// 根据对话框状态判断保存或编辑
if (this.dialogStatus === STATUS.CREATE) {
type = this.$PROCRUD.crud.DML.INSERT;
type = DML.INSERT;
msg = '添加成功';
} else {
type = this.$PROCRUD.crud.DML.UPDATE;
type = DML.UPDATE;
msg = '编辑成功';
}
let promise;
Expand All @@ -601,7 +600,6 @@ export default {
} else {
promise = this.$PROCRUD.crud(type, 'form', opt);
}

promise
.then(() => {
this.btnSaveIsLoading = false;
Expand All @@ -619,7 +617,8 @@ export default {
this.btnSaveIsLoading = false;
});
})
.catch(() => {
.catch((err) => {
console.log(err);
// 数据校验失败
this.btnSaveIsLoading = false;
});
Expand Down
17 changes: 12 additions & 5 deletions packages/table-designer/src/TableDesignerDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,6 @@ export default {
// 默认必须为null用于后期判断是否传入
default: null,
},
// 远程数据方法
remoteFuncs: {
type: Object,
default: () => ({}),
},
},
data() {
return {
Expand All @@ -182,6 +177,18 @@ export default {
minColumnWidth: 140,
// 获取表单实体
entity: {},
remoteFuncs: {
getTablesOfDB: (resolve) => {
// 请求表名列表
this.$PROCRUD.getTables().then((res) => {
const options = res.data.map(item => ({
label: item.TABLE_NAME,
value: item.TABLE_NAME,
}));
resolve(options);
});
},
},
};
},
methods: {
Expand Down

0 comments on commit 9a8be90

Please sign in to comment.