EditAnalysis.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. <!--
  2. * @Author: your name
  3. * @Date: 2024-05-29 09:14:23
  4. * @LastEditTime: 2024-05-31 15:33:18
  5. * @LastEditors: bogon
  6. * @Description: In User Settings Edit
  7. * @FilePath: /performance-test/src/views/performance/components/EditAnalysis.vue
  8. -->
  9. <template>
  10. <div>
  11. <el-form ref="form" :model="form" label-width="120px">
  12. <el-row type="flex" justify="end">
  13. <el-col :span="5">
  14. <el-form-item class="searchFrom">
  15. <el-button type="primary" @click="onSubmit" size="small"
  16. >查询</el-button
  17. >
  18. <el-button size="small">重置</el-button>
  19. <i @click="drawer = true" class="el-icon-setting"></i>
  20. </el-form-item>
  21. </el-col>
  22. </el-row>
  23. <el-collapse v-model="activeNames">
  24. <el-collapse-item title="基础筛选:" name="1">
  25. <el-row class="flex-wrap-row" :gutter="5">
  26. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="5">
  27. <el-form-item
  28. label="分析类型"
  29. v-if="checkedCities.find((item) => item === '分析类型')"
  30. >
  31. <el-select
  32. v-model="form.region"
  33. placeholder="请选择分析类型"
  34. size="small"
  35. >
  36. <el-option label="类型一" value="shanghai"></el-option>
  37. <el-option label="类型二" value="beijing"></el-option>
  38. </el-select> </el-form-item
  39. ></el-col>
  40. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="5">
  41. <el-form-item
  42. label="机组编号"
  43. v-if="checkedCities.find((item) => item === '机组编号')"
  44. >
  45. <el-select
  46. multiple
  47. v-model="form.region"
  48. placeholder="请选择机组编号"
  49. size="small"
  50. >
  51. <el-option label="类型一" value="shanghai"></el-option>
  52. <el-option label="类型二" value="beijing"></el-option>
  53. </el-select> </el-form-item
  54. ></el-col>
  55. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="5">
  56. <el-form-item
  57. label="滤除月份"
  58. v-if="checkedCities.find((item) => item === '滤除月份')"
  59. >
  60. <el-date-picker
  61. width="200"
  62. size="small"
  63. type="dates"
  64. v-model="value4"
  65. placeholder="选择一个或多个日期"
  66. >
  67. </el-date-picker>
  68. </el-form-item>
  69. </el-col>
  70. <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="9">
  71. <el-form-item
  72. label="分析时间"
  73. v-if="checkedCities.find((item) => item === '分析时间')"
  74. >
  75. <el-date-picker
  76. size="small"
  77. v-model="value1"
  78. type="daterange"
  79. range-separator="至"
  80. start-placeholder="开始日期"
  81. end-placeholder="结束日期"
  82. >
  83. </el-date-picker> </el-form-item
  84. ></el-col>
  85. </el-row>
  86. </el-collapse-item>
  87. <el-collapse-item
  88. title="SACAD数据测点过滤设置:"
  89. name="2"
  90. v-if="checkedCities.find((item) => item === 'SCADA数据过滤')"
  91. >
  92. <el-row :gutter="5">
  93. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  94. <el-form-item label="风速过滤">
  95. <div class="demo-input-suffix">
  96. <el-input
  97. type="number"
  98. size="small"
  99. placeholder="最小值"
  100. v-model="input1"
  101. >
  102. </el-input>
  103. <el-input
  104. type="number"
  105. size="small"
  106. placeholder="最大值"
  107. v-model="input2"
  108. >
  109. </el-input>
  110. </div>
  111. </el-form-item>
  112. </el-col>
  113. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  114. <el-form-item label="桨距角过滤">
  115. <div class="demo-input-suffix">
  116. <el-input
  117. type="number"
  118. size="small"
  119. placeholder="最小值"
  120. v-model="input1"
  121. >
  122. </el-input>
  123. <el-input
  124. type="number"
  125. size="small"
  126. placeholder="最大值"
  127. v-model="input2"
  128. >
  129. </el-input>
  130. </div>
  131. </el-form-item>
  132. </el-col>
  133. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  134. <el-form-item label="有功功率过滤">
  135. <div class="demo-input-suffix">
  136. <el-input
  137. type="number"
  138. size="small"
  139. placeholder="最小值"
  140. v-model="input1"
  141. >
  142. </el-input>
  143. <el-input
  144. type="number"
  145. size="small"
  146. placeholder="最大值"
  147. v-model="input2"
  148. >
  149. </el-input>
  150. </div>
  151. </el-form-item>
  152. </el-col>
  153. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  154. <el-form-item label="发电机转速过滤">
  155. <div class="demo-input-suffix">
  156. <el-input
  157. type="number"
  158. size="small"
  159. placeholder="最小值"
  160. v-model="input1"
  161. >
  162. </el-input>
  163. <el-input
  164. type="number"
  165. size="small"
  166. placeholder="最大值"
  167. v-model="input2"
  168. >
  169. </el-input>
  170. </div>
  171. </el-form-item>
  172. </el-col>
  173. </el-row>
  174. </el-collapse-item>
  175. <el-collapse-item
  176. title="图像轴系设置:"
  177. name="3"
  178. v-if="checkedCities.find((item) => item === '图像设置')"
  179. >
  180. <el-row :gutter="5">
  181. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  182. <el-form-item label="发电机转矩">
  183. <div class="demo-input-suffix">
  184. <el-input
  185. type="number"
  186. size="small"
  187. placeholder="步长"
  188. v-model="input1"
  189. >
  190. </el-input>
  191. <el-input
  192. type="number"
  193. size="small"
  194. placeholder="最小值"
  195. v-model="input2"
  196. >
  197. </el-input>
  198. <el-input
  199. type="number"
  200. size="small"
  201. placeholder="最大值"
  202. v-model="input2"
  203. >
  204. </el-input>
  205. </div>
  206. </el-form-item>
  207. </el-col>
  208. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  209. <el-form-item label="风能利用系数">
  210. <div class="demo-input-suffix">
  211. <el-input
  212. type="number"
  213. size="small"
  214. placeholder="步长"
  215. v-model="input1"
  216. >
  217. </el-input>
  218. <el-input
  219. type="number"
  220. size="small"
  221. placeholder="最小值"
  222. v-model="input2"
  223. >
  224. </el-input>
  225. <el-input
  226. type="number"
  227. size="small"
  228. placeholder="最大值"
  229. v-model="input2"
  230. >
  231. </el-input>
  232. </div>
  233. </el-form-item>
  234. </el-col>
  235. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  236. <el-form-item label="叶尖转速比">
  237. <div class="demo-input-suffix">
  238. <el-input
  239. type="number"
  240. size="small"
  241. placeholder="步长"
  242. v-model="input1"
  243. >
  244. </el-input>
  245. <el-input
  246. type="number"
  247. size="small"
  248. placeholder="最小值"
  249. v-model="input2"
  250. >
  251. </el-input>
  252. <el-input
  253. type="number"
  254. size="small"
  255. placeholder="最大值"
  256. v-model="input2"
  257. >
  258. </el-input>
  259. </div>
  260. </el-form-item>
  261. </el-col>
  262. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  263. <el-form-item label="有功功率">
  264. <div class="demo-input-suffix">
  265. <el-input
  266. type="number"
  267. size="small"
  268. placeholder="步长"
  269. v-model="input1"
  270. >
  271. </el-input>
  272. <el-input
  273. type="number"
  274. size="small"
  275. placeholder="最小值"
  276. v-model="input2"
  277. >
  278. </el-input>
  279. <el-input
  280. type="number"
  281. size="small"
  282. placeholder="最大值"
  283. v-model="input2"
  284. >
  285. </el-input>
  286. </div>
  287. </el-form-item>
  288. </el-col>
  289. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
  290. <el-form-item label="桨距角">
  291. <div class="demo-input-suffix">
  292. <el-input
  293. type="number"
  294. size="small"
  295. placeholder="步长"
  296. v-model="input1"
  297. >
  298. </el-input>
  299. <el-input
  300. type="number"
  301. size="small"
  302. placeholder="最小值"
  303. v-model="input2"
  304. >
  305. </el-input>
  306. <el-input
  307. type="number"
  308. size="small"
  309. placeholder="最大值"
  310. v-model="input2"
  311. >
  312. </el-input>
  313. </div>
  314. </el-form-item>
  315. </el-col>
  316. </el-row>
  317. </el-collapse-item>
  318. </el-collapse>
  319. </el-form>
  320. <el-card shadow="always" class="box-card">
  321. <el-row>
  322. <el-col :span="12"
  323. ><div class="left">
  324. <div>
  325. <span>机组编号:</span>
  326. <el-select v-model="value" placeholder="请选择" size="small">
  327. <el-option
  328. v-for="item in options"
  329. :key="item.value"
  330. :label="item.label"
  331. :value="item.value"
  332. >
  333. </el-option>
  334. </el-select>
  335. </div>
  336. <div>1.额定功率(Rated Power):指发电机组在标准工况下</div>
  337. <div>2.发电机类型(Generator Type):</div>
  338. <div>3.经度(Longitude):</div>
  339. <div>4.维度(Dimensionality):</div>
  340. <div>5.海拔高度(Altitude):</div>
  341. <div>6.并网时间(Grid connection time):</div>
  342. <div>7.是否标杆(Benchmarking or not):</div>
  343. <div>8.地理位置(Location):不同地理位置的气候条件</div>
  344. <div>
  345. 9.供应商信息(Manufacturer
  346. Information):制造商的信誉、技术水平和售后
  347. </div>
  348. <div>
  349. 10.维护需求(Maintenance Requirements):风力发电机组需要定期
  350. </div>
  351. <div>11.预期寿命(Expected Lifetime):风力发电机组的设计寿命</div>
  352. </div>
  353. </el-col>
  354. <el-col :span="12"><div class="right">右</div></el-col>
  355. </el-row>
  356. </el-card>
  357. <div class="abalysisType">
  358. <el-tabs
  359. v-model="editableTabsValue"
  360. type="card"
  361. editable
  362. @edit="handleTabsEdit"
  363. >
  364. <el-tab-pane
  365. :key="item.name"
  366. v-for="(item, index) in editableTabs"
  367. :label="item.title"
  368. :name="item.name"
  369. >
  370. {{ item.content }}
  371. <tinymce-editor
  372. ref="editor"
  373. v-model="msg"
  374. :disabled="disabled"
  375. @onClick="onClick"
  376. >
  377. </tinymce-editor>
  378. </el-tab-pane>
  379. </el-tabs>
  380. </div>
  381. <el-drawer
  382. title="偏好设置"
  383. :visible.sync="drawer"
  384. :direction="direction"
  385. :before-close="handleClose"
  386. class="drawerOption"
  387. >
  388. <el-row>
  389. <el-col :span="12"
  390. ><div class="drawerLeft">
  391. <div style="text-align: center; font-size: 16px">常用功能设置</div>
  392. <el-checkbox
  393. :indeterminate="isIndeterminate"
  394. v-model="checkAll"
  395. @change="handleCheckAllChange"
  396. >全选</el-checkbox
  397. >
  398. <div style="margin: 15px 0"></div>
  399. <el-checkbox-group
  400. v-model="checkedCities"
  401. @change="handleCheckedCitiesChange"
  402. >
  403. <el-checkbox v-for="city in cities" :label="city" :key="city">{{
  404. city
  405. }}</el-checkbox>
  406. <el-checkbox
  407. label="SCADA数据过滤"
  408. key="SCADA数据过滤"
  409. ></el-checkbox>
  410. <div class="checkFromRow">
  411. <el-row>
  412. <el-col :span="12">发电机转速测点</el-col>
  413. <el-col :span="12">桨距角值测点</el-col>
  414. <el-col :span="12">有功功率测点</el-col>
  415. <el-col :span="12">风速速度测点</el-col>
  416. </el-row>
  417. </div>
  418. <el-checkbox label="图像设置" key="图像设置"></el-checkbox>
  419. <div class="checkFromRow">
  420. <el-row>
  421. <el-col :span="12">发电机转矩轴系</el-col>
  422. <el-col :span="12">桨距角轴系</el-col>
  423. <el-col :span="12">叶尖速比轴系</el-col>
  424. <el-col :span="12">有功功率轴系</el-col>
  425. <el-col :span="12">发电机转矩轴系</el-col>
  426. </el-row>
  427. </div>
  428. </el-checkbox-group>
  429. </div></el-col
  430. >
  431. <el-col :span="12">
  432. <div class="drawerRight">
  433. <div style="text-align: center; font-size: 16px">已选中功能</div>
  434. <ul>
  435. <li v-for="func in checkedCities" :key="func">
  436. {{ func }}
  437. <el-button
  438. type="text"
  439. icon="el-icon-delete"
  440. @click="removeFunction(func)"
  441. ></el-button>
  442. </li>
  443. </ul></div
  444. ></el-col>
  445. </el-row>
  446. <div class="demo-drawer__footer">
  447. <el-button @click="handleClose">取 消</el-button>
  448. <el-button type="primary" @click="handleClose">{{ "确 定" }}</el-button>
  449. </div>
  450. </el-drawer>
  451. </div>
  452. </template>
  453. <script>
  454. import TinymceEditor from "@/components/Tinymce.vue";
  455. export default {
  456. components: {
  457. TinymceEditor,
  458. },
  459. data() {
  460. return {
  461. value4: "",
  462. value1: "",
  463. form: {},
  464. activeNames: ["1", "2", "3"],
  465. msg: "",
  466. disabled: false,
  467. checkAll: false,
  468. checkedCities: ["分析类型", "分析时间", "滤除月份", "机组编号"],
  469. cities: ["分析类型", "分析时间", "滤除月份", "机组编号"],
  470. isIndeterminate: true,
  471. drawer: false,
  472. direction: "rtl",
  473. value: "",
  474. options: [],
  475. editableTabsValue: "2",
  476. editableTabs: [
  477. {
  478. title: "Tab 1",
  479. name: "1",
  480. content: "Tab 1 content",
  481. },
  482. {
  483. title: "Tab 2",
  484. name: "2",
  485. content: "Tab 2 content",
  486. },
  487. ],
  488. formData: { content: "<p>Hello, Tinymce!</p>" },
  489. tabIndex: 2,
  490. };
  491. },
  492. methods: {
  493. handleCheckAllChange(val) {
  494. this.checkedCities = val
  495. ? [...this.cities, "SCADA数据过滤", "图像设置"]
  496. : [];
  497. this.isIndeterminate = false;
  498. },
  499. handleCheckedCitiesChange(value) {
  500. let checkedCount = value.length;
  501. this.checkAll = checkedCount === this.cities.length + 2;
  502. this.isIndeterminate =
  503. checkedCount > 0 && checkedCount < this.cities.length + 2;
  504. },
  505. removeFunction(item) {
  506. this.checkedCities = this.checkedCities.filter((fuc) => fuc !== item);
  507. },
  508. handleClose(done) {
  509. this.$confirm("确认关闭?")
  510. .then((_) => {
  511. // done();
  512. this.drawer = false;
  513. })
  514. .catch((_) => {});
  515. },
  516. // 鼠标单击的事件
  517. onClick(e, editor) {
  518. console.log("Element clicked");
  519. console.log(e);
  520. console.log(editor);
  521. },
  522. onSubmit() {
  523. console.log("submit!");
  524. },
  525. // 清空内容
  526. clear() {
  527. this.$refs.editor.clear();
  528. },
  529. handleTabsEdit(targetName, action) {
  530. if (action === "add") {
  531. let newTabName = ++this.tabIndex + "";
  532. this.editableTabs.push({
  533. title: "New Tab",
  534. name: newTabName,
  535. content: "New Tab content",
  536. });
  537. this.editableTabsValue = newTabName;
  538. }
  539. if (action === "remove") {
  540. let tabs = this.editableTabs;
  541. let activeName = this.editableTabsValue;
  542. if (activeName === targetName) {
  543. tabs.forEach((tab, index) => {
  544. if (tab.name === targetName) {
  545. let nextTab = tabs[index + 1] || tabs[index - 1];
  546. if (nextTab) {
  547. activeName = nextTab.name;
  548. }
  549. }
  550. });
  551. }
  552. this.editableTabsValue = activeName;
  553. this.editableTabs = tabs.filter((tab) => tab.name !== targetName);
  554. }
  555. },
  556. },
  557. };
  558. </script>
  559. <style scoped lang="scss">
  560. .box-card {
  561. margin: 10px 0;
  562. // box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
  563. width: 100%;
  564. font-size: 14px;
  565. .el-card__body {
  566. width: 100%;
  567. .left {
  568. > div {
  569. line-height: 3;
  570. }
  571. }
  572. }
  573. }
  574. ::v-deep .searchFrom {
  575. .el-form-item__content {
  576. display: flex !important;
  577. justify-content: end !important;
  578. align-items: center !important;
  579. i {
  580. margin-left: 10px;
  581. font-size: 20px;
  582. }
  583. }
  584. }
  585. .drawerOption {
  586. .el-checkbox-group {
  587. line-height: 40px !important;
  588. }
  589. .drawerLeft {
  590. margin-left: 20px;
  591. color: #606266 !important;
  592. }
  593. .checkFromRow {
  594. .el-col-12 {
  595. color: #606266 !important;
  596. font-size: 14px;
  597. }
  598. .el-col-12:nth-child(even) {
  599. text-align: end !important;
  600. }
  601. }
  602. .drawerRight {
  603. margin-right: 20px;
  604. color: #606266 !important;
  605. font-size: 14px;
  606. ul {
  607. list-style-type: none;
  608. padding: 0;
  609. color: #606266 !important;
  610. li {
  611. display: flex;
  612. align-items: center;
  613. justify-content: space-between;
  614. padding: 0px 10px;
  615. line-height: 40px !important;
  616. }
  617. }
  618. }
  619. .demo-drawer__footer {
  620. display: flex;
  621. margin-top: 50px;
  622. justify-content: center;
  623. }
  624. }
  625. ::v-deep.el-input--small .el-input__inner {
  626. width: 200px !important;
  627. }
  628. .demo-input-suffix {
  629. display: flex !important;
  630. }
  631. ::v-deep.demo-input-suffix .el-input--small {
  632. width: 100px !important;
  633. }
  634. ::v-deep.demo-input-suffix .el-input--small .el-input__inner {
  635. width: 90px !important;
  636. }
  637. .abalysisType {
  638. margin-top: 30px;
  639. }
  640. </style>