analysisEvent.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990
  1. <!--
  2. * @Author: your name
  3. * @Date: 2024-05-29 09:13:51
  4. * @LastEditTime: 2025-03-19 16:18:02
  5. * @LastEditors: bogon
  6. * @Description: In User Settings Edit
  7. * @FilePath: /performance-test/src/views/performance/components/analysisEvent.vue
  8. -->
  9. <template>
  10. <!-- 分析事件页面 -->
  11. <div v-loading="loading">
  12. <el-form
  13. ref="form"
  14. :model="form"
  15. label-position="right"
  16. label-width="120px"
  17. inline
  18. >
  19. <el-row type="flex" justify="end">
  20. <el-col :span="12">
  21. <el-form-item label="分析主题:">
  22. <span>{{ analysisName }}</span>
  23. </el-form-item>
  24. <el-form-item label="分析风场:">
  25. <span>{{ fieldName }}</span>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="12" style="display: flex; justify-content: end">
  29. <el-form-item class="searchFrom">
  30. <!-- <span>分析主题:{{ analysisName }}</span>
  31. <span>分析风场:{{ fieldName }}</span> -->
  32. <el-button type="primary" @click="onSubmit" size="small"
  33. >分析</el-button
  34. >
  35. <el-button size="small" @click="resetForm">重置</el-button>
  36. <!-- <el-button
  37. type="info"
  38. size="small"
  39. @click="drawer = true"
  40. icon="el-icon-setting"
  41. ></el-button> -->
  42. <i @click="drawer = true" class="el-icon-setting setting"></i>
  43. </el-form-item>
  44. </el-col>
  45. </el-row>
  46. <el-collapse v-model="activeNames">
  47. <el-collapse-item title="数据关联:" name="1">
  48. <el-row class="flex-wrap-row" :gutter="5">
  49. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="5">
  50. <el-form-item
  51. label="机组名称"
  52. v-if="checkedCities.find((item) => item === '机组名称')"
  53. >
  54. <el-select
  55. multiple
  56. collapse-tags
  57. v-model="form.turbines"
  58. placeholder="请选择机组名称"
  59. size="small"
  60. clearable
  61. >
  62. <el-checkbox
  63. v-model="checkedTurbines"
  64. @change="selectAllTurbines"
  65. >全选</el-checkbox
  66. >
  67. <el-option
  68. v-for="item in windEngineGroupList"
  69. :key="item.engineCode"
  70. :label="item.engineName"
  71. :value="item.engineCode"
  72. ></el-option>
  73. </el-select>
  74. </el-form-item>
  75. </el-col>
  76. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="5">
  77. <el-form-item
  78. label="分析模型"
  79. v-if="checkedCities.find((item) => item === '分析模型')"
  80. prop=""
  81. >
  82. <el-select
  83. v-model="form.configAnalysis"
  84. placeholder="请选择分析模型"
  85. size="small"
  86. collapse-tags
  87. multiple
  88. clearable
  89. @change="handleScadaAnalysis"
  90. >
  91. <el-checkbox v-model="checked" @change="selectAll"
  92. >全选</el-checkbox
  93. >
  94. <el-option
  95. v-for="(item, indsanal) in analysisTypeList"
  96. :key="item.typeCode + indsanal + 'analysisTypeList'"
  97. :label="item.typeName"
  98. :value="`${item.typeCode}|${item.typeFlag}`"
  99. ></el-option>
  100. </el-select> </el-form-item
  101. ></el-col>
  102. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="5">
  103. <el-form-item
  104. label="数据源(选填)"
  105. v-if="checkedCities.find((item) => item === '数据源')"
  106. >
  107. <el-select
  108. v-model="form.scada"
  109. placeholder="请选择数据源"
  110. size="small"
  111. clearable
  112. @change="handleScada"
  113. >
  114. <el-option
  115. v-for="(TranItem, indTran) in transferTypeData"
  116. :key="TranItem.transferType + TranItem + 'transferTypeData'"
  117. :label="TranItem.transferTypeName"
  118. :value="TranItem.transferType"
  119. ></el-option>
  120. </el-select>
  121. </el-form-item>
  122. </el-col>
  123. <el-col
  124. :xs="24"
  125. :sm="24"
  126. :md="12"
  127. :lg="8"
  128. :xl="5"
  129. v-hasPermi="['home:performance:onlineAlsDate']"
  130. >
  131. <el-form-item
  132. label="开始时间"
  133. v-if="checkedCities.find((item) => item === '分析时间')"
  134. >
  135. <el-date-picker
  136. value-format="yyyy-MM-dd HH:mm:ss"
  137. v-model="picker[0]"
  138. size="small"
  139. type="datetime"
  140. placeholder="选择分析开始时间"
  141. :picker-options="pickerOptions"
  142. >
  143. </el-date-picker>
  144. <!-- <el-date-picker
  145. value-format="yyyy-MM-dd HH:mm:ss"
  146. v-model="picker"
  147. type="datetimerange"
  148. size="small"
  149. range-separator="至"
  150. start-placeholder="开始日期"
  151. end-placeholder="结束日期"
  152. :picker-options="pickerOptions"
  153. >
  154. </el-date-picker> -->
  155. </el-form-item></el-col
  156. >
  157. <el-col
  158. :xs="24"
  159. :sm="24"
  160. :md="12"
  161. :lg="8"
  162. :xl="5"
  163. v-hasPermi="['home:performance:onlineAlsDate']"
  164. >
  165. <el-form-item
  166. label="结束时间"
  167. v-if="checkedCities.find((item) => item === '分析时间')"
  168. >
  169. <el-date-picker
  170. value-format="yyyy-MM-dd HH:mm:ss"
  171. v-model="picker[1]"
  172. size="small"
  173. type="datetime"
  174. placeholder="选择分析结束时间"
  175. :picker-options="pickerOptions"
  176. >
  177. </el-date-picker> </el-form-item
  178. ></el-col>
  179. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="5">
  180. <el-form-item
  181. label="滤除月份"
  182. v-if="checkedCities.find((item) => item === '滤除月份')"
  183. >
  184. <el-date-picker
  185. value-format="yyyy-MM"
  186. width="200"
  187. size="small"
  188. type="months"
  189. v-model="form.excludingMonths"
  190. placeholder="选择一个或多个月"
  191. >
  192. </el-date-picker>
  193. </el-form-item>
  194. </el-col>
  195. </el-row>
  196. </el-collapse-item>
  197. <el-collapse-item
  198. title="数据源测点过滤设置:"
  199. name="2"
  200. v-if="checkedCities.find((item) => item === '数据源过滤')"
  201. >
  202. <el-row :gutter="5">
  203. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  204. <el-form-item label="风速过滤">
  205. <div class="demo-input-suffix">
  206. <el-input
  207. type="number"
  208. :min="1"
  209. size="small"
  210. placeholder="最小值"
  211. v-model="form.valueWindSpeed[0]"
  212. @input="ensureMinValue(form.valueWindSpeed, 0)"
  213. >
  214. </el-input>
  215. <el-input
  216. type="number"
  217. :min="1"
  218. size="small"
  219. placeholder="最大值"
  220. v-model="form.valueWindSpeed[1]"
  221. @input="ensureMinValue(form.valueWindSpeed, 1)"
  222. >
  223. </el-input>
  224. </div>
  225. </el-form-item>
  226. </el-col>
  227. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  228. <el-form-item label="桨距角过滤">
  229. <div class="demo-input-suffix">
  230. <el-input
  231. type="number"
  232. :min="1"
  233. size="small"
  234. placeholder="最小值"
  235. v-model="form.valuePitchAngle[0]"
  236. @input="ensureMinValue(form.valuePitchAngle, 0)"
  237. >
  238. </el-input>
  239. <el-input
  240. type="number"
  241. :min="1"
  242. size="small"
  243. placeholder="最大值"
  244. v-model="form.valuePitchAngle[1]"
  245. @input="ensureMinValue(form.valuePitchAngle, 1)"
  246. >
  247. </el-input>
  248. </div>
  249. </el-form-item>
  250. </el-col>
  251. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  252. <el-form-item label="有功功率过滤">
  253. <div class="demo-input-suffix">
  254. <el-input
  255. type="number"
  256. :min="1"
  257. size="small"
  258. placeholder="最小值"
  259. v-model="form.valueActivePower[0]"
  260. @input="ensureMinValue(form.valueActivePower, 0)"
  261. >
  262. </el-input>
  263. <el-input
  264. type="number"
  265. :min="1"
  266. size="small"
  267. placeholder="最大值"
  268. v-model="form.valueActivePower[1]"
  269. @input="ensureMinValue(form.valueActivePower, 1)"
  270. >
  271. </el-input>
  272. </div>
  273. </el-form-item>
  274. </el-col>
  275. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  276. <el-form-item label="发电机转速过滤">
  277. <div class="demo-input-suffix">
  278. <el-input
  279. type="number"
  280. :min="1"
  281. size="small"
  282. placeholder="最小值"
  283. v-model="form.valueGeneratorSpeed[0]"
  284. @input="ensureMinValue(form.valueGeneratorSpeed, 0)"
  285. >
  286. </el-input>
  287. <el-input
  288. type="number"
  289. :min="1"
  290. size="small"
  291. placeholder="最大值"
  292. v-model="form.valueGeneratorSpeed[1]"
  293. @input="ensureMinValue(form.valueGeneratorSpeed, 1)"
  294. >
  295. </el-input>
  296. </div>
  297. </el-form-item>
  298. </el-col>
  299. </el-row>
  300. </el-collapse-item>
  301. </el-collapse>
  302. </el-form>
  303. <el-card shadow="always" class="box-card">
  304. <el-row>
  305. <div class="filedView">
  306. <span></span>
  307. <span>风场信息概览</span>
  308. <el-button type="primary" size="small" @click="handleBtn"
  309. >切换{{ disableMsg }}</el-button
  310. >
  311. </div>
  312. </el-row>
  313. <el-row>
  314. <el-col :span="24" v-if="disableMsg === '地图'">
  315. <div class="left">
  316. <el-table :data="batchList" border>
  317. <el-table-column prop="engineName" label="风机名称">
  318. </el-table-column>
  319. <el-table-column prop="ratedCapacity" label="额定容量/KW">
  320. </el-table-column>
  321. <el-table-column prop="ratedWindSpeed" label="额定风速(m/s)">
  322. </el-table-column>
  323. <el-table-column prop="hubHeight" label="轮毂高度(m)">
  324. </el-table-column>
  325. <el-table-column prop="sightcing" label="是否标杆">
  326. <template slot-scope="{ row }">
  327. {{ row.sightcing == 1 ? "是" : "否" }}
  328. </template>
  329. </el-table-column>
  330. </el-table>
  331. <div class="pagination-container">
  332. <el-pagination
  333. @current-change="handleCurrentChange"
  334. :current-page.sync="formInline.pageNum"
  335. layout="total, prev, pager, next"
  336. :page-size="formInline.pageSize"
  337. :total="formInline.totalSize"
  338. >
  339. </el-pagination>
  340. </div>
  341. </div>
  342. </el-col>
  343. <el-col :span="24" v-loading="htmlLoading" v-else>
  344. <div class="right">
  345. <Map></Map>
  346. </div>
  347. </el-col>
  348. </el-row>
  349. </el-card>
  350. <el-drawer
  351. title="偏好设置"
  352. :visible.sync="drawer"
  353. :direction="direction"
  354. :before-close="handleClose"
  355. class="drawerOption"
  356. >
  357. <el-row>
  358. <el-col :span="12"
  359. ><div class="drawerLeft">
  360. <div style="text-align: center; font-size: 16px">常用功能设置</div>
  361. <el-checkbox
  362. :indeterminate="isIndeterminate"
  363. v-model="checkAll"
  364. @change="handleCheckAllChange"
  365. >全选</el-checkbox
  366. >
  367. <div style="margin: 15px 0"></div>
  368. <el-checkbox-group
  369. v-model="checkedCities"
  370. @change="handleCheckedCitiesChange"
  371. >
  372. <el-checkbox v-for="city in cities" :label="city" :key="city">{{
  373. city
  374. }}</el-checkbox>
  375. <el-checkbox label="数据源过滤" key="数据源过滤"></el-checkbox>
  376. <!-- <div class="checkFromRow">
  377. <el-row>
  378. <el-col :span="12">发电机转速测点</el-col>
  379. <el-col :span="12">桨距角值测点</el-col>
  380. <el-col :span="12">有功功率测点</el-col>
  381. <el-col :span="12">风速速度测点</el-col>
  382. </el-row>
  383. </div> -->
  384. </el-checkbox-group>
  385. </div></el-col
  386. >
  387. <el-col :span="12">
  388. <div class="drawerRight">
  389. <div style="text-align: center; font-size: 16px">已选中功能</div>
  390. <ul>
  391. <li v-for="func in checkedCities" :key="func">
  392. {{ func }}
  393. <el-button
  394. type="text"
  395. icon="el-icon-delete"
  396. @click="removeFunction(func)"
  397. ></el-button>
  398. </li>
  399. </ul></div
  400. ></el-col>
  401. </el-row>
  402. <div class="demo-drawer__footer">
  403. <el-button @click="handleClose">取 消</el-button>
  404. <el-button type="primary" @click="handleClose">{{ "确 定" }}</el-button>
  405. </div>
  406. </el-drawer>
  407. </div>
  408. </template>
  409. <script>
  410. import {
  411. analysisEditQuery,
  412. analysis,
  413. queryDataTime,
  414. queryAllTypeScada,
  415. } from "@/api/performance";
  416. import {
  417. getWindEngineGroup,
  418. windEngineGrouPage,
  419. getWindEngineGroupRatedListByFieldCodePage,
  420. } from "@/api/ledger";
  421. import Map from "./map.vue";
  422. import axios from "axios";
  423. export default {
  424. components: {
  425. Map,
  426. },
  427. props: {
  428. activeName: String,
  429. fieldName: {
  430. type: String,
  431. default: "",
  432. },
  433. analysisName: {
  434. type: String,
  435. default: "",
  436. },
  437. },
  438. data() {
  439. return {
  440. disableMsg: "表格",
  441. formInline: {
  442. pageNum: 1,
  443. pageSize: 10,
  444. totalSize: 0,
  445. },
  446. batchList: [],
  447. checkedTurbines: false,
  448. checked: false,
  449. htmlLoading: false,
  450. engineCode: null, //台账机组编号
  451. picker: [],
  452. dataMinTime: null,
  453. dataMaxTime: null,
  454. // pickerOptions: {
  455. // disabledDate: this.disabledDate,
  456. // },
  457. loading: false,
  458. form: {
  459. configAnalysis: null, //分析模型
  460. powerFarmID: null, //风场编号//通过路由获取的默认传递的
  461. dataBatchNum: null, //批次号
  462. scada: "", //scada数类型
  463. turbines: [], //机组编号
  464. beginTime: null, //开始时间
  465. endTime: null, //结束时间
  466. excludingMonths: null, //过滤月份
  467. valueWindSpeed: [], //风速值最大最小 数组第一值为min 第二个 max
  468. valuePitchAngle: [], //桨距角最大最小
  469. valueActivePower: [], //有功功率
  470. valueGeneratorSpeed: [], //发电机转速
  471. //图像
  472. dgeneratorSpeed: [], //直驱发电机转速轴系 第一个值为步长 第二个min 第三个 max
  473. igeneratorSpeed: [], //非直驱发电机转速轴系设置
  474. dgeneratorTorque: [], //直驱发电机转矩轴系
  475. igeneratorTorque: [], //非直驱发电机转矩轴系
  476. cp: [], //风能利用系数轴系
  477. tsr: [], //叶尖速比轴系
  478. pitchAngle: [], //桨距角轴系
  479. activePower: [], //有功功率轴系
  480. },
  481. activeNames: ["1", "2", "3"],
  482. checkAll: false,
  483. checkedCities: ["分析模型", "数据源", "分析时间", "滤除月份", "机组名称"],
  484. cities: ["分析模型", "数据源", "分析时间", "滤除月份", "机组名称"],
  485. isIndeterminate: true,
  486. drawer: false,
  487. direction: "rtl",
  488. value: "",
  489. options: [],
  490. tabIndex: 2,
  491. analysisTypeList: [],
  492. windEngineGroupList: [],
  493. windDetail: {},
  494. transferTypeData: [],
  495. // 时间范围数组
  496. timeRanges: [
  497. // { start: '2024-12-01 00:00:00', end: '2024-12-30 23:59:59' },
  498. // { start: '2024-10-01 00:00:00', end: '2024-10-30 23:59:59' },
  499. // { start: '2024-05-01 00:00:00', end: '2024-05-30 23:59:59' },
  500. ],
  501. };
  502. },
  503. computed: {
  504. pickerOptions() {
  505. return {
  506. disabledDate: this.disabledDate,
  507. };
  508. },
  509. },
  510. watch: {
  511. activeName: {
  512. handler(newVal, oldVal) {
  513. // console.log(newVal, "新值 分析事件");
  514. },
  515. },
  516. },
  517. created() {
  518. //获取分析 分析模型、机组编号 列表
  519. this.getWindCodeList();
  520. this.getQueryDataTime();
  521. this.getFengjiList();
  522. queryAllTypeScada().then((res) => {
  523. this.transferTypeData = res.data;
  524. this.getTimeList();
  525. });
  526. },
  527. methods: {
  528. //切换风机信息展示
  529. handleBtn() {
  530. this.disableMsg = this.disableMsg == "表格" ? "地图" : "表格";
  531. },
  532. getTimeList() {
  533. let scada = [];
  534. if (this.form.scada) {
  535. scada.push(this.form.scada);
  536. } else {
  537. console.log(this.form.configAnalysis, "this.form.scada");
  538. scada = this.form.configAnalysis.map((item) => {
  539. console.log(item, "item");
  540. return item.split("|")[1];
  541. });
  542. console.log([...new Set(scada)], "scada");
  543. }
  544. axios
  545. .post("/transDataWeb/dataTransfer/getTimeRange", {
  546. transferType: [...new Set(scada)],
  547. windFarmCode: this.$route.query.fieldEngineCode,
  548. })
  549. .then((res) => {
  550. if (res.data.code === 200) {
  551. this.timeRanges = res.data.datas;
  552. console.log(this.timeRanges, "this.timeRanges");
  553. // this.formData = { ...res.data.datas };
  554. }
  555. })
  556. .catch((error) => {});
  557. },
  558. getFengjiList() {
  559. getWindEngineGroupRatedListByFieldCodePage({
  560. fieldCode: this.$route.query.fieldEngineCode,
  561. ...this.formInline,
  562. totalSize: undefined,
  563. }).then((res) => {
  564. this.batchList = res.data.list;
  565. this.formInline.totalSize = res.data.totalSize;
  566. });
  567. },
  568. //分页数据切换
  569. handleCurrentChange(val) {
  570. this.formInline.pageNum = val;
  571. this.getFengjiList();
  572. },
  573. // disabledDate(time) {
  574. // if (!this.dataMinTime || !this.dataMaxTime) {
  575. // return false;
  576. // }
  577. // const minTime = new Date(this.dataMinTime).getTime();
  578. // const maxTime = new Date(this.dataMaxTime).getTime();
  579. // return time.getTime() < minTime || time.getTime() > maxTime;
  580. // },
  581. // 禁用日期函数
  582. disabledDate(time) {
  583. const timeInMs = time.getTime();
  584. // 判断日期是否在任意一个时间范围内
  585. const isDisabled = !this.timeRanges.some((range) => {
  586. const start = new Date(range.startTime).getTime();
  587. const end = new Date(range.endTime).getTime();
  588. return timeInMs >= start && timeInMs <= end;
  589. });
  590. return isDisabled;
  591. },
  592. handleScadaAnalysis(obj) {
  593. const scada = obj[obj.length - 1].split("|")[0];
  594. if (
  595. scada === "temperature_large_components" ||
  596. scada === "production_indicator" ||
  597. scada === "fault"
  598. ) {
  599. this.$message.warning("当前分析模型无法单独分析");
  600. }
  601. this.getTimeList();
  602. // this.getQueryDataTime();
  603. },
  604. handleScada() {
  605. this.getTimeList();
  606. // this.getQueryDataTime();
  607. },
  608. async getQueryDataTime() {
  609. const res = await queryDataTime({
  610. batchCode: this.$route.query.batchCode,
  611. dataTransferType: this.form.scada,
  612. });
  613. if (res.data && res.data.dataMinTime && res.data.dataMaxTime) {
  614. this.dataMinTime = res.data.dataMinTime; // 可选最小时间
  615. this.dataMaxTime = res.data.dataMaxTime; // 可选最大时间
  616. // 更新日期选择器的默认范围
  617. } else {
  618. this.dataMinTime = null; // 可选最小时间
  619. this.dataMaxTime = null; // 可选最大时间
  620. }
  621. },
  622. selectAllTurbines() {
  623. this.form.turbines = [];
  624. if (this.checkedTurbines) {
  625. this.windEngineGroupList.map((item) => {
  626. this.form.turbines.push(item.engineCode);
  627. });
  628. } else {
  629. this.form.turbines = [];
  630. }
  631. },
  632. selectAll() {
  633. this.form.configAnalysis = [];
  634. if (this.checked) {
  635. this.analysisTypeList.map((item) => {
  636. this.form.configAnalysis.push(`${item.typeCode}|${item.typeFlag}`);
  637. });
  638. } else {
  639. this.form.configAnalysis = [];
  640. }
  641. this.getTimeList();
  642. },
  643. ensureMinValue(field, index) {
  644. if (field[index] < 1) {
  645. field[index] = 1;
  646. }
  647. },
  648. handleEngineCode(e) {
  649. this.engineCode = e;
  650. this.getWindEngList();
  651. },
  652. async getWindEngList() {
  653. this.loading = true;
  654. try {
  655. const res = await getWindEngineGroup({
  656. engineCode: this.engineCode,
  657. });
  658. this.loading = false;
  659. this.windDetail = res.data;
  660. } catch (error) {
  661. this.loading = false;
  662. console.error(error);
  663. }
  664. },
  665. async getAnalysis() {
  666. this.loading = true;
  667. try {
  668. await analysis({
  669. // ...this.form,
  670. configAnalysis:
  671. this.form.configAnalysis !== null
  672. ? this.form.configAnalysis
  673. : undefined, //分析模型
  674. powerFarmID: this.$route.query.fieldEngineCode, //风场编号//通过路由获取的默认传递的
  675. dataBatchNum: this.$route.query.batchCode, //批次号
  676. scada: this.form.scada !== null ? this.form.scada : undefined, //scada数类型
  677. turbines:
  678. this.form.turbines.length > 0 ? this.form.turbines : undefined, //机组编号
  679. excludingMonths:
  680. this.form.excludingMonths === null
  681. ? undefined
  682. : this.form.excludingMonths, //过滤月份
  683. valueWindSpeed:
  684. this.form.valueWindSpeed.length > 0
  685. ? this.form.valueWindSpeed
  686. : undefined, //风速值最大最小 数组第一值为min 第二个 max
  687. valuePitchAngle:
  688. this.form.valuePitchAngle.length > 0
  689. ? this.form.valuePitchAngle
  690. : undefined, //桨距角最大最小
  691. valueActivePower:
  692. this.form.valueActivePower.length > 0
  693. ? this.form.valueActivePower
  694. : undefined, //有功功率
  695. valueGeneratorSpeed:
  696. this.form.valueGeneratorSpeed.length > 0
  697. ? this.form.valueGeneratorSpeed
  698. : undefined, //发电机转速
  699. //图像
  700. dgeneratorSpeed:
  701. this.form.dgeneratorSpeed.length > 0
  702. ? this.form.dgeneratorSpeed
  703. : undefined, //直驱发电机转速轴系 第一个值为步长 第二个min 第三个 max
  704. igeneratorSpeed:
  705. this.form.igeneratorSpeed.length > 0
  706. ? this.form.igeneratorSpeed
  707. : undefined, //非直驱发电机转速轴系设置
  708. dgeneratorTorque:
  709. this.form.dgeneratorTorque.length > 0
  710. ? this.form.dgeneratorTorque
  711. : undefined, //直驱发电机转矩轴系
  712. igeneratorTorque:
  713. this.form.igeneratorTorque.length > 0
  714. ? this.form.igeneratorTorque
  715. : undefined, //非直驱发电机转矩轴系
  716. cp: this.form.cp.length > 0 ? this.form.cp : undefined, //风能利用系数轴系
  717. tsr: this.form.tsr.length > 0 ? this.form.tsr : undefined, //叶尖速比轴系
  718. pitchAngle:
  719. this.form.pitchAngle.length > 0 ? this.form.pitchAngle : undefined, //桨距角轴系
  720. activePower:
  721. this.form.activePower.length > 0
  722. ? this.form.activePower
  723. : undefined, //有功功率轴系
  724. beginTime: this.picker[0], //开始时间
  725. endTime: this.picker[1], //结束时间
  726. });
  727. this.$message({
  728. type: "success",
  729. message: "已分析请前往分析详情中查看结果",
  730. });
  731. this.loading = false;
  732. } catch (error) {
  733. console.error(error);
  734. this.loading = false;
  735. }
  736. },
  737. async getWindCodeList() {
  738. this.loading = true;
  739. try {
  740. const response = await analysisEditQuery({
  741. batchCode: this.$route.query.batchCode,
  742. });
  743. if (
  744. response.data.windEngineGroupList === null ||
  745. response.data.windEngineGroupList.length === 0
  746. ) {
  747. this.$message({
  748. type: "warning",
  749. message: "当前风场没有风机,无法进行分析",
  750. });
  751. // this.$router.push("/home/performance/assetssMag");
  752. }
  753. this.form.powerFarmID = this.$route.query.fieldEngineCode;
  754. this.form.dataBatchNum = this.$route.query.batchCode;
  755. this.analysisTypeList = response.data.analysisTypeList;
  756. this.windEngineGroupList = response.data.windEngineGroupList;
  757. this.engineCode =
  758. response.data.windEngineGroupList !== null &&
  759. response.data.windEngineGroupList.length > 0
  760. ? response.data.windEngineGroupList[0].engineCode
  761. : null;
  762. if (response.data.windEngineGroupList.length > 0) {
  763. //获取台账机组编号
  764. this.getWindEngList();
  765. }
  766. this.loading = false;
  767. } catch (error) {
  768. this.$message({
  769. type: "error",
  770. message: error,
  771. });
  772. this.loading = false;
  773. this.$router.push("/home/performance/assetssMag");
  774. }
  775. },
  776. handleCheckAllChange(val) {
  777. this.checkedCities = val
  778. ? [...this.cities, "数据源过滤", "图像设置"]
  779. : [];
  780. this.isIndeterminate = false;
  781. },
  782. handleCheckedCitiesChange(value) {
  783. let checkedCount = value.length;
  784. this.checkAll = checkedCount === this.cities.length + 2;
  785. this.isIndeterminate =
  786. checkedCount > 0 && checkedCount < this.cities.length + 2;
  787. },
  788. removeFunction(item) {
  789. this.checkedCities = this.checkedCities.filter((fuc) => fuc !== item);
  790. },
  791. handleClose(done) {
  792. this.$confirm("确认关闭?")
  793. .then((_) => {
  794. // done();
  795. this.drawer = false;
  796. })
  797. .catch((_) => {});
  798. },
  799. onSubmit() {
  800. this.getAnalysis();
  801. },
  802. resetForm() {
  803. this.picker = [];
  804. this.form = {
  805. configAnalysis: null, //分析模型
  806. powerFarmID: this.$route.query.fieldEngineCode, //风场编号//通过路由获取的默认传递的
  807. dataBatchNum: this.$route.query.batchCode, //批次号
  808. scada: "", //scada数类型
  809. turbines: [], //机组编号
  810. beginTime: null, //开始时间
  811. endTime: null, //结束时间
  812. excludingMonths: null, //过滤月份
  813. valueWindSpeed: [], //风速值最大最小 数组第一值为min 第二个 max
  814. valuePitchAngle: [], //桨距角最大最小
  815. valueActivePower: [], //有功功率
  816. valueGeneratorSpeed: [], //发电机转速
  817. //图像
  818. dgeneratorSpeed: [], //直驱发电机转速轴系 第一个值为步长 第二个min 第三个 max
  819. igeneratorSpeed: [], //非直驱发电机转速轴系设置
  820. dgeneratorTorque: [], //直驱发电机转矩轴系
  821. igeneratorTorque: [], //非直驱发电机转矩轴系
  822. cp: [], //风能利用系数轴系
  823. tsr: [], //叶尖速比轴系
  824. pitchAngle: [], //桨距角轴系
  825. activePower: [], //有功功率轴系
  826. };
  827. },
  828. // 清空内容
  829. clear() {
  830. this.$refs.editor.clear();
  831. },
  832. },
  833. };
  834. </script>
  835. <style scoped lang="scss">
  836. .box-card {
  837. margin: 10px 0;
  838. width: 100%;
  839. font-size: 14px;
  840. height: 100%;
  841. .filedView {
  842. height: 60px;
  843. // line-height: 60px;
  844. background-color: #fff;
  845. color: #303133;
  846. cursor: pointer;
  847. border-bottom: 1px solid #ebeef5;
  848. font-size: 16px;
  849. text-align: center;
  850. display: flex;
  851. justify-content: space-between;
  852. align-items: center;
  853. font-weight: 500;
  854. margin-bottom: 10px;
  855. }
  856. .el-card__body {
  857. width: 100%;
  858. height: 100% !important;
  859. .left {
  860. > div {
  861. line-height: 3;
  862. }
  863. }
  864. .el-row {
  865. height: 100%;
  866. width: 100%;
  867. }
  868. .el-col {
  869. min-height: 500px;
  870. }
  871. .right {
  872. height: 500px;
  873. width: 100%;
  874. iframe {
  875. width: 100%;
  876. height: 100%;
  877. }
  878. }
  879. }
  880. }
  881. .el-select-dropdown__wrap {
  882. .el-select-dropdown__list {
  883. .el-checkbox {
  884. display: flex;
  885. justify-content: end;
  886. margin: 0px 20px;
  887. }
  888. }
  889. }
  890. // .setting {
  891. // font-size: 20px;
  892. // font-weight: 900;
  893. // }
  894. ::v-deep.el-select--small,
  895. ::v-deep.el-select__tags {
  896. width: 220px !important;
  897. // min-width: 180px !important;
  898. .el-tag--light {
  899. display: flex;
  900. justify-content: space-between;
  901. }
  902. .el-tag--light:nth-child(1) {
  903. width: 125px;
  904. }
  905. }
  906. ::v-deep .searchFrom {
  907. .el-form-item__content {
  908. display: flex !important;
  909. justify-content: end !important;
  910. align-items: center !important;
  911. i {
  912. margin-left: 10px;
  913. font-size: 24px;
  914. font-weight: 800;
  915. }
  916. }
  917. }
  918. ::v-deep.drawerOption {
  919. .el-drawer {
  920. width: 33% !important;
  921. }
  922. .el-checkbox-group {
  923. line-height: 40px !important;
  924. }
  925. .drawerLeft {
  926. margin-left: 20px;
  927. color: #606266 !important;
  928. }
  929. .checkFromRow {
  930. .el-col-12 {
  931. color: #606266 !important;
  932. font-size: 14px;
  933. }
  934. .el-col-12:nth-child(even) {
  935. text-align: end !important;
  936. }
  937. }
  938. .drawerRight {
  939. margin-right: 20px;
  940. color: #606266 !important;
  941. font-size: 14px;
  942. ul {
  943. list-style-type: none;
  944. padding: 0;
  945. color: #606266 !important;
  946. li {
  947. display: flex;
  948. align-items: center;
  949. justify-content: space-between;
  950. padding: 0px 10px;
  951. line-height: 40px !important;
  952. }
  953. }
  954. }
  955. .demo-drawer__footer {
  956. display: flex;
  957. margin-top: 50px;
  958. justify-content: center;
  959. }
  960. }
  961. ::v-deep.el-input--small .el-input__inner {
  962. width: 220px !important;
  963. }
  964. .demo-input-suffix {
  965. display: flex !important;
  966. }
  967. ::v-deep.demo-input-suffix .el-input--small {
  968. width: 100px !important;
  969. }
  970. ::v-deep.demo-input-suffix .el-input--small .el-input__inner {
  971. width: 90px !important;
  972. }
  973. .abalysisType {
  974. margin-top: 30px;
  975. }
  976. ::v-deep .el-table th.el-table__cell > .cell {
  977. display: block !important;
  978. }
  979. </style>