说明.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  1. <!--<script src="http://192.168.1.70:8500/static/panel/jquery.min.js" type="text/javascript"></script>-->
  2. <!-- 通讯协议标准
  3. 头:sn+ch 如: A0000001v_xx_1
  4. v_xx_1 : 值
  5. v_xx_1-img : 对应图片
  6. v_xx_1-color : 对应颜色
  7. v_xx_1-bimg : 对应图片
  8. v_xx_1-bcolor : 对应颜色
  9. -->
  10. <!-- 自动表单
  11. 数据类型:
  12. sn: 选择设备
  13. snlist: 选择设备(多选) |分割
  14. tab:基于 sn 通道选择
  15. text:文字(多行)
  16. str:文本
  17. int:整数
  18. folat:小数
  19. img:图片
  20. font:字体
  21. imglist:图片列表 .png|.png|.png|.png|.png|.png|
  22. color:颜色
  23. pane:面板
  24. 定义变量:
  25. !命名规则: 只准许 【小写字母 数值】 不能出现 任何特殊符号,
  26. !隐藏表单: 在动态变量名 前面加_ 如: _sn_sn
  27. !提示标题: 在动态变量名 后面加_提示内容 如: w_int_宽度
  28. sn_sn (动态变量名)_(数据类型)
  29. sn_sn="xxx" //设备 SN
  30. tab_tab="xxx"
  31. text1_text="xxx"
  32. img1_img="xxx"
  33. img1_imglist=".png|.png|.png|.png|.png|.png|"
  34. text1_textlist="text1|text2|text3|text4|text5|text6|"
  35. {"sn_sn":"866222050911984","tab_tab":"v_do_2","text1_text":"替换的文本"}
  36. 变量:
  37. [{动态变量名}] 如:[{tab}]
  38. 层全局变量:
  39. [-{sn}-]
  40. 公共变量:
  41. [{ID}]
  42. [{USER_UUID}] 当期用户 UUID
  43. 订阅:
  44. sn/tab 如:866222050911984/v_do
  45. -->
  46. <!--data {"sn_sn":"866222050911984","tab_tab":"v_do_1","text1_text":"替换的文本"} data-->
  47. <div >
  48. <span>这里是 [{text1}]<span id="xxxxx[{ID}]">xxx</span></span>
  49. <script>
  50. // 这里要加延时
  51. setTimeout(function(){
  52. // 订阅
  53. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  54. console.log(`收到2:${T_value}`);
  55. $("#xxxxx[{ID}]").html(T_value)
  56. })
  57. },2000);
  58. </script>
  59. </div>
  60. <!--文字-->
  61. <!--data {"text_text_替换内容":"替换的文本","color_color_字体颜色":"","size_int_字体大小":"20","font_font":"123"} data-->
  62. <div >
  63. <style> @font-face{ font-family:font_[{ID}]; src: url('123') }</style>
  64. <span id="text[{ID}]" style="font-family: font_[{ID}];font-size: [{size}]px;color: [{color}];">[{text}]</span>
  65. </div>
  66. <!--图片-->
  67. <!--data {"url_img":"https://standardoss.baozhida.cn/UpImage/76d52805-4540-4589-9f60-ece1cfd51a41.png"} data-->
  68. <div>
  69. <img src="[{url}]" width="100%" height="100%">
  70. </div>
  71. <!--背景图片-->
  72. <!--data {"url_img":"https://standardoss.baozhida.cn/UpImage/1652941123f122d0c4-8bd9-476c-a110-425e882a64d4.svg"} data-->
  73. <div style="background: rgba(0, 0, 0, 0) url('[{url}]') repeat scroll 0% 0%;width: 100%;height: 100%">
  74. <div></div>
  75. </div>
  76. <!--data {} data-->
  77. <div >
  78. </div>
  79. <!--面板页面-->
  80. <!--data {"pane_pane":"","url_img":"https://standardoss.baozhida.cn/UpImage/1655261167cba53203-8326-49ea-82d7-5563ead17bc0.png"} data-->
  81. <div>
  82. <img src="[{url}]" onclick="window.location.href="../../Panel/Index?T_viewid=[{pane}]';" width="100%" height="100%">
  83. </div>
  84. <!--图片组[数据]-->
  85. <!--data {"sn_sn":"866222050911984","tab_tab":"v_do_1","img1_imglist":"https://standardoss.baozhida.cn/UpImage/93784cea-5cc7-433f-849d-991a6e56e979.png|"} data-->
  86. <div >
  87. <img id="img[{ID}]" src="https://standardoss.baozhida.cn/UpImage/76d52805-4540-4589-9f60-ece1cfd51a41.png" width="100%" height="100%">
  88. <script>
  89. v[{ID}]img_str = "[{img1}]"
  90. v[{ID}]img_list = v[{ID}]img_str.split("|")
  91. $("#img[{ID}]").attr("src",v[{ID}]img_list[0])
  92. // 这里要加延时
  93. setTimeout(function(){
  94. // 订阅
  95. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  96. console.log(`收到:${T_value}`);
  97. $("#img[{ID}]").attr("src",v[{ID}]img_list[parseInt(T_value)])
  98. })
  99. },2000);
  100. </script>
  101. </div>
  102. <!--文字组[数据]-->
  103. <!--data {"sn_sn":"866222050911984","tab_tab":"v_do_1","text1_textlist":"等待|"} data-->
  104. <div >
  105. <span id="text[{ID}]">xxx</span>
  106. <script>
  107. v[{ID}]text_str = "[{text1}]"
  108. v[{ID}]text_list = v[{ID}]text_str.split("|")
  109. $("#text[{ID}]").html(v[{ID}]text_list[0])
  110. // 这里要加延时
  111. setTimeout(function(){
  112. // 订阅
  113. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  114. console.log(`收到:${T_value}`);
  115. $("#text[{ID}]").html(v[{ID}]text_list[parseInt(T_value)])
  116. })
  117. },2000);
  118. </script>
  119. </div>
  120. <!--文字[获取设备名称]-->
  121. <!--data {"sn_sn":"[-{sn}-]","color_color_字体颜色":"","size_int_字体大小":"20","font_font":""} data-->
  122. <div style="padding-top: 4px;">
  123. <style> @font-face{ font-family:font_[{ID}]; src: url('[{font}]') }</style>
  124. <span id="text[{ID}]" style="font-family: font_[{ID}];font-size: [{size}]px;color: [{color}];">设备名称</span>
  125. <script>
  126. $("#text[{ID}]").html("")
  127. // 这里要加延时
  128. setTimeout(function(){
  129. // 订阅
  130. pubSub.subscribe('[{sn}]/Device_name', T_value => {
  131. console.log(`收到:${T_value}`);
  132. $("#text[{ID}]").html(T_value)
  133. })
  134. },2000);
  135. </script>
  136. </div>
  137. <!--数值[数据]-->
  138. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"n_temp_2","color_color_字体颜色":"","size_int_字体大小":"20","font_font":"https://standardoss.baozhida.cn/shumaguan.ttf"} data-->
  139. <div style="padding-top: 4px;">
  140. <style> @font-face{ font-family:font_[{ID}]; src: url('[{font}]') }</style>
  141. <span id="text[{ID}]" style="font-family: font_[{ID}];font-size: [{size}]px;color: [{color}];">xxx</span>
  142. <script>
  143. $("#text[{ID}]").html("")
  144. // 这里要加延时
  145. setTimeout(function(){
  146. // 订阅
  147. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  148. console.log(`收到:${T_value}`);
  149. $("#text[{ID}]").html(T_value)
  150. })
  151. },2000);
  152. </script>
  153. </div>
  154. <!--触发开关[数据]-->
  155. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"v_do_1","img1_imglist":"https://standardoss.baozhida.cn/UpImage/300f1259-e12f-46a9-b9df-4021104e29ea.png|https://standardoss.baozhida.cn/UpImage/f52edbf2-7f87-4340-a6b8-e280bc7aae06.png|"} data-->
  156. <div >
  157. <img id="switch[{ID}]" onclick="f_switch[{ID}]_on()" style="user-select: auto;" src="https://standardoss.baozhida.cn/UpImage/f52edbf2-7f87-4340-a6b8-e280bc7aae06.png" width="100%" height="100%">
  158. <script>
  159. v[{ID}]img_str = "[{img1}]"
  160. v[{ID}]img_list = v[{ID}]img_str.split("|")
  161. v[{ID}]value = 1
  162. $("#img[{ID}]").attr("src",v[{ID}]img_list[0])
  163. if(Public_Value_map.has('[{sn}]/[{tab}]')){ //判断映射是否存在
  164. v[{ID}]value = parseInt(Public_Value_map.get('[{sn}]/[{tab}]'))
  165. f_switch[{ID}]_show()
  166. }
  167. // 这里要加延时
  168. setTimeout(function(){
  169. // 订阅
  170. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  171. console.log(`收到:${T_value}`);
  172. v[{ID}]value = parseInt(T_value)
  173. f_switch[{ID}]_show()
  174. })
  175. },2000);
  176. function f_switch[{ID}]_on() {
  177. console.log("v[{ID}]value:",v[{ID}]value)
  178. if(v[{ID}]value == 0){
  179. v[{ID}]value = 1
  180. f_Data_Write("switch[{ID}]","[{sn}]","[{tab}]",v[{ID}]value)
  181. }else{
  182. v[{ID}]value = 0
  183. f_Data_Write("switch[{ID}]","[{sn}]","[{tab}]",v[{ID}]value)
  184. }
  185. }
  186. function f_switch[{ID}]_show() {
  187. $("#switch[{ID}]").attr("src",v[{ID}]img_list[v[{ID}]value])
  188. }
  189. </script>
  190. </div>
  191. <!--触发开关(提示版)[数据]-->
  192. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"v_do_1","img1_imglist":"https://standardoss.baozhida.cn/UpImage/300f1259-e12f-46a9-b9df-4021104e29ea.png|https://standardoss.baozhida.cn/UpImage/f52edbf2-7f87-4340-a6b8-e280bc7aae06.png|"} data-->
  193. <div >
  194. <img id="switch[{ID}]" onclick="f_switch[{ID}]_on()" style="user-select: auto;" src="https://standardoss.baozhida.cn/UpImage/f52edbf2-7f87-4340-a6b8-e280bc7aae06.png" width="100%" height="100%">
  195. <div style=""> </div>
  196. <script>
  197. v[{ID}]img_str = "[{img1}]"
  198. v[{ID}]img_list = v[{ID}]img_str.split("|")
  199. v[{ID}]value = 1
  200. $("#img[{ID}]").attr("src",v[{ID}]img_list[0])
  201. if(Public_Value_map.has('[{sn}]/[{tab}]')){ //判断映射是否存在
  202. v[{ID}]value = parseInt(Public_Value_map.get('[{sn}]/[{tab}]'))
  203. f_switch[{ID}]_show()
  204. }
  205. // 这里要加延时
  206. setTimeout(function(){
  207. // 订阅
  208. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  209. console.log(`收到:${T_value}`);
  210. v[{ID}]value = parseInt(T_value)
  211. f_switch[{ID}]_show()
  212. })
  213. },2000);
  214. function f_switch[{ID}]_on() {
  215. $("body").append('<div id="switch[{ID}]_Tips" style="padding: 10px;text-align: center;user-select: none;position: absolute;left: '+$("#switch[{ID}]").offset().left+'px;top: '+$("#switch[{ID}]").offset().top+'px;z-index: 999999999999999;width: 142px;height: 100px;background-color:rgba(238,238,238,0.62);border-radius: 5px;">' +
  216. '<h3>确定操作</h3>' +
  217. '<button style="border-color: #1E9FFF;background-color: #1E9FFF;color: #fff;height: 28px;line-height: 28px;margin: 0 6px;padding: 0 15px;border: 1px solid #dedede;" ' +
  218. ' onclick="f_switch[{ID}]_yes()">确定</button>' +
  219. '<button style="border-color: #FF1E1E;background-color: #FF1E1E;color: #fff;height: 28px;line-height: 28px;margin: 0 6px;padding: 0 15px;border: 1px solid #dedede;"' +
  220. ' onclick="f_switch[{ID}]_no()">取消</button>' +
  221. '</div>')
  222. }
  223. function f_switch[{ID}]_yes() {
  224. console.log("v[{ID}]value:",v[{ID}]value)
  225. if(v[{ID}]value == 0){
  226. v[{ID}]value = 1
  227. f_Data_Write("switch[{ID}]","[{sn}]","[{tab}]",v[{ID}]value)
  228. }else{
  229. v[{ID}]value = 0
  230. f_Data_Write("switch[{ID}]","[{sn}]","[{tab}]",v[{ID}]value)
  231. }
  232. $("#switch[{ID}]_Tips").remove()
  233. }
  234. function f_switch[{ID}]_no() {
  235. $("#switch[{ID}]_Tips").remove()
  236. }
  237. function f_switch[{ID}]_show() {
  238. $("#switch[{ID}]").attr("src",v[{ID}]img_list[v[{ID}]value])
  239. }
  240. </script>
  241. </div>
  242. <!--触发模式[数据]-->
  243. <!--data {"sn_sn":"866222050911984","tab_tab":"v_do_1","img1_imglist":"https://standardoss.baozhida.cn/UpImage/c14655ce-e357-44c0-b1a7-8d57df82593a.png|"} data-->
  244. <div >
  245. <img id="mode[{ID}]" onclick="f_mode[{ID}]_on()" style="user-select: auto;" src="https://standardoss.baozhida.cn/UpImage/c14655ce-e357-44c0-b1a7-8d57df82593a.png" width="100%" height="100%">
  246. <script>
  247. v[{ID}]img_str = "[{img1}]"
  248. v[{ID}]img_list = v[{ID}]img_str.split("|")
  249. v[{ID}]value = 0
  250. $("#img[{ID}]").attr("src",v[{ID}]img_list[0])
  251. if(Public_Value_map.has('[{sn}]/[{tab}]')){ //判断映射是否存在
  252. v[{ID}]value = parseInt(Public_Value_map.get('[{sn}]/[{tab}]'))
  253. f_mode[{ID}]_show()
  254. }
  255. // 这里要加延时
  256. setTimeout(function(){
  257. // 订阅
  258. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  259. console.log(`收到:${T_value}`);
  260. v[{ID}]value = parseInt(T_value)
  261. f_mode[{ID}]_show()
  262. })
  263. },2000);
  264. function f_mode[{ID}]_on() {
  265. console.log("v[{ID}]value:",v[{ID}]value)
  266. console.log("v[{ID}]img_list.length:",v[{ID}]img_list.length)
  267. if(v[{ID}]img_list.length < v[{ID}]value+1){
  268. v[{ID}]value = 0
  269. f_Data_Write("mode[{ID}]","[{sn}]","[{tab}]",v[{ID}]value)
  270. return;
  271. }
  272. if(v[{ID}]img_list[v[{ID}]value+1].length <= 3){
  273. v[{ID}]value = 0
  274. f_Data_Write("mode[{ID}]","[{sn}]","[{tab}]",v[{ID}]value)
  275. return;
  276. }
  277. v[{ID}]value += 1
  278. f_Data_Write("mode[{ID}]","[{sn}]","[{tab}]",v[{ID}]value)
  279. }
  280. function f_mode[{ID}]_show() {
  281. $("#mode[{ID}]").attr("src",v[{ID}]img_list[v[{ID}]value])
  282. }
  283. </script>
  284. </div>
  285. <!-- 数值加减 -->
  286. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"v_do_1","max_int":"100","min_int":"0"} data-->
  287. <div >
  288. <link rel="stylesheet" href="[{OSS_Static}]/panel/lib/NumBox/Panel_number-box.css">
  289. <div id="Panel_on_number_[{ID}]" class="Panel_number-box">
  290. <input type="button" class="Panel_on-number" onclick="Panel_number[{ID}]_on(this)" value="-" data-v="-1">
  291. <input id="Panel_on_number_[{ID}]_v" type="text" value="0" >
  292. <input type="button" class="Panel_on-number" onclick="Panel_number[{ID}]_on(this)" value="+" data-v="1">
  293. </div>
  294. <script>
  295. // 这里要加延时
  296. setTimeout(function(){
  297. // 订阅
  298. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  299. console.log(`收到:${T_value}`);
  300. $("#Panel_on_number_[{ID}]_v").val(parseInt(T_value))
  301. })
  302. },2000);
  303. function Panel_number[{ID}]_on(this_) {
  304. var $val = $(this_).siblings("input[type='text']"),val = parseInt($val.val(), 10) + parseInt($(this_).data("v"));
  305. V_num = isNaN(val) ? 0 : val
  306. if([{max}] < V_num ){
  307. V_num = [{max}]
  308. }
  309. if([{min}] > V_num ){
  310. V_num = [{min}]
  311. }
  312. $val.val(V_num);
  313. f_Data_Write("Panel_on_number_[{ID}]","[{sn}]","[{tab}]",V_num)
  314. };
  315. </script>
  316. </div>
  317. <!--数值[数据]-->
  318. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"n_temp_2","color_color_字体颜色":"","size_int_字体大小":"20","font_font":"https://standardoss.baozhida.cn/shumaguan.ttf"} data-->
  319. <div style="padding-top: 4px;">
  320. </div>
  321. <!-- 弹窗-数值加减 -->
  322. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"v_do_1","max_int_最高温度":"100","min_int_最低温度":"0","color_color_字体颜色":"","size_int_字体大小":"20","font_font":"https://standardoss.baozhida.cn/shumaguan.ttf"} data-->
  323. <div >
  324. <link rel="stylesheet" href="[{OSS_Static}]/panel/lib/NumBox/Panel_number-box.css">
  325. <style> @font-face{ font-family:font_[{ID}]; src: url('[{font}]') }</style>
  326. <span id="text[{ID}]" style="font-family: font_[{ID}];font-size: [{size}]px;color: [{color}];" onclick="f_open_control_[{ID}]_on()">xxx</span>
  327. <script>
  328. $("#text[{ID}]").html("")
  329. var T_value_[{ID}]_v = 0
  330. // 这里要加延时
  331. setTimeout(function(){
  332. // 订阅
  333. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  334. console.log(`收到:${T_value}`);
  335. $("#text[{ID}]").html(T_value)
  336. T_value_[{ID}]_v = parseInt(T_value)
  337. })
  338. },2000);
  339. function Panel_number[{ID}]_on(this_) {
  340. var $val = $(this_).siblings("input[type='text']"),val = parseInt($val.val(), 10) + parseInt($(this_).data("v"));
  341. V_num = isNaN(val) ? 0 : val
  342. if([{max}] < V_num ){
  343. V_num = [{max}]
  344. }
  345. if([{min}] > V_num ){
  346. V_num = [{min}]
  347. }
  348. $val.val(V_num);
  349. };
  350. function f_button_[{ID}]_on() {
  351. f_Data_Write("Panel_on_number_[{ID}]_v","[{sn}]","[{tab}]",$("#Panel_on_number_[{ID}]_v").val())
  352. layer.close(layer_[{ID}]_id)
  353. }
  354. var layer_[{ID}]_id
  355. layer_[{ID}]_html = "<div id=\"open_control_[{ID}]\" style=\"width: 200px;height: 150px;text-align: center\">\n" +
  356. " <div class=\"Panel_number-box\" style=\"width: 132px;margin-top: 30px\">\n" +
  357. " <input type=\"button\" class=\"Panel_on-number\" onclick=\"Panel_number[{ID}]_on(this)\" value=\"-\" data-v=\"-1\">\n" +
  358. " <input id=\"Panel_on_number_[{ID}]_v\" type=\"text\" value=\""+T_value_[{ID}]_v+"\" >\n" +
  359. " <input type=\"button\" class=\"Panel_on-number\" onclick=\"Panel_number[{ID}]_on(this)\" value=\"+\" data-v=\"1\">\n" +
  360. " </div>\n" +
  361. " <div style=\"width: 132px;margin-top: 30px;margin: 10px auto\">\n" +
  362. " <button onclick=\"f_button_[{ID}]_on()\" style=\"height: 28px;margin-top: 10px;line-height: 28px;border: 1px solid transparent;padding: 0 18px;background-color: #1E9FFF;color: #fff;white-space: nowrap;text-align: center;font-size: 12px;border-radius: 2px;cursor: pointer;\">确定</button>\n" +
  363. " </div>\n" +
  364. " </div> <script>\n" +
  365. " $(\"#Panel_on_number_[{ID}]_v\").val(parseInt(T_value_[{ID}]_v))\n" +" <\/script>"
  366. function f_open_control_[{ID}]_on() {
  367. layer_[{ID}]_id = layer.open({
  368. title: '设置',
  369. type: 1,
  370. fix: false, //不固定
  371. maxmin: false,
  372. content: layer_[{ID}]_html,
  373. shadeClose:true,
  374. anim: 1,
  375. isOutAnim: false,
  376. Boolean:false,
  377. success: function (layero, index) {
  378. },
  379. end: function () {
  380. }
  381. });
  382. }
  383. </script>
  384. </div>
  385. <!-- 设备设置 -->
  386. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"v_do_1","url_img":"https://standardoss.baozhida.cn/UpImage/d78f68bf-a06c-45ce-9eab-a45b1ce3dec7.png"} data-->
  387. <div>
  388. <img src="[{url}]" width="100%" height="100%" onclick="f_open_control_[{ID}]_on()">
  389. <script>
  390. function f_open_control_[{ID}]_on() {
  391. tab = "[{tab}]".split("_")
  392. layer.open({
  393. title: "设备参数配置",
  394. type: 2,
  395. area: ['500px', '630px'],
  396. fix: false, //不固定
  397. maxmin: false,
  398. content: "../../DeviceCh/DeviceChParameter_Html?T_sn=[{sn}]&T_tab="+tab[0]+"_"+tab[1]+"&T_ch="+tab[2],
  399. shadeClose:true,
  400. anim: 1,
  401. isOutAnim: false,
  402. });
  403. }
  404. </script>
  405. </div>
  406. <!-- 折线图-牵引格栅 -->
  407. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"v_temp_1","max_int_最大值":"0","min_int_最小值":"0"} data-->
  408. <div>
  409. <div style="width: 100%">
  410. <svg id="chart-[{ID}]" viewBox="0 0 80 40">
  411. </svg>
  412. </div>
  413. <link rel="stylesheet" href="[{OSS_Static}]/panel/lib/modernizr/css/drawGridStyle.css" media="screen" type="text/css" />
  414. <script src='[{OSS_Static}]/panel/jquery.min.js'></script>
  415. <script src='[{OSS_Static}]/panel/lib/modernizr/js/snap.svg-min.js'></script>
  416. <script src="[{OSS_Static}]/panel/lib/modernizr/js/drawGrid.js"></script>
  417. <script>
  418. var chart_[{ID}]_list = [
  419. 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0,1,
  420. ];
  421. $.ajax({
  422. type: 'POST',
  423. url: '../../Data/Data_List',//发送请求
  424. data: {
  425. T_sn: '[{sn}]',
  426. T_tab: "[{tab}]",
  427. page: 1,
  428. page_z: chart_[{ID}]_list.length,
  429. },
  430. success: function (result) {
  431. console.log(result)
  432. if (result.Code == 200) {
  433. if(result.Data.List == null){
  434. return
  435. }
  436. for (var i = 0; i < result.Data.List.length; i++){
  437. T_value = parseFloat(result.Data.List[i].T_value)
  438. chart_[{ID}]_list.shift();
  439. chart_[{ID}]_list.push(T_value)
  440. }
  441. }
  442. }
  443. });
  444. drawGrid('#chart-[{ID}]');
  445. drawLineGraph('#chart-[{ID}]', chart_[{ID}]_list, 1);
  446. // 这里要加延时
  447. setTimeout(function(){
  448. // 订阅
  449. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  450. console.log(`收到:${T_value}`);
  451. chart_[{ID}]_list.shift();
  452. chart_[{ID}]_list.push(parseFloat(T_value))
  453. if(Math.abs(Math.max.apply(Math,chart_[{ID}]_list) - Math.min.apply(Math,chart_[{ID}]_list)) > 0 ){
  454. drawGrid('#chart-[{ID}]');
  455. drawLineGraph('#chart-[{ID}]', chart_[{ID}]_list, 1,[{max}],[{min}]);
  456. }
  457. })
  458. },2000);
  459. </script>
  460. </div>
  461. <!-- 折线图-牵引格栅-时间 -->
  462. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"v_temp_1","time_int_间隔时间s":"2","max_int_最大值":"0","min_int_最小值":"0"} data-->
  463. <div>
  464. <div style="width: 100%">
  465. <svg id="chart-[{ID}]" viewBox="0 0 80 40">
  466. </svg>
  467. </div>
  468. <link rel="stylesheet" href="[{OSS_Static}]/panel/lib/modernizr/css/drawGridStyle.css" media="screen" type="text/css" />
  469. <script src='[{OSS_Static}]/panel/jquery.min.js'></script>
  470. <script src='[{OSS_Static}]/panel/lib/modernizr/js/snap.svg-min.js'></script>
  471. <script src="[{OSS_Static}]/panel/lib/modernizr/js/drawGrid.js"></script>
  472. <script>
  473. var chart_[{ID}]_list = [
  474. 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0,1,
  475. ];
  476. var chart_[{ID}]_v = 0
  477. $.ajax({
  478. type: 'POST',
  479. url: '../../Data/Data_List',//发送请求
  480. data: {
  481. T_sn: '[{sn}]',
  482. T_tab: "[{tab}]",
  483. page: 1,
  484. page_z: chart_[{ID}]_list.length,
  485. },
  486. success: function (result) {
  487. console.log(result)
  488. if (result.Code == 200) {
  489. if(result.Data.List == null){
  490. return
  491. }
  492. for (var i = 0; i < result.Data.List.length; i++){
  493. T_value = parseFloat(result.Data.List[i].T_value)
  494. chart_[{ID}]_list.shift();
  495. chart_[{ID}]_list.push(T_value)
  496. chart_[{ID}]_v = T_value
  497. }
  498. }
  499. }
  500. });
  501. drawGrid('#chart-[{ID}]');
  502. drawLineGraph('#chart-[{ID}]', chart_[{ID}]_list, 1);
  503. // 这里要加延时
  504. setTimeout(function(){
  505. // 订阅
  506. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  507. console.log(`收到:${T_value}`);
  508. chart_[{ID}]_v = T_value
  509. })
  510. },2000);
  511. setInterval(function(){
  512. chart_[{ID}]_list.shift();
  513. chart_[{ID}]_list.push(parseFloat(chart_[{ID}]_v))
  514. if(Math.abs(Math.max.apply(Math,chart_[{ID}]_list) - Math.min.apply(Math,chart_[{ID}]_list)) > 0 ){
  515. drawGrid('#chart-[{ID}]');
  516. drawLineGraph('#chart-[{ID}]', chart_[{ID}]_list, 1,[{max}],[{min}]);
  517. }
  518. },[{time}] * 1000);
  519. </script>
  520. </div>
  521. <!-- 柱状图-水位 -->
  522. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"n_temp_2","width_int_宽度":"200","height_int_高度":"300","color_color":"skyblue","formula_str_公式":"T_value"} data-->
  523. <div>
  524. <div class="tank waterTankHere[{ID}]"></div>
  525. <script src="[{OSS_Static}]/panel/jquery.min.js" type="text/javascript"></script>
  526. <script src="[{OSS_Static}]/panel/lib/Poolhistogram/js/waterTank.js"></script>
  527. <script>
  528. $('.waterTankHere[{ID}]').waterTank({
  529. width: [{width}],
  530. height: [{height}],
  531. color: '[{color}]',
  532. level: 100
  533. })
  534. // 这里要加延时
  535. setTimeout(function(){
  536. // 订阅
  537. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  538. console.log(`收到:${T_value}`);
  539. T_value = parseInt(T_value)
  540. $('.waterTankHere[{ID}]').waterTank([{formula}]);
  541. })
  542. },2000);
  543. </script>
  544. </div>
  545. <!-- 弹窗-数值加减 -->
  546. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"v_do_1","max_int":"100","min_int":"0","url_img":"https://standardoss.baozhida.cn/UpImage/54353e11-37e4-4b15-84f5-4e91b4c1282e.png"} data-->
  547. <div >
  548. <link rel="stylesheet" href="[{OSS_Static}]/panel/lib/NumBox/Panel_number-box.css">
  549. <img src="[{url}]" width="100%" height="100%" onclick="f_open_control_[{ID}]_on()">
  550. <script>
  551. var T_value_[{ID}]_v = 0
  552. // 这里要加延时
  553. setTimeout(function(){
  554. // 订阅
  555. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  556. console.log(`收到:${T_value}`);
  557. T_value_[{ID}]_v = parseInt(T_value)
  558. $("#Panel_on_number_[{ID}]_v").val(parseInt(T_value))
  559. })
  560. },2000);
  561. function Panel_number[{ID}]_on(this_) {
  562. var $val = $(this_).siblings("input[type='text']"),val = parseInt($val.val(), 10) + parseInt($(this_).data("v"));
  563. V_num = isNaN(val) ? 0 : val
  564. if([{max}] < V_num ){
  565. V_num = [{max}]
  566. }
  567. if([{min}] > V_num ){
  568. V_num = [{min}]
  569. }
  570. $val.val(V_num);
  571. };
  572. function f_button_[{ID}]_on() {
  573. f_Data_Write("open_control_[{ID}]","[{sn}]","[{tab}]",$("#Panel_on_number_[{ID}]_v").val())
  574. layer.close(layer_[{ID}]_id)
  575. }
  576. var layer_[{ID}]_id
  577. layer_[{ID}]_html = "<div id=\"open_control_[{ID}]\" style=\"width: 200px;height: 150px;text-align: center\">\n" +
  578. " <div class=\"Panel_number-box\" style=\"width: 132px;margin-top: 30px\">\n" +
  579. " <input type=\"button\" class=\"Panel_on-number\" onclick=\"Panel_number[{ID}]_on(this)\" value=\"-\" data-v=\"-1\">\n" +
  580. " <input id=\"Panel_on_number_[{ID}]_v\" type=\"text\" value=\""+T_value_[{ID}]_v+"\" >\n" +
  581. " <input type=\"button\" class=\"Panel_on-number\" onclick=\"Panel_number[{ID}]_on(this)\" value=\"+\" data-v=\"1\">\n" +
  582. " </div>\n" +
  583. " <div style=\"width: 132px;margin-top: 30px;margin: 10px auto\">\n" +
  584. " <button onclick=\"f_button_[{ID}]_on()\" style=\"height: 28px;margin-top: 10px;line-height: 28px;border: 1px solid transparent;padding: 0 18px;background-color: #1E9FFF;color: #fff;white-space: nowrap;text-align: center;font-size: 12px;border-radius: 2px;cursor: pointer;\">确定</button>\n" +
  585. " </div>\n" +
  586. " </div> <script>\n" +
  587. " $(\"#Panel_on_number_[{ID}]_v\").val(parseInt(T_value_[{ID}]_v))\n" +" <\/script>"
  588. function f_open_control_[{ID}]_on() {
  589. layer_[{ID}]_id = layer.open({
  590. title: '设置',
  591. type: 1,
  592. fix: false, //不固定
  593. maxmin: false,
  594. content: layer_[{ID}]_html,
  595. shadeClose:true,
  596. anim: 1,
  597. isOutAnim: false,
  598. Boolean:false,
  599. success: function (layero, index) {
  600. },
  601. end: function () {
  602. }
  603. });
  604. }
  605. </script>
  606. </div>
  607. <!--数值-可设定-->
  608. <!--data {"sn_sn":"[-{sn}-]","tab_tab":"v_do_1","max_int_最高温度":"100","min_int_最低温度":"0","color_color_字体颜色":"","size_int_字体大小":"20","font_font":"https://standardoss.baozhida.cn/shumaguan.ttf"} data-->
  609. <div >
  610. <link rel="stylesheet" href="[{OSS_Static}]/panel/lib/NumBox/Panel_number-box.css">
  611. <style> @font-face{ font-family:font_[{ID}]; src: url('[{font}]') }</style>
  612. <span id="text[{ID}]" style="font-family: font_[{ID}];font-size: [{size}]px;color: [{color}];" onclick="f_open_control_[{ID}]_on()">xxx</span>
  613. <script>
  614. $("#text[{ID}]").html("")
  615. var T_value_[{ID}]_v = 0
  616. // 这里要加延时
  617. setTimeout(function(){
  618. // 订阅
  619. pubSub.subscribe('[{sn}]/[{tab}]', T_value => {
  620. console.log(`收到:${T_value}`);
  621. $("#text[{ID}]").html(T_value)
  622. T_value_[{ID}]_v = parseInt(T_value)
  623. })
  624. },2000);
  625. function Panel_number[{ID}]_on(this_) {
  626. var $val = $(this_).siblings("input[type='text']"),val = parseInt($val.val(), 10) + parseInt($(this_).data("v"));
  627. V_num = isNaN(val) ? 0 : val
  628. if([{max}] < V_num ){
  629. V_num = [{max}]
  630. }
  631. if([{min}] > V_num ){
  632. V_num = [{min}]
  633. }
  634. $val.val(V_num);
  635. };
  636. function f_button_[{ID}]_on() {
  637. f_Data_Write("text[{ID}]","[{sn}]","[{tab}]",$("#Panel_on_number_[{ID}]_v").val())
  638. layer.close(layer_[{ID}]_id)
  639. }
  640. var layer_[{ID}]_id
  641. layer_[{ID}]_html = "<div id=\"open_control_[{ID}]\" style=\"width: 200px;height: 150px;text-align: center\">\n" +
  642. " <div class=\"Panel_number-box\" style=\"width: 132px;margin-top: 30px\">\n" +
  643. " <input type=\"button\" class=\"Panel_on-number\" onclick=\"Panel_number[{ID}]_on(this)\" value=\"-\" data-v=\"-1\">\n" +
  644. " <input id=\"Panel_on_number_[{ID}]_v\" type=\"text\" value=\""+T_value_[{ID}]_v+"\" >\n" +
  645. " <input type=\"button\" class=\"Panel_on-number\" onclick=\"Panel_number[{ID}]_on(this)\" value=\"+\" data-v=\"1\">\n" +
  646. " </div>\n" +
  647. " <div style=\"width: 132px;margin-top: 30px;margin: 10px auto\">\n" +
  648. " <button onclick=\"f_button_[{ID}]_on()\" style=\"height: 28px;margin-top: 10px;line-height: 28px;border: 1px solid transparent;padding: 0 18px;background-color: #1E9FFF;color: #fff;white-space: nowrap;text-align: center;font-size: 12px;border-radius: 2px;cursor: pointer;\">确定</button>\n" +
  649. " </div>\n" +
  650. " </div> <script>\n" +
  651. " $(\"#Panel_on_number_[{ID}]_v\").val(parseInt(T_value_[{ID}]_v))\n" +" <\/script>"
  652. function f_open_control_[{ID}]_on() {
  653. layer_[{ID}]_id = layer.open({
  654. title: '设置',
  655. type: 1,
  656. fix: false, //不固定
  657. maxmin: false,
  658. content: layer_[{ID}]_html,
  659. shadeClose:true,
  660. anim: 1,
  661. isOutAnim: false,
  662. Boolean:false,
  663. success: function (layero, index) {
  664. },
  665. end: function () {
  666. }
  667. });
  668. }
  669. </script>
  670. </div>
  671. <script>
  672. $("body").append('<div style="user-select: none;position: absolute;left: 539px;top: 223px;z-index: 999999999999999;width: 20px;height: 20px;background-color: rgba(231,0,62,0.97);">1</div>')
  673. </script>
  674. <!-- 发布订阅模式
  675. pubSub.publish('866222050911984/v_do_4', '06:00:00');
  676. -->
  677. <!--data {"pane_pane":"","url_img":"https://standardoss.baozhida.cn/UpImage/1655261167cba53203-8326-49ea-82d7-5563ead17bc0.png"} data-->
  678. <div>
  679. <img src="[{url}]" onclick="window.location.href='../../Panel/Index_plan?T_viewid=[{pane}]';" width="100%" height="100%">
  680. </div>