GeneratorData.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <!-- SELECT t_id,t_name,MIN(t_t),MIN(t_rh),MAX(t_t),MAX(t_rh) FROM `Z_DeviceData_KF20220620145301` WHERE `t_time` >= '2022-6-28 02:00:00' AND `t_time` <= '2022-6-28 08:00:00' AND t_id = 1 -->
  4. <head>
  5. <meta charset="UTF-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>Document</title>
  9. <!-- <link rel="stylesheet" href="https://unpkg.com/layui@2.6.8/dist/css/layui.css"> -->
  10. <script src="/static/js/jquery-3.1.1.min.js"></script>
  11. <link type="text/css" rel="stylesheet" href="/static/css/layui.css" />
  12. <link type="text/css" rel="stylesheet" href="/static/css/jedate.css">
  13. <link type="text/css" rel="stylesheet" href="/static/css/xcConfirm.css">
  14. <script type="text/javascript" src="/static/js/jedate.js"></script>
  15. <script src="/static/js/jquery.custom.imitate.editor-v1.0.js"></script>
  16. <script src="/static/js/jedate.min.js"></script>
  17. <script src="/static/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>
  18. <style>
  19. .div2 {
  20. min-height: 20vh;
  21. /* display: flex; */
  22. flex-direction: column;
  23. background-color: lightgray;
  24. }
  25. .div2 .content {
  26. flex: 1 0 auto;
  27. display: flex;
  28. }
  29. .div2 .content article {
  30. flex: 1 0 auto;
  31. /* background-color: green; */
  32. }
  33. .div2 header,
  34. .div2 footer {
  35. /* background-color: bisque; */
  36. }
  37. #text1 {
  38. width: 130%;
  39. background-color: #282923;
  40. height: 600px;
  41. padding-top: 10px;
  42. padding-right: 10px;
  43. padding-bottom: 10px;
  44. color: #f8f8f2;
  45. font-size: 16px;
  46. }
  47. #text2 {
  48. width: 100%;
  49. background-color: black;
  50. height: 600px;
  51. padding-top: 10px;
  52. padding-right: 10px;
  53. padding-bottom: 10px;
  54. color: #f8f8f2;
  55. font-size: 16px;
  56. /* margin-left: 4%; */
  57. }
  58. #toto {
  59. width: 160px;
  60. height: 50px;
  61. /* border: black 1px solid; */
  62. position: absolute;
  63. display: inline-block;
  64. float: left;
  65. font-size: 20px;
  66. }
  67. #BUT {
  68. height: 70px;
  69. width: 50%;
  70. /* border: red solid 1px; */
  71. position: absolute;
  72. margin-top: -2%;
  73. margin-left: 96%;
  74. }
  75. button {
  76. width:70px;
  77. height: 40px;
  78. background: lightcyan;
  79. font-size: 20px;
  80. }
  81. input {
  82. width: 70%;
  83. height: 24px;
  84. border: 1px #393D49 solid;
  85. }
  86. table {
  87. width: 95%;
  88. /* border: 1px red solid; */
  89. /* margin-bottom: 10px; */
  90. }
  91. .hide{
  92. display: none;
  93. }
  94. .co{
  95. color: red;
  96. }
  97. </style>
  98. </head>
  99. <body style="overflow-x: hidden;">
  100. <div class="div2">
  101. <header>
  102. <table border="0" cellspacing="" cellpadding="" style="height: 120px;">
  103. <tr>
  104. <th style="width: 200px;">温度下限<input type="text" id="T_Tlower"></th>
  105. <th style="width: 200px;">温度上限<input type="text" id="T_Tupper"></th>
  106. <th style="width: 200px;">湿度下限<input type="text" id="T_RHlower"></th>
  107. <th style="width: 200px;">湿度上限<input type="text" id="T_RHupper"></th>
  108. <th style="width: 200px;">GPS:<input type="text" id="T_Site" value="1"></th>
  109. <th style="width: 200px;">电量:<input type="text" id="T_Dattery" value="0"></th>
  110. </tr>
  111. <tr>
  112. <th style="width: 400px;">sn:<input type="text" id="sn"></th>
  113. <th style="width: 180px;">名称:<input type="text" id="name" style="width: 70%;"></th>
  114. <th>ID:<input type="text" id="ID" style="width: 40%;"></th>
  115. <th style="width: 240px;">开始时间:<input type="text" id="start_date" style="width: 60%;"></th>
  116. <th style="width: 240px;">结束时间:<input type="text" id="end_date" style="width: 60%;"></th>
  117. <th>时间间隔:<input type="text" id="date_num" style="width: 40%;"></th>
  118. <th id="qushi" style="width: 200px;">
  119. 趋势:
  120. <select name="" id="Trend" style="background-color: white; width: 80px;">
  121. <option value="" id="data">原始</option>
  122. <option value="" id="up">上升</option>
  123. <option value="" id="down">下降</option>
  124. <option value="" id="mild">平缓</option>
  125. <option value="" id="model">模板</option>
  126. </select>
  127. </th>
  128. <th>
  129. <!-- <a id="puti" style="width: 70px;height: 30px;font-size: 1.2em;background-color: cadetblue;color: white; font-weight: 400;">图表</a> -->
  130. <button type="button" id="CS" style="width: 70px;height: 30px;font-size: 1.2em;background-color: cadetblue;color: white; font-weight: 400;">语句</button>
  131. </th>
  132. <th>
  133. <!-- <a id="puti" style="width: 70px;height: 30px;font-size: 1.2em;background-color: cadetblue;color: white; font-weight: 400;">图表</a> -->
  134. <button type="button" id="puti" style="width: 70px;height: 30px;font-size: 1.2em;background-color: cadetblue;color: white; font-weight: 400;">生成</button>
  135. </th>
  136. </tr>
  137. <tr>
  138. <th id="t_max">最高温度:<input type="text" id="temp_max" style="width:20%;"></th>
  139. <th id="t_min">最低温度:<input type="text" id="temp_mix" style="width: 40%;"></th>
  140. <th class="hide" id="gee">温度偏差:<input type="text" id="ge" style="width: 40%;"></th>
  141. <th id="humi_x">最大湿度:<input type="text" id="humi_max" style="width: 40%;"></th>
  142. <th id="humi_m">最小湿度:<input type="text" id="humi_mix" style="width: 40%;"></th>
  143. <th class="hide" id="shi_ge">湿度偏差:<input type="text" id="shi_g" style="width: 40%;"></th>
  144. <th colspan="12" class="hide" id="mol">温度数据:<input type="text" style="width: 85%;" id="tempData"></th>
  145. </tr>
  146. <tr>
  147. <th colspan="12" class="hide" id="wel">湿度数据:<input type="text" style="width: 85%;" id="humi_Data"></th>
  148. </tr>
  149. </table>
  150. <div id="BUT">
  151. <button type="button" id="but" class="layui-btn layui-btn-lg">提交</button>
  152. </div>
  153. </header>
  154. <!--<div class="content">
  155. &lt;!&ndash; <aside></aside> &ndash;&gt;
  156. <article>
  157. <div style="width: 100%;height: 600px;position: relative;">
  158. <div class="layui-row">
  159. <div class="layui-col-md10">
  160. <div style="width: 100%;height: 600px;">
  161. <textarea type="text" id="text1" class="text"></textarea>
  162. </div>
  163. </div>
  164. <div class="layui-col-md1">
  165. <div id="toto">
  166. <textarea type="text" id="text2" class="text"></textarea>
  167. &lt;!&ndash; <span></span> &ndash;&gt;
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </article>
  173. </div>-->
  174. <!-- <footer>footer</footer> -->
  175. </div>
  176. <div id="container" style="height: 600px;margin-top: 20px;"></div>
  177. <div id="container1" style="height: 600px;"></div>
  178. <!-- <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script> -->
  179. <script type="text/javascript" src="https://fastly.jsdelivr.net/npm/echarts@5.3.3/dist/echarts.min.js"></script>
  180. <script>
  181. jeDate("#start_date", {
  182. festival: false,
  183. minDate: "1900-01-01", //最小日期
  184. maxDate: "2099-12-31", //最大日期
  185. method: {
  186. choose: function(params) {
  187. // console.log(params);
  188. }
  189. },
  190. format: "YYYY-MM-DD hh:mm:ss"
  191. });
  192. jeDate("#end_date", {
  193. festival: false,
  194. minDate: "1900-01-01", //最小日期
  195. maxDate: "2099-12-31", //最大日期
  196. method: {
  197. choose: function(params) {
  198. // console.log(params);
  199. }
  200. },
  201. format: "YYYY-MM-DD hh:mm:ss"
  202. });
  203. $("#text1,#text2").initTextarea();
  204. function getData() {
  205. var data = {
  206. "sn": $("#sn").val(),
  207. "name": $("#name").val(),
  208. "ID": parseInt($("#ID").val()),
  209. "temp_max": parseFloat($("#temp_max").val()),
  210. "temp_mix": parseFloat($("#temp_mix").val()),
  211. "humi_max": parseFloat($("#humi_max").val()),
  212. "humi_mix": parseFloat($("#humi_mix").val()),
  213. "start_date": $("#start_date").val(),
  214. "end_date": $("#end_date").val(),
  215. "date_num": parseInt($("#date_num").val()),
  216. "T_Tlower": parseFloat($("#T_Tlower").val()),
  217. "T_Tupper": parseFloat($("#T_Tupper").val()),
  218. "T_RHlower": parseFloat($("#T_RHlower").val()),
  219. "T_RHupper": parseFloat($("#T_RHupper").val()),
  220. "T_Site": $("#T_Site").val(),
  221. "T_Dattery": parseInt($("#T_Dattery").val()),
  222. };
  223. return data;
  224. }
  225. $("#but").click(function() {
  226. insertData = getInsertData();
  227. $("#text1").val(insertData);
  228. var SQL = insertData;
  229. var sql = SQL.split('\n')
  230. var str = "";
  231. var j = 0
  232. for (var i in sql) {
  233. if (sql[i] != "") {
  234. var vd_list = sql[i].split('|')
  235. console.log("vd_list",vd_list)
  236. // continue;
  237. $.ajax({
  238. type: 'POST',
  239. url: 'https://cold.baozhida.cn/Device/DeviceData_Add', //发送请求
  240. // url: 'http://47.111.15.17:6200/Device/DeviceData_Add',//测试
  241. async: false,
  242. data: {
  243. Tokey: "1f9db553",
  244. T_sn: vd_list[0],
  245. T_name: vd_list[1],
  246. T_id: vd_list[2],
  247. T_t: vd_list[3],
  248. T_rh: vd_list[4],
  249. T_time: vd_list[5],
  250. T_Tlower: vd_list[6],
  251. T_Tupper: vd_list[7],
  252. T_RHlower: vd_list[8],
  253. T_RHupper: vd_list[9],
  254. T_Site: vd_list[10],
  255. T_Dattery: vd_list[11],
  256. },
  257. success: function(result) {
  258. if (result.Code == 200) {
  259. str = str + "OK" + '\n';
  260. } else {
  261. str = str + "Err" + '\n';
  262. }
  263. }
  264. });
  265. }
  266. str = str;
  267. }
  268. $("#text2").val(str);
  269. })
  270. $("#Trend").click(function() {
  271. //获取数据
  272. sortTempAndDate = get_sortTempAndDate();
  273. })
  274. //用来保存不会改变的数据
  275. var sortTempAndDate = {};
  276. $("#puti").click(function() {
  277. // //获取数据
  278. sortTempAndDate1 = get_sortTempAndDate();
  279. sortTempAndDate = sortTempAndDate1;
  280. // console.log(sortTempAndDate);
  281. echart01(sortTempAndDate1);
  282. echart02(sortTempAndDate1);
  283. function echart01(sortTempAndDate) {
  284. var dom1 = document.getElementById('container1');
  285. var myChart1 = echarts.init(dom1, 'dark', {
  286. renderer: 'canvas',
  287. useDirtyRect: false
  288. });
  289. var app1 = {};
  290. var option1;
  291. option1 = {
  292. title: {
  293. text: '湿度时间趋势图',
  294. // textVerticalAlign:'center'
  295. // textAlign:'center'
  296. textStyle: {
  297. fontSize: 20,
  298. },
  299. left: 'center'
  300. },
  301. xAxis: {
  302. type: 'category',
  303. data: sortTempAndDate['date'],
  304. },
  305. yAxis: {
  306. type: 'value',
  307. },
  308. tooltip: {
  309. trigger: 'axis', //坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用
  310. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  311. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  312. }
  313. },
  314. series: [{
  315. data: sortTempAndDate['sortHumi'],
  316. type: 'line',
  317. smooth: true
  318. }]
  319. };
  320. if (option1 && typeof option1 === 'object') {
  321. myChart1.setOption(option1);
  322. }
  323. window.addEventListener('resize', myChart1.resize);
  324. }
  325. function echart02(sortTempAndDate) {
  326. var dom = document.getElementById('container');
  327. var myChart = echarts.init(dom, 'dark', {
  328. renderer: 'canvas',
  329. useDirtyRect: false
  330. });
  331. var app = {};
  332. var option;
  333. option = {
  334. title: {
  335. text: '温度时间趋势图',
  336. // textVerticalAlign:'center'
  337. // textAlign:'center'
  338. textStyle: {
  339. fontSize: 20,
  340. },
  341. left: 'center'
  342. },
  343. xAxis: {
  344. type: 'category',
  345. data: sortTempAndDate['date'],
  346. },
  347. yAxis: {
  348. type: 'value',
  349. },
  350. tooltip: {
  351. trigger: 'axis', //坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用
  352. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  353. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  354. }
  355. },
  356. series: [{
  357. data: sortTempAndDate['sorTtemp'],
  358. type: 'line',
  359. smooth: true
  360. }]
  361. };
  362. if (option && typeof option === 'object') {
  363. myChart.setOption(option);
  364. }
  365. window.addEventListener('resize', myChart.resize);
  366. }
  367. })
  368. //获取插入数据
  369. function getInsertData() {
  370. var str = "";
  371. data = getData();
  372. var sql_top = "sn|name|id|t|h|time|T_Tlower|T_Tupper|T_RHlower|T_RHupper|T_Site|T_Dattery";
  373. // console.log(sql_top);
  374. // sortTempAndDate = get_sortTempAndDate();
  375. for (var i = 0; i < sortTempAndDate['date'].length; i++) {
  376. // 替换
  377. // console.log(data)
  378. str_ = sql_top;
  379. str_ = str_.replace("sn", data.sn);
  380. str_ = str_.replace("name", data.name);
  381. str_ = str_.replace("id", data.ID);
  382. str_ = str_.replace("t", sortTempAndDate['sorTtemp'][i]);
  383. str_ = str_.replace("h", sortTempAndDate['sortHumi'][i]);
  384. str_ = str_.replace("time", sortTempAndDate['date'][i]);
  385. str_ = str_.replace("T_Tlower",data.T_Tlower);
  386. str_ = str_.replace("T_Tupper",data.T_Tupper);
  387. str_ = str_.replace("T_RHlower",data.T_RHlower);
  388. str_ = str_.replace("T_RHupper",data.T_RHupper);
  389. str_ = str_.replace("T_Site",data.T_Site);
  390. str_ = str_.replace("T_Dattery",data.T_Dattery);
  391. str = str + str_ + "\n"
  392. }
  393. return str;
  394. }
  395. //温排序温度、湿度以及时间
  396. function get_sortTempAndDate() {
  397. var qushi = $("#qushi").find('option:selected').text();
  398. //排序温度
  399. var sorTtemp = [];
  400. //湿度
  401. var sortHumi = [];
  402. //时间
  403. var date = [];
  404. data = getData();
  405. var jiange = data.date_num;
  406. var date_start = convertDateFromString(data.start_date);
  407. var date_end = convertDateFromString(data.end_date);
  408. var sortTempAndDate = {};
  409. while (date_start < date_end) {
  410. // date_start.setTime(date_start.setSeconds(date_start.getSeconds() + jiange)); //秒
  411. date_start.setTime(date_start.setMinutes(date_start.getMinutes() + jiange));
  412. var Dates = date_start.Format("yyyy-MM-dd HH:mm:ss");
  413. if (date_start >= date_end) {
  414. date_start = date_end;
  415. var Dates = date_start.Format("yyyy-MM-dd HH:mm:ss");
  416. date.push(Dates);
  417. sorTtemp.push(get_rund(data.temp_max, data.temp_mix));
  418. sortHumi.push(get_rund(data.humi_max, data.humi_mix));
  419. break;
  420. }
  421. date.push(Dates);
  422. sorTtemp.push(get_rund(data.temp_max, data.temp_mix));
  423. sortHumi.push(get_rund(data.humi_max, data.humi_mix));
  424. }
  425. if (qushi == '上升') {
  426. $("#t_max").show();
  427. $("#t_min").show();
  428. $("#humi_m").show();
  429. $("#humi_x").show();
  430. $("#mol").hide();
  431. $("#wel").hide();
  432. $("#gee").hide();
  433. $("#shi_ge").hide();
  434. sorTtemp.sort(function(a, b) {
  435. return a - b
  436. });
  437. sortHumi.sort(function(c, d) {
  438. return c - d
  439. });
  440. } else if (qushi == '下降') {
  441. $("#t_max").show();
  442. $("#t_min").show();
  443. $("#humi_m").show();
  444. $("#humi_x").show();
  445. $("#mol").hide();
  446. $("#wel").hide();
  447. $("#gee").hide();
  448. $("#shi_ge").hide();
  449. sorTtemp.sort(function(a, b) {
  450. return b - a
  451. });
  452. sortHumi.sort(function(c, d) {
  453. return d - c
  454. });
  455. } else if (qushi == '原始') {
  456. $("#t_max").show();
  457. $("#t_min").show();
  458. $("#ge").show();
  459. $("#humi_m").show();
  460. $("#humi_x").show();
  461. $("#mol").hide();
  462. $("#wel").hide();
  463. $("#gee").hide();
  464. $("#shi_ge").hide();
  465. // console.log("sorTtemp:",sorTtemp)
  466. } else if (qushi == '平缓') {
  467. //获取温度、湿度数据
  468. var ge = document.getElementById('ge').value;
  469. var g = document.getElementById('shi_g').value;
  470. $("#gee").show();
  471. $("#shi_ge").show();
  472. $("#t_max").show();
  473. $("#t_min").show();
  474. $("#humi_m").show();
  475. $("#humi_x").show();
  476. $("#mol").hide();
  477. $("#wel").hide();
  478. // console.log("sorTtemp:",sorTtemp)
  479. //温度
  480. for (var l = 1; l < sorTtemp.length; l++) {
  481. C = get_rund(0, 1)
  482. if (C >= 0.5) {
  483. sorTtemp[l] = parseFloat(sorTtemp[l - 1]) - parseFloat(ge);
  484. } else {
  485. sorTtemp[l] = parseFloat(sorTtemp[l - 1]) + parseFloat(ge);
  486. }
  487. // 限制
  488. if (data.temp_max < sorTtemp[l]) {
  489. sorTtemp[l] = data.temp_max
  490. }
  491. if (data.temp_mix > sorTtemp[l]) {
  492. sorTtemp[l] = data.temp_mix
  493. }
  494. }
  495. //湿度
  496. for (var h = 1; h < sortHumi.length; h++) {
  497. k = get_rund(0, 1)
  498. if (k >= 0.5) {
  499. sortHumi[h] = (parseFloat(sortHumi[h - 1]) - parseFloat(g)).toFixed(1);
  500. } else {
  501. sortHumi[h] = (parseFloat(sortHumi[h - 1]) + parseFloat(g)).toFixed(1);
  502. }
  503. // 限制
  504. if (data.humi_max < sortHumi[h]) {
  505. sortHumi[h] = data.humi_max
  506. }
  507. if (data.humi_min > sortHumi[h]) {
  508. sortHumi[h] = data.humi_min
  509. }
  510. }
  511. // console.log("sorTtemp:",sorTtemp)
  512. } else if (qushi == '模板') {
  513. $("#mol").show();
  514. $("#wel").show();
  515. $("#gee").hide();
  516. $("#shi_ge").hide();
  517. $("#humi_m").hide();
  518. $("#humi_x").hide();
  519. $("#t_max").hide();
  520. $("#t_min").hide();
  521. tempData = $("#tempData").val();
  522. humi_Date = $("#humi_Data").val();
  523. tempDataArr = tempData.split(',');
  524. humi_Date_Arr = humi_Date.split(',');
  525. var tempDataList = [];
  526. var humi_Data_List = [];
  527. var h = 0;
  528. for (k = 0; k < date.length; k++) {
  529. humi_Data_List.push(parseFloat(humi_Date_Arr[h++]).toFixed(1));
  530. if (h == humi_Date_Arr.length) {
  531. h = 0;
  532. }
  533. }
  534. sortHumi = humi_Data_List;
  535. var j = 0;
  536. for (i = 0; i < date.length; i++) {
  537. tempDataList.push(parseFloat(tempDataArr[j++]).toFixed(1));
  538. if (j == tempDataArr.length) {
  539. j = 0;
  540. }
  541. }
  542. sorTtemp = tempDataList;
  543. }
  544. // sortHumiDate["date"] = date;
  545. sortTempAndDate["sortHumi"] = sortHumi;
  546. sortTempAndDate["date"] = date;
  547. sortTempAndDate["sorTtemp"] = sorTtemp;
  548. return sortTempAndDate;
  549. }
  550. //获取随机数
  551. function get_rund(max, min) {
  552. return parseFloat((Math.random() * (max - min)) + min).toFixed(1);
  553. }
  554. //字符串转换成日期
  555. function convertDateFromString(dateString) {
  556. if (dateString) {
  557. var arr1 = dateString.replace('|');
  558. var date = new Date(arr1);
  559. return date;
  560. }
  561. }
  562. //jquery将日期转换成指定格式的字符串
  563. Date.prototype.Format = function(fmt) {
  564. var o = {
  565. "M+": this.getMonth() + 1, //月份
  566. "d+": this.getDate(), //日
  567. "H+": this.getHours(), //小时
  568. "m+": this.getMinutes(), //分
  569. "s+": this.getSeconds(), //秒
  570. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  571. "S": this.getMilliseconds() //毫秒
  572. };
  573. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  574. for (var k in o)
  575. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" +
  576. o[k]).substr(("" + o[k]).length)));
  577. return fmt;
  578. }
  579. $("#CS").click(function(){
  580. var txt= "请输入";
  581. window.wxc.xcConfirm(txt, window.wxc.xcConfirm.typeEnum.input,{
  582. onOk:function(v){
  583. // console.log(v);
  584. v_list = v.split(" ")
  585. // console.log(v_list[0]);
  586. $("#ID").val(v_list[0]);
  587. $("#name").val(v_list[1]);
  588. $("#temp_mix").val(v_list[2]);
  589. $("#humi_mix").val(v_list[3]);
  590. $("#temp_max").val(v_list[4]);
  591. $("#humi_max").val(v_list[5]);
  592. }
  593. });
  594. });
  595. </script>
  596. </body>
  597. </html>