index.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  1. <template>
  2. <div class="dataAnalysisCom" :class="!theme ? 'themeDark' : 'themeLight'">
  3. <div class="dataAnalysisComMain">
  4. <div class="main_top">
  5. <p class="topPsty">功率曲线拟合分析</p>
  6. <search-cop @submit="funSubmit">
  7. </search-cop>
  8. </div>
  9. <div class="main">
  10. <div class="treeDataMain">
  11. <tree-cop :data="treeData" @checkChange="funTreeCheckChange" :show-checkbox="true"
  12. :height="treeHeight" @currentChange="funCurrentChange" @refresh="funGetTree">
  13. </tree-cop>
  14. <tree-cop :dropdownMenu="['export','delete','save']" :data="processTreeData" :height="treeHeight"
  15. @currentChange="funProcessCurrentChange" @refresh="funGetProcessTree">
  16. </tree-cop>
  17. </div>
  18. <div class="excelDataMain">
  19. <div class="excelDataMain_top">
  20. <excel-cop :checkIds="excelCheckIds" :showCheckbox="excelCheckboxShow" :data="excelList"
  21. :theme="theme" :height="excelHeight" @excelChange="funExcelChange"
  22. @checkChange="funExcelCheckChange">
  23. </excel-cop>
  24. </div>
  25. <div class="excelDataMain_bot">
  26. <excel-cop :data="excelFitList" :height="excelHeight" :theme="theme"
  27. @excelChange="funExcelChange">
  28. </excel-cop>
  29. </div>
  30. </div>
  31. <div class="tableDataMain">
  32. <SubmitBtn class="butten_com" desc="区域划分" v-if="activeTab === '2' && excelType === 'fitting'"
  33. @click="funChartArea">
  34. </SubmitBtn>
  35. <el-tabs v-model="activeTab" @tab-click="handleClick">
  36. <el-tab-pane label="表格数据" name="1">
  37. <table-cop :data="tableData" :column="tableColumn" :theme="theme" :loading="tableLoading"
  38. :height="tableHeight" :tableId="tableShowId" :tableName="tableName">
  39. </table-cop>
  40. </el-tab-pane>
  41. <el-tab-pane label="图表展示" name="2">
  42. <div
  43. :style="{ height: typeof tableHeight === 'string' ? tableHeight : tableHeight + 'px' }">
  44. <CurrentScatterChart ref="chartRef" width="100%"
  45. :height="`calc( ${tableHeight} - 20px )`"
  46. :chartTitle="avgObj.title+ '&nbsp;&nbsp;' +'平均Cp值:'+avgObj.cpavg+'; 静风频率:'+avgObj.frequency+'%; 曲线偏差率:'+avgObj.pcratio+'%'"
  47. :xAxisData="xAxisData" :yAxisData="{ splitLine: { show: false } }"
  48. :seriesData="seriesData" :showLegend="true" :brushSelected="!isChartArea"
  49. :theme="theme" :echartsTheme="echartsTheme" :dataSet="dataSet"
  50. @getSelected="funChartSelect" />
  51. </div>
  52. </el-tab-pane>
  53. </el-tabs>
  54. </div>
  55. </div>
  56. </div>
  57. <el-dialog v-model="wtDialog" draggable title="风机功率点位">
  58. <el-tabs v-model="wtTab" @tab-click="handleClick">
  59. <el-tab-pane label="数据" name="table">
  60. <el-table :data="wtData" row-key="id" :max-height="550">
  61. <el-table-column property="wtId" align="center" label="风机" />
  62. <el-table-column property="time" sortable :width="160" align="center" label="时间" />
  63. <el-table-column property="speed" sortable align="center" label="风速(m/s)" />
  64. <el-table-column property="power" sortable align="center" label="功率(kW)" />
  65. <el-table-column property="rr" sortable align="center" label="转速" />
  66. <el-table-column property="filter" sortable align="center" label="是否有用点" />
  67. </el-table>
  68. </el-tab-pane>
  69. <el-tab-pane label="故障" name="problem">
  70. <el-table :data="faultData" row-key="id" :max-height="550">
  71. <el-table-column property="deviceId" align="center" label="风机" />
  72. <el-table-column property="ts" sortable :width="160" align="center" label="时间">
  73. <template v-slot="scope">
  74. {{new Date(scope.row.ts).formatDate("yyyy-MM-dd hh:mm:ss")}}
  75. </template>
  76. </el-table-column>
  77. <el-table-column property="characteristic" sortable align="center" label="特性" />
  78. <el-table-column property="components" sortable align="center" label="部件" />
  79. <el-table-column property="description" sortable align="center" label="描述" />
  80. </el-table>
  81. </el-tab-pane>
  82. <el-tab-pane label="预警" name="warning">
  83. <el-table :data="warnData" row-key="id" :max-height="550">
  84. <el-table-column property="deviceId" align="center" label="风机" />
  85. <el-table-column property="ts" sortable :width="160" align="center" label="时间">
  86. <template v-slot="scope">
  87. {{new Date(scope.row.ts).formatDate("yyyy-MM-dd hh:mm:ss")}}
  88. </template>
  89. </el-table-column>
  90. <el-table-column property="characteristic" sortable align="center" label="特性" />
  91. <el-table-column property="components" sortable align="center" label="部件" />
  92. <el-table-column property="description" sortable align="center" label="描述" />
  93. </el-table>
  94. </el-tab-pane>
  95. </el-tabs>
  96. </el-dialog>
  97. </div>
  98. </template>
  99. <script setup name="prepare">
  100. import searchCop from './components/search.vue'
  101. import SubmitBtn from '@/components/generatingCapacityComponent/SubmitBtn.vue'
  102. import excelCop from '@/components/generatingCapacityComponent/excel.vue'
  103. import treeCop from '@/components/generatingCapacityComponent/tree.vue'
  104. import tableCop from '@/components/generatingCapacityComponent/table.vue'
  105. import {
  106. ref,
  107. nextTick,
  108. onActivated,
  109. onMounted,
  110. reactive,
  111. watch
  112. } from 'vue'
  113. import {
  114. useStore
  115. } from 'vuex';
  116. import httpRequest from '@/utils/request.js'
  117. import {
  118. ElMessage
  119. } from 'element-plus'
  120. import util from "@tools/util";
  121. import CurrentScatterChart from './components/current-scatter-chart.vue'
  122. // import dotRes from '@/data/dot.json'
  123. // import tableRes from '@/data/table.json'
  124. // import areaDataRes from '@/data/areaData.json'
  125. /**配置参数 */
  126. const tableHeight = ref(window.innerHeight - 170 + 'px')
  127. const excelHeight = ref((window.innerHeight - 131) / 2 + 'px')
  128. const treeHeight = ref((window.innerHeight - 131) / 2 + 'px')
  129. /**excel 开始 */
  130. const excelCheckboxShow = ref(false)
  131. const excelType = ref('')
  132. const excelCheckIds = ref([])
  133. const excelList = ref([])
  134. const funExcelChange = async (obj) => { //点击excel项时
  135. activeTab.value = '1'
  136. isChartArea.value = false
  137. tableShowId.value = obj.id
  138. tableName.value = obj.name
  139. excelType.value = obj.type // 接收excel的type 用于控制右侧tab展示
  140. let res = null
  141. let chartRes = {
  142. scatterhs: [
  143. []
  144. ],
  145. scatterls: [
  146. []
  147. ],
  148. sjgl: [
  149. []
  150. ],
  151. llgl: [
  152. []
  153. ],
  154. cpz: [
  155. []
  156. ]
  157. }
  158. let chartResponse = null
  159. tableLoading.value = true
  160. if (obj.type === 'process') {
  161. res = await httpRequest.get('/power/process/show', {
  162. params: {
  163. id: obj.id
  164. }
  165. })
  166. } else if (obj.type === 'fitting') {
  167. activeTab.value = '2'
  168. res = await httpRequest.get('/power/fitting/show', {
  169. params: {
  170. id: obj.id
  171. }
  172. })
  173. // res = tableRes
  174. // chartResponse = dotRes
  175. chartResponse = await httpRequest.get('/power/fitting/curve', {
  176. params: {
  177. id: obj.id,
  178. p: 1
  179. }
  180. })
  181. }
  182. if (res.code === 200) {
  183. tableColumn.value = res.data.title.map(o => {
  184. return {
  185. prop: o.key,
  186. width: o.des === '时间' ? 100 : 80,
  187. label: o.des,
  188. }
  189. })
  190. tableData.value = res.data.data
  191. tableLoading.value = false
  192. } else {
  193. tableLoading.value = false
  194. }
  195. if (chartResponse && chartResponse.code === 200) {
  196. chartRes = chartResponse.data
  197. markDot.pcl5 = chartRes.obj.pc5ratio
  198. markDot.pcl10 = chartRes.obj.pc10ratio
  199. markDot.pcl12 = chartRes.obj.pc12ratio
  200. markDot.pcl25 = chartRes.obj.pc25ratio
  201. avgObj.title = chartRes.obj.path.substring(chartRes.obj.path.indexOf(chartRes.obj.station + '_') + (
  202. chartRes.obj.station + '_').length).split('_')[0];
  203. avgObj.cpavg = Number(chartRes.obj.cpavg).toFixed(2)
  204. avgObj.frequency = Number(chartRes.obj.frequency).toFixed(2)
  205. avgObj.pcratio = Number(chartRes.obj.pcratio).toFixed(2)
  206. dataSet.value = JSON.stringify([{
  207. source: chartRes.wyd
  208. // source: chartRes.scatterls
  209. },
  210. {
  211. source: chartRes.yyd
  212. // source: chartRes.scatterhs
  213. }
  214. ])
  215. const color = ["#1C99FF", "#FF8700", "#3D54BE", "#fa8c16", "#1DA0D7", "#DD5044"]
  216. seriesData.value = [{
  217. name: "拟合功率",
  218. type: "line",
  219. symbol: "line", //设定为实心点
  220. symbolSize: 0, //设定实心点的大小
  221. smooth: true, //这个是把线变成曲线
  222. data: chartRes.sjgl,
  223. xAxisIndex: 0,
  224. },
  225. {
  226. name: "保证功率",
  227. type: "line",
  228. symbol: "line", //设定为实心点
  229. symbolSize: 0, //设定实心点的大小
  230. smooth: true, //这个是把线变成曲线
  231. data: chartRes.llgl,
  232. xAxisIndex: 0,
  233. },
  234. {
  235. type: 'effectScatter',
  236. showEffectOn: "emphasis",
  237. rippleEffect: {
  238. scale: 1
  239. },
  240. name: '无用点',
  241. symbolSize: (data) => {
  242. return data.s ? data.s > 10 ? 10 : data.s : 4
  243. },
  244. datasetIndex: 0,
  245. encode: {
  246. x: 'x',
  247. y: 'y'
  248. },
  249. xAxisIndex: 0,
  250. yAxisIndex: 0,
  251. },
  252. {
  253. type: 'effectScatter',
  254. showEffectOn: "emphasis",
  255. rippleEffect: {
  256. scale: 1
  257. },
  258. name: '有用点',
  259. symbolSize: (data) => {
  260. return data.s ? data.s > 10 ? 10 : data.s : 4
  261. },
  262. datasetIndex: 1,
  263. encode: {
  264. x: 'x',
  265. y: 'y'
  266. },
  267. xAxisIndex: 0,
  268. yAxisIndex: 0,
  269. },
  270. {
  271. name: "Cp值",
  272. type: "line",
  273. symbol: "line", //设定为实心点
  274. symbolSize: 0, //设定实心点的大小
  275. smooth: true, //这个是把线变成曲线
  276. data: chartRes.cpz,
  277. xAxisIndex: 0,
  278. yAxisIndex: 1,
  279. },
  280. ]
  281. }
  282. }
  283. const funExcelCheckChange = ({
  284. checkArr,
  285. data
  286. }) => { //bug
  287. excelCheckIds.value = checkArr
  288. }
  289. /**excel fitData */
  290. const excelFitList = ref([])
  291. /**prepare tree 开始 */
  292. const treeData = ref([])
  293. const actTreeNode = ref(null) //当前激活的treeNode
  294. const funRepeatMap = (arr, type = 'prepare') => {
  295. return arr.map(o => {
  296. if (o.children) {
  297. const findIndex = o.children.findIndex(p => !!p.type)
  298. if (findIndex !== -1) {
  299. o.childs = o.children
  300. o.children = []
  301. if (!actTreeNode.value && type === 'process') { //判断当且仅有process获取tree时 赋值
  302. actTreeNode.value = o
  303. }
  304. }
  305. }
  306. return {
  307. ...o,
  308. children: o.children ? funRepeatMap(o.children, type) : []
  309. }
  310. })
  311. }
  312. const funGetTree = async () => {
  313. const res = await httpRequest.get("/power/process/tree")
  314. treeData.value = funRepeatMap(res.data)
  315. excelList.value = []
  316. }
  317. const funCurrentChange = ({
  318. current,
  319. currentNode
  320. }) => {
  321. excelCheckboxShow.value = true
  322. if (current.childs) {
  323. excelList.value = current.childs.map(o => {
  324. return {
  325. id: o.id,
  326. interval: o.interval,
  327. path: o.path,
  328. prepareid: o.prepareid,
  329. station: o.station,
  330. time: o.time,
  331. type: o.type,
  332. windturbine: o.windturbine,
  333. name: o.path.substring(o.path.indexOf(o.station + '_') + (o.station + '_').length)
  334. }
  335. })
  336. } else {
  337. excelList.value = []
  338. }
  339. }
  340. const funTreeCheckChange = ({
  341. current,
  342. checkedNodes,
  343. checkedKeys,
  344. halfCheckedNodes,
  345. halfCheckedKeys
  346. }) => { //tree change -> excel change
  347. funCurrentChange({
  348. current,
  349. currentNode: ''
  350. })
  351. const checkIds = []
  352. if (checkedNodes.checkedNodes.length) {
  353. let checkArr = checkedNodes.checkedNodes
  354. checkArr.forEach(it => {
  355. if (it.childs && it.childs.length) {
  356. it.childs.forEach(iv => {
  357. checkIds.push(iv.id)
  358. })
  359. }
  360. })
  361. }
  362. excelCheckIds.value = checkIds
  363. }
  364. /**process tree 开始 */
  365. const processTreeData = ref([])
  366. const funGetProcessTree = async (flag = true) => { //flag控制是否获取tree的第一项 true为可获取
  367. actTreeNode.value = null
  368. const res = await httpRequest.get("/power/fitting/tree")
  369. excelFitList.value = []
  370. processTreeData.value = funRepeatMap(res.data, flag ? 'process' : 'prepare') //flag控制对actTreeNode赋值
  371. if (actTreeNode.value) {
  372. funProcessCurrentChange({
  373. current: actTreeNode.value,
  374. currentNode: null
  375. })
  376. const child = actTreeNode.value.childs[0]
  377. const obj = {
  378. id: child.id,
  379. interval: child.interval,
  380. path: child.path,
  381. prepareid: child.prepareid,
  382. station: child.station,
  383. time: child.time,
  384. type: child.type,
  385. windturbine: child.windturbine,
  386. name: child.path.substring(child.path.indexOf(child.station + '_') + (child.station + '_')
  387. .length)
  388. }
  389. funExcelChange(obj)
  390. }
  391. }
  392. const funProcessCurrentChange = ({
  393. current,
  394. currentNode
  395. }) => {
  396. if (current.childs) {
  397. excelFitList.value = current.childs.map(o => {
  398. return {
  399. id: o.id,
  400. interval: o.interval,
  401. path: o.path,
  402. prepareid: o.prepareid,
  403. station: o.station,
  404. time: o.time,
  405. type: o.type,
  406. windturbine: o.windturbine,
  407. name: o.path.substring(o.path.indexOf(o.station + '_') + (o.station + '_').length)
  408. }
  409. })
  410. if (excelFitList.value.length > 0) {
  411. funExcelChange(excelFitList.value[0])
  412. }
  413. } else {
  414. excelFitList.value = []
  415. }
  416. }
  417. /**table 开始 */
  418. const tableShowId = ref('')
  419. const tableColumn = ref([])
  420. const tableLoading = ref(false)
  421. const tableName = ref('')
  422. const tableData = ref([])
  423. /**table 结束 */
  424. /**search 开始 */
  425. const funSubmit = async (query) => {
  426. if (!excelCheckIds.value.length) {
  427. ElMessage.error('请勾选要预处理的项')
  428. return false
  429. }
  430. const params = {
  431. ...query,
  432. ids: excelCheckIds.value.join(',')
  433. }
  434. const res = await httpRequest.get('/power/fitting/data', {
  435. params: params
  436. })
  437. if (res.code === 200) {
  438. ElMessage.success(res.msg)
  439. funGetProcessTree(false) //阻止获取tree第一项数据及图表
  440. const excelInfo = res.data
  441. /**拟合完成后 显示右侧图表及数据 */
  442. funExcelChange({
  443. id: excelInfo.id,
  444. name: excelInfo.path.substring(excelInfo.path.indexOf(excelInfo.station + '_') + (
  445. excelInfo.station + '_').length),
  446. type: 'fitting'
  447. })
  448. }
  449. }
  450. /**chart Data */
  451. const avgObj = reactive({ //平均cpz等
  452. title: '',
  453. cpavg: '',
  454. frequency: '',
  455. pcratio: ''
  456. })
  457. const markDot = reactive({ //3-5 point点等
  458. pcl5: null,
  459. pcl10: null,
  460. pcl12: null,
  461. pcl25: null
  462. })
  463. const xAxisData = ref([])
  464. const chartRef = ref() //chart 的ref
  465. const seriesData = ref([])
  466. const isChartArea = ref(false) // 用来控制图表是否区域划分
  467. const dataSet = ref('')
  468. const funChartSelect = async (batch) => {
  469. const wDataArr = []
  470. const yDataArr = []
  471. let scatterls = []
  472. let scatterhs = []
  473. let dataSetObj = []
  474. wtData.value = []
  475. if (batch.length && dataSet.value) {
  476. scatterls = batch[0].selected[2].dataIndex
  477. scatterhs = batch[0].selected[3].dataIndex
  478. if (scatterls.length || scatterhs.length) {
  479. dataSetObj = JSON.parse(dataSet.value)
  480. if (scatterls.length) {
  481. for (const scatterIndex of scatterls) {
  482. wDataArr.push(dataSetObj[0].source[scatterIndex].k)
  483. }
  484. }
  485. if (scatterhs.length) {
  486. for (const scatterIndex of scatterhs) {
  487. yDataArr.push(dataSetObj[1].source[scatterIndex].k)
  488. }
  489. }
  490. const wtRes = await httpRequest.get('/power/fitting/filter', {
  491. params: {
  492. yk: yDataArr.join(','),
  493. wk: wDataArr.join(','),
  494. only: dataRadom.value
  495. }
  496. })
  497. if (wtRes.code === 200) {
  498. let id = 1
  499. const tempArr = [] //用于以风机id 聚合dataArr
  500. if (wtRes.data.length) {
  501. for (const data of wtRes.data) {
  502. if (tempArr.length) {
  503. const findIndex = tempArr.findIndex(o => o.wtId === data.wtId)
  504. if (findIndex !== -1) {
  505. if (!tempArr[findIndex].children) {
  506. tempArr[findIndex].children = []
  507. }
  508. tempArr[findIndex].children.push({
  509. ...data,
  510. id: id,
  511. filter: data.filter === 0 ? '是' : '否'
  512. })
  513. id++
  514. } else {
  515. tempArr.push({
  516. ...data,
  517. id: id,
  518. filter: data.filter === 0 ? '是' : '否'
  519. })
  520. id++
  521. }
  522. } else {
  523. tempArr.push({
  524. ...data,
  525. id: id,
  526. filter: data.filter === 0 ? '是' : '否'
  527. })
  528. id++
  529. }
  530. }
  531. wtDialog.value = true
  532. nextTick(() => {
  533. wtTab.value = 'table'
  534. wtData.value = tempArr
  535. })
  536. }
  537. }
  538. }
  539. }
  540. }
  541. const funChartArea = () => {
  542. if (seriesData.value.length) {
  543. if (!isChartArea.value) {
  544. // 请求一下
  545. seriesData.value[0] = {
  546. ...seriesData.value[0],
  547. markLine: {
  548. symbol: 'none',
  549. label: {
  550. show: false
  551. },
  552. lineStyle: {
  553. color: 'rgba(96,174,255, 1)'
  554. },
  555. data: [{
  556. xAxis: 3,
  557. valueIndex: 0,
  558. },
  559. {
  560. xAxis: 5,
  561. valueIndex: 0
  562. },
  563. {
  564. xAxis: 10,
  565. valueIndex: 0
  566. },
  567. {
  568. xAxis: 12,
  569. valueIndex: 0
  570. },
  571. {
  572. xAxis: 25,
  573. valueIndex: 0
  574. },
  575. ]
  576. },
  577. markArea: {
  578. label: {
  579. fontSize: util.vh(12),
  580. },
  581. itemStyle: {
  582. color: 'rgba(236,245,255, 0)'
  583. },
  584. emphasis: {
  585. itemStyle: {
  586. color: 'rgba(96,174,255, 0.5)'
  587. }
  588. },
  589. data: [
  590. [{
  591. name: `3~5m 偏差率: ${markDot.pcl5}%`,
  592. xAxis: 3,
  593. },
  594. {
  595. xAxis: 5,
  596. }
  597. ],
  598. [{
  599. name: `5~10m 偏差率: ${markDot.pcl10}%`,
  600. xAxis: 5,
  601. },
  602. {
  603. xAxis: 10,
  604. }
  605. ],
  606. [{
  607. name: `10~12m 偏差率: ${markDot.pcl12}%`,
  608. xAxis: 10,
  609. },
  610. {
  611. xAxis: 12,
  612. }
  613. ],
  614. [{
  615. name: `12~25m 偏差率: ${markDot.pcl25}%`,
  616. xAxis: 12,
  617. },
  618. {
  619. xAxis: 25,
  620. }
  621. ],
  622. ]
  623. },
  624. }
  625. isChartArea.value = true
  626. } else {
  627. seriesData.value[0] = {
  628. ...seriesData.value[0],
  629. markLine: null,
  630. markArea: null,
  631. }
  632. isChartArea.value = false
  633. }
  634. }
  635. }
  636. const handleClick = (val) => {
  637. wtTab.value = val.props.name
  638. if (wtTab.value === 'problem') {
  639. faultDataFn()
  640. } else if (wtTab.value === 'warning') {
  641. warnDataFn()
  642. }
  643. }
  644. //故障数据
  645. const faultDataFn = async () => {
  646. let params = {
  647. only: dataRadom.value,
  648. table: 'alarmWt'
  649. }
  650. const faultRes = await httpRequest.get('/power/fitting/alarms', {
  651. params: params
  652. })
  653. faultData.value = faultRes.data
  654. }
  655. //预警数据
  656. const warnDataFn = async () => {
  657. let params = {
  658. only: dataRadom.value,
  659. table: 'alarmCt'
  660. }
  661. const warnRes = await httpRequest.get('/power/fitting/alarms', {
  662. params: params
  663. })
  664. warnData.value = warnRes.data
  665. }
  666. /**dialog 数据 */
  667. const wtDialog = ref(false)
  668. const wtData = ref([])
  669. const faultData = ref([])
  670. const warnData = ref([])
  671. const wtTab = ref('table')
  672. // 随机数
  673. const dataRadom = ref(null)
  674. /**tab */
  675. const activeTab = ref('1')
  676. /**created */
  677. // funGetTree()
  678. // funGetProcessTree()
  679. const theme = ref(null)
  680. const echartsTheme = ref('')
  681. const store = useStore()
  682. watch(() => store.state.theme, (newVal, oldVal) => {
  683. theme.value = newVal
  684. echartsTheme.value = !newVal ? 'dark' : ''
  685. funGetTree()
  686. funGetProcessTree()
  687. }, {
  688. deep: true
  689. })
  690. /**mounted */
  691. onMounted(() => {
  692. funGetTree()
  693. funGetProcessTree()
  694. theme.value = store.state.theme
  695. echartsTheme.value = !theme.value ? 'dark' : ''
  696. dataRadom.value = (new Date().getTime()).toString()
  697. tableHeight.value = window.innerHeight - 170 + 'px'
  698. excelHeight.value = (window.innerHeight - 131) / 2 + 'px'
  699. treeHeight.value = (window.innerHeight - 131) / 2 + 'px'
  700. window.addEventListener('resize', () => {
  701. tableHeight.value = window.innerHeight - 170 + 'px'
  702. excelHeight.value = (window.innerHeight - 131) / 2 + 'px'
  703. treeHeight.value = (window.innerHeight - 131) / 2 + 'px'
  704. })
  705. /**test */
  706. // funExcelChange({
  707. // id: 1,
  708. // name: 'excel',
  709. // type: 'fitting',
  710. // })
  711. })
  712. </script>
  713. <style lang="less">
  714. .dataAnalysisCom {
  715. height: 100%;
  716. .dataAnalysisComMain {
  717. height: 100%;
  718. .main_top {
  719. height: 40px;
  720. display: flex;
  721. align-items: center;
  722. .topPsty {
  723. position: relative;
  724. top: 5px;
  725. padding: 7px 20px;
  726. font-size: 12px;
  727. font-weight: 600;
  728. margin-left: 10px;
  729. border-radius: 3px;
  730. }
  731. }
  732. .main {
  733. display: flex;
  734. width: 100%;
  735. .treeDataMain,
  736. .excelDataMain,
  737. .tableDataMain {
  738. border-radius: 10px;
  739. }
  740. .treeDataMain {
  741. margin-right: 10px;
  742. padding: 10px 0 10px 10px;
  743. width: calc(19% - 20px);
  744. }
  745. .excelDataMain {
  746. margin-right: 10px;
  747. padding: 10px 0 10px 10px;
  748. width: calc(15% - 20px);
  749. .excelDataMain_top {
  750. padding: 5px 0;
  751. }
  752. .excelDataMain_bot {
  753. padding: 5px 0;
  754. }
  755. }
  756. .tableDataMain {
  757. padding: 10px;
  758. width: calc(66% - 20px);
  759. position: relative;
  760. .butten_com {
  761. position: absolute;
  762. right: 20px;
  763. z-index: 111111;
  764. }
  765. }
  766. }
  767. }
  768. }
  769. .themeDark {
  770. .dataAnalysisComMain {
  771. .main_top {
  772. .topPsty {
  773. color: #1C99FF;
  774. background: #1E2126;
  775. }
  776. }
  777. .main {
  778. background: #13171e;
  779. .treeDataMain {
  780. background: transparent;
  781. }
  782. .excelDataMain {
  783. background: #313233;
  784. }
  785. .tableDataMain {
  786. margin-top: 5px;
  787. background: #212223;
  788. }
  789. }
  790. }
  791. }
  792. .themeLight {
  793. padding: 0;
  794. .dataAnalysisComMain {
  795. .main_top {
  796. .topPsty {
  797. color: #2778FF;
  798. background: #FFFFFF;
  799. }
  800. }
  801. .main {
  802. background: #E6E8F2;
  803. .treeDataMain {
  804. background: transparent;
  805. }
  806. .excelDataMain {
  807. background: #F4F6FB;
  808. }
  809. .tableDataMain {
  810. background: #fff;
  811. margin-top: 5px;
  812. }
  813. }
  814. }
  815. }
  816. </style>