Skip to content

Commit

Permalink
fix: 修复 useFs返回值里面没有context的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Sep 3, 2023
1 parent 699f432 commit b88fea7
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
17 changes: 17 additions & 0 deletions packages/fast-crud/src/components/crud/fs-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,23 @@ export default defineComponent({
.fs-form-invalid {
}
.fs-form-item-component {
.ant-picker,
.ant-input-number,
.el-cascader,
.el-date-editor,
.el-input-number {
width: 100%;
}
.el-date-editor .el-range__icon {
margin-left: 10px;
}
.el-date-editor .el-range__close-icon {
margin-right: 10px;
}
}
//.el-date-editor.el-input__wrapper {
// width: 100%;
//}
Expand Down
14 changes: 14 additions & 0 deletions packages/fast-crud/src/components/search/layout-default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,20 @@ export default defineComponent({
&:first-child {
// margin-left: 0;
}
.ant-input-number,
.ant-picker,
.el-input-number,
.el-cascader,
.el-date-editor {
width: 100%;
}
.el-date-editor .el-range__icon {
margin-left: 10px;
}
.el-date-editor .el-range__close-icon {
margin-right: 10px;
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion packages/fast-crud/src/use/use-crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ export type UseFsRet = {
crudRef: Ref;
crudBinding: Ref<CrudBinding>;
crudExpose: CrudExpose;
context: UseFsContext;
} & UseCrudRet &
CreateCrudOptionsRet;

Expand Down Expand Up @@ -510,7 +511,8 @@ function useFsImpl(props: UseFsProps): UseFsRet | Promise<UseCrudRet> {
...useCrudRet,
crudRef,
crudExpose,
crudBinding
crudBinding,
context
};
}

Expand Down
5 changes: 4 additions & 1 deletion packages/ui/ui-antdv/src/antdv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,10 @@ export class Antdv implements UiInterface {
vLoading: false,
scrollTo(req: TableScrollReq) {
try {
req.fsTableRef.vnode.el.querySelector(".ant-table-body").scrollTop = req.top;
const body = req.fsTableRef.vnode.el.querySelector(".ant-table-body");
if (body) {
body.scrollTop = req.top;
}
} catch (e) {
console.error("scroll to top error:", e);
}
Expand Down
5 changes: 4 additions & 1 deletion packages/ui/ui-antdv4/src/antdv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,10 @@ export class Antdv implements UiInterface {
vLoading: false,
scrollTo(req: TableScrollReq) {
try {
req.fsTableRef.vnode.el.querySelector(".ant-table-body").scrollTop = req.top;
const body = req.fsTableRef.vnode.el.querySelector(".ant-table-body");
if (body) {
body.scrollTop = req.top;
}
} catch (e) {
console.error("scroll to top error:", e);
}
Expand Down

0 comments on commit b88fea7

Please sign in to comment.