绘图
“绘图”是“项列表”组件的预定义配置,用于显示部件和 CAD 文档的 CAD 绘图列表。“绘图”具有与“项列表”类似的搜索、排序、筛选和恢复默认值等功能。对于每个绘图,“绘图”都会显示可通过配置进行选取的属性。默认属性为“名称”、“格式”、“版本”和“上次修改时间”,其中“名称”和“格式”是绘图的自定义属性。“名称”包含用于下载绘图的链接,而“格式”则包含可供下载的其他格式的下拉菜单。
下面是两个示例图像,其中显示了“绘图”的预定义配置:
“查看绘图”任务中“绘图”组件的截屏
“查看绘图”任务中“绘图”组件的截屏 - 显示展开的可用格式下拉菜单
绑定属性 
有关绑定“绘图”的信息,请参阅项列表组件。
* 
对于“绘图”,输入绑定属性支持 PTC.CADDocumentMgmt.CADDocumentPTC.ProdMgmt.Part 对象类型。
selectedItems 绑定属性的输出中包含具有 PTC.CADDocumentMgmt.CADDocument 对象类型的项。
配置属性 
有关配置“绘图”的信息,请参阅项列表组件。此外,下列 JSON 属性是特定于“绘图”的。
有关详细信息,请参阅组件配置结构
有关子属性的详细信息,请参阅子属性和容器键
属性名称
说明
属性类型
默认值
必需或可选
getDrawingOptions
用于控制:检索文件的类型。选项:
allFiles- 检索部件或 CAD 文档的所有绘图文件
lastModifiedFileOnly- 仅检索部件或 CAD 文档的最新修改的绘图文件
此配置属性位于组件配置中 implementationConfiguration 属性的下方。
allFiles
必需
getDrawingFormats
用于控制:“格式”列的下拉菜单中检索和显示的文件格式。选项:
specifiedFormatsOnly- 仅检索指定的文件格式;使用 specifiedFormatsDefinition 属性可指定要包括的文件格式。文件格式在下拉菜单中的显示顺序与 specifiedFormatsDefinition 属性中的顺序相同。
allAvailableFormats- 检索所有可用的文件格式。如果绘图具有 PDF 格式,则“名称”列包含用于下载 PDF 的链接,而且 PDF 是下拉菜单中的第一个格式。
* 
如果绘图只有一种文件格式,则该格式会显示在“名称”列下。该绘图的“格式”列为空白。
此配置属性位于组件配置中 implementationConfiguration 属性的下方。
specifiedFormatsOnly
必需
specifiedFormatsDefinition
要检索的指定格式的列表。格式之间以空格分隔。此处列出的格式顺序指定了“格式”列的下拉菜单中的格式显示顺序。
这是 getDrawingFormats 的子属性,仅在 getDrawingFormats 设置为 specifiedFormatsOnly 时才相关。其容器键为 implementationConfiguration
PDF DXF PLT CGM
必需
attributes
有关详细信息,请参阅项列表
接受 PTC.CADDocumentMgmt.CADDocument 对象类型的属性。
此外,还接受具有 PTC.CADDocumentMgmt.CADDocument.Custom.Implementation 对象类型的 NameFormats 属性。
不适用
必需
defaultSortField
有关详细信息,请参阅项列表
接受 PTC.CADDocumentMgmt.CADDocumentPTC.CADDocumentMgmt.CADDocument.Custom.Implementation 对象类型的属性。
不适用
可选
配置示例 
{
"drawing": {
"configuration": {
"attributes": {
"selectedValues": {
"data": [{
"itemListsData": [{
"items": [{
"id": "LastModified",
"ordinal": 2
}, {
"id": "Version",
"ordinal": 3
}
],
"objectType": "PTC.CADDocumentMgmt.CADDocument"
}, {
"items": [{
"id": "Name",
"ordinal": 0
}, {
"id": "Formats",
"ordinal": 1
}
],
"objectType": "PTC.CADDocumentMgmt.CADDocument.Custom.Implementation"
}
],
"adapter": {
"instanceName": "windchill",
"thingName": "PTC.WCAdapter"
}
}
]
}
},
"label": {
"value": ""
},
"defaultSortFields": {
"selectedValues": {
"data": [{
"itemListsData": [{
"items": [{
"additionalData": {
"itemListDefaultSortFieldDefinition": {
"defaultSortDirection": {
"selectedKey": "asc"
}
}
},
"id": "Name"
}
],
"objectType": "PTC.CADDocumentMgmt.CADDocument.Custom.Implementation"
}
],
"adapter": {
"instanceName": "windchill",
"thingName": "PTC.WCAdapter"
}
}
]
}
},
"enableSearch": {
"additionalData": {
"itemListSearchDefinition": {
"searchHintText": {
"value": "[[PTC.Nav.Drawings.FindDrawing]]"
}
}
},
"value": true
},
"implementationConfiguration": {
"value": {
"getDrawingOptions": {
"selectedKey": "allFiles"
},
"getDrawingFormats": {
"additionalData": {
"specifiedFormatsDefinition": {
"specifiedFormats": {
"value": "PDF DXF PLT CGM"
}
}
},
"selectedKey": "specifiedFormatsOnly"
}
}
},
"selectionType": {
"selectedKey": "none"
},
"showExportAction": {
"value": false
},
"waitForInput": {
"value": true
},
"baseConfigurationVersion": {
"value": "nav.2"
},
"implementationConfigurationVersion": {
"value": "nav.1"
}
},
"label": "[[PTC.Nav.Drawings.ConfigurationLabel]]"
}
}
自定义服务 
除配置外,每个组件还支持通过扩展其业务逻辑来自定义组件。每个组件的业务逻辑在事物模板中都包含可改写服务,您可以对这些服务进行扩展和改写。下表对此组件的可改写服务进行了详细说明。
有关每个服务的返回值和参数的示例,请参阅自定义服务的输入/输出示例
名称
说明
GetConfigurations
返回“绘图”的可用配置。
参数:
返回:JSON
GetItems
返回后端系统中绘图的列表及其属性和值。
参数:
input (必需) - CCO 格式的 JSON,其中包含要从后端系统获取的数据的输入 ID,以及后端系统的适配器信息。
configuration (必需) - JSON,其中包含从“定制管理器”资源获得的最终合并配置。
返回:CCO 格式的 JSON
DefHookImplementationConfigurationDefinitionGroup
返回“绘图”实施定义,其中包含可用的自定义配置。包括 getDrawingOptionsgetDrawingFormats 配置属性的定义。
参数:
返回:JSON:Array
实施定义 
{
"array": [
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"directDefinition": [
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Textbox"
},
"mandatory": false,
"key": "actionBarConfigurationJSON"
}
]
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.DefinitionGroup"
},
"mandatory": false,
"key": "actionBarConfiguration"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"additionalDefinition": [
{
"directDefinition": [
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Textbox"
},
"mandatory": false,
"key": "fieldTitleOverride"
}
],
"key": "itemListAttributesDefinition"
},
{
"directDefinition": [],
"key": "implementationAttributesDefinition"
}
],
"updateServiceName": "",
"minimumSelectedAttributes": null,
"supportedTypes": {
"data": [],
"allowSubsetForTailoring": false
},
"addServiceName": "",
"maximumSelectedAttributes": null
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.AttributesSelector"
},
"mandatory": true,
"key": "attributes"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"options": [
{
"label": "1",
"key": "1"
},
{
"label": "2",
"key": "2"
},
{
"label": "3",
"key": "3"
},
{
"label": "4",
"key": "4"
},
{
"label": "5",
"key": "5"
},
{
"label": "6",
"key": "6"
},
{
"label": "7",
"key": "7"
},
{
"label": "8",
"key": "8"
},
{
"label": "9",
"key": "9"
},
{
"label": "-1",
"key": "-1"
}
],
"updateServiceName": null,
"addServiceName": null
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Dropdown"
},
"mandatory": false,
"key": "defaultExpansionLevel"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"additionalDefinition": [
{
"directDefinition": [
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"options": [
{
"description": "Sort column in ascending order",
"label": "[[PTC.Nav.ItemList.SortOrder.Asc]]",
"key": "asc"
},
{
"description": "Sort column in descending order",
"label": "[[PTC.Nav.ItemList.SortOrder.Dsc]]",
"key": "dsc"
}
],
"updateServiceName": null,
"addServiceName": null
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.RadioButton"
},
"mandatory": false,
"key": "defaultSortDirection"
}
],
"key": "itemListDefaultSortFieldDefinition"
}
],
"updateServiceName": "",
"minimumSelectedAttributes": null,
"supportedTypes": {
"data": [],
"allowSubsetForTailoring": false
},
"addServiceName": "",
"maximumSelectedAttributes": null
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.AttributesSelector"
},
"mandatory": false,
"key": "defaultSortFields"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"default": true,
"true": {
"additionalDefinition": [
{
"directDefinition": [
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Textbox"
},
"mandatory": false,
"key": "searchHintText"
}
],
"key": "itemListSearchDefinition"
}
],
"label": "[[PTC.Nav.Yes]]"
},
"false": {
"additionalDefinition": [],
"label": "[[PTC.Nav.No]]"
}
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Toggle"
},
"mandatory": false,
"key": "enableSearch"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"additionalDefinition": [
{
"directDefinition": [
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"dynamicallySetTypeServiceName": "GetFilterTypeDefinitionForFilterField",
"type": {
"enum": {
"options": [],
"updateServiceName": null,
"dynamicallySetOptionsServiceName": null,
"addServiceName": null,
"multiSelect": null
}
}
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.FieldFilter"
},
"mandatory": false,
"key": "defaultSelectedFilterValues"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Textbox"
},
"mandatory": false,
"key": "filterLabelOverride"
}
],
"key": "itemListFilterFieldDefinition"
}
],
"updateServiceName": "",
"minimumSelectedAttributes": 0,
"supportedTypes": {
"data": [],
"allowSubsetForTailoring": false
},
"addServiceName": "",
"maximumSelectedAttributes": 1
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.AttributesSelector"
},
"mandatory": false,
"key": "filterFields"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"directDefinition": [
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"options": [],
"updateServiceName": null,
"addServiceName": null
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.RadioButton"
},
"mandatory": false,
"key": "getDrawingFormats"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"options": [],
"updateServiceName": null,
"addServiceName": null
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.RadioButton"
},
"mandatory": false,
"key": "getDrawingOptions"
}
]
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.DefinitionGroup"
},
"mandatory": false,
"key": "implementationConfiguration"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Textbox"
},
"mandatory": false,
"key": "label"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"minValue": 50,
"default": 500,
"maxValue": 10000,
"step": 50
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Number"
},
"mandatory": false,
"key": "maxNumberOfRowsInGrid"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"options": [
{
"description": "Disallow items selection",
"label": "[[PTC.Nav.ItemList.SelectionType.None]]",
"key": "none"
},
{
"description": "Allow single item selection",
"label": "[[PTC.Nav.ItemList.SelectionType.Single]]",
"key": "single"
},
{
"description": "Allow multiple items selection",
"label": "[[PTC.Nav.ItemList.SelectionType.Multiple]]",
"key": "multi"
}
],
"updateServiceName": null,
"addServiceName": null
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.RadioButton"
},
"mandatory": false,
"key": "selectionType"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"default": true,
"true": {
"additionalDefinition": [
{
"directDefinition": [
{
"property": {
"options": [
[
{
"label": "[[PTC.Nav.ItemList.ExportCSVActionLabel]]",
"key": "exportToCsv"
},
{
"label": "[[PTC.Nav.ItemList.ExportCSVAsExcelActionLabel]]",
"key": "exportToExcel"
}
]
]
},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"default": "",
"overflow": null,
"minimumSelectedItems": null,
"options": [],
"updateServiceName": null,
"addServiceName": null,
"constraints": {}
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.CheckboxArray"
},
"mandatory": false,
"key": "exportTypes"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"default": false,
"true": {
"additionalDefinition": [],
"label": null
},
"false": {
"additionalDefinition": [],
"label": null
}
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Toggle"
},
"mandatory": false,
"key": "exportUnFilteredData"
}
],
"key": "itemListExportDefinition"
}
],
"label": "[[PTC.Nav.Yes]]"
},
"false": {
"additionalDefinition": [],
"label": "[[PTC.Nav.No]]"
}
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Toggle"
},
"mandatory": false,
"key": "showExportAction"
},
{
"property": {},
"value": {
"initializationData": {
"version": "1.0.0",
"constraints": {},
"properties": {
"default": false,
"true": {
"additionalDefinition": [],
"label": "[[PTC.Nav.Yes]]"
},
"false": {
"additionalDefinition": [],
"label": "[[PTC.Nav.No]]"
}
}
},
"elementVersion": "1.0.0",
"elementName": "PTC.Nav.DynamicForm.Toggle"
},
"mandatory": false,
"key": "waitForInput"
}
]
}
这对您有帮助吗?