零件結構
「零件結構」是「項目清單」元件的預先定義組態。零件結構包含將顯示零件或 CAD 文件與其子代之間的階層關係的結構樹。針對樹中的每個項目,零件結構都會顯示您可以透過組態選擇的屬性。預設屬性為編號、名稱與狀態。
您可以配置零件結構以設定樹的初始展開層級。依預設,初始展開層級設定為 3。使用者可以展開及摺疊樹中的元素。
「零件結構」樹包括縮排,用來以視覺化方式顯示結構層級。您可以透過組態來定義表格中顯示的第一欄。依預設,第一欄為「編號」。
零件結構與項目清單具有相同的匯出功能。匯出的檔案包括將顯示結構中每個項目之數位層級的欄,同時包括顯示結構層級的縮排。
以下是顯示零件結構預先定義組態的範例圖像:
* 
如果檢視結構樹的使用者沒有結構中某個項目的存取權限,則不會顯示該項目,且會顯示下列訊息:「一些項目會隱藏,因為您沒有這些項目的存取權限」。
* 
零件結構只能與項目清單小器具搭配使用,而不適用於項目清單混搭,後者已被取代。
繫結內容 
如需有關繫結零件結構的資訊,請參閱項目清單元件。
* 
針對「零件結構」,輸入繫結內容支援 PTC.ProdMgmt.PartPTC.CADDocumentMgmt.CADDocument 物件類型。
selectedItems 繫結內容的輸出包含具有物件類型 PTC.ProdMgmt.PartStructureItemPTC.CADDocumentMgmt.CADStructure 的項目。
組態內容 
如需有關配置零件結構的資訊,請參閱項目清單元件。此外,下列 JSON 內容為「零件結構」所特有。
如需有關組態結構的詳細資訊,請參閱元件組態結構
如需有關子內容的詳細資訊,請參閱子內容與容器金鑰
內容名稱
描述
內容類型
預設值
必要或選用
defaultExpansionLevel
定義結構樹的初始展開層級。接受將數字 1-9 和 -1 作為輸入。當內容設定為 -1 時,結構樹最初會完全展開,並顯示所有層級。
範例:
{
"defaultExpansionLevel":{
"selectedKey":[
"3"
]
}
}
* 
對於大型結構,設定高於 3 的預設可能會影響初始載入效能。
如果此內容收到無效輸入,預設展開層級為 3。
3
選用
attributes
如需詳細資訊,請參閱項目清單
接受 PTC.ProdMgmt.PartStructureItemPTC.CADDocumentMgmt.CADStructure 物件類型的屬性。
* 
您可以透過設定每個屬性的序數內容來設定欄的順序。序數值為 0 的屬性會顯示為第一欄,序數值為 1 的屬性會顯示為第二欄,依此類推。如需詳細資訊,請參閱使用序數組態內容主題。
依預設,零件結構樹會依第一個屬性排序,即具有最低非負序數值的屬性。
N/A
必要
範例組態 
{
"attributes":{
"inTailoring":true,
"selectedValues":{
"data":[
{
"itemListsData":[
{
"items":[
{
"id":"Part|Number",
"ordinal":0
},
{
"id":"Part|Name",
"ordinal":1
},
{
"id":"Part|State#Display",
"ordinal":2
}
],
"objectType":"PTC.ProdMgmt.PartStructureItem"
},
{
"items":[
{
"id":"CADDocument|Number",
"ordinal":0
},
{
"id":"CADDocument|Name",
"ordinal":1
},
{
"id":"CADDocument|State#Display",
"ordinal":2
}
],
"objectType":"PTC.CADDocumentMgmt.CADStructure"
}
],
"adapter":{
"instanceName":"windchill",
"thingName":"PTC.WCAdapter"
}
}
]
}
},
"defaultExpansionLevel":{
"selectedKey":[
"3"
],
"inTailoring":true
},
"label":{
"value":""
},
"selectionType":{
"selectedKey":"multi"
},
"showExportAction":{
"additionalData":{
"itemListExportDefinition":{
"exportTypes":{
"selected":[
{
"key":"exportToCsv"
},
{
"key":"exportToExcel"
}
]
},
"exportUnFilteredData":{
"value":true
}
}
},
"value":true
},
"waitForInput":{
"value":true
},
"baseConfigurationVersion":{
"value":"nav.3"
},
"implementationConfigurationVersion":{
"value":"nav.1"
}
}
自訂服務 
除組態以外,每個元件還支援延伸其企業邏輯以自訂元件。每個元件的企業邏輯包括物範本中可以進行延伸與取代的置換服務。此元件的置換服務會在下表中詳細說明:
如需每個服務的傳回結果與參數範例,請參閱自訂服務的輸入/輸出範例
名稱
描述
ComputeMessages
計算要顯示在零件結構中的所需訊息。它會接收目前訊息 JSON 與建議訊息 JSON,並傳回包含要顯示在項目清單中之訊息的通知訊息 JSON。
參數:
getItemsResponse (必填) - CCO 格式的 JSON 物件,其中包含從 getItems 服務傳回的項目。
currentMessages (必填) - 包含顯示在使用者介面中的目前通知訊息的 JSON 物件。
suggestedMessages (必填) - 包含一組建議訊息的 JSON 物件。推薦使用建議的訊息。
input (選用) - CCO 格式的 JSON,其中包括結構根節點中項目的輸入 ID。
configuration (選用) - 包含組態的 JSON。
scope (選用) - 表示 getItemsResponse 中資料範圍的 JSON。JSON 物件包含接受值 rootchildscope 索引鍵。與階層式資料相關範例:
{
"scope": "root"
}
返回:包含要顯示在項目清單格點中之訊息的 JSON 物件。範例:
"INFO":{
{
"messages":[
"[[PTC.Nav.ItemList.HiddenItemsBecauseAccessRightMessage]]"
]
}
}
DefHookAttributesTypesInfo
傳回 JSON:包含轉接器資訊的陣列以及零件結構支援的屬性物件類型。
參數:
傳回:JSON 陣列
GetChildren
接收零件或 CAD 文件,並傳回包含該項目子項之 CCO 格式的 JSON,即在階層資料結構中,位於該零件或 CAD 文件以下一個層級的所有項目。傳回的 JSON 包含一般清單形式的子項,而非階層式資料。
參數:
input (選用) - CCO 格式的 JSON,其中包括結構根節點中零件或 CAD 文件的輸入 ID。
configuration (必填) - 包含組態的 JSON。
item (必填) - 包含要傳回其子項之項目的 JSON。
傳回:CCO 格式的 JSON
GetConfigurations
傳回零件結構的可用組態
參數:
傳回:JSON
GetImplementationSettings
傳回零件結構實行的設定資料。實行可以取代此服務,以提供其自己的設定。如需詳細資訊,請參閱針對項目清單啟用 selectedItems 輸入繫結內容主題。
參數:
傳回:JSON 物件
GetItems
傳回在輸入中指定之零件或 CAD 文件的結構。
參數:
input (必要) - CCO 格式的 JSON,其中包括要從後端系統擷取之資料的輸入 ID,以及後端系統的轉接器資訊。
configuration (必要) - 包含從「調整管理員」資源取得之最終合併組態的 JSON。
傳回:CCO 格式的 JSON
GetItemsByExpansionPath
傳回階層結構 CCO,其包含從根節點到所請求項目之路徑上的所有項目,包括所有請求的屬性 itemIdentifierKeys 以及 itemExpansionKeys。階層結構 CCO 包括路徑上的所有同等物件。
selectedItems 繫結內容接收指定未載入項目的輸入時,會呼叫此服務。
參數:
input (選用) - CCO 格式的 JSON,其中包括結構根節點中零件或 CAD 文件的輸入 ID。
configuration (必填) - 包含組態的 JSON。
itemExpansionValues (必填) - JSON 陣列,其中包含請求展開的零件或 CAD 文件的 itemExpansionKeys。陣列值會根據樹中的路徑排序,從根零件或 CAD 文件開始。
傳回:CCO 格式的 JSON
GetStructureSkeleton
以 CCO 格式傳回階層結構的所有層級,其中結構中的每個零件或 CAD 文件都包含 itemIdentifierKeysitemExpansionKeys,如 GetImplementationSettings 服務中所定義。
參數:
input (選用) - CCO 格式的 JSON,其中包括結構根節點中零件或 CAD 文件的輸入 ID。
configuration (必填) - 包含組態的 JSON。
傳回:CCO 格式的 JSON
MapItemToInputObject
將零件或 CAD 文件對應至輸入,之後 GetItems 服務便可使用該輸入。
參數:
input (選用) - CCO 格式的 JSON,其中包括結構根節點中零件或 CAD 文件的輸入 ID。
item (必填) - 包含要對應的零件或 CAD 文件的 JSON。
返回:CCO 格式的 JSON,單一零件或 CAD 文件僅包含 id 屬性。
實行定義 
{
"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": [
{
"itemListsData": [
{
"selectionGroupIds": [
"PSI"
],
"objectType": "PTC.ProdMgmt.PartStructureItem"
},
{
"selectionGroupIds": [
"CS"
],
"objectType": "PTC.CADDocumentMgmt.CADStructure"
}
],
"adapter": {
"instanceName": "windchill",
"thingName": "PTC.WCAdapter"
}
}
],
"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": "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"
}
],
"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": [
{
"itemListsData": [
{
"selectionGroupIds": [
"PSI"
],
"objectType": "PTC.ProdMgmt.PartStructureItem"
},
{
"selectionGroupIds": [
"CS"
],
"objectType": "PTC.CADDocumentMgmt.CADStructure"
}
],
"adapter": {
"instanceName": "windchill",
"thingName": "PTC.WCAdapter"
}
}
],
"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": [
{
"itemListsData": [
{
"selectionGroupIds": [
"PSI"
],
"objectType": "PTC.ProdMgmt.PartStructureItem"
},
{
"selectionGroupIds": [
"CS"
],
"objectType": "PTC.CADDocumentMgmt.CADStructure"
}
],
"adapter": {
"instanceName": "windchill",
"thingName": "PTC.WCAdapter"
}
}
],
"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": {}
},
"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"
}
]
}
這是否有幫助?