space_eq.clmt 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <templet>
  2. <version>1.0</version>
  3. <procedure _name="target">
  4. <parameters>
  5. <ref_parameter>
  6. <name>spaceId</name>
  7. <ref>resource/params.spaceId</ref>
  8. </ref_parameter>
  9. <parameter>
  10. <name>group</name>
  11. <description>设备是否按类型分组,缺省false不分组</description>
  12. <type>9</type>
  13. <format></format>
  14. <defaultVal>false</defaultVal>
  15. </parameter>
  16. </parameters>
  17. <elements>
  18. <table_query>
  19. <name>query</name>
  20. <dataSource>poc</dataSource>
  21. <table>device</table>
  22. <fields1>
  23. <bogda_item>
  24. <bogda_item>type</bogda_item>
  25. <bogda_null/>
  26. </bogda_item>
  27. <bogda_item>
  28. <bogda_item>name</bogda_item>
  29. <bogda_null/>
  30. </bogda_item>
  31. <bogda_item>
  32. <bogda_item>position</bogda_item>
  33. <bogda_null/>
  34. </bogda_item>
  35. <bogda_item>
  36. <bogda_item>remark</bogda_item>
  37. <bogda_null/>
  38. </bogda_item>
  39. <bogda_item>
  40. <bogda_item>spaceId</bogda_item>
  41. <bogda_null/>
  42. </bogda_item>
  43. <bogda_item>
  44. <bogda_item>deviceId</bogda_item>
  45. <bogda_null/>
  46. </bogda_item>
  47. </fields1>
  48. <fieldsWhere>
  49. <spaceId>=nvl(spaceId, $disabled)</spaceId>
  50. <state>='1'</state>
  51. </fieldsWhere>
  52. </table_query>
  53. <variable>
  54. <name>eqData</name>
  55. <description>设备类型树</description>
  56. <assignment>clmt('dict/sys_eq', {scopeFilter: false}, 'rtn')</assignment>
  57. </variable>
  58. <logic_grid>
  59. <name>grid</name>
  60. <description>设备分组</description>
  61. <l_grid name="grid">
  62. <rowCount>1</rowCount>
  63. <colCount>8</colCount>
  64. <rows>
  65. <l_row>
  66. <index>0</index>
  67. <props>
  68. <height>98</height>
  69. <filter>=a1!=null</filter>
  70. </props>
  71. </l_row>
  72. </rows>
  73. <columns>
  74. <l_col>
  75. <index>0</index>
  76. </l_col>
  77. <l_col>
  78. <index>1</index>
  79. </l_col>
  80. <l_col>
  81. <index>2</index>
  82. </l_col>
  83. <l_col>
  84. <index>3</index>
  85. </l_col>
  86. <l_col>
  87. <index>4</index>
  88. </l_col>
  89. <l_col>
  90. <index>5</index>
  91. </l_col>
  92. <l_col>
  93. <index>6</index>
  94. </l_col>
  95. <l_col>
  96. <index>7</index>
  97. </l_col>
  98. </columns>
  99. <cells>
  100. <bogda_item>
  101. <l_cell>
  102. <l_replication _name="replication">
  103. <dataBind>=query.group(type)</dataBind>
  104. <dimension>1</dimension>
  105. </l_replication>
  106. <rowIndex>0</rowIndex>
  107. <colIndex>0</colIndex>
  108. <props>
  109. <data>=query.type</data>
  110. <data_id>type</data_id>
  111. </props>
  112. </l_cell>
  113. <l_cell>
  114. <rowIndex>0</rowIndex>
  115. <colIndex>1</colIndex>
  116. <props>
  117. <data>=get(treeNode(eqData, 'code', a1), 'name')</data>
  118. <data_id>typeName</data_id>
  119. </props>
  120. </l_cell>
  121. <l_cell>
  122. <l_replication _name="replication">
  123. <dataBind>=query.list()</dataBind>
  124. <dimension>1</dimension>
  125. </l_replication>
  126. <rowIndex>0</rowIndex>
  127. <colIndex>2</colIndex>
  128. <props>
  129. <data_id>children</data_id>
  130. </props>
  131. </l_cell>
  132. <l_cell>
  133. <rowIndex>0</rowIndex>
  134. <colIndex>3</colIndex>
  135. <props>
  136. <data>=query.deviceId</data>
  137. <data_id>deviceId</data_id>
  138. </props>
  139. </l_cell>
  140. <l_cell>
  141. <rowIndex>0</rowIndex>
  142. <colIndex>4</colIndex>
  143. <props>
  144. <data>=query.name</data>
  145. <data_id>name</data_id>
  146. </props>
  147. </l_cell>
  148. <l_cell>
  149. <rowIndex>0</rowIndex>
  150. <colIndex>5</colIndex>
  151. <props>
  152. <data>=query.position</data>
  153. <data_id>position</data_id>
  154. </props>
  155. </l_cell>
  156. <l_cell>
  157. <rowIndex>0</rowIndex>
  158. <colIndex>6</colIndex>
  159. <props>
  160. <data>=query.remark</data>
  161. <data_id>remark</data_id>
  162. </props>
  163. </l_cell>
  164. <l_cell>
  165. <rowIndex>0</rowIndex>
  166. <colIndex>7</colIndex>
  167. </l_cell>
  168. </bogda_item>
  169. </cells>
  170. </l_grid>
  171. <output>
  172. <grid_out>
  173. <name>data</name>
  174. <content>region(A1,G1)</content>
  175. </grid_out>
  176. </output>
  177. </logic_grid>
  178. </elements>
  179. <output>
  180. <variable>
  181. <comment_id>1</comment_id>
  182. <name>rtn</name>
  183. <assignment>group ? grid.data : query.list()</assignment>
  184. </variable>
  185. </output>
  186. </procedure>
  187. <comments>
  188. <next_id>2</next_id>
  189. <list>
  190. <comment>
  191. <id>0</id>
  192. <items>
  193. <comment_item>
  194. <content>查询空间下的设备(所在关系)</content>
  195. <update_time>2021-6-4 18:12</update_time>
  196. </comment_item>
  197. </items>
  198. </comment>
  199. <comment>
  200. <id>1</id>
  201. <items>
  202. <comment_item>
  203. <content>返回示例
  204. 分组:
  205. {
  206. "rtn": [
  207. {
  208. "type": "SETDHS",
  209. "typeName": "高压开关柜",
  210. "children": [
  211. {
  212. "deviceId": "6dcbd6a1f7904f50bd6d73fe132a5ac3",
  213. "name": "高压开关柜01_1",
  214. "position": "{\"x\":12,\"y\":23}"
  215. }
  216. ]
  217. }
  218. ]
  219. }
  220. 不分租:
  221. {
  222. "rtn": [
  223. {
  224. "type": "SETDHS",
  225. "name": "高压开关柜01_1",
  226. "position": "{\"x\":12,\"y\":23}",
  227. "spaceId": "Sp0002220011f170a7c74f8347589ea9863cfec65fab",
  228. "deviceId": "6dcbd6a1f7904f50bd6d73fe132a5ac3"
  229. }
  230. ]
  231. }</content>
  232. <update_time>2021-6-9 11:55</update_time>
  233. </comment_item>
  234. </items>
  235. </comment>
  236. </list>
  237. </comments>
  238. <comment_id>0</comment_id>
  239. </templet>