index.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  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 - 180 + 'px')
  127. const excelHeight = ref((window.innerHeight - 150) / 2 + 'px')
  128. const treeHeight = ref((window.innerHeight - 150) / 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. } else {
  411. excelFitList.value = []
  412. }
  413. }
  414. /**table 开始 */
  415. const tableShowId = ref('')
  416. const tableColumn = ref([])
  417. const tableLoading = ref(false)
  418. const tableName = ref('')
  419. const tableData = ref([])
  420. /**table 结束 */
  421. /**search 开始 */
  422. const funSubmit = async (query) => {
  423. if (!excelCheckIds.value.length) {
  424. ElMessage.error('请勾选要预处理的项')
  425. return false
  426. }
  427. const params = {
  428. ...query,
  429. ids: excelCheckIds.value.join(',')
  430. }
  431. const res = await httpRequest.get('/power/fitting/data', {
  432. params: params
  433. })
  434. if (res.code === 200) {
  435. ElMessage.success(res.msg)
  436. funGetProcessTree(false) //阻止获取tree第一项数据及图表
  437. const excelInfo = res.data
  438. /**拟合完成后 显示右侧图表及数据 */
  439. funExcelChange({
  440. id: excelInfo.id,
  441. name: excelInfo.path.substring(excelInfo.path.indexOf(excelInfo.station + '_') + (
  442. excelInfo.station + '_').length),
  443. type: 'fitting'
  444. })
  445. }
  446. }
  447. /**chart Data */
  448. const avgObj = reactive({ //平均cpz等
  449. title: '',
  450. cpavg: '',
  451. frequency: '',
  452. pcratio: ''
  453. })
  454. const markDot = reactive({ //3-5 point点等
  455. pcl5: null,
  456. pcl10: null,
  457. pcl12: null,
  458. pcl25: null
  459. })
  460. const xAxisData = ref([])
  461. const chartRef = ref() //chart 的ref
  462. const seriesData = ref([])
  463. const isChartArea = ref(false) // 用来控制图表是否区域划分
  464. const dataSet = ref('')
  465. const funChartSelect = async (batch) => {
  466. const wDataArr = []
  467. const yDataArr = []
  468. let scatterls = []
  469. let scatterhs = []
  470. let dataSetObj = []
  471. wtData.value = []
  472. if (batch.length && dataSet.value) {
  473. scatterls = batch[0].selected[2].dataIndex
  474. scatterhs = batch[0].selected[3].dataIndex
  475. if (scatterls.length || scatterhs.length) {
  476. dataSetObj = JSON.parse(dataSet.value)
  477. if (scatterls.length) {
  478. for (const scatterIndex of scatterls) {
  479. wDataArr.push(dataSetObj[0].source[scatterIndex].k)
  480. }
  481. }
  482. if (scatterhs.length) {
  483. for (const scatterIndex of scatterhs) {
  484. yDataArr.push(dataSetObj[1].source[scatterIndex].k)
  485. }
  486. }
  487. const wtRes = await httpRequest.get('/power/fitting/filter', {
  488. params: {
  489. yk: yDataArr.join(','),
  490. wk: wDataArr.join(','),
  491. only: dataRadom.value
  492. }
  493. })
  494. if (wtRes.code === 200) {
  495. let id = 1
  496. const tempArr = [] //用于以风机id 聚合dataArr
  497. if (wtRes.data.length) {
  498. for (const data of wtRes.data) {
  499. if (tempArr.length) {
  500. const findIndex = tempArr.findIndex(o => o.wtId === data.wtId)
  501. if (findIndex !== -1) {
  502. if (!tempArr[findIndex].children) {
  503. tempArr[findIndex].children = []
  504. }
  505. tempArr[findIndex].children.push({
  506. ...data,
  507. id: id,
  508. filter: data.filter === 0 ? '是' : '否'
  509. })
  510. id++
  511. } else {
  512. tempArr.push({
  513. ...data,
  514. id: id,
  515. filter: data.filter === 0 ? '是' : '否'
  516. })
  517. id++
  518. }
  519. } else {
  520. tempArr.push({
  521. ...data,
  522. id: id,
  523. filter: data.filter === 0 ? '是' : '否'
  524. })
  525. id++
  526. }
  527. }
  528. wtDialog.value = true
  529. nextTick(() => {
  530. wtTab.value = 'table'
  531. wtData.value = tempArr
  532. })
  533. }
  534. }
  535. }
  536. }
  537. }
  538. const funChartArea = () => {
  539. if (seriesData.value.length) {
  540. if (!isChartArea.value) {
  541. // 请求一下
  542. seriesData.value[0] = {
  543. ...seriesData.value[0],
  544. markLine: {
  545. symbol: 'none',
  546. label: {
  547. show: false
  548. },
  549. lineStyle: {
  550. color: 'rgba(96,174,255, 1)'
  551. },
  552. data: [{
  553. xAxis: 3,
  554. valueIndex: 0,
  555. },
  556. {
  557. xAxis: 5,
  558. valueIndex: 0
  559. },
  560. {
  561. xAxis: 10,
  562. valueIndex: 0
  563. },
  564. {
  565. xAxis: 12,
  566. valueIndex: 0
  567. },
  568. {
  569. xAxis: 25,
  570. valueIndex: 0
  571. },
  572. ]
  573. },
  574. markArea: {
  575. label: {
  576. fontSize: util.vh(12),
  577. },
  578. itemStyle: {
  579. color: 'rgba(236,245,255, 0)'
  580. },
  581. emphasis: {
  582. itemStyle: {
  583. color: 'rgba(96,174,255, 0.5)'
  584. }
  585. },
  586. data: [
  587. [{
  588. name: `3~5m 偏差率: ${markDot.pcl5}%`,
  589. xAxis: 3,
  590. },
  591. {
  592. xAxis: 5,
  593. }
  594. ],
  595. [{
  596. name: `5~10m 偏差率: ${markDot.pcl10}%`,
  597. xAxis: 5,
  598. },
  599. {
  600. xAxis: 10,
  601. }
  602. ],
  603. [{
  604. name: `10~12m 偏差率: ${markDot.pcl12}%`,
  605. xAxis: 10,
  606. },
  607. {
  608. xAxis: 12,
  609. }
  610. ],
  611. [{
  612. name: `12~25m 偏差率: ${markDot.pcl25}%`,
  613. xAxis: 12,
  614. },
  615. {
  616. xAxis: 25,
  617. }
  618. ],
  619. ]
  620. },
  621. }
  622. isChartArea.value = true
  623. } else {
  624. seriesData.value[0] = {
  625. ...seriesData.value[0],
  626. markLine: null,
  627. markArea: null,
  628. }
  629. isChartArea.value = false
  630. }
  631. }
  632. }
  633. const handleClick = (val) => {
  634. wtTab.value = val.props.name
  635. if (wtTab.value === 'problem') {
  636. faultDataFn()
  637. } else if (wtTab.value === 'warning') {
  638. warnDataFn()
  639. }
  640. }
  641. //故障数据
  642. const faultDataFn = async () => {
  643. let params = {
  644. only: dataRadom.value,
  645. table: 'alarmWt'
  646. }
  647. const faultRes = await httpRequest.get('/power/fitting/alarms', {
  648. params: params
  649. })
  650. faultData.value = faultRes.data
  651. }
  652. //预警数据
  653. const warnDataFn = async () => {
  654. let params = {
  655. only: dataRadom.value,
  656. table: 'alarmCt'
  657. }
  658. const warnRes = await httpRequest.get('/power/fitting/alarms', {
  659. params: params
  660. })
  661. warnData.value = warnRes.data
  662. }
  663. /**dialog 数据 */
  664. const wtDialog = ref(false)
  665. const wtData = ref([])
  666. const faultData = ref([])
  667. const warnData = ref([])
  668. const wtTab = ref('table')
  669. // 随机数
  670. const dataRadom = ref(null)
  671. /**tab */
  672. const activeTab = ref('1')
  673. /**created */
  674. // funGetTree()
  675. // funGetProcessTree()
  676. const theme = ref(null)
  677. const echartsTheme = ref('')
  678. const store = useStore()
  679. watch(() => store.state.theme, (newVal, oldVal) => {
  680. theme.value = newVal
  681. echartsTheme.value = !newVal ? 'dark' : ''
  682. funGetTree()
  683. funGetProcessTree()
  684. }, {
  685. deep: true
  686. })
  687. /**mounted */
  688. onMounted(() => {
  689. funGetTree()
  690. funGetProcessTree()
  691. theme.value = store.state.theme
  692. echartsTheme.value = !theme.value ? 'dark' : ''
  693. dataRadom.value = (new Date().getTime()).toString()
  694. tableHeight.value = window.innerHeight - 180 + 'px'
  695. excelHeight.value = (window.innerHeight - 150) / 2 + 'px'
  696. treeHeight.value = (window.innerHeight - 150) / 2 + 'px'
  697. window.addEventListener('resize', () => {
  698. tableHeight.value = window.innerHeight - 180 + 'px'
  699. excelHeight.value = (window.innerHeight - 150) / 2 + 'px'
  700. treeHeight.value = (window.innerHeight - 150) / 2 + 'px'
  701. })
  702. /**test */
  703. // funExcelChange({
  704. // id: 1,
  705. // name: 'excel',
  706. // type: 'fitting',
  707. // })
  708. })
  709. </script>
  710. <style lang="less">
  711. .dataAnalysisCom {
  712. height: 100%;
  713. .dataAnalysisComMain {
  714. height: 100%;
  715. .main_top {
  716. height: 40px;
  717. display: flex;
  718. align-items: center;
  719. .topPsty {
  720. position: relative;
  721. top: 5px;
  722. padding: 7px 20px;
  723. font-size: 12px;
  724. font-weight: 600;
  725. margin-left: 10px;
  726. border-radius: 3px;
  727. }
  728. }
  729. .main {
  730. display: flex;
  731. justify-content: space-between;
  732. // width: calc(100% - 40px);
  733. width: 100%;
  734. .treeDataMain,
  735. .excelDataMain,
  736. .tableDataMain {
  737. padding: 10px;
  738. border-radius: 10px;
  739. }
  740. .treeDataMain {
  741. width: calc(20% - 20px);
  742. }
  743. .excelDataMain {
  744. width: calc(13% - 20px);
  745. .excelDataMain_top {
  746. padding: 5px 0;
  747. }
  748. .excelDataMain_bot {
  749. padding: 5px 0;
  750. }
  751. }
  752. .tableDataMain {
  753. width: calc(66% - 20px);
  754. position: relative;
  755. .butten_com {
  756. position: absolute;
  757. right: 20px;
  758. z-index: 111111;
  759. }
  760. }
  761. }
  762. }
  763. }
  764. .themeDark {
  765. .dataAnalysisComMain {
  766. .main_top {
  767. .topPsty {
  768. color: #1C99FF;
  769. background: #1E2126;
  770. }
  771. }
  772. .main {
  773. background: #13171e;
  774. .treeDataMain {
  775. background: transparent;
  776. }
  777. .excelDataMain {
  778. background: #313233;
  779. }
  780. .tableDataMain {
  781. margin-top: 5px;
  782. background: #212223;
  783. }
  784. }
  785. }
  786. }
  787. .themeLight {
  788. padding: 0;
  789. .dataAnalysisComMain {
  790. .main_top {
  791. .topPsty {
  792. color: #2778FF;
  793. background: #FFFFFF;
  794. }
  795. }
  796. .main {
  797. background: #E6E8F2;
  798. .treeDataMain {
  799. background: transparent;
  800. }
  801. .excelDataMain {
  802. background: #F4F6FB;
  803. }
  804. .tableDataMain {
  805. background: #fff;
  806. margin-top: 5px;
  807. }
  808. }
  809. }
  810. }
  811. </style>