Commit d96bc940 by zhaochengxiang

标签增加哪行

parent a9dcad0f
......@@ -8,6 +8,31 @@ import './AddTagModal.less';
const { Option } = Select;
const ClassifySelect = ({ value = '', data = [], onChange, ...restProps }) => {
const onClassifyChange = (value) => {
onChange((value||[]).join(','));
}
return (
<Select
mode="multiple"
value={value?value.split(','):[]}
onChange={onClassifyChange}
allowClear
style={{ width: '100%' }}
>
{
(data?.tagClassifyNodes||[]).map((item, index) => {
return (
<Option key={item.id}>{item.cnName||''}</Option>
);
})
}
</Select>
)
}
const AddTagModal = (props) => {
const { visible, onCancel, id, type, creator } = props;
......@@ -150,12 +175,7 @@ const AddTagModal = (props) => {
const newTagForm = JSON.parse(JSON.stringify(tagForm));
(newTagForm?.targetParameters||[]).forEach(param => {
if (param.selectMode === 'multiSelect') {
param.value = row[param.name].join(',');
} else {
param.value = row[param.name];
}
param.value = row[param.name];
})
setConfirmLoading(true);
......@@ -226,6 +246,7 @@ const AddTagModal = (props) => {
const reset = () => {
setConfirmLoading(false);
form.resetFields();
setStep(0);
setSelectTag(null);
setKeyword('');
......@@ -337,19 +358,9 @@ const AddTagModal = (props) => {
);
} else if (param.selectMode==='multiSelect') {
itemComponent = (
<Select
mode="multiple"
allowClear
style={{ width: '100%' }}
>
{
(param?.tagClassifyNodes||[]).map((item, index) => {
return (
<Option key={item.id}>{item.cnName||''}</Option>
);
})
}
</Select>
<ClassifySelect
data={param}
/>
);
}
......
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