space_pipe.clmt 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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>pipe</table>
  22. <fields1>
  23. <bogda_item>
  24. <bogda_item>pipeId</bogda_item>
  25. <bogda_null/>
  26. </bogda_item>
  27. <bogda_item>
  28. <bogda_item>spaceId</bogda_item>
  29. <bogda_null/>
  30. </bogda_item>
  31. <bogda_item>
  32. <bogda_item>type</bogda_item>
  33. <bogda_null/>
  34. </bogda_item>
  35. <bogda_item>
  36. <bogda_item>position</bogda_item>
  37. <bogda_null/>
  38. </bogda_item>
  39. <bogda_item>
  40. <bogda_item>name</bogda_item>
  41. <bogda_null/>
  42. </bogda_item>
  43. <bogda_item>
  44. <bogda_item>remark</bogda_item>
  45. <bogda_null/>
  46. </bogda_item>
  47. </fields1>
  48. <fieldsWhere>
  49. <spaceId>=spaceId</spaceId>
  50. <state>='1'</state>
  51. </fieldsWhere>
  52. </table_query>
  53. <variable>
  54. <name>pipeData</name>
  55. <description>管线类型树</description>
  56. <assignment>clmt('dict/pipe', null, '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. </l_row>
  68. </rows>
  69. <columns>
  70. <l_col>
  71. <index>0</index>
  72. </l_col>
  73. <l_col>
  74. <index>1</index>
  75. </l_col>
  76. <l_col>
  77. <index>2</index>
  78. </l_col>
  79. <l_col>
  80. <index>3</index>
  81. </l_col>
  82. <l_col>
  83. <index>4</index>
  84. </l_col>
  85. <l_col>
  86. <index>5</index>
  87. </l_col>
  88. <l_col>
  89. <index>6</index>
  90. </l_col>
  91. <l_col>
  92. <index>7</index>
  93. </l_col>
  94. </columns>
  95. <cells>
  96. <bogda_item>
  97. <l_cell>
  98. <l_replication _name="replication">
  99. <dataBind>=query.group(type)</dataBind>
  100. <dimension>1</dimension>
  101. </l_replication>
  102. <rowIndex>0</rowIndex>
  103. <colIndex>0</colIndex>
  104. <props>
  105. <data>=query.type</data>
  106. <data_id>type</data_id>
  107. </props>
  108. </l_cell>
  109. <l_cell>
  110. <rowIndex>0</rowIndex>
  111. <colIndex>1</colIndex>
  112. <props>
  113. <data>=get(treeNode(pipeData, 'code', a1), 'name')</data>
  114. <data_id>typeName</data_id>
  115. </props>
  116. </l_cell>
  117. <l_cell>
  118. <l_replication _name="replication">
  119. <dataBind>=query.list()</dataBind>
  120. <dimension>1</dimension>
  121. </l_replication>
  122. <rowIndex>0</rowIndex>
  123. <colIndex>2</colIndex>
  124. <props>
  125. <data_id>children</data_id>
  126. </props>
  127. </l_cell>
  128. <l_cell>
  129. <rowIndex>0</rowIndex>
  130. <colIndex>3</colIndex>
  131. <props>
  132. <data>=query.pipeId</data>
  133. <data_id>pipeId</data_id>
  134. </props>
  135. </l_cell>
  136. <l_cell>
  137. <rowIndex>0</rowIndex>
  138. <colIndex>4</colIndex>
  139. <props>
  140. <data>=query.name</data>
  141. <data_id>name</data_id>
  142. </props>
  143. </l_cell>
  144. <l_cell>
  145. <rowIndex>0</rowIndex>
  146. <colIndex>5</colIndex>
  147. <props>
  148. <data>=query.position</data>
  149. <data_id>position</data_id>
  150. </props>
  151. </l_cell>
  152. <l_cell>
  153. <rowIndex>0</rowIndex>
  154. <colIndex>6</colIndex>
  155. <props>
  156. <data>=query.remark</data>
  157. <data_id>remark</data_id>
  158. </props>
  159. </l_cell>
  160. <l_cell>
  161. <rowIndex>0</rowIndex>
  162. <colIndex>7</colIndex>
  163. </l_cell>
  164. </bogda_item>
  165. </cells>
  166. </l_grid>
  167. <output>
  168. <grid_out>
  169. <name>data</name>
  170. <content>region(A1,G1)</content>
  171. </grid_out>
  172. </output>
  173. </logic_grid>
  174. </elements>
  175. <output>
  176. <variable>
  177. <comment_id>1</comment_id>
  178. <name>rtn</name>
  179. <assignment>group ? grid.data : query.list()</assignment>
  180. </variable>
  181. </output>
  182. </procedure>
  183. <comments>
  184. <next_id>2</next_id>
  185. <list>
  186. <comment>
  187. <id>0</id>
  188. <items>
  189. <comment_item>
  190. <content>查询空间下的管道</content>
  191. <update_time>2021-6-9 15:28</update_time>
  192. </comment_item>
  193. </items>
  194. </comment>
  195. <comment>
  196. <id>1</id>
  197. <items>
  198. <comment_item>
  199. <content>返回数据示例
  200. 分组:
  201. {
  202. "rtn": [
  203. {
  204. "type": "acch_water01",
  205. "typeName": "热水管",
  206. "children": [
  207. {
  208. "pipeId": "5171a317f01c4dd79407e954ff94419f",
  209. "name": "水管11",
  210. "position": "[{\"x\":12,\"y\":23},{\"x\":34,\"y\":45}]"
  211. }
  212. ]
  213. }
  214. ]
  215. }
  216. 不分组:
  217. {
  218. "rtn": [
  219. {
  220. "pipeId": "5171a317f01c4dd79407e954ff94419f",
  221. "spaceId": "Sp0002220011f170a7c74f8347589ea9863cfec65fab",
  222. "type": "acch_water01",
  223. "position": "[{\"x\":12,\"y\":23},{\"x\":34,\"y\":45}]",
  224. "name": "水管11"
  225. }
  226. ]
  227. }</content>
  228. <update_time>2021-6-9 15:46</update_time>
  229. </comment_item>
  230. </items>
  231. </comment>
  232. </list>
  233. </comments>
  234. <comment_id>0</comment_id>
  235. </templet>