search template update

This commit is contained in:
shiyang 2021-04-14 01:08:15 +08:00 committed by medcl
parent e6be0c7534
commit 338d0bd4d9
2 changed files with 11 additions and 1 deletions

View File

@ -19,7 +19,10 @@ export default {
console.log("fetchList response:",res);
if (res.hits) {
let newList = [];
let hits = res.hits.hits;
let hits = res.hits.hits || [];
if (!hits.length) {
return;
}
for (let item of hits) {
item._source.id = item._id;
newList.push(item._source);

View File

@ -76,6 +76,12 @@ const UpdateForm = Form.create()(props => {
onOk={okHandle}
onCancel={() => handleUpdateModalVisible()}
>
<FormItem>
{form.getFieldDecorator('id', {
initialValue: values.id,
})(<Input type="hidden" />)}
</FormItem>
<FormItem labelCol={{ span: 5 }} wrapperCol={{ span: 15 }} label="模板名称">
{form.getFieldDecorator('name', {
initialValue: values.name,
@ -278,6 +284,7 @@ class SearchTemplate extends PureComponent {
type: 'searchTemplate/update',
payload: {
cluster_id: clusterID,
id: fields.id,
name: fields.name,
source: fields.source,
},