Commit a61b03fb authored by 田翔's avatar 田翔

fix: 代码修复

parent 2341bb15
{
"name": "panda-xform",
"version": "5.5.1",
"description": "5.5.1 隐藏显示修复",
"version": "5.5.2",
"description": "5.5.2 增加变量",
"keywords": [
"panda-xform"
],
......
......@@ -109,6 +109,10 @@ const widgetData = {
name: '地址位置',
type: '文本控件',
},
'TextHTML': {
name: '描述控件',
type: '文本控件',
},
'ComboBox': {
name: '下拉框',
type: '选择器控件',
......
......@@ -798,6 +798,38 @@ const textWidgets = [
},
},
},
{
text: '描述控件',
name: '描述控件',
icon: <IconPack.SearchLocation />,
schema: {
title: '',
type: 'string',
widget: 'TextHTML',
placeholder: '',
width: '100%',
labelWidth: 1,
},
setting: {
widget: {
title: '控件类型',
type: 'string',
widget: 'WidgetType',
displayType: 'row',
labelWidth: 75,
},
contentHTML: {
title: '控件内容',
type: 'string',
widget: 'ContentHTML',
},
// styleHTML: {
// title: '控件样式',
// type: 'string',
// widget: 'StyleHTML',
// },
},
},
]
const selectWidgets = [
......
......@@ -11,6 +11,12 @@ const fnList = [
{ label: '是否为工作时间', value: '$fn.isWorkTime()' },
]
const env = [
{ title: '当前节点名称', key: '$env.nodeName' },
{ title: '当前用户ID', key: '$env.userld' },
{ title: '当前用户姓名', key: '$env.userName' },
]
const HiddenCondition = (props) => {
const { value, onChange, addons, disabled } = props
......@@ -28,9 +34,7 @@ const HiddenCondition = (props) => {
{
title: '环境变量',
key: '环境变量',
children: [
{ title: '当前节点名称', key: '$env.nodeName' },
]
children: env
},
{
title: tableNameParent,
......@@ -58,7 +62,7 @@ const HiddenCondition = (props) => {
const onSelect = (prop, treeNode) => {
if (!treeNode.node.children) {
if (['$env.nodeName'].includes(treeNode.node.key)) {
if (env.some(v => v.key === treeNode.node.key)) {
insert(treeNode.node.key)
} else {
insert(`{${treeNode.node.key}}`)
......
import React, { useState, useEffect } from 'react'
import { Input, Modal } from 'antd'
import { Editor, Toolbar } from '@wangeditor/editor-for-react'
import styles from './index.less'
import Drag from '../../../../components/Drag'
const { TextArea } = Input
const uploadFileAPI = `/PandaWorkFlow/WorkFlow/AccountManage/UploaderFiles`;
const downFileAPI = `/PandaWorkFlow/WorkFlow/AccountManage/DownloadFiles`;
const ContentHTML = (props) => {
const { value, onChange, schema } = props
const [visible, setVisible] = useState(false)
const [editor, setEditor] = useState(null)
const inputClick = () => {
setVisible(true)
}
// const editorChange = (editor) => {
// onChange(editor.getHtml())
// }
const onOk = () => {
onChange(editor.getHtml())
setVisible(false)
}
useEffect(() => {
return () => {
if (editor == null) return
editor.destroy()
setEditor(null)
}
}, [editor])
return (
<div>
<TextArea value={value} onClick={() => inputClick()} />
<Drag
title={'控件内容'}
visible={visible}
width={1100}
bodyStyle={{ height: '500px', overflowY: 'auto' }}
onCancel={() => setVisible(false)}
onOk={onOk}
>
<div className={styles.richText}>
<Toolbar
editor={editor}
defaultConfig={{
excludeKeys: ['insertLink', 'group-image', 'group-video', 'codeBlock', 'undo', 'redo', 'fullScreen']
}}
mode="default"
style={{ borderBottom: '1px solid #ccc' }}
/>
<Editor
defaultConfig={{
readOnly: false,
placeholder: '请输入内容',
focus: false,
pasteFilterStyle: true, // 忽略粘贴样式
pasteIgnoreImg: true, // 忽略粘贴的图片
styleWithCSS: false,
zIndex: 500,
MENU_CONF: {
uploadImage: {
customInsert(res, inserFn) {
const formData = new FormData();
formData.append('file', file);
},
server: uploadFileAPI,
}
}
}}
value={value}
onCreated={setEditor}
// onChange={editorChange}
mode="default"
style={{ minHeight: '400px', overflowY: 'hidden' }}
/>
</div>
</Drag>
</div>
)
}
export default ContentHTML
\ No newline at end of file
@import '~antd/es/style/themes/default.less';
@pandaXform-prefix-cls: ~'@{ant-prefix}-pandaXform';
.richText {
border: 1px solid #ccc;
z-index: 100;
&[disabled] {
border: none;
background: #f8fafc;
.w-e-text-container {
background: none;
}
}
}
.RichText {
width: 100%;
height: auto;
min-height: 400px;
position: relative;
display: flex;
flex-direction: column;
border: 1px solid #d9d9d9;
border-radius: 2px;
&[disabled] {
.w-e-text-container {
background: none;
}
border: none;
background: #f8fafc;
.RichTextToolbar {
display: none;
}
}
.loadingWrap {
width: 100%;
height: 100%;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
top: 0;
left: 0;
background-color: rgba(255, 255, 255, 0.8);
}
ol li {
list-style: decimal !important;
}
ul li {
list-style: disc !important;
}
}
.RichTextContainer {
background-color: #fff;
color: #000000d9;
position: relative;
overflow-y: scroll;
flex: 1;
}
.RichTextToolbar {
border-bottom: 1px solid #d9d9d9; // height: 0;
.w-e-toolbar .w-e-menu i {
background-color: transparent!important;
}
}
\ No newline at end of file
import React from 'react'
import { Form } from 'antd'
const StyleHTML = (props) => {
const { value, onChange } = props
return (
<div>
<Form>
<Form.Item label="背景色">
</Form.Item>
<Form.Item label="边距">
</Form.Item>
<Form.Item label="背景色">
</Form.Item>
</Form>
</div>
)
}
export default StyleHTML
\ No newline at end of file
......@@ -3,6 +3,8 @@ import ShowText from './ShowText'
import Formatting from './Formatting'
import DecimalDigits from './DecimalDigits'
import FileTypeSelect from './FileTypeSelect'
import ContentHTML from './ContentHTML'
import StyleHTML from './StyleHTML'
const groupStyle = {
PercentSlider,
......@@ -10,6 +12,8 @@ const groupStyle = {
Formatting,
DecimalDigits,
FileTypeSelect,
ContentHTML,
StyleHTML,
}
export default groupStyle
\ No newline at end of file
......@@ -60,7 +60,6 @@
.RichTextToolbar {
border-bottom: 1px solid #d9d9d9; // height: 0;
// overflow: hidden;
.w-e-toolbar .w-e-menu i {
background-color: transparent!important;
}
......
import React from 'react'
const TextHTML = (props) => {
const { value, onChange, schema } = props
const { contentHTML, styleHTML } = schema
console.log('props', props)
return (
<div style={{ width: '100%', ...styleHTML }}>
<div dangerouslySetInnerHTML={{ __html: contentHTML }}></div>
</div>
)
}
export default TextHTML
\ No newline at end of file
......@@ -4,6 +4,7 @@ import NumberInput from './NumberInput'
import RichText from './RichText'
import Coding from './Coding'
import SearchLocation from './SearchLocation'
import TextHTML from './TextHTML'
const text = {
TextInput,
......@@ -12,6 +13,7 @@ const text = {
RichText,
Coding,
SearchLocation,
TextHTML,
}
export default text
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment