Browse Source

物模型修改

master
zhaoy 7 months ago
parent
commit
1c5f53abf5
3 changed files with 25 additions and 9 deletions
  1. +6
    -6
      src/pages/device/productmanage/components/ActionForm.jsx
  2. +18
    -2
      src/pages/device/productmanage/components/CreateAction.jsx
  3. +1
    -1
      src/pages/device/productmanage/components/CreateForm.jsx

+ 6
- 6
src/pages/device/productmanage/components/ActionForm.jsx View File

@@ -84,12 +84,12 @@ const ActionForm = (props) => {
// }
// }
// },
{
title: '排序',
dataIndex: 'sort',
valueType:'digit',
width: '8%',
},
// {
// title: '排序',
// dataIndex: 'sort',
// valueType:'digit',
// width: '8%',
// },
{
title: '操作',
valueType: 'option',


+ 18
- 2
src/pages/device/productmanage/components/CreateAction.jsx View File

@@ -8,8 +8,11 @@ const CreateAction = (props) => {
const [valueType, setValueType] = useState('text');
const [layoutType, setLayoutType] = useState('Form');
const [optionitem,setoptionitem]=useState([])
const [jsontext,setjsontext]=useState('')
const [modalVisit, setModalVisit] = useState(false);
const [shuUpdate, setshuUpdate] = useState(false);
const { TextArea } = Input;
useEffect(() => {
formRef.current?.setFieldsValue(props.values);
if(props.createModalVisible){
@@ -34,6 +37,8 @@ const CreateAction = (props) => {
ary.push({actionValueName:op[t].actionValueName})
}
setoptionitem(ary);
}if(props.values.actionType=="textareaary"){
setjsontext(props.values.actionValue)
}else{
setValueType(props.values.actionType);
setLayoutType('Form');
@@ -130,6 +135,17 @@ const handleChange=(value)=>{
renderFormItem: () => <Input placeholder="输入类型值" disabled />
},
];
case 'textareaary':
return [
{
dataIndex: 'actionValue',
valueType: 'text',
initialValue:jsontext,
renderFormItem: () => <TextArea
placeholder="数据格式:[data1:{value1:'1'},{value2:'2'},data2:{value1:'1'},{value2:'2'}]"
autoSize={{minRows: 10,maxRows: 100}}/>
},
];
default:
return [{
dataIndex: 'actionValue',
@@ -214,9 +230,9 @@ const handleChange=(value)=>{
<Form.Item name="isBatch" label="是否绑定物料" valuePropName="checked">
<Switch checkedChildren="是" unCheckedChildren="否"/>
</Form.Item> */}
<Form.Item name="sort" label="排序">
{/* <Form.Item name="sort" label="排序">
<Input placeholder="请输入排序" />
</Form.Item>
</Form.Item> */}
<Button htmlType="button" style={{float:'right',left:10}} onClick={props.onCancel} >
取消
</Button>


+ 1
- 1
src/pages/device/productmanage/components/CreateForm.jsx View File

@@ -299,7 +299,7 @@ const onChangeboolLabel1=(e)=>{
</Form.Item>
<Form.Item style={{display:displaytxtjson}} name="dataJson" label="数组字符串" rules={[{ required: false }]}>
<TextArea
placeholder="数据格式:[data1:{value1:'1'},value2:'2'},data2:{value1:'1'},value2:'2'}]"
placeholder="数据格式:[data1:{value1:'1'},{value2:'2'},data2:{value1:'1'},{value2:'2'}]"
autoSize={{minRows: 10,maxRows: 100}}/>
</Form.Item>
<Form.Item style={{display:display}} name="readWrite" label="读写类型" rules={[{ required: false }]}>


Loading…
Cancel
Save