Commit e7d4acbf by zhaochengxiang

模型目录增加权重

parent 305e5107
......@@ -553,7 +553,7 @@ const ImportActionTable = (props) => {
},
{
title: '类型',
width: (editingKey!=='')?250:100,
width: (editingKey!=='')?250:150,
dataIndex: 'datatype',
editable: true,
ellipsis: true,
......
import React, { useState, useEffect } from 'react';
import { Modal, Form, Input, Radio } from 'antd';
import { Modal, Form, Input, Radio, InputNumber } from 'antd';
import { dispatchLatest } from '../../../../model';
......@@ -70,6 +70,12 @@ class UpdateTreeItemForm extends React.Component {
>
<Input />
</Form.Item>
<Form.Item
label="权重"
name="weight"
>
<InputNumber min={0} />
</Form.Item>
</Form>
);
}
......@@ -92,9 +98,9 @@ const UpdateTreeItemModal = (props) => {
form.setFields([{ name: 'name', errors: [] }, { name: 'remark', errors: [] }]);
if (type === 'add') {
form.setFieldsValue({ action: _action, name: '', remark: '' });
form.setFieldsValue({ action: _action, name: '', remark: '', weight: 0 });
} else {
form.setFieldsValue({ action: '', name: item?item.name:'', remark: item?item.remark:'' });
form.setFieldsValue({ action: '', name: item?item.name:'', remark: item?item.remark:'', weight: item?item.weight:0 });
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
......@@ -111,13 +117,15 @@ const UpdateTreeItemModal = (props) => {
if (type === 'add' && values.action==='root') {
payload = {
name: values.name||'',
remark: values.remark||'',
remark: values.remark||'',
weight: values.weight||0,
parentId: rootId
};
} else if (type === 'add') {
payload = {
name: values.name||'',
remark: values.remark||'',
weight: values.weight||0,
parentId: item.id
};
} else {
......@@ -125,6 +133,7 @@ const UpdateTreeItemModal = (props) => {
...item,
name: values.name||'',
remark: values.remark||'',
weight: values.weight||0,
}
}
......
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