spectrogramchartsNew.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343
  1. <template>
  2. <div v-loading="loading">
  3. <!-- ECharts 图表容器 -->
  4. <div class="pannel" v-if="isshow">
  5. 光标数据
  6. <div class="pannel-row" v-show="showReadoutSingle">
  7. <span class="pannel-key">单指针</span>
  8. <span class="pannel-val">{{ cursorReadoutSingle }}</span>
  9. </div>
  10. <div class="pannel-row" v-show="showReadoutSideband">
  11. <span class="pannel-key">边带</span>
  12. <span class="pannel-val">{{ cursorReadoutSideband }}</span>
  13. </div>
  14. <div class="pannel-row" v-show="showReadoutPeak">
  15. <span class="pannel-key">峰值</span>
  16. <span class="pannel-val">{{ cursorReadoutPeak }}</span>
  17. </div>
  18. <div class="pannel-row" v-show="showReadoutHarmonic">
  19. <span class="pannel-key">谐波</span>
  20. <span class="pannel-val">{{ cursorReadoutHarmonic }}</span>
  21. </div>
  22. </div>
  23. <div class="line-chart" ref="chart"></div>
  24. <div class="control-panel">
  25. <!-- 频率范围 -->
  26. <div class="box full-row">
  27. <div class="panel-block">
  28. <span class="label1">频率</span>
  29. <el-input v-model="freqMin" size="mini" placeholder="下限" />
  30. <span>~</span>
  31. <el-input v-model="freqMax" size="mini" placeholder="上限" />
  32. <el-button size="mini" type="primary" @click="handleFreqRange">
  33. 应用
  34. </el-button>
  35. </div>
  36. </div>
  37. <!-- 手动标注 -->
  38. <div class="panel-block">
  39. <span class="label1">标注</span>
  40. <el-input v-model="manualFreq" size="mini" placeholder="频率" />
  41. <el-input v-model="multiple" size="mini" placeholder="倍频" />
  42. <el-button size="mini" type="success" @click="handleMark"
  43. >标注</el-button
  44. >
  45. </div>
  46. <!-- 特征值(多选) -->
  47. <div class="panel-block">
  48. <span class="label">特征 </span>
  49. <el-cascader
  50. v-model="selectedFeatures"
  51. :options="cascaderOptions"
  52. :props="cascaderProps"
  53. collapse-tags
  54. clearable
  55. placeholder="请选择特征"
  56. size="small"
  57. @change="handleCascaderChange"
  58. />
  59. </div>
  60. <!-- 光标(单选) -->
  61. <div class="panel-block">
  62. <span class="label">光标</span>
  63. <div class="btn-group">
  64. <span
  65. v-for="item in GBcheckList"
  66. :key="item.val"
  67. :class="['btn', checkedGB.includes(item.val) ? 'active' : '']"
  68. @click="selectCursor(item.val)"
  69. >
  70. {{ item.val }}
  71. </span>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </template>
  77. <script>
  78. import axios from "axios";
  79. import * as echarts from "echarts";
  80. import cursorReferenceMixin from "./spectrogramcharts/cursorReferenceMixin";
  81. import Bdgb from "./spectrogramcharts/Bdgb";
  82. import Xdgb from "./spectrogramcharts/Xdgb";
  83. import Tjgb from "./spectrogramcharts/Tjgb";
  84. import failureFrequency from "./data/failureFrequency.json";
  85. export default {
  86. name: "TimedomainCharts",
  87. mixins: [cursorReferenceMixin, Bdgb, Xdgb, Tjgb],
  88. props: {
  89. isshow: {
  90. type: Boolean,
  91. default: false,
  92. },
  93. currentIndex: {
  94. type: Number,
  95. default: 0,
  96. },
  97. activeIndex: {
  98. type: Number,
  99. default: 0,
  100. },
  101. ids: {
  102. type: Array,
  103. default: () => [],
  104. },
  105. spectrumListTwo: {
  106. type: Object,
  107. default: () => ({}),
  108. },
  109. currentRow: {
  110. type: Object,
  111. default: () => ({}),
  112. },
  113. /** 振动页合并 sessionStorage+路由 后的深链快照(可含 rotationalSpeed、otherData.RPM) */
  114. deepLinkSpectrumContext: {
  115. type: Object,
  116. default: null,
  117. },
  118. /** 已打开图表列表(含 rowData),与深链 id 严格一致时取 RPM;不再使用 measurementPointData */
  119. chartRowSnapshots: {
  120. type: Array,
  121. default: () => [],
  122. },
  123. routeAnalysisId: {
  124. type: String,
  125. default: "",
  126. },
  127. routeAnalysisTime: {
  128. type: String,
  129. default: "",
  130. },
  131. windCode: {
  132. type: String,
  133. default: "",
  134. },
  135. loading: {
  136. type: Boolean,
  137. default: false,
  138. },
  139. },
  140. data() {
  141. return {
  142. freqMin: "",
  143. freqMax: "",
  144. manualFreq: "",
  145. multiple: 1,
  146. manualMarks: [],
  147. chartInstance: null,
  148. option: null,
  149. // TZshow: false,
  150. BGshow: false,
  151. PXshow: false,
  152. spectrumList: {},
  153. GBcheckList: [
  154. { val: "单指针", checked: false, disabled: false },
  155. { val: "谐波光标", checked: false, disabled: false },
  156. { val: "边带光标", checked: false, disabled: false },
  157. { val: "移动峰值", checked: false, disabled: false },
  158. ],
  159. featureGroups: [
  160. {
  161. label: "轴承故障",
  162. type: "bearing",
  163. children: [
  164. {
  165. // GEN
  166. label: "发电机轴承",
  167. type: "bearing",
  168. children: [
  169. "GEN NDE BPFO",
  170. "GEN NDE BPFI",
  171. "GEN NDE BSF",
  172. "GEN NDE FTF",
  173. "GEN-DE BPFO",
  174. "GEN-DE BPFI",
  175. "GEN-DE BSF",
  176. "GEN-DE FTF",
  177. ],
  178. },
  179. {
  180. label: "主轴轴承",
  181. type: "bearing",
  182. children: [
  183. // 主轴轴承
  184. "MB01 BPFO",
  185. "MB01 BPFI",
  186. "MB01 BSF",
  187. "MB01 FTF",
  188. "MB02 BPFO",
  189. "MB02 BPFI",
  190. "MB02 BSF",
  191. "MB02 FTF",
  192. ],
  193. },
  194. {
  195. label: "LSS",
  196. type: "bearing",
  197. children: [
  198. "lSS NNCF5048 BPFO",
  199. "lSS NNCF5048 BPFI",
  200. "lSS NNCF5048 BSF",
  201. "lSS NNCF5048 FTF",
  202. ],
  203. },
  204. {
  205. label: "HSS",
  206. type: "bearing",
  207. children: [
  208. // HSS
  209. "HSS-NU2228 BPFO",
  210. "HSS-NU2228 BPFI",
  211. "HSS-NU2228 BSF",
  212. "HSS-NU2228 FTF",
  213. "HSS-QJ328 BPFO",
  214. "HSS-QJ328 BPFI",
  215. "HSS-QJ328 BSF",
  216. "HSS-QJ328 FTF",
  217. ],
  218. },
  219. {
  220. label: "IMS",
  221. type: "bearing",
  222. children: [
  223. // IMS
  224. "IMS-32956 BPFO",
  225. "IMS-32956 BPFI",
  226. "IMS-32956 BSF",
  227. "IMS-32956 FTF",
  228. "IMS-NU1052 BPFO",
  229. "IMS-NU1052 BPFI",
  230. "IMS-NU1052 BSF",
  231. "IMS-NU1052 FTF",
  232. "IMS-NU2324 BPFO",
  233. "IMS-NU2324 BPFI",
  234. "IMS-NU2324 BSF",
  235. "IMS-NU2324 FTF",
  236. ],
  237. },
  238. {
  239. label: "行星轴承(LSS/IMS)",
  240. type: "bearing",
  241. children: [
  242. // 行星轴承(LSS/IMS)
  243. "LSS BPFO",
  244. "LSS BPFI",
  245. "LSS BSF",
  246. "LSS FTF",
  247. "IMS BPFO", //中间轴
  248. "IMS BPFI",
  249. "IMS BSF",
  250. "IMS FTF",
  251. ],
  252. },
  253. ],
  254. },
  255. {
  256. label: "转动基频",
  257. type: "rotation",
  258. children: [
  259. "Speed",
  260. "Blade",
  261. "MainShaft",
  262. "LSS Planet shaft",
  263. "IMS Planet shaft",
  264. "Rotor, Rotor bars", //转子
  265. "固定联轴节HHS",
  266. ],
  267. },
  268. {
  269. label: "结构频率",
  270. type: "structure",
  271. children: [
  272. "Stator, Pole pass freq.", //定子
  273. "Stator, Grid freq.",
  274. "Rotor, Grid freq.",
  275. ],
  276. },
  277. {
  278. label: "齿轮特征",
  279. type: "gear",
  280. children: [
  281. "GearIMS",
  282. "GearHHS",
  283. "LSS", //小齿轮// 行星啮合频率(本质GMF)
  284. "IMS", //中间轴
  285. ],
  286. },
  287. ],
  288. // 每个分类单独存
  289. selectedMap: {
  290. bearing: [],
  291. rotation: [],
  292. structure: [],
  293. gear: [],
  294. },
  295. // 最终统一给图表用
  296. checkedFeatures: [],
  297. selectedFeatures: [],
  298. cascaderProps: {
  299. multiple: true,
  300. checkStrictly: false,
  301. emitPath: true, // 保留(你需要路径)
  302. value: "value",
  303. label: "label",
  304. },
  305. Fr: [],
  306. BPFI: [],
  307. BPFO: [],
  308. BSF: [],
  309. FTF: [],
  310. B3P: [],
  311. checkedGB: [],
  312. checkedValues: [],
  313. featureMultipleMap: {},
  314. /** 与 failureFrequency.json 中各部件的 ratio(传动比)对应到每条故障特征名 */
  315. featureRatioMap: {},
  316. rpmMissingWarned: false,
  317. };
  318. },
  319. computed: {
  320. cascaderOptions() {
  321. return this.featureGroups.map((group) => ({
  322. label: group.label,
  323. value: group.label,
  324. children: group.children.map((item) => {
  325. // 其它分组:子项为字符串;「轴承故障」为 { label, children: string[] } 多一级
  326. if (typeof item === "string") {
  327. return { label: item, value: item };
  328. }
  329. if (item && Array.isArray(item.children)) {
  330. return {
  331. label: item.label,
  332. value: item.label,
  333. children: item.children.map((leaf) => ({
  334. label: leaf,
  335. value: leaf,
  336. })),
  337. };
  338. }
  339. return {
  340. label: item.label,
  341. value: item.label,
  342. };
  343. }),
  344. }));
  345. },
  346. spectrumXLabel() {
  347. const t = this.spectrumList?.xaxis;
  348. return t && String(t).trim() ? String(t).trim() : "Hz";
  349. },
  350. spectrumYLabel() {
  351. const t = this.spectrumList?.yaxis;
  352. return t && String(t).trim() ? String(t).trim() : "m/s²";
  353. },
  354. /** 单指针:点击后的频率与幅值(来自 mixin singlePointerPoint) */
  355. cursorReadoutSingle() {
  356. const p = this.singlePointerPoint;
  357. if (!p || p.xAxis == null) return this.formatCursorPair(null, null);
  358. return this.formatCursorPair(p.xAxis, p.val);
  359. },
  360. /** 边带:展示 +1 边带线处的频率与谱幅(与图上「+1」标注一致) */
  361. cursorReadoutSideband() {
  362. if (!this.sidebandCursorPoints?.length || !this.singlePointerPoint) {
  363. return this.formatCursorPair(null, null);
  364. }
  365. const plusOne = this.sidebandCursorPoints.find((p) => p.val === "+1");
  366. if (!plusOne || plusOne.xAxis == null) {
  367. return this.formatCursorPair(null, null);
  368. }
  369. const xData = this.spectrumList?.x;
  370. const yData = this.spectrumList?.y;
  371. if (!xData?.length || !yData?.length) {
  372. return this.formatCursorPair(plusOne.xAxis, null);
  373. }
  374. const idx = this.findClosestIndex(Number(plusOne.xAxis), xData);
  375. const yVal = yData[idx];
  376. const amp =
  377. yVal != null && !Number.isNaN(Number(yVal))
  378. ? Number(yVal).toFixed(6)
  379. : null;
  380. return this.formatCursorPair(plusOne.xAxis, amp);
  381. },
  382. /** 移动峰值:当前峰值光标(cursorHightPoints) */
  383. cursorReadoutPeak() {
  384. const pts = this.cursorHightPoints;
  385. if (!pts?.length) return this.formatCursorPair(null, null);
  386. const p = pts[0];
  387. return this.formatCursorPair(p.xAxis, p.val);
  388. },
  389. /** 谐波:基频(1×)处频率与插值幅值(harmonicCursorPoints[0]) */
  390. cursorReadoutHarmonic() {
  391. const pts = this.harmonicCursorPoints;
  392. if (!pts?.length) return this.formatCursorPair(null, null);
  393. const p = pts[0];
  394. return this.formatCursorPair(p.xAxis, p.yValue);
  395. },
  396. /** v-show 用:字符串恒为真,不能写 v-show="cursorReadoutPeak",需按数据源判断 */
  397. showReadoutSingle() {
  398. return (
  399. this.singlePointerPoint != null && this.singlePointerPoint.xAxis != null
  400. );
  401. },
  402. showReadoutSideband() {
  403. return (
  404. !!this.sidebandCursorPoints?.length &&
  405. this.singlePointerPoint != null &&
  406. this.singlePointerPoint.xAxis != null
  407. );
  408. },
  409. showReadoutPeak() {
  410. return !!(this.cursorHightPoints && this.cursorHightPoints.length);
  411. },
  412. showReadoutHarmonic() {
  413. return !!(this.harmonicCursorPoints && this.harmonicCursorPoints.length);
  414. },
  415. },
  416. watch: {
  417. // immediate:开发热更新重挂载时 props 引用未变,普通 watch 不触发,会导致 spectrumList 仍是 {}、图表空白
  418. spectrumListTwo: {
  419. handler(newValue) {
  420. this.spectrumList =
  421. newValue && typeof newValue === "object" ? newValue : {};
  422. if (
  423. this.chartInstance &&
  424. Array.isArray(this.spectrumList?.y) &&
  425. Array.isArray(this.spectrumList?.x) &&
  426. this.spectrumList.y.length === this.spectrumList.x.length
  427. ) {
  428. this.updateChart(this.spectrumList.y, this.spectrumList.x);
  429. this.updateFeatureLinesByGroup();
  430. }
  431. },
  432. immediate: true,
  433. deep: true,
  434. },
  435. spectrumList(newVal) {
  436. if (!newVal) return;
  437. this.$nextTick(() => {
  438. this.updateFeatureLinesByGroup();
  439. });
  440. },
  441. currentRow: {
  442. deep: true,
  443. handler() {
  444. this.$nextTick(() => {
  445. this.updateFeatureLinesByGroup();
  446. });
  447. },
  448. },
  449. },
  450. mounted() {
  451. this.$nextTick(() => {
  452. this.initializeChart();
  453. window.addEventListener("resize", this.handleResize);
  454. // 数据由父组件统一刷新(props: spectrumListTwo),同步依赖 watch immediate
  455. });
  456. },
  457. beforeDestroy() {
  458. window.removeEventListener("resize", this.handleResize);
  459. if (this.chartInstance) {
  460. this.disableSinglePointer?.();
  461. this.chartInstance.getZr().off("dblclick", this.handleDoubleClick);
  462. this.chartInstance.dispose();
  463. this.chartInstance = null;
  464. }
  465. },
  466. methods: {
  467. /** 频率类数值展示:统一保留 6 位小数(特征竖线标签、光标读数等) */
  468. formatNumericFreq(v) {
  469. const n = Number(v);
  470. if (Number.isNaN(n)) return null;
  471. return Math.abs(n) >= 1000 ? n.toFixed(2) : n.toFixed(6);
  472. },
  473. toFinitePositiveNumber(raw) {
  474. if (raw === null || raw === undefined || raw === "") return null;
  475. if (typeof raw === "number") {
  476. return Number.isFinite(raw) && raw > 0 ? raw : null;
  477. }
  478. if (typeof raw === "string") {
  479. const s = raw.trim();
  480. if (!s) return null;
  481. const direct = Number(s);
  482. if (Number.isFinite(direct) && direct > 0) return direct;
  483. const m = s.match(/-?\d+(?:\.\d+)?/);
  484. if (!m) return null;
  485. const n = Number(m[0]);
  486. return Number.isFinite(n) && n > 0 ? n : null;
  487. }
  488. return null;
  489. },
  490. normalizeIdToken(v) {
  491. if (v === undefined || v === null) return "";
  492. return String(v).trim();
  493. },
  494. normalizeTimeToken(v) {
  495. if (v === undefined || v === null) return "";
  496. return String(v).trim().replace(/\s+/g, " ");
  497. },
  498. timeTokensEffectivelyEqual(a, b) {
  499. const na = this.normalizeTimeToken(a);
  500. const nb = this.normalizeTimeToken(b);
  501. if (na === nb) return true;
  502. const da = Date.parse(String(a).replace(/-/g, "/"));
  503. const db = Date.parse(String(b).replace(/-/g, "/"));
  504. if (!Number.isFinite(da) || !Number.isFinite(db)) return false;
  505. return da === db;
  506. },
  507. extractRpmFromRow(row) {
  508. if (!row) return null;
  509. const od = row.otherData || {};
  510. const candidates = [
  511. row.rotationalSpeed,
  512. row.rotationSpeed,
  513. od.RPM,
  514. od.rpm,
  515. od.rotationalSpeed,
  516. od.rotationSpeed,
  517. ];
  518. for (const raw of candidates) {
  519. const n = this.toFinitePositiveNumber(raw);
  520. if (n != null) return n;
  521. }
  522. return null;
  523. },
  524. getStrictAnchor() {
  525. const routeId = this.normalizeIdToken(this.routeAnalysisId);
  526. const routeTime = this.normalizeTimeToken(this.routeAnalysisTime);
  527. if (routeId) {
  528. return { id: routeId, time: routeTime };
  529. }
  530. const cur = this.currentRow || {};
  531. const curId = this.normalizeIdToken(cur.id ?? cur.itemKey);
  532. const curTime = this.normalizeTimeToken(
  533. cur.timeStamp ?? cur.itemValue ?? "",
  534. );
  535. return { id: curId, time: curTime };
  536. },
  537. recordMatchesAnchor(row) {
  538. const { id: anchorId, time: anchorTime } = this.getStrictAnchor();
  539. if (!anchorId || !row) return false;
  540. if (this.normalizeIdToken(row.id ?? row.itemKey) !== anchorId) {
  541. return false;
  542. }
  543. if (anchorTime) {
  544. return this.timeTokensEffectivelyEqual(
  545. row.timeStamp ?? row.itemValue ?? "",
  546. anchorTime,
  547. );
  548. }
  549. return true;
  550. },
  551. /** sessionStorage+路由 合并对象:id(及可选 time)与当前分析一致时才用其中的 RPM */
  552. findRpmFromDeepLinkSpectrumContext() {
  553. const ctx = this.deepLinkSpectrumContext;
  554. if (!ctx || typeof ctx !== "object") return null;
  555. const anchorId = this.normalizeIdToken(
  556. this.routeAnalysisId || this.currentRow?.id || this.currentRow?.itemKey,
  557. );
  558. if (!anchorId) return null;
  559. const cid = this.normalizeIdToken(ctx.id ?? ctx.itemKey);
  560. if (cid !== anchorId) return null;
  561. const wantTime = this.normalizeTimeToken(this.routeAnalysisTime);
  562. if (wantTime) {
  563. if (
  564. !this.timeTokensEffectivelyEqual(
  565. ctx.timeStamp ?? ctx.itemValue ?? "",
  566. wantTime,
  567. )
  568. ) {
  569. return null;
  570. }
  571. }
  572. return this.extractRpmFromRow(ctx);
  573. },
  574. /** 仅扫历史图表 rowData,不用 measurementPointData(避免默认列表错行) */
  575. findRpmFromStrictChartSnapshots() {
  576. const { id: anchorId } = this.getStrictAnchor();
  577. if (!anchorId) return null;
  578. const snapshots = Array.isArray(this.chartRowSnapshots)
  579. ? this.chartRowSnapshots
  580. : [];
  581. for (const item of snapshots) {
  582. const rd = item?.rowData;
  583. if (rd && this.recordMatchesAnchor(rd)) {
  584. const r = this.extractRpmFromRow(rd);
  585. if (r != null) return r;
  586. }
  587. }
  588. return null;
  589. },
  590. formatCursorPair(freqNum, ampVal) {
  591. const xl = this.spectrumXLabel;
  592. const yl = this.spectrumYLabel;
  593. const numStr = this.formatNumericFreq(freqNum);
  594. const left = numStr == null ? "—" : `${numStr} ${xl}`;
  595. const amp =
  596. ampVal === null || ampVal === undefined || ampVal === ""
  597. ? null
  598. : String(ampVal);
  599. const right = amp == null ? "—" : `${amp} ${yl}`;
  600. return `${left};${right}`;
  601. },
  602. normalizeFeatureName(name) {
  603. if (!name) return "";
  604. return String(name)
  605. .replace(/GEN-NDE/g, "GEN NDE")
  606. .trim();
  607. },
  608. buildFeatureMultipleMap() {
  609. const map = {};
  610. const ratioMap = {};
  611. (failureFrequency || []).forEach((part) => {
  612. const partRatioRaw = part?.ratio;
  613. const partRatio =
  614. partRatioRaw != null && partRatioRaw !== ""
  615. ? Number(partRatioRaw)
  616. : 1;
  617. const r = Number.isFinite(partRatio) ? partRatio : 1;
  618. (part.faultFrequencies || []).forEach((item) => {
  619. if (!item?.name) return;
  620. const key = this.normalizeFeatureName(item.name);
  621. map[key] = Number(item.multiple);
  622. ratioMap[key] = r;
  623. });
  624. });
  625. // 兼容页面中的中文别名
  626. if (map.Blade != null) {
  627. map.叶片频率 = map.Blade;
  628. ratioMap.叶片频率 = ratioMap.Blade != null ? ratioMap.Blade : 1;
  629. }
  630. map.转速频率 = 1;
  631. ratioMap.转速频率 = ratioMap.Speed != null ? ratioMap.Speed : 1;
  632. this.featureMultipleMap = map;
  633. this.featureRatioMap = ratioMap;
  634. },
  635. getFeatureMultipleByName(name) {
  636. const normalized = this.normalizeFeatureName(name);
  637. if (this.featureMultipleMap[normalized] != null) {
  638. return this.featureMultipleMap[normalized];
  639. }
  640. // 兼容 GEN-NDE / GEN NDE 两种写法
  641. const swapped = normalized.includes("GEN NDE")
  642. ? normalized.replace("GEN NDE", "GEN-NDE")
  643. : normalized.replace("GEN-NDE", "GEN NDE");
  644. if (this.featureMultipleMap[swapped] != null) {
  645. return this.featureMultipleMap[swapped];
  646. }
  647. return null;
  648. },
  649. /** 传动比:来自 failureFrequency.json 中该特征所属部件的 ratio,缺省为 1 */
  650. getFeatureRatioByName(name) {
  651. const normalized = this.normalizeFeatureName(name);
  652. const m = this.featureRatioMap || {};
  653. if (m[normalized] != null && Number.isFinite(Number(m[normalized]))) {
  654. return Number(m[normalized]);
  655. }
  656. const swapped = normalized.includes("GEN NDE")
  657. ? normalized.replace("GEN NDE", "GEN-NDE")
  658. : normalized.replace("GEN-NDE", "GEN NDE");
  659. if (m[swapped] != null && Number.isFinite(Number(m[swapped]))) {
  660. return Number(m[swapped]);
  661. }
  662. return 1;
  663. },
  664. /** 「齿轮特征」分组下的叶子项:不乘传动比,轴转频 = RPM/60(与轴承/转动等其它分组区分) */
  665. isGearGroupFeatureName(name) {
  666. const n = this.normalizeFeatureName(name);
  667. const gear = this.featureGroups.find((g) => g.type === "gear");
  668. const leaves = (gear?.children || []).filter(
  669. (c) => typeof c === "string",
  670. );
  671. return leaves.some((leaf) => this.normalizeFeatureName(leaf) === n);
  672. },
  673. /**
  674. * 特征竖线:非齿轮特征 X = (RPM×传动比/60)×倍频;齿轮特征 X = (RPM/60)×倍频
  675. * 转速来源:树节点 otherData.RPM 优先,其次行上 rotationalSpeed(与波形接口一致)
  676. */
  677. getRotationalSpeedRpm() {
  678. const cur = this.currentRow || {};
  679. const od = cur.otherData || {};
  680. const sp = this.spectrumList || {};
  681. const spOd =
  682. sp.otherData && typeof sp.otherData === "object" ? sp.otherData : {};
  683. const candidates = [
  684. od.RPM,
  685. od.rpm,
  686. od.rotationalSpeed,
  687. od.rotationSpeed,
  688. cur.rotationalSpeed,
  689. cur.rotationSpeed,
  690. sp.RPM,
  691. sp.rpm,
  692. sp.rotationalSpeed,
  693. sp.rotationSpeed,
  694. spOd.RPM,
  695. spOd.rpm,
  696. spOd.rotationalSpeed,
  697. spOd.rotationSpeed,
  698. ];
  699. for (const raw of candidates) {
  700. const n = this.toFinitePositiveNumber(raw);
  701. if (n != null) return n;
  702. }
  703. const fromDeepLink = this.findRpmFromDeepLinkSpectrumContext();
  704. if (fromDeepLink != null) return fromDeepLink;
  705. const fromCharts = this.findRpmFromStrictChartSnapshots();
  706. if (fromCharts != null) return fromCharts;
  707. return null;
  708. },
  709. handleResize() {
  710. this.chartInstance?.resize();
  711. },
  712. handleFeatureChange() {
  713. // 1️⃣ 汇总所有选中的特征
  714. const allSelected = Object.values(this.selectedMap).flat();
  715. this.checkedFeatures = allSelected;
  716. // 2️⃣ 更新图表
  717. this.updateFeatureLinesByGroup();
  718. },
  719. handleCascaderChange(val) {
  720. // console.log(
  721. // this.spectrumListTwo,
  722. // val,
  723. // "spectrumListTwo",
  724. // this.spectrumList,
  725. // );
  726. this.manualFreq = "";
  727. this.multiple = 1;
  728. if (!val || val.length === 0) {
  729. this.checkedFeatures = [];
  730. this.renderFeatureSeries([]);
  731. return;
  732. }
  733. // 👉 1. 提取最后一层(真正特征)
  734. this.checkedFeatures = val
  735. .map((item) => item[item.length - 1])
  736. .filter(Boolean);
  737. console.log(this.checkedFeatures, "checkedFeatures");
  738. // 👉 3. 更新图表
  739. this.updateFeatureLinesByGroup();
  740. },
  741. selectCursor(val) {
  742. // 光标选择逻辑:
  743. // - 「单指针」与「边带光标」允许同时选中(边带依赖单指针中心)
  744. // - 其它光标(谐波光标 / 移动峰值)保持单选互斥
  745. const isAlreadyChecked = this.checkedGB.includes(val);
  746. const isSinglePointerVal = val === "单指针";
  747. const isSidebandVal = val === "边带光标";
  748. const isHarmonicVal = val === "谐波光标";
  749. const isMovePeakVal = val === "移动峰值";
  750. if (isAlreadyChecked) {
  751. // 取消选中
  752. if (isSinglePointerVal) {
  753. // 单指针被取消时:边带依赖单指针中心,直接级联取消边带并清除边带设置
  754. this.checkedGB = this.checkedGB.filter(
  755. (v) => v !== "单指针" && v !== "边带光标",
  756. );
  757. } else {
  758. // 其它:仅移除当前项
  759. this.checkedGB = this.checkedGB.filter((v) => v !== val);
  760. }
  761. } else if (isSinglePointerVal || isSidebandVal) {
  762. // 单指针/边带:在现有基础上追加(保留对方)
  763. const next = new Set(this.checkedGB);
  764. next.add(val);
  765. // 但如果此时已经选了「谐波光标」或「移动峰值」,需要清掉(它们保持单选)
  766. next.delete("谐波光标");
  767. next.delete("移动峰值");
  768. this.checkedGB = Array.from(next);
  769. } else if (isHarmonicVal || isMovePeakVal) {
  770. // 其它:单选互斥(会清掉单指针/边带)
  771. this.checkedGB = [val];
  772. } else {
  773. this.checkedGB = [val];
  774. }
  775. console.log(this.checkedGB, "this.checkedGB");
  776. const isMoveChecked = this.checkedGB.includes("移动峰值");
  777. const isSidebandChecked = this.checkedGB.includes("边带光标");
  778. const isHarmonicChecked = this.checkedGB.includes("谐波光标");
  779. const isSinglePointer = this.checkedGB.includes("单指针");
  780. // 峰值 / 谐波 与 单指针+边带 互斥:先清边带与单指针线,再画峰值或谐波(避免只清状态、线残留)
  781. if (isMoveChecked || isHarmonicChecked) {
  782. this.disableSidebandCursor();
  783. this.disableSinglePointer();
  784. }
  785. isMoveChecked ? this.handleMoveCursor() : this.removeCursor();
  786. isSidebandChecked
  787. ? this.enableSidebandCursor()
  788. : this.disableSidebandCursor();
  789. isHarmonicChecked
  790. ? this.enableHarmonicCursor()
  791. : this.disableHarmonicCursor();
  792. // 单指针:
  793. // - 只要没选中「单指针」→ 移除单指针线+解绑事件
  794. // - 选中「单指针」且未启用「边带光标」→ 允许点击移动单指针
  795. // - 选中「单指针」且启用「边带光标」→ 冻结单指针(保留线,不允许点击移动)
  796. if (!isSinglePointer) {
  797. this.disableSinglePointer();
  798. } else if (isSidebandChecked) {
  799. // 冻结:仅解绑 click,不删除单指针线
  800. this.unbindSinglePointerClick?.();
  801. } else {
  802. this.enableSinglePointer();
  803. }
  804. },
  805. initializeChart() {
  806. const chartDom = this.$refs.chart;
  807. if (chartDom && !this.chartInstance) {
  808. this.chartInstance = echarts.init(chartDom);
  809. this.chartInstance.getZr().on("dblclick", this.handleDoubleClick);
  810. }
  811. this.$nextTick(() => {
  812. if (this.chartInstance && this.spectrumList.y && this.spectrumList.x) {
  813. this.updateChart(this.spectrumList.y, this.spectrumList.x);
  814. }
  815. });
  816. },
  817. handleFreqRange() {
  818. const min = Number(this.freqMin);
  819. const max = Number(this.freqMax);
  820. if (isNaN(min) || isNaN(max)) return;
  821. this.chartInstance.setOption({
  822. xAxis: { min, max },
  823. });
  824. },
  825. handleMark() {
  826. const freq = Number(this.manualFreq);
  827. const multiple = Number(this.multiple) || 1;
  828. if (isNaN(freq)) return;
  829. const marks = [];
  830. for (let i = 1; i <= multiple; i++) {
  831. marks.push({
  832. xAxis: freq * i,
  833. val: `${i}x`,
  834. });
  835. }
  836. this.manualMarks = marks;
  837. this.renderManualMarks();
  838. },
  839. renderManualMarks() {
  840. const option = this.chartInstance.getOption();
  841. const manualSeries = {
  842. id: "MANUAL_MARK",
  843. type: "line",
  844. markLine: {
  845. symbol: ["none", "none"],
  846. lineStyle: {
  847. color: "#ff0000",
  848. width: 2,
  849. type: "dashed",
  850. },
  851. label: {
  852. formatter: ({ data }) => data.val,
  853. },
  854. data: this.manualMarks,
  855. },
  856. };
  857. this.chartInstance.setOption({
  858. series: [
  859. ...(option.series || []).filter((s) => s && s.id !== "MANUAL_MARK"),
  860. manualSeries,
  861. ],
  862. });
  863. },
  864. updateFeatureLinesByGroup() {
  865. console.log(this.spectrumList, "updateFeatureLinesByGroup");
  866. if (!this.spectrumList) return;
  867. const rpm = this.getRotationalSpeedRpm();
  868. console.log(rpm, "rpm");
  869. if (rpm == null) {
  870. this.renderFeatureSeries([]);
  871. if (this.checkedFeatures.length && !this.rpmMissingWarned) {
  872. this.rpmMissingWarned = true;
  873. this.$message.warning(
  874. "当前数据缺少有效转速(RPM),无法计算特征频率标注",
  875. );
  876. }
  877. return;
  878. }
  879. this.rpmMissingWarned = false;
  880. const featureLines = this.checkedFeatures
  881. .map((name) => {
  882. const multiple = this.getFeatureMultipleByName(name);
  883. if (multiple == null || Number.isNaN(multiple)) return null;
  884. const ratio = this.getFeatureRatioByName(name);
  885. console.log(multiple, "multiple");
  886. console.log(rpm, ratio, "rpm, ratio");
  887. const shaftHz = this.isGearGroupFeatureName(name)
  888. ? rpm / 60
  889. : (rpm * ratio) / 60;
  890. const x = shaftHz * Number(multiple);
  891. if (!Number.isFinite(x)) return null;
  892. const freqStr = this.formatNumericFreq(x);
  893. const xl = this.spectrumXLabel;
  894. const labelText =
  895. freqStr != null ? `${name}: ${freqStr} ${xl}` : `${name}`;
  896. return {
  897. Xaxis: x,
  898. val: labelText,
  899. };
  900. })
  901. .filter(Boolean);
  902. console.log(featureLines, "featureLines");
  903. this.renderFeatureSeries(featureLines);
  904. },
  905. updateChart(data, labels) {
  906. if (
  907. !this.chartInstance ||
  908. !Array.isArray(labels) ||
  909. !Array.isArray(data) ||
  910. labels.length !== data.length
  911. ) {
  912. console.error("Invalid data or labels");
  913. return;
  914. }
  915. console.log(this.spectrumList, "updataChart 频谱图");
  916. const createMarkLine = (dataSource, color) => ({
  917. type: "line",
  918. markLine: {
  919. silent: false,
  920. lineStyle: { color, type: "dashed", width: 2 },
  921. symbol: ["none", "none"],
  922. label: {
  923. show: true,
  924. position: "end",
  925. formatter: ({ data }) => data.val,
  926. },
  927. emphasis: {
  928. lineStyle: { color: "#FF6A00", width: 4, type: "dashed" },
  929. label: {
  930. show: true,
  931. formatter: ({ value }) => `特征值: ${value}`,
  932. color: "#000",
  933. backgroundColor: "#FFF",
  934. padding: [2, 4],
  935. borderRadius: 3,
  936. fontSize: 12,
  937. },
  938. },
  939. data: dataSource.map(({ Xaxis, val }) => ({ xAxis: Xaxis, val })),
  940. },
  941. });
  942. const markLines = [
  943. { data: this.Fr, color: "#A633FF" },
  944. { data: this.BPFI, color: "#23357e" },
  945. { data: this.BPFO, color: "#42a0ae" },
  946. { data: this.BSF, color: "#008080" },
  947. { data: this.FTF, color: "#af254f" },
  948. { data: this.B3P, color: "#FFD700" },
  949. ].map(({ data, color }) => createMarkLine(data, color));
  950. const option = {
  951. grid: {
  952. left: 60, // 原来是100,适当缩小左右边距
  953. right: 20,
  954. // top: 90, // 给推拽条和坐标轴腾出空间
  955. top: 30,
  956. bottom: 50,
  957. },
  958. // title: {
  959. // text: this.spectrumList.title || "",
  960. // left: "center",
  961. // top: 0,
  962. // textStyle: {
  963. // fontSize: 15,
  964. // fontWeight: 600,
  965. // color: "#303133",
  966. // },
  967. // padding: [0, 12, 6, 12],
  968. // },
  969. toolbox: {
  970. right: 10,
  971. // top: 55, // 👈 工具栏在最上面
  972. feature: {
  973. dataZoom: { yAxisIndex: "none" },
  974. restore: {},
  975. saveAsImage: {},
  976. },
  977. },
  978. xAxis: {
  979. type: "value",
  980. name: this.spectrumList.xaxis,
  981. nameLocation: "center",
  982. nameTextStyle: {
  983. fontSize: 12,
  984. color: "#333",
  985. padding: [10, 0, 0, 0], // 增加X轴标题和轴线的距离
  986. },
  987. axisLabel: {
  988. margin: 1, // 增加数值标签和轴线的间距
  989. formatter: (value) => value,
  990. },
  991. },
  992. yAxis: {
  993. type: "value",
  994. name: this.spectrumList.yaxis,
  995. nameTextStyle: {
  996. fontSize: 12,
  997. color: "#333",
  998. padding: [10, 0, 0, 0],
  999. },
  1000. },
  1001. tooltip: {
  1002. trigger: "axis",
  1003. formatter: ([
  1004. {
  1005. value: [x, y],
  1006. },
  1007. ]) => `X: ${x}<br/>Y: ${y}`,
  1008. axisPointer: { type: "line" },
  1009. },
  1010. // 无滑块;工具栏「区域缩放」需 dataZoom 组件:用不可见 inside,关闭滚轮
  1011. dataZoom: [
  1012. {
  1013. type: "inside",
  1014. xAxisIndex: 0,
  1015. filterMode: "none",
  1016. zoomOnMouseWheel: false,
  1017. moveOnMouseMove: false,
  1018. moveOnMouseWheel: false,
  1019. },
  1020. ],
  1021. series: [
  1022. {
  1023. id: "MAIN_SPECTRUM_SERIES",
  1024. name: "数据系列",
  1025. type: "line",
  1026. data: labels.map((x, i) => [x, data[i]]),
  1027. symbol: "none",
  1028. lineStyle: { color: "#162961", width: 1 },
  1029. itemStyle: {
  1030. color: "#162961",
  1031. borderColor: "#fff",
  1032. borderWidth: 1,
  1033. },
  1034. large: true,
  1035. progressive: 2000,
  1036. },
  1037. ...markLines,
  1038. ],
  1039. };
  1040. this.chartInstance.setOption(option, true);
  1041. this.$nextTick(() => {
  1042. if (this.singlePointerPoint) {
  1043. this.applySinglePointerSeries();
  1044. }
  1045. });
  1046. },
  1047. /**
  1048. * 特征竖线必须挂在「数据系列」上(与频谱折线同一 series)。
  1049. * 若用独立的无 data 的 line + markLine,ECharts 无法对齐 x 轴,竖线会全部画在 x=0。
  1050. */
  1051. renderFeatureSeries(featureLines) {
  1052. if (!this.chartInstance) return;
  1053. const colors = [
  1054. "#A633FF",
  1055. "#23357e",
  1056. "#42a0ae",
  1057. "#008080",
  1058. "#af254f",
  1059. "#FFD700",
  1060. "#ff7f50",
  1061. "#00bcd4",
  1062. ];
  1063. const markLineData = (featureLines || [])
  1064. .map((line, i) => {
  1065. const x = Number(line.Xaxis);
  1066. if (!Number.isFinite(x)) return null;
  1067. const text = line.val != null ? String(line.val) : "";
  1068. return {
  1069. xAxis: x,
  1070. lineStyle: {
  1071. color: colors[i % colors.length],
  1072. type: "dashed",
  1073. width: 2,
  1074. },
  1075. label: {
  1076. show: true,
  1077. position: "end",
  1078. formatter: text,
  1079. },
  1080. };
  1081. })
  1082. .filter(Boolean);
  1083. this.chartInstance.setOption(
  1084. {
  1085. series: [
  1086. {
  1087. id: "MAIN_SPECTRUM_SERIES",
  1088. // 特征值仅作为展示,不参与点击交互,避免触发额外事件链
  1089. markLine: {
  1090. silent: true,
  1091. symbol: ["none", "none"],
  1092. data: markLineData,
  1093. },
  1094. },
  1095. ],
  1096. },
  1097. false,
  1098. true,
  1099. );
  1100. },
  1101. // 获取数据
  1102. getTime() {
  1103. this.$emit("handleLoading", {
  1104. id: this.chartId,
  1105. currentRow: this.currentRow,
  1106. loading: true,
  1107. });
  1108. const params = {
  1109. ids: this.ids,
  1110. windCode: this.windCode,
  1111. analysisType: "frequency",
  1112. };
  1113. axios
  1114. .post("/AnalysisMulti/analysis/frequency", params)
  1115. .then((res) => {
  1116. this.spectrumList = { ...JSON.parse(res.data) };
  1117. console.log(this.spectrumList, "频谱图数据1");
  1118. const XrmsValue = this.spectrumList?.Xrms;
  1119. this.$emit("updateXrms", XrmsValue);
  1120. // 拉完数据后,如果已有选中项,自动渲染
  1121. this.$nextTick(() => {
  1122. this.updateFeatureLinesByGroup();
  1123. });
  1124. })
  1125. .catch((error) => {
  1126. console.error(error);
  1127. })
  1128. .finally(() => {
  1129. this.$emit("handleLoading", {
  1130. id: this.chartId,
  1131. currentRow: this.currentRow,
  1132. loading: false,
  1133. });
  1134. });
  1135. },
  1136. Show(value) {
  1137. const stateMap = {
  1138. 1: { TZshow: true, BGshow: false, PXshow: false },
  1139. 2: { TZshow: false, BGshow: true, PXshow: false },
  1140. 3: { TZshow: false, BGshow: false, PXshow: true },
  1141. };
  1142. if (stateMap[value]) {
  1143. this.TZshow = value === "1" ? !this.TZshow : false;
  1144. this.BGshow = value === "2" ? !this.BGshow : false;
  1145. this.PXshow = value === "3" ? !this.PXshow : false;
  1146. }
  1147. },
  1148. },
  1149. created() {
  1150. this.buildFeatureMultipleMap();
  1151. },
  1152. };
  1153. </script>
  1154. <style lang="scss" scoped>
  1155. .line-chart {
  1156. width: 100%;
  1157. height: 400px;
  1158. }
  1159. .FD {
  1160. width: 100%;
  1161. height: 1px;
  1162. position: relative;
  1163. }
  1164. .eigenvalue {
  1165. position: absolute;
  1166. top: 60px;
  1167. right: 0;
  1168. font-size: 10px;
  1169. width: 146px;
  1170. border: 1px solid rgb(182, 182, 182);
  1171. padding: 5px;
  1172. background: #fff;
  1173. z-index: 99;
  1174. border-radius: 5px;
  1175. h5 {
  1176. line-height: 16px;
  1177. height: 16px;
  1178. }
  1179. }
  1180. .eigenvalue--first {
  1181. width: 100px;
  1182. }
  1183. .control-panel {
  1184. /* 按控件区域实际宽度断点(嵌入侧栏时比视口媒体查询可靠) */
  1185. container-name: control-panel;
  1186. container-type: inline-size;
  1187. display: flex;
  1188. flex-wrap: wrap;
  1189. justify-content: space-between;
  1190. gap: 6px;
  1191. padding: 8px 12px;
  1192. background: #f5f7fa;
  1193. border: 1px solid #ddd;
  1194. border-radius: 6px;
  1195. margin-bottom: 10px;
  1196. }
  1197. /* 🌟 独占一行;容器宽度 ≤600 时频率块全宽,>600 时约半宽 */
  1198. .full-row {
  1199. width: 100%;
  1200. display: flex;
  1201. justify-content: space-between;
  1202. .panel-block {
  1203. width: 92%;
  1204. }
  1205. }
  1206. @container control-panel (min-width: 701px) {
  1207. .full-row .panel-block {
  1208. width: 45%;
  1209. }
  1210. }
  1211. .panel-block {
  1212. display: flex;
  1213. align-items: center;
  1214. gap: 6px;
  1215. }
  1216. .label {
  1217. font-size: 12px;
  1218. color: #666;
  1219. }
  1220. .label1 {
  1221. font-size: 12px;
  1222. color: #666;
  1223. display: inline-block;
  1224. width: 75px;
  1225. }
  1226. .btn-group {
  1227. display: flex;
  1228. gap: 6px;
  1229. }
  1230. .btn {
  1231. padding: 2px 8px;
  1232. font-size: 12px;
  1233. border: 1px solid #ccc;
  1234. border-radius: 3px;
  1235. cursor: pointer;
  1236. }
  1237. .btn.active {
  1238. background: #409eff;
  1239. color: #fff;
  1240. }
  1241. .full-width {
  1242. width: 100%;
  1243. }
  1244. .el-cascader {
  1245. font-size: 12px;
  1246. }
  1247. .el-cascader__tags {
  1248. max-width: 240px;
  1249. overflow: hidden;
  1250. }
  1251. .feature-grid {
  1252. display: grid;
  1253. grid-template-columns: repeat(4, 1fr); // 两列布局
  1254. gap: 10px;
  1255. width: 100%;
  1256. }
  1257. .feature-item {
  1258. display: flex;
  1259. align-items: center;
  1260. gap: 6px;
  1261. }
  1262. .el-select {
  1263. flex: 1;
  1264. }
  1265. .pannel {
  1266. margin: 5px;
  1267. padding: 8px 10px;
  1268. font-size: 12px;
  1269. line-height: 1.5;
  1270. // color: #303133;
  1271. background: #f5f7fa;
  1272. border: 1px solid #ddd;
  1273. border-radius: 4px;
  1274. display: flex;
  1275. }
  1276. .pannel-row {
  1277. display: flex;
  1278. align-items: flex-start;
  1279. margin: 0px 10px;
  1280. // margin-right: 5px;
  1281. // gap: 5px;
  1282. // margin-bottom: 4px;
  1283. &:last-child {
  1284. margin-bottom: 0;
  1285. }
  1286. }
  1287. .pannel-key {
  1288. // flex: 0 0 37px;
  1289. // flex: 0 0 45px;
  1290. color: #666;
  1291. }
  1292. .pannel-val {
  1293. flex: 1;
  1294. word-break: break-all;
  1295. }
  1296. </style>