[comment]: # translation:outdated

[comment]: # ({3ab1bd41-3322a856})
# 更新

[comment]: # ({/3ab1bd41-3322a856})

[comment]: # ({777f6231-1e60acfc})
### 说明

`object templatescreen.update(object/array templateScreens)`

此方法允许更新现有的聚合图形模板。

[comment]: # ({/777f6231-1e60acfc})

[comment]: # ({ac625d7b-3498b558})
### 参数

`(object/array)`需要更新的聚合图形模板属性。

必须为每个聚合图形模板定义`screenid`属性，所有其他属性为可选项。只有通过的属性会被更新，所有其他属性将保持不变。

除[standard template screen
properties](object#template_screen)之外，该方法接受以下参数。

|参数          类|说明|<|
|-------------------|------|-|
|screenitems|array|用来替换现有内容的聚合[图形项](/zh/manual/api/reference/templatescreen/object)。<br>聚合图形项通过坐标轴更新，因此每个聚合图形项必须定义`x`和`y`属性。|

[comment]: # ({/ac625d7b-3498b558})

[comment]: # ({06ed5719-4dc47ba2})
### 返回值

`(object)`返回一个对象，该对象包含在`screenids`属性中已更新聚合图形模板的ID。

[comment]: # ({/06ed5719-4dc47ba2})

[comment]: # ({392bbd85-b41637d2})
### 范例

[comment]: # ({/392bbd85-b41637d2})

[comment]: # ({b7e08abc-5c75e0d1})
#### 重命名聚合图形模板

将聚合图形模板重命名为"Performance graphs"。

Request 请求:

``` {.java}
{
    "jsonrpc": "2.0",
    "method": "templatescreen.update",
    "params": {
        "screenid": "3",
        "name": "Performance graphs"
    },
    "auth": "038e1d7b1735c6a5436ee9eae095879e",
    "id": 1
}
```

Response 响应:

``` {.java}
{
    "jsonrpc": "2.0",
    "result": {
        "screenids": [
            "3"
        ]
    },
    "id": 1
}
```

[comment]: # ({/b7e08abc-5c75e0d1})

[comment]: # ({90b67b32-9c4d8c39})
### 源码

CTemplateScreen::update()方法可在ui/include/classes/api/services/CTemplateScreen.php中参考。

[comment]: # ({/90b67b32-9c4d8c39})
