point - 副本.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  1. <template>
  2. <el-row type="flex">
  3. <div class="query-actions">
  4. <button class="btn" @click="addEdit">新增</button>
  5. <button class="btn" @click="dbfx">原始数据对标</button>
  6. <button class="btn" @click="back">返回</button>
  7. </div>
  8. </el-row>
  9. <el-row :type="'flex'" class="content">
  10. <el-col :span="24">
  11. <ComTable :data="tableData" :pageSize="pageSize" @onPagging="onChangePage" height="84vh"
  12. v-loading="tableLoading" ref="curRef" element-loading-text="拼命加载中"
  13. element-loading-background="rgba(0, 0, 0, 0.8)"></ComTable>
  14. </el-col>
  15. </el-row>
  16. <el-dialog :title="isvisiableType == 1 ? '新增' : '编辑'" v-model="isvisiable" width="45%" top="15vh"
  17. custom-class="modal" :close-on-click-modal="false" :before-close="onClickDialogClose" class="isvisiable">
  18. <!-- 这里是新增或编辑 -->
  19. <el-row type="flex" class="mb10">
  20. <el-col :span="12">
  21. <div>样本类型:</div>
  22. <el-select v-model="widget" placeholder="请选择样本" popper-class="select" class="w">
  23. <el-option v-for="item in widgetArr" :key="item.value" :value="item.value"
  24. :label="item.label">
  25. </el-option>
  26. </el-select>
  27. </el-col>
  28. <el-col :span="12">
  29. <div>风机型号:</div>
  30. <el-select v-model="tableModel" placeholder="请选择风机型号" popper-class="select" class="w">
  31. <el-option v-for="item in fjxh" :key="item.value" :value="item.value" :label="item.label">
  32. </el-option>
  33. </el-select>
  34. </el-col>
  35. </el-row>
  36. <el-row type="flex" class="mb10">
  37. <el-col :span="12">
  38. <div>故障分类:</div>
  39. <el-select v-model="windturbinename" placeholder="请选择故障" popper-class="select" class="w">
  40. <el-option v-for="item in BuJian" :key="item.value" :value="item.value" :label="item.label">
  41. </el-option>
  42. </el-select>
  43. </el-col>
  44. <el-col :span="12">
  45. <div>时间:</div>
  46. <el-date-picker v-model="tableTime" type="datetimerange" range-separator="至"
  47. start-placeholder="开始日期" end-placeholder="结束日期" class="w">
  48. </el-date-picker>
  49. </el-col>
  50. </el-row>
  51. <el-row type="flex" class="mb10">
  52. <el-col :span="12">
  53. <div>故障原因:</div>
  54. <el-input placeholder="请输入故障原因" v-model="tableSymptom" :value="tableSymptom">
  55. </el-input>
  56. </el-col>
  57. <el-col :span="12">
  58. <div>风机厂商:</div>
  59. <el-input placeholder="请输入风机厂商" v-model="tableManufacturer" :value="tableManufacturer">
  60. </el-input>
  61. </el-col>
  62. </el-row>
  63. <el-row type="flex" class="mb10">
  64. <el-col :span="12">
  65. <div>风机编号:</div>
  66. <el-input placeholder="请输入风机编号" v-model="stationcn" :value="stationcn">
  67. </el-input>
  68. </el-col>
  69. </el-row>
  70. <el-row type="flex" justify="end">
  71. <div class="query-actions" style="margin-top: 15px">
  72. <button class="btn" @click="onClickDialogClose">取消</button>
  73. <button class="btn" @click="dialogSave">保存</button>
  74. </div>
  75. </el-row>
  76. </el-dialog>
  77. <!-- 原始数据start -->
  78. <el-dialog title="原始数据" v-model="yssjDialog" width="70%" top="15vh" custom-class="modal"
  79. :close-on-click-modal="false" :before-close="yssjDialogClose">
  80. <div class="query mg-b-8">
  81. <div class="query-items">
  82. <div class="query-item">
  83. <div class="lable">时间:</div>
  84. <div class="search-input">
  85. <el-date-picker v-model="time" type="datetimerange" range-separator="至" start-placeholder="开始日期"
  86. end-placeholder="结束日期">
  87. </el-date-picker>
  88. </div>
  89. </div>
  90. <div class="query-item">
  91. <div class="lable">等间隔:</div>
  92. <div class="search-input">
  93. <el-select
  94. v-if="!chooseStatus"
  95. @change="switchChange(selectValue)"
  96. class="inputs"
  97. v-model="selectValue"
  98. placeholder="请选择"
  99. >
  100. <el-option
  101. v-for="item in timeoptions"
  102. :key="item.value"
  103. :label="item.label"
  104. :value="item.value"
  105. >
  106. </el-option>
  107. </el-select>
  108. </div>
  109. </div>
  110. <div class="query-actions">
  111. <button class="btn" @click="queryYssj">查询</button>
  112. </div>
  113. </div>
  114. </div>
  115. <el-row type="flex">
  116. <multiple-y-line-chart-normal
  117. height="500px"
  118. :list="Powertrend"
  119. :yAxises="PowertrendYAxises"
  120. :showLegend="true"
  121. />
  122. </el-row>
  123. </el-dialog>
  124. <!-- 原始数据end -->
  125. </template>
  126. <script>
  127. import ComTable from "@/components/coms/table/table.vue";
  128. import MultipleYLineChartNormal from "../../NewPages/multiple-y-line-chart-normal.vue";
  129. import Tab from "@/components/coms/tabs/tab.vue";
  130. export default {
  131. components: {
  132. ComTable,MultipleYLineChartNormal,Tab
  133. },
  134. data() {
  135. const that = this;
  136. return {
  137. Powertrend: [
  138. {
  139. title: "",
  140. yAxisIndex: 0, // 使用单位
  141. value: [],
  142. },
  143. ],
  144. PowertrendYAxises: [
  145. {
  146. name: "功率",
  147. min: 0,
  148. max: null,
  149. unit: "(万kWh)",
  150. position: "left",
  151. },
  152. {
  153. name: "风速",
  154. min: 0,
  155. max: 25,
  156. unit: "(m/s)",
  157. position: "right",
  158. },
  159. ],
  160. selectValue: "60",
  161. timeoptions: [
  162. {
  163. value: "60",
  164. label: "一分钟",
  165. },
  166. {
  167. value: "300",
  168. label: "五分钟",
  169. },
  170. {
  171. value: "600",
  172. label: "十分钟",
  173. },
  174. {
  175. value: "1800",
  176. label: "三十分钟",
  177. },
  178. {
  179. value: "3600",
  180. label: "一小时",
  181. },
  182. {
  183. value: "86400",
  184. label: "一天",
  185. },
  186. ],
  187. time: [],
  188. yssjDialog:false,
  189. point:[],
  190. pointdes:[],
  191. widgetArr: [{label: '正样本',value: 0},{label: '负样本',value: 1}],
  192. queryType: false, //没有改变select时,点击查询无效
  193. pageIndex: 1,
  194. pageSize: 20,
  195. BuJian: [{
  196. label: '部件1',
  197. value: '1'
  198. }, {
  199. label: '部件2',
  200. value: '2'
  201. }],
  202. ChangZhan: [{
  203. label: '麻黄山风电场',
  204. value: 'MHS_FDC'
  205. }],
  206. fjxh: [{
  207. label: '类型1',
  208. value: '1'
  209. }],
  210. fjxhArr: [{
  211. id: "MHS_FDC",
  212. value: ['UP77', 'UP82', 'UP105']
  213. }],
  214. widget: [],
  215. model: [],
  216. station: '',
  217. windturbinename: "",
  218. widget: "",
  219. tableModel: "",
  220. tableTime: "",
  221. tableSymptom: "",
  222. tableManufacturer: "",
  223. stationcn: "",
  224. tableCategory: "", //隐藏保存部分
  225. tableRemark: "",
  226. tableFaultcode: "",
  227. tableId: "",
  228. tableSymptomcode: "",
  229. tableStationen: "",
  230. isvisiable: false,
  231. isvisiableType: 1, //新增为1,编辑为2
  232. checkLength: 0, //对标分析只能选择5个
  233. tableData: {
  234. column: [{
  235. name: "序号",
  236. field: "index",
  237. is_light: false,
  238. width: '50px',
  239. },
  240. {
  241. name: "",
  242. field: "check",
  243. is_light: false,
  244. width: '50px',
  245. template: function () {
  246. return "<input class='check curCheckBox' type='CheckBox'/>";
  247. },
  248. click: function (event, data) {
  249. let point = data.point,
  250. pointdes = data.pointdes;
  251. if (event.target.checked == false && that.checkLength <= 5) {
  252. that.point.forEach((item, i) => {
  253. if (item == point) {
  254. that.point.splice(i, 1);
  255. that.pointdes.splice(i, 1);
  256. }
  257. });
  258. that.checkLength--;
  259. } else if (event.target.checked && that.checkLength < 5) {
  260. that.point.push(point);
  261. that.pointdes.push(pointdes);
  262. that.checkLength++;
  263. } else if (that.checkLength == 5) {
  264. event.target.checked = false;
  265. }
  266. },
  267. },
  268. {
  269. name: "风机",
  270. field: "windturbineid",
  271. is_light: false,
  272. width: '100px',
  273. },
  274. {
  275. name: "部件",
  276. field: "widget",
  277. is_light: false,
  278. width: '100px',
  279. },
  280. {
  281. name: "测点",
  282. field: "point",
  283. is_light: false,
  284. width: '250px',
  285. },
  286. {
  287. name: "测点描述",
  288. field: "pointdes",
  289. is_light: false,
  290. width: '150px',
  291. },
  292. {
  293. name: "风机型号",
  294. field: "model",
  295. is_light: false,
  296. width: '150px',
  297. },
  298. {
  299. name: "场站",
  300. field: "stationcn",
  301. is_light: false,
  302. width: '150px',
  303. },
  304. {
  305. name: "操作",
  306. is_light: false,
  307. width: '200px',
  308. template: () => {
  309. return (
  310. "<el-button type='text' style='cursor: pointer;' value='edit'>编辑</el-button>&nbsp" +
  311. "<el-button type='text' style='cursor: pointer;' value='delete'>删除</el-button>&nbsp" +
  312. "<el-button type='text' style='cursor: pointer;' value='config'>原始数据</el-button>&nbsp"
  313. );
  314. },
  315. click(e, row) {
  316. that.onClickOption(e, row);
  317. },
  318. },
  319. ],
  320. data: [{
  321. index: 1,
  322. windturbineid: 0,
  323. widget: "MG01-01",
  324. point: "0.1000",
  325. pointdes: "0.1000",
  326. model: "0.1000",
  327. stationcn: "0.1000",
  328. is_light: false,
  329. }],
  330. }
  331. };
  332. },
  333. props: {
  334. data: {
  335. type: Array
  336. },
  337. st:{
  338. type: String
  339. }
  340. },
  341. methods: {
  342. getTable() {
  343. let that = this;
  344. this.tableLoading = true;
  345. that.API.requestData({
  346. method: "GET",
  347. baseURL: "http://192.168.10.4:9002/",
  348. subUrl: "benchmarking/wplist",
  349. data: {
  350. wpId: that.stationId,
  351. startTs: that.startDate,
  352. endTs: that.endDate,
  353. pageNum: that.pageIndex,
  354. pageSize: that.pageSize,
  355. },
  356. success(res) {
  357. var dataTab = [];
  358. if (res.data) {
  359. res.data.list.forEach(item => {
  360. dataTab.push({ //表格
  361. recodedata: that.formatTime(item.recodedata),
  362. region: item.region,
  363. })
  364. })
  365. that.tableData.data = dataTab;
  366. that.tableData.total = res.data.total;
  367. } else {
  368. that.tableData.data = [];
  369. that.tableData.total = 0;
  370. }
  371. that.tableLoading = false;
  372. },
  373. });
  374. },
  375. onChangePage(params) {
  376. this.pageIndex = params.pageIndex;
  377. this.pageSize = params.pageSize;
  378. this.getTable();
  379. },
  380. startAjax() {
  381. var that = this;
  382. // that.time = [new Date((new Date() - 3600 * 1000 * 24 * 30)).formatDate("yyyy-MM-dd"), new Date().formatDate("yyyy-MM-dd")];
  383. that.time = [new Date((new Date() - 3600 * 1000 * 24 * 360)).formatDate("yyyy-MM-dd"), new Date()
  384. .formatDate("yyyy-MM-dd")
  385. ];
  386. that.API.requestData({
  387. method: "GET",
  388. baseURL: "http://10.155.32.4:9001/",
  389. subUrl: "benchmarking/wplist",
  390. success(res) {
  391. that.ChangZhan = res.data;
  392. // that.station = res.data[0].name
  393. that.station = res.data[1].name
  394. },
  395. });
  396. that.API.requestData({
  397. method: "GET",
  398. baseURL: "http://192.168.1.18:9002/",
  399. subUrl: "basic/widget/condition",
  400. success(res) {
  401. let keys = Object.keys(res.data[0]);
  402. let bujian = [],
  403. widget = [];
  404. keys.forEach((ele, index) => {
  405. bujian.push({
  406. label: res.data[0].ele,
  407. value: ele
  408. })
  409. widget.push(ele)
  410. })
  411. that.widget = widget;
  412. that.BuJian = bujian;
  413. },
  414. });
  415. that.API.requestData({
  416. method: "GET",
  417. baseURL: "http://192.168.1.18:9002/",
  418. subUrl: "basic/station/all",
  419. success(res) {
  420. let fjxhArr = [];
  421. let model = [],
  422. fjxh = [];
  423. res.data.forEach(ele => {
  424. fjxhArr.push({
  425. id: ele.id,
  426. value: ele.model.split("/")
  427. })
  428. if (ele.id == "MHS_FDC") {
  429. model = ele.model.split("/");
  430. model.forEach(ele => {
  431. fjxh.push({
  432. label: ele,
  433. value: ele
  434. })
  435. })
  436. }
  437. })
  438. that.fjxhArr = fjxhArr;
  439. that.model = model;
  440. that.fjxh = fjxh;
  441. },
  442. });
  443. },
  444. query() {
  445. if (this.queryType) {
  446. this.list();
  447. }
  448. },
  449. addEdit() {
  450. this.isvisiableType = 1;
  451. this.windturbinename = '';
  452. this.tableModel = '';
  453. this.tableTime = '';
  454. this.tableSymptom = '';
  455. this.tableManufacturer = '';
  456. this.stationcn = '';
  457. // this.tableCategory: data[i].category,
  458. // this.tableRemark: data[i].remark,
  459. // this.tableFaultcode: data[i].faultcode,
  460. // this.tableId: data[i].id,
  461. // this.tableSymptomcode:data[i].Symptomcode,
  462. // this.tableStationen:data[i].stationen
  463. this.isvisiable = true;
  464. },
  465. onClickOption(e, row) { // 操作按钮
  466. let that = this;
  467. if ("delete" == e.target.getAttribute("value")) {
  468. that
  469. .$confirm("确认删除此条样本数据?", "提示", {
  470. confirmButtonText: "删除",
  471. cancelButtonText: "取消"
  472. })
  473. .then((_) => {
  474. console.log('ok')
  475. // that.requestDelete(row);
  476. })
  477. .catch((_) => {});
  478. }
  479. if ("edit" == e.target.getAttribute("value")) {
  480. that.isvisiableType = 2;
  481. that.$nextTick(() => {
  482. let tableTime = row.tableTime.split(" - ");
  483. that.widget = row.widget;
  484. that.BuJian.forEach(ele => {
  485. if (ele.value == row.tableFaultcode) {
  486. that.windturbinename = ele.label
  487. }
  488. })
  489. that.tableModel = row.tableModel;
  490. that.tableTime = [Date.parse(new Date(tableTime[0])), Date.parse(new Date(tableTime[1]))];
  491. that.tableSymptom = row.tableSymptom;
  492. that.tableManufacturer = row.tableManufacturer;
  493. that.stationcn = row.stationcn;
  494. that.tableCategory = row.tableCategory;
  495. that.tableRemark = row.tableRemark;
  496. that.tableFaultcode = row.tableFaultcode;
  497. that.tableId = row.tableId;
  498. that.tableSymptomcode = row.tableSymptomcode;
  499. that.tableStationen = row.tableStationen;
  500. });
  501. that.isvisiable = true;
  502. }
  503. if ("config" == e.target.getAttribute("value")) { //传感点
  504. that.time = [that.st - (3600 * 1000), that.st];
  505. that.point =[row.point];
  506. that.pointdes = [row.pointdes];
  507. that.requestDetailData(that.point,that.pointdes,that.time,that.selectValue);
  508. that.yssjDialog=true;
  509. }
  510. },
  511. onClickDialogClose() { // 弹窗右上角关闭按钮
  512. this.isvisiable = false;
  513. this.isvisiableType = 1;
  514. },
  515. dialogSave() {
  516. let that = this;
  517. that.tableTime[0] = that.formatDate(that.tableTime[0].valueOf());
  518. that.tableTime[1] = that.formatDate(that.tableTime[1].valueOf());
  519. console.log(that.tableTime)
  520. that.API.requestData({
  521. method: "POST",
  522. baseURL: "http://192.168.1.18:9002/",
  523. headers: {
  524. 'Content-Type': 'application/json;charset=utf-8',
  525. },
  526. subUrl: "case/item/edit",
  527. body: {
  528. category: that.tableCategory,
  529. endtime: that.tableTime[1],
  530. faultcode: that.tableFaultcode,
  531. faulttype: that.windturbinename,
  532. id: that.tableId,
  533. manufacturer: that.tableManufacturer,
  534. model: that.tableModel,
  535. remark: that.tableRemark,
  536. starttime: that.tableTime[0],
  537. stationen: that.tableStationen,
  538. symptom: that.tableSymptom,
  539. symptomcode: that.tableSymptomcode,
  540. tag: that.widget == "正样本" ? 0 : 1,
  541. windturbineid: that.stationcn
  542. },
  543. success(res) {
  544. if (res.code == 200) {
  545. that.BASE.showMsg({
  546. type: "success",
  547. msg: "保存成功",
  548. });
  549. that.onClickDialogClose();
  550. that.list();
  551. }
  552. },
  553. });
  554. },
  555. gzCgdClick(data) {
  556. this.gzCgd = data;
  557. },
  558. formatDate(dates) {
  559. var date = new Date(dates);
  560. var YY = date.getFullYear() + '-';
  561. var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  562. var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
  563. var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
  564. var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
  565. var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
  566. return YY + MM + DD + " " + hh + mm + ss;
  567. },
  568. list(data) {
  569. console.log(data)
  570. var that = this;
  571. that.tableData.data = [];
  572. if (data.length) {
  573. for (var i = 0; i < data.length; i++) {
  574. let obj = {
  575. index: i + 1,
  576. windturbineid: data[i].windturbineid,
  577. widget: data[i].widget,
  578. point: data[i].point,
  579. pointdes: data[i].pointdes,
  580. model: data[i].model,
  581. stationcn: data[i].stationcn,
  582. };
  583. that.tableData.data.push(obj);
  584. }
  585. }
  586. // let station = '',
  587. // widget = ''
  588. // if (typeof that.time[0].valueOf() != 'string') {
  589. // that.time[0] = that.formatDate(that.time[0].valueOf())
  590. // }
  591. // if (typeof that.time[1].valueOf() != 'string') {
  592. // that.time[1] = that.formatDate(that.time[1].valueOf())
  593. // }
  594. // if (typeof that.station.valueOf() == 'string') {
  595. // that.ChangZhan.forEach(ele => {
  596. // if (ele.name == that.station) {
  597. // station = ele.id
  598. // }
  599. // })
  600. // }
  601. // if (typeof that.widget.valueOf() == 'string') {
  602. // that.BuJian.forEach(ele => {
  603. // if (ele.label == that.widget) {
  604. // widget = ele.value
  605. // }
  606. // })
  607. // }
  608. // if (that.model.length == 0) {
  609. // that.BASE.showMsg({
  610. // type: "warning",
  611. // msg: "请选择风机型号",
  612. // });
  613. // return
  614. // }
  615. // if (that.widget.length == 0) {
  616. // that.BASE.showMsg({
  617. // type: "warning",
  618. // msg: "请选择部件",
  619. // });
  620. // return
  621. // }
  622. // that.API.requestData({
  623. // showLoading: true,
  624. // method: "GET",
  625. // baseURL: "http://192.168.1.18:9002/",
  626. // subUrl: "case/fault/all",
  627. // data: {
  628. // widget: widget ? widget : that.widget,
  629. // station: station ? station : that.station,
  630. // model: that.model,
  631. // st: that.time[0].valueOf(),
  632. // et: that.time[1].valueOf()
  633. // },
  634. // success(res) {
  635. // if (res.code == 200) {
  636. // console.log(res)
  637. // that.tableData.data = [];
  638. // if (res.data.length) {
  639. // let data = res.data;
  640. // for (var i = 0; i < data.length; i++) {
  641. // let obj = {
  642. // index: i + 1,
  643. // widget: data[i].tag == 0 ? '正样本' : '负样本',
  644. // windturbinename: data[i].faulttype,
  645. // tableModel: data[i].model,
  646. // tableTime: data[i].starttime + ' - ' + data[i].endtime,
  647. // tableSymptom: data[i].symptom,
  648. // tableManufacturer: data[i].manufacturer,
  649. // stationcn: data[i].windturbineid,
  650. // tableCategory: data[i].category,
  651. // tableRemark: data[i].remark,
  652. // tableFaultcode: data[i].faultcode,
  653. // tableId: data[i].id,
  654. // tableSymptomcode: data[i].symptomcode,
  655. // tableStationen: data[i].stationen
  656. // };
  657. // that.tableData.data.push(obj);
  658. // }
  659. // }
  660. // }
  661. // },
  662. // });
  663. },
  664. back() {
  665. this.clearDb();
  666. this.$emit('gzCgdClick', 1);
  667. },
  668. switchChange(interval,status) {
  669. if(status === 'interval') {
  670. this.chooseStatus = false
  671. this.selectValue = '60'
  672. }else if(status === 'original'){
  673. this.chooseStatus = true
  674. }
  675. // this.requestDetailData(
  676. // this.wpvalue,
  677. // this.startdate,
  678. // this.enddate,
  679. // interval,
  680. // this.wtId,
  681. // this.descName
  682. // );
  683. },
  684. requestDetailData(point, pointdes, time,interval) {
  685. let that = this;
  686. let Powertrend = [];
  687. pointdes.forEach((ele,index)=>{
  688. Powertrend.push({
  689. title:ele,
  690. smooth: true,
  691. value: [],
  692. })
  693. })
  694. point.forEach((ele,index)=>{
  695. that.API.requestData({
  696. method: "GET",
  697. baseURL: "http://192.168.1.18:9002/",
  698. subUrl: "point/item",
  699. data:{
  700. point:ele,
  701. startTs:time[0],
  702. endTs:time[1],
  703. interval:interval
  704. },
  705. success(res) {
  706. if(res.data){
  707. res.data.forEach((cEle) => {
  708. Powertrend[index].value.push({
  709. text: new Date(cEle.ts).formatDate("hh:mm"),
  710. value: cEle.doubleValue,
  711. });
  712. });
  713. if((point.length - 1) == index){
  714. that.Powertrend = Powertrend;
  715. }
  716. }
  717. },
  718. });
  719. })
  720. },
  721. queryYssj(){
  722. this.requestDetailData(this.point,this.pointdes,[Date.parse(new Date(this.time[0])), Date.parse(new Date(this.time[1]))],this.selectValue);
  723. },
  724. dbfx() {
  725. var that = this;
  726. if (that.point.length <=5) {
  727. that.Powertrend = [];
  728. that.time = [that.st - (3600 * 1000), that.st];
  729. that.requestDetailData(that.point,that.pointdes,[Date.parse(new Date(that.time[0])), Date.parse(new Date(that.time[1]))],that.selectValue);
  730. that.yssjDialog = true;
  731. that.clearDb();
  732. }
  733. },
  734. clearDb() {
  735. //清空对标状态
  736. this.$refs.curRef.clearCheckBox();
  737. this.point = [];
  738. this.pointdes = [];
  739. this.checkLength = 0;
  740. },
  741. },
  742. created() {
  743. this.list(this.data)
  744. },
  745. watch: {
  746. station(res) {
  747. let fjxh = [];
  748. this.fjxhArr.forEach(ele => {
  749. if (ele.id == res) {
  750. ele.value.forEach(ele2 => {
  751. fjxh.push({
  752. label: ele2,
  753. value: ele2
  754. })
  755. })
  756. this.model = ele.value;
  757. }
  758. })
  759. this.fjxh = fjxh;
  760. this.queryType = true;
  761. },
  762. widget() {
  763. this.queryType = true;
  764. },
  765. model() {
  766. this.queryType = true;
  767. },
  768. time() {
  769. this.queryType = true;
  770. },
  771. },
  772. };
  773. </script>
  774. <style lang="less" scoped>
  775. .mb10 {
  776. margin-bottom: 10px;
  777. }
  778. .el-select.w {
  779. width: 100%;
  780. }
  781. </style>