fix(all): zhst/biz、zhst/meta、zhst/material: 修改 od、修改 boxSelectTree
This commit is contained in:
parent
0f0644495a
commit
59f0924c66
@ -1,5 +1,21 @@
|
|||||||
# @zhst/biz
|
# @zhst/biz
|
||||||
|
|
||||||
|
## 0.21.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- fix: 修改 zhst/meta
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.20.3
|
||||||
|
|
||||||
|
## 0.21.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- zhst/biz、zhst/meta、zhst/material: 修改 od、修改 boxSelectTree
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.20.2
|
||||||
|
|
||||||
## 0.21.3
|
## 0.21.3
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@zhst/biz",
|
"name": "@zhst/biz",
|
||||||
"version": "0.21.3",
|
"version": "0.21.5",
|
||||||
"description": "业务库",
|
"description": "业务库",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"business",
|
"business",
|
||||||
|
@ -223,11 +223,6 @@ const BigImageModal: React.FC<BigImageModalProps, BigModalRef> = forwardRef((pro
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: 页面初始化
|
|
||||||
useEffect(() => {
|
|
||||||
}, [dataSource]);
|
|
||||||
|
|
||||||
// 暴露 ref 实例
|
// 暴露 ref 实例
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
ref,
|
ref,
|
||||||
|
@ -1,15 +1,31 @@
|
|||||||
.zhst-biz-box-select-tree-panel {
|
.zhst-biz-box-select-tree-panel {
|
||||||
padding: 0 16px;
|
|
||||||
|
|
||||||
&-btns-common {
|
&-search {
|
||||||
padding: 4px 8px;
|
display: flex;
|
||||||
|
padding: 0 12px;
|
||||||
|
&-input {
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
&-btns {
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-btns-import {
|
&-btns {
|
||||||
padding: 4px 8px;
|
padding: 6px 12px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
&-common {
|
||||||
|
padding: 4px 8px;
|
||||||
|
}
|
||||||
|
&-import {
|
||||||
|
padding: 4px 8px;
|
||||||
|
}
|
||||||
|
&-divider {
|
||||||
|
margin: 8px 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
&-tree {
|
||||||
&-btns-divider {
|
padding: 6px 0;
|
||||||
margin: 8px 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,102 +128,109 @@ const BoxPanel: FC<BoxPanelProps> = (props) => {
|
|||||||
onTreeCheck={onTreeCheck} // 树check选中事件
|
onTreeCheck={onTreeCheck} // 树check选中事件
|
||||||
onItemDelete={onItemDelete} // 右侧点击删除事件
|
onItemDelete={onItemDelete} // 右侧点击删除事件
|
||||||
/>
|
/>
|
||||||
<Space size={12} direction='vertical' style={{ width: '100%' }}>
|
<div className={classNames(componentName + '-search')}>
|
||||||
<Space size={4} style={{ width: '100%', justifyContent: 'space-between' }} >
|
<Input
|
||||||
<Input size='middle' onChange={(e) => onSearch?.(e)} placeholder='请输入盒子名称' {...searchInputProps} />
|
className={classNames(componentName + '-search-input')}
|
||||||
{customImport || (
|
size='middle'
|
||||||
<>
|
onChange={(e) => onSearch?.(e)}
|
||||||
<Button type="text" onClick={() => onBatch?.() || handleCheckable()} icon={isTreeCheckable ? <SwitcherOutlined /> : <DiffOutlined />} />
|
placeholder='请输入盒子名称'
|
||||||
<Button type="text" onClick={() => onClockClick?.()} icon={<ClockCircleOutlined />} />
|
{...searchInputProps}
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Space>
|
|
||||||
{/* 是否显示操作按钮 */}
|
|
||||||
{showOptions && (
|
|
||||||
<>
|
|
||||||
<Space align='center'>
|
|
||||||
<Button className={classNames(componentName + '-btns-common')} type='text' onClick={() => onImport?.()} icon={<ImportOutlined />} >导入盒子</Button>
|
|
||||||
<Divider className={classNames(componentName + '-btns-divider')} type="vertical" />
|
|
||||||
{onCreate ?
|
|
||||||
(
|
|
||||||
<Button className={classNames(componentName + '-btns-common')} onClick={onCreate} type='text' icon={<FolderAddOutlined />} >新建组</Button>
|
|
||||||
) : (
|
|
||||||
<ModalForm<{
|
|
||||||
name: string
|
|
||||||
boxList?: any[]
|
|
||||||
}>
|
|
||||||
className={classNames(componentName + '-create-modal')}
|
|
||||||
open={onCreate ? false : undefined}
|
|
||||||
formRef={createFormRef}
|
|
||||||
title="新建组"
|
|
||||||
modalProps={{ destroyOnClose: true }}
|
|
||||||
layout='horizontal'
|
|
||||||
labelCol={{ span: 6 }}
|
|
||||||
wrapperCol={{ span: 18 }}
|
|
||||||
trigger={<Button type='text' className={classNames(componentName + '-btns-common')} icon={<FolderAddOutlined />} >新建组</Button>}
|
|
||||||
submitter={{
|
|
||||||
searchConfig: {
|
|
||||||
submitText: '确定',
|
|
||||||
resetText: '取消',
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
onFinish={onCreateSubmit}
|
|
||||||
>
|
|
||||||
<ProFormText
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
max: 20,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: /^[^\s]*$/g,
|
|
||||||
message: '禁止输入空格'
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
fieldProps={{ showCount: true }}
|
|
||||||
width="md"
|
|
||||||
name="name"
|
|
||||||
label="盒子组名称"
|
|
||||||
placeholder="请输入盒子名称"
|
|
||||||
/>
|
|
||||||
<ProFormText
|
|
||||||
width="md"
|
|
||||||
name="boxList"
|
|
||||||
label="盒子选择"
|
|
||||||
fieldProps={{
|
|
||||||
readOnly: true,
|
|
||||||
value: `已选择${createFormRef.current?.getFieldValue('boxList')?.length || 0}个盒子`,
|
|
||||||
suffix: (
|
|
||||||
<Space>
|
|
||||||
<a onClick={() => {
|
|
||||||
createFormRef.current?.setFieldValue('boxList', null)
|
|
||||||
onBoxChoiceReset()
|
|
||||||
}} >恢复默认</a>
|
|
||||||
<a onClick={() => setBoxChoiceOpen(true)}>范围选择</a>
|
|
||||||
</Space>
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ModalForm>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
<Divider className={classNames(componentName + '-btns-divider')} type="vertical" />
|
|
||||||
{/* @ts-ignore */}
|
|
||||||
<Button className={classNames(componentName + '-btns-common')} danger type='text' icon={<CloseCircleOutlined />} disabled={treeProps?.checkedKeys?.length <= 0} onClick={onBoxBatchDelete} >删除</Button>
|
|
||||||
</Space>
|
|
||||||
<Divider style={{ margin: 0 }} />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
{extraBtns}
|
|
||||||
<BoxTree
|
|
||||||
treeCheckable={isTreeCheckable}
|
|
||||||
data={data}
|
|
||||||
onItemSelect={onItemSelect}
|
|
||||||
onItemCheck={onItemCheck}
|
|
||||||
onItemDelete={onBoxDelete}
|
|
||||||
{...treeProps}
|
|
||||||
/>
|
/>
|
||||||
</Space>
|
{customImport || (
|
||||||
|
<div
|
||||||
|
className={classNames(componentName + '-search-btns')}
|
||||||
|
>
|
||||||
|
<Button type="text" onClick={() => onBatch?.() || handleCheckable()} icon={isTreeCheckable ? <SwitcherOutlined /> : <DiffOutlined />} />
|
||||||
|
<Button type="text" onClick={() => onClockClick?.()} icon={<ClockCircleOutlined />} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{/* 是否显示操作按钮 */}
|
||||||
|
{showOptions && (
|
||||||
|
<>
|
||||||
|
<div className={classNames(componentName + '-btns')}>
|
||||||
|
<Button className={classNames(componentName + '-btns-common')} type='text' onClick={() => onImport?.()} icon={<ImportOutlined />} >导入盒子</Button>
|
||||||
|
<Divider className={classNames(componentName + '-btns-divider')} type="vertical" />
|
||||||
|
{onCreate ?
|
||||||
|
(
|
||||||
|
<Button className={classNames(componentName + '-btns-common')} onClick={onCreate} type='text' icon={<FolderAddOutlined />} >新建组</Button>
|
||||||
|
) : (
|
||||||
|
<ModalForm<{
|
||||||
|
name: string
|
||||||
|
boxList?: any[]
|
||||||
|
}>
|
||||||
|
className={classNames(componentName + '-create-modal')}
|
||||||
|
open={onCreate ? false : undefined}
|
||||||
|
formRef={createFormRef}
|
||||||
|
title="新建组"
|
||||||
|
modalProps={{ destroyOnClose: true }}
|
||||||
|
layout='horizontal'
|
||||||
|
labelCol={{ span: 6 }}
|
||||||
|
wrapperCol={{ span: 18 }}
|
||||||
|
trigger={<Button type='text' className={classNames(componentName + '-btns-common')} icon={<FolderAddOutlined />} >新建组</Button>}
|
||||||
|
submitter={{
|
||||||
|
searchConfig: {
|
||||||
|
submitText: '确定',
|
||||||
|
resetText: '取消',
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
onFinish={onCreateSubmit}
|
||||||
|
>
|
||||||
|
<ProFormText
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
max: 20,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /^[^\s]*$/g,
|
||||||
|
message: '禁止输入空格'
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
fieldProps={{ showCount: true }}
|
||||||
|
width="md"
|
||||||
|
name="name"
|
||||||
|
label="盒子组名称"
|
||||||
|
placeholder="请输入盒子名称"
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
width="md"
|
||||||
|
name="boxList"
|
||||||
|
label="盒子选择"
|
||||||
|
fieldProps={{
|
||||||
|
readOnly: true,
|
||||||
|
value: `已选择${createFormRef.current?.getFieldValue('boxList')?.length || 0}个盒子`,
|
||||||
|
suffix: (
|
||||||
|
<Space>
|
||||||
|
<a onClick={() => {
|
||||||
|
createFormRef.current?.setFieldValue('boxList', null)
|
||||||
|
onBoxChoiceReset()
|
||||||
|
}} >恢复默认</a>
|
||||||
|
<a onClick={() => setBoxChoiceOpen(true)}>范围选择</a>
|
||||||
|
</Space>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</ModalForm>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
<Divider className={classNames(componentName + '-btns-divider')} type="vertical" />
|
||||||
|
{/* @ts-ignore */}
|
||||||
|
<Button className={classNames(componentName + '-btns-common')} danger type='text' icon={<CloseCircleOutlined />} disabled={treeProps?.checkedKeys?.length <= 0} onClick={onBoxBatchDelete} >删除</Button>
|
||||||
|
</div>
|
||||||
|
<Divider style={{ margin: 0 }} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{extraBtns}
|
||||||
|
<BoxTree
|
||||||
|
className={classNames(componentName + '-tree')}
|
||||||
|
treeCheckable={isTreeCheckable}
|
||||||
|
data={data}
|
||||||
|
onItemSelect={onItemSelect}
|
||||||
|
onItemCheck={onItemCheck}
|
||||||
|
onItemDelete={onBoxDelete}
|
||||||
|
{...treeProps}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ const demo = () => {
|
|||||||
addonBefore: (
|
addonBefore: (
|
||||||
<Select
|
<Select
|
||||||
value={searchType}
|
value={searchType}
|
||||||
|
dropdownMatchSelectWidth={false}
|
||||||
onChange={_type => {
|
onChange={_type => {
|
||||||
setSearchType(_type)
|
setSearchType(_type)
|
||||||
setSearchVal('')
|
setSearchVal('')
|
||||||
|
@ -1,5 +1,23 @@
|
|||||||
# @zhst/material
|
# @zhst/material
|
||||||
|
|
||||||
|
## 0.17.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- fix: 修改 zhst/meta
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.20.3
|
||||||
|
- @zhst/biz@0.21.5
|
||||||
|
|
||||||
|
## 0.17.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- zhst/biz、zhst/meta、zhst/material: 修改 od、修改 boxSelectTree
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.20.2
|
||||||
|
- @zhst/biz@0.21.4
|
||||||
|
|
||||||
## 0.17.2
|
## 0.17.2
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@zhst/material",
|
"name": "@zhst/material",
|
||||||
"version": "0.17.2",
|
"version": "0.17.4",
|
||||||
"description": "物料库",
|
"description": "物料库",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"business",
|
"business",
|
||||||
|
@ -1,5 +1,21 @@
|
|||||||
# @zhst/utils
|
# @zhst/utils
|
||||||
|
|
||||||
|
## 0.20.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- fix: 修改 zhst/meta
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.20.3
|
||||||
|
|
||||||
|
## 0.20.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- zhst/biz、zhst/meta、zhst/material: 修改 od、修改 boxSelectTree
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.20.2
|
||||||
|
|
||||||
## 0.20.1
|
## 0.20.1
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@zhst/meta",
|
"name": "@zhst/meta",
|
||||||
"version": "0.20.1",
|
"version": "0.20.3",
|
||||||
"description": "原子组件",
|
"description": "原子组件",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"meta",
|
"meta",
|
||||||
|
@ -201,6 +201,7 @@ const CropperImage = forwardRef<CropperImageRefProps, CropperImageProps>((props,
|
|||||||
const { containerData = {}, targetTransform = {} } = viewer
|
const { containerData = {}, targetTransform = {} } = viewer
|
||||||
const imageSize = viewer.getImgSize()
|
const imageSize = viewer.getImgSize()
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
currentFabricRef.current = new fabric.Canvas(
|
currentFabricRef.current = new fabric.Canvas(
|
||||||
canvasRef.current,
|
canvasRef.current,
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user