123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <templet>
- <version>1.0</version>
- <procedure _name="target">
- <parameters>
- <ref_parameter>
- <name>spaceId</name>
- <ref>resource/params.spaceId</ref>
- </ref_parameter>
- <parameter>
- <name>group</name>
- <description>设备是否按类型分组,缺省false不分组</description>
- <type>9</type>
- <format></format>
- <defaultVal>false</defaultVal>
- </parameter>
- </parameters>
- <elements>
- <table_query>
- <name>query</name>
- <dataSource>poc</dataSource>
- <table>device</table>
- <fields1>
- <bogda_item>
- <bogda_item>type</bogda_item>
- <bogda_null/>
- </bogda_item>
- <bogda_item>
- <bogda_item>name</bogda_item>
- <bogda_null/>
- </bogda_item>
- <bogda_item>
- <bogda_item>position</bogda_item>
- <bogda_null/>
- </bogda_item>
- <bogda_item>
- <bogda_item>remark</bogda_item>
- <bogda_null/>
- </bogda_item>
- <bogda_item>
- <bogda_item>spaceId</bogda_item>
- <bogda_null/>
- </bogda_item>
- <bogda_item>
- <bogda_item>deviceId</bogda_item>
- <bogda_null/>
- </bogda_item>
- </fields1>
- <fieldsWhere>
- <spaceId>=nvl(spaceId, $disabled)</spaceId>
- <state>='1'</state>
- </fieldsWhere>
- </table_query>
- <variable>
- <name>eqData</name>
- <description>设备类型树</description>
- <assignment>clmt('dict/sys_eq', {scopeFilter: false}, 'rtn')</assignment>
- </variable>
- <logic_grid>
- <name>grid</name>
- <description>设备分组</description>
- <l_grid name="grid">
- <rowCount>1</rowCount>
- <colCount>8</colCount>
- <rows>
- <l_row>
- <index>0</index>
- <props>
- <height>98</height>
- <filter>=a1!=null</filter>
- </props>
- </l_row>
- </rows>
- <columns>
- <l_col>
- <index>0</index>
- </l_col>
- <l_col>
- <index>1</index>
- </l_col>
- <l_col>
- <index>2</index>
- </l_col>
- <l_col>
- <index>3</index>
- </l_col>
- <l_col>
- <index>4</index>
- </l_col>
- <l_col>
- <index>5</index>
- </l_col>
- <l_col>
- <index>6</index>
- </l_col>
- <l_col>
- <index>7</index>
- </l_col>
- </columns>
- <cells>
- <bogda_item>
- <l_cell>
- <l_replication _name="replication">
- <dataBind>=query.group(type)</dataBind>
- <dimension>1</dimension>
- </l_replication>
- <rowIndex>0</rowIndex>
- <colIndex>0</colIndex>
- <props>
- <data>=query.type</data>
- <data_id>type</data_id>
- </props>
- </l_cell>
- <l_cell>
- <rowIndex>0</rowIndex>
- <colIndex>1</colIndex>
- <props>
- <data>=get(treeNode(eqData, 'code', a1), 'name')</data>
- <data_id>typeName</data_id>
- </props>
- </l_cell>
- <l_cell>
- <l_replication _name="replication">
- <dataBind>=query.list()</dataBind>
- <dimension>1</dimension>
- </l_replication>
- <rowIndex>0</rowIndex>
- <colIndex>2</colIndex>
- <props>
- <data_id>children</data_id>
- </props>
- </l_cell>
- <l_cell>
- <rowIndex>0</rowIndex>
- <colIndex>3</colIndex>
- <props>
- <data>=query.deviceId</data>
- <data_id>deviceId</data_id>
- </props>
- </l_cell>
- <l_cell>
- <rowIndex>0</rowIndex>
- <colIndex>4</colIndex>
- <props>
- <data>=query.name</data>
- <data_id>name</data_id>
- </props>
- </l_cell>
- <l_cell>
- <rowIndex>0</rowIndex>
- <colIndex>5</colIndex>
- <props>
- <data>=query.position</data>
- <data_id>position</data_id>
- </props>
- </l_cell>
- <l_cell>
- <rowIndex>0</rowIndex>
- <colIndex>6</colIndex>
- <props>
- <data>=query.remark</data>
- <data_id>remark</data_id>
- </props>
- </l_cell>
- <l_cell>
- <rowIndex>0</rowIndex>
- <colIndex>7</colIndex>
- </l_cell>
- </bogda_item>
- </cells>
- </l_grid>
- <output>
- <grid_out>
- <name>data</name>
- <content>region(A1,G1)</content>
- </grid_out>
- </output>
- </logic_grid>
- </elements>
- <output>
- <variable>
- <comment_id>1</comment_id>
- <name>rtn</name>
- <assignment>group ? grid.data : query.list()</assignment>
- </variable>
- </output>
- </procedure>
- <comments>
- <next_id>2</next_id>
- <list>
- <comment>
- <id>0</id>
- <items>
- <comment_item>
- <content>查询空间下的设备(所在关系)</content>
- <update_time>2021-6-4 18:12</update_time>
- </comment_item>
- </items>
- </comment>
- <comment>
- <id>1</id>
- <items>
- <comment_item>
- <content>返回示例
- 分组:
- {
- "rtn": [
- {
- "type": "SETDHS",
- "typeName": "高压开关柜",
- "children": [
- {
- "deviceId": "6dcbd6a1f7904f50bd6d73fe132a5ac3",
- "name": "高压开关柜01_1",
- "position": "{\"x\":12,\"y\":23}"
- }
- ]
- }
- ]
- }
- 不分租:
- {
- "rtn": [
- {
- "type": "SETDHS",
- "name": "高压开关柜01_1",
- "position": "{\"x\":12,\"y\":23}",
- "spaceId": "Sp0002220011f170a7c74f8347589ea9863cfec65fab",
- "deviceId": "6dcbd6a1f7904f50bd6d73fe132a5ac3"
- }
- ]
- }</content>
- <update_time>2021-6-9 11:55</update_time>
- </comment_item>
- </items>
- </comment>
- </list>
- </comments>
- <comment_id>0</comment_id>
- </templet>
|