NightscapeAnalysis.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. <template>
  2. <div
  3. class="ZTGlobal"
  4. style="width: 100%; padding: 1rem 1rem 0rem 1rem; color: white"
  5. >
  6. <el-row :gutter="10">
  7. <el-col :span="24">
  8. <div class="titleHeader">
  9. <el-switch
  10. v-model="isNightscaoe"
  11. active-text="开启夜景"
  12. inactive-text="关闭夜景"
  13. @change="handleChange"
  14. >
  15. </el-switch>
  16. <el-tooltip content="点击后可直接在光源参数中保存" placement="top">
  17. <el-button type="primary" size="mini" @click="openDgyAddVisibility"
  18. >添加光源</el-button
  19. >
  20. </el-tooltip>
  21. <el-button type="danger" size="mini" @click="dgyremove"
  22. >删除光源</el-button
  23. >
  24. </div>
  25. </el-col>
  26. </el-row>
  27. <el-row :gutter="10">
  28. <el-col :span="10">
  29. 光源列表:
  30. <el-row>
  31. <el-col :span="24" style="border: 1px solid #fff">
  32. <el-table
  33. ref="dgytable"
  34. :show-header="false"
  35. :data="gyTableData"
  36. :highlight-current-row="true"
  37. @current-change="handleCurrentChange"
  38. style="width: 100%"
  39. >
  40. <el-table-column prop="gyName" label="光源名称"></el-table-column>
  41. </el-table> </el-col
  42. ></el-row>
  43. </el-col>
  44. <el-col :span="14">
  45. 光源参数:
  46. <el-row>
  47. <el-col :span="24" style="border: 1px solid #fff">
  48. <el-form
  49. ref="dgyform"
  50. :model="dgyform"
  51. label-width="80px"
  52. style="padding: 1rem 1rem 0rem 1rem"
  53. >
  54. <el-form-item label="光源名称">
  55. <el-input
  56. size="mini"
  57. v-model="dgyform.gyName"
  58. placeholder="请输入光源名称"
  59. ></el-input>
  60. </el-form-item>
  61. <el-form-item label="光源类型">
  62. <el-select
  63. size="mini"
  64. v-model="dgyform.gyType"
  65. placeholder="请选择光源类型"
  66. >
  67. <el-option label="点光源" value="点光源"></el-option>
  68. <el-option label="聚光灯" value="聚光灯"></el-option>
  69. <el-option label="直射光" value="直射光"></el-option>
  70. </el-select>
  71. </el-form-item>
  72. <el-form-item label="光源颜色">
  73. <el-color-picker
  74. size="mini"
  75. v-model="dgyform.gyColor"
  76. ></el-color-picker>
  77. <el-button size="mini" @click="addPoint"
  78. >添加光源位置</el-button
  79. >
  80. </el-form-item>
  81. <!-- <el-form-item label="X坐标(度)">
  82. <el-input-number
  83. size="mini"
  84. v-model="dgyform.cartesian.x"
  85. ></el-input-number>
  86. </el-form-item>
  87. <el-form-item label="Y坐标(度)">
  88. <el-input-number
  89. size="mini"
  90. v-model="dgyform.cartesian.y"
  91. ></el-input-number>
  92. </el-form-item>-->
  93. <!-- <el-form-item label="光源高度">
  94. <el-input-number
  95. size="mini"
  96. v-model="dgyform.cartesian.z"
  97. ></el-input-number>
  98. </el-form-item> -->
  99. <el-form-item label="扩散距离" v-if="dgyform.gyType != '直射光'">
  100. <el-input-number
  101. size="mini"
  102. v-model="dgyform.gyDistance"
  103. :min="0"
  104. :max="10000"
  105. ></el-input-number>
  106. </el-form-item>
  107. <el-form-item label="衰减因子" v-if="dgyform.gyType != '直射光'">
  108. <el-input-number
  109. size="mini"
  110. v-model="dgyform.gyDecay"
  111. :min="0"
  112. :max="10000"
  113. ></el-input-number>
  114. </el-form-item>
  115. <el-form-item label="光源强度">
  116. <el-input-number
  117. size="mini"
  118. v-model="dgyform.gyIntensity"
  119. :min="0"
  120. :max="10000"
  121. ></el-input-number>
  122. </el-form-item>
  123. </el-form>
  124. <div class="SaveCenter">
  125. <el-button size="mini" type="primary" @click="onSubmit"
  126. >保存</el-button
  127. >
  128. <el-button size="mini" @click="resetForm">取消</el-button>
  129. </div>
  130. </el-col>
  131. </el-row>
  132. </el-col>
  133. </el-row>
  134. </div>
  135. </template>
  136. <script>
  137. import { v4 as uuidv4 } from "uuid";
  138. import Nightscape from "@/components/Combinations/NightscapeAnalysis/index.js";
  139. let entityPointLightPairs = new Map(),
  140. entitySpotLightPairs = new Map(),
  141. entityDirectionalLightPairs = new Map(),
  142. pointLightSourceDrawHandler = null,
  143. spotOrDirectionalLightSourceDrawHandler = null,
  144. spotOrDirectionalLightSourceCountHandler = null,
  145. spotOrDirectionalLightSourceAdding = false,
  146. spotOrDirectionalLightPositions = [];
  147. export default {
  148. data() {
  149. return {
  150. tooltip: createTooltip(document.body),
  151. // GeoJsonLayerList: [],
  152. // liudongGntities: [],
  153. sharedState: store.state,
  154. isNightscaoe: false,
  155. gyTableData: [],
  156. dgyform: {
  157. id: "",
  158. gyName: "",
  159. gyType: "点光源",
  160. gyColor: "#409EFF",
  161. gyDistance: 300,
  162. gyDecay: 5,
  163. gyIntensity: 5,
  164. // cartesian: {
  165. // x: 0,
  166. // y: 0,
  167. // z: 0,
  168. // },
  169. },
  170. // pointLightSourceDrawHandler: null,
  171. // spotOrDirectionalLightSourceDrawHandler: null,
  172. // spotOrDirectionalLightSourceCountHandler: null,
  173. // spotOrDirectionalLightSourceAdding: false,
  174. // spotOrDirectionalLightPositions: [],
  175. // entityPointLightPairs: new Map(), // Entity和点光源对象的键值对
  176. // entitySpotLightPairs: new Map(), // Entity和聚光灯对象的键值对
  177. // entityDirectionalLightPairs: new Map(), // Entity和平行光对象的键值对
  178. tycindex: 0,
  179. };
  180. },
  181. props: {
  182. info: {
  183. type: Object,
  184. default: () => {
  185. return {};
  186. },
  187. },
  188. layerid: {
  189. type: String,
  190. default: "",
  191. },
  192. lydata: {
  193. type: Object,
  194. default: () => {
  195. return {};
  196. },
  197. },
  198. lyoption: {
  199. type: Object,
  200. default: () => {
  201. return {};
  202. },
  203. },
  204. },
  205. computed: {},
  206. mounted() {
  207. this.init();
  208. },
  209. methods: {
  210. handleChange() {
  211. if (this.isNightscaoe) {
  212. this.startNight(true);
  213. } else {
  214. this.startNight(false);
  215. }
  216. },
  217. openDgyAddVisibility() {
  218. this.resetForm();
  219. },
  220. init() {
  221. this.hyp = new Cesium.HypsometricSetting();
  222. this.startNight(false);
  223. },
  224. //夜景开关
  225. startNight(isNight) {
  226. if (isNight) {
  227. Nightscape.openNightSwitch();
  228. this.gyTableData.forEach((element) => {
  229. this.addLightSource(element);
  230. });
  231. } else {
  232. Nightscape.closNightSwitch();
  233. }
  234. },
  235. onSubmit() {
  236. //更新
  237. if (this.dgyform.id) {
  238. let gydata = this.gyTableData.find((c) => c.id == this.dgyform.id);
  239. let data = JSON.parse(JSON.stringify(this.dgyform));
  240. gydata.gyName = data.gyName;
  241. gydata.gyColor = data.gyColor;
  242. gydata.gyDistance = data.gyDistance;
  243. gydata.gyDecay = data.gyDecay;
  244. gydata.gyIntensity = data.gyIntensity;
  245. gydata.cartesian = data.cartesian;
  246. gydata.LightSource = this.dgyform.LightSource;
  247. }
  248. //添加
  249. else {
  250. this.dgyform.id = uuidv4();
  251. let data = JSON.parse(JSON.stringify(this.dgyform));
  252. data.LightSource = this.dgyform.LightSource;
  253. this.gyTableData.push(this.dgyform);
  254. }
  255. this.clearLightSource(false);
  256. },
  257. //清空from
  258. resetForm() {
  259. this.dgyform = {
  260. id: "",
  261. gyName: "",
  262. gyType: "点光源",
  263. gyColor: "#409EFF",
  264. gyDistance: 300,
  265. gyDecay: 5,
  266. gyIntensity: 5,
  267. cartesian: {},
  268. LightSource: null,
  269. };
  270. },
  271. //删除添加的光源
  272. dgyremove() {
  273. let that = this;
  274. this.gyTableData = this.gyTableData.filter(function (item) {
  275. if (that.currentRow == item) {
  276. if (item.LightSource) scene.removeLightSource(item.LightSource);
  277. return false;
  278. } else {
  279. return true;
  280. }
  281. });
  282. },
  283. //点光源表选中
  284. handleCurrentChange(row) {
  285. this.currentRow = row;
  286. this.clearLightSource();
  287. let data = JSON.parse(JSON.stringify(row));
  288. this.dgyform = data;
  289. this.dgyform.LightSource = row.LightSource;
  290. },
  291. addPoint() {
  292. switch (this.dgyform.gyType) {
  293. case "点光源":
  294. if (pointLightSourceDrawHandler) {
  295. pointLightSourceDrawHandler.clear();
  296. pointLightSourceDrawHandler = null;
  297. }
  298. this.initPointLightSourceDrawHandler();
  299. pointLightSourceDrawHandler.activate();
  300. break;
  301. case "聚光灯":
  302. case "直射光":
  303. if (spotOrDirectionalLightSourceDrawHandler) {
  304. spotOrDirectionalLightSourceDrawHandler.clear();
  305. spotOrDirectionalLightSourceDrawHandler = null;
  306. spotOrDirectionalLightPositions = [];
  307. spotOrDirectionalLightSourceDrawHandler.deactivate();
  308. }
  309. if (spotOrDirectionalLightSourceCountHandler) {
  310. spotOrDirectionalLightSourceCountHandler.destroy();
  311. spotOrDirectionalLightSourceCountHandler = undefined;
  312. }
  313. this.initSpotOrDirectionalLightSourceDrawHandler();
  314. spotOrDirectionalLightSourceAdding = true;
  315. spotOrDirectionalLightSourceDrawHandler.activate();
  316. break;
  317. default:
  318. break;
  319. }
  320. },
  321. initPointLightSourceDrawHandler() {
  322. let that = this;
  323. this.clearLightSource();
  324. pointLightSourceDrawHandler = new Cesium.DrawHandler(
  325. viewer,
  326. Cesium.DrawMode.Point
  327. );
  328. pointLightSourceDrawHandler.activeEvt.addEventListener(function (
  329. isActive
  330. ) {
  331. if (isActive == true) {
  332. viewer.enableCursorStyle = false;
  333. viewer._element.style.cursor = "";
  334. document.body.classList.add("drawCur");
  335. } else {
  336. viewer.enableCursorStyle = true;
  337. document.body.classList.remove("drawCur");
  338. }
  339. });
  340. pointLightSourceDrawHandler.movingEvt.addEventListener(
  341. (windowPosition) => {
  342. that.tooltip.showAt(
  343. windowPosition,
  344. `<p>${Resource.clickToConfirmThePositionOfTheLightSource}</p><p>${Resource.clickLightChangeAttributes}</p>`
  345. );
  346. }
  347. );
  348. pointLightSourceDrawHandler.drawEvt.addEventListener((result) => {
  349. let xyz = result.object.position;
  350. let cartesian = this.cartesianToWgs84(xyz.x, xyz.y, xyz.z);
  351. this.dgyform.cartesian = cartesian;
  352. let option = {
  353. color: Cesium.Color.fromCssColorString(this.dgyform.gyColor),
  354. cutoffDistance: Number(this.dgyform.gyDistance),
  355. decay: Number(this.dgyform.gyDecay),
  356. intensity: Number(this.dgyform.gyIntensity),
  357. };
  358. let pointLight = new Cesium.PointLight(
  359. new Cesium.Cartesian3.fromDegrees(
  360. cartesian.x,
  361. cartesian.y,
  362. cartesian.z
  363. ),
  364. option
  365. );
  366. scene.addLightSource(pointLight);
  367. if (this.dgyform.LightSource) {
  368. scene.removeLightSource(this.dgyform.LightSource);
  369. }
  370. this.dgyform.LightSource = pointLight;
  371. let entityAsKey = viewer.entities.add({
  372. id: "point-light-" + new Date().getTime(),
  373. position: cartesian,
  374. billboard: {
  375. image: "@/../static/images/lightSource/pointLight.png",
  376. scaleByDistance: new Cesium.NearFarScalar(10, 1.0, 1000, 0.1),
  377. disableDepthTestDistance: Number.POSITIVE_INFINITY, // 关闭深度检测,使billboard不至于被裁剪
  378. },
  379. });
  380. console.log(entityPointLightPairs);
  381. entityPointLightPairs.set(entityAsKey, pointLight);
  382. pointLightSourceDrawHandler.clear();
  383. pointLightSourceDrawHandler = null;
  384. this.tooltip.setVisible(false);
  385. });
  386. },
  387. initSpotOrDirectionalLightSourceDrawHandler() {
  388. let that = this;
  389. that.clearLightSource();
  390. spotOrDirectionalLightSourceDrawHandler = new Cesium.DrawHandler(
  391. viewer,
  392. Cesium.DrawMode.Line
  393. );
  394. spotOrDirectionalLightSourceCountHandler =
  395. new Cesium.ScreenSpaceEventHandler(scene.canvas);
  396. spotOrDirectionalLightSourceDrawHandler.activeEvt.addEventListener(
  397. function (isActive) {
  398. if (isActive == true) {
  399. viewer.enableCursorStyle = false;
  400. viewer._element.style.cursor = "";
  401. document.body.classList.add("drawCur");
  402. } else {
  403. viewer.enableCursorStyle = true;
  404. document.body.classList.remove("drawCur");
  405. }
  406. }
  407. );
  408. spotOrDirectionalLightSourceDrawHandler.movingEvt.addEventListener(
  409. (windowPosition) => {
  410. this.tooltip.showAt(
  411. windowPosition,
  412. `<p>${Resource.ClickLineDirectionLightSource}</p><p>${Resource.clickLightChangeAttributes}</p>`
  413. );
  414. }
  415. );
  416. spotOrDirectionalLightSourceDrawHandler.drawEvt.addEventListener(
  417. (result) => {
  418. let positions = (result.object && result.object.positions) || result;
  419. if (positions.length !== 2) {
  420. return;
  421. }
  422. this.dgyform.cartesian = positions;
  423. if (that.dgyform.gyType === "聚光灯") {
  424. let spotLightOptions = {
  425. color: Cesium.Color.fromCssColorString(this.dgyform.gyColor),
  426. distance: Number(this.dgyform.gyDistance),
  427. decay: Number(this.dgyform.gyDecay),
  428. intensity: Number(this.dgyform.gyIntensity),
  429. angle: Cesium.Math.toRadians(Number(30)),
  430. };
  431. let spotLight = new Cesium.SpotLight(
  432. positions[0],
  433. positions[1],
  434. spotLightOptions
  435. );
  436. scene.addLightSource(spotLight);
  437. if (this.dgyform.LightSource) {
  438. scene.removeLightSource(this.dgyform.LightSource);
  439. }
  440. this.dgyform.LightSource = spotLight;
  441. let entityAsKey = viewer.entities.add({
  442. id: "spot-light-" + new Date().getTime(),
  443. position: positions[0],
  444. billboard: {
  445. image: "@/../static/images/lightSource/spotLight.png",
  446. scaleByDistance: new Cesium.NearFarScalar(10, 1.0, 1000, 0.1), // 按照距离调整图片的大小
  447. disableDepthTestDistance: Number.POSITIVE_INFINITY, // 关闭深度检测,使billboard不至于被裁剪
  448. },
  449. });
  450. entitySpotLightPairs.set(entityAsKey, spotLight);
  451. } else if (that.dgyform.gyType === "直射光") {
  452. let directionalLightOptions = {
  453. targetPosition: positions[1],
  454. color: Cesium.Color.fromCssColorString(this.dgyform.gyColor),
  455. intensity: Number(this.dgyform.gyIntensity),
  456. };
  457. let directionalLight = new Cesium.DirectionalLight(
  458. positions[0],
  459. directionalLightOptions
  460. );
  461. scene.addLightSource(directionalLight);
  462. if (this.dgyform.LightSource) {
  463. scene.removeLightSource(this.dgyform.LightSource);
  464. }
  465. this.dgyform.LightSource = directionalLight;
  466. let entityAsKey = viewer.entities.add({
  467. id: "directional-light-" + new Date().getTime(),
  468. position: positions[0],
  469. billboard: {
  470. image: "@/../static/images/lightSource/directionalLight.png",
  471. scaleByDistance: new Cesium.NearFarScalar(10, 1.0, 1000, 0.1),
  472. disableDepthTestDistance: Number.POSITIVE_INFINITY, // 关闭深度检测,使billboard不至于被裁剪
  473. },
  474. });
  475. entityDirectionalLightPairs.set(entityAsKey, directionalLight);
  476. }
  477. spotOrDirectionalLightPositions = [];
  478. spotOrDirectionalLightSourceDrawHandler.clear();
  479. spotOrDirectionalLightSourceDrawHandler = null;
  480. this.tooltip.setVisible(false);
  481. }
  482. );
  483. spotOrDirectionalLightSourceCountHandler.setInputAction(function (e) {
  484. if (spotOrDirectionalLightSourceAdding) {
  485. spotOrDirectionalLightPositions.push(scene.pickPosition(e.position));
  486. if (spotOrDirectionalLightPositions.length === 2) {
  487. if (spotOrDirectionalLightSourceCountHandler) {
  488. spotOrDirectionalLightSourceCountHandler.destroy();
  489. spotOrDirectionalLightSourceCountHandler = undefined;
  490. }
  491. spotOrDirectionalLightSourceDrawHandler.deactivate();
  492. spotOrDirectionalLightSourceAdding = false;
  493. spotOrDirectionalLightSourceDrawHandler.drawEvt.raiseEvent(
  494. spotOrDirectionalLightPositions
  495. );
  496. }
  497. }
  498. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  499. },
  500. addLightSource(gyData) {
  501. switch (gyData.gyType) {
  502. case "点光源":
  503. let option = {
  504. color: Cesium.Color.fromCssColorString(gyData.gyColor),
  505. cutoffDistance: Number(gyData.gyDistance),
  506. decay: Number(gyData.gyDecay),
  507. intensity: Number(gyData.gyIntensity),
  508. };
  509. let pointLight = new Cesium.PointLight(
  510. new Cesium.Cartesian3.fromDegrees(
  511. gyData.cartesian.x,
  512. gyData.cartesian.y,
  513. gyData.cartesian.z
  514. ),
  515. option
  516. );
  517. scene.addLightSource(pointLight);
  518. gyData.LightSource = pointLight;
  519. break;
  520. case "聚光灯":
  521. let spotLightOptions = {
  522. color: Cesium.Color.fromCssColorString(gyData.gyColor),
  523. distance: Number(gyData.gyDistance),
  524. decay: Number(gyData.gyDecay),
  525. intensity: Number(gyData.gyIntensity),
  526. angle: Cesium.Math.toRadians(Number(30)),
  527. };
  528. let spotLight = new Cesium.SpotLight(
  529. new Cesium.Cartesian3.fromDegrees(
  530. gyData.cartesian[0].x,
  531. gyData.cartesian[0].y,
  532. gyData.cartesian[0].z
  533. ),
  534. new Cesium.Cartesian3.fromDegrees(
  535. gyData.cartesian[1].x,
  536. gyData.cartesian[1].y,
  537. gyData.cartesian[1].z
  538. ),
  539. spotLightOptions
  540. );
  541. scene.addLightSource(spotLight);
  542. gyData.LightSource = spotLight;
  543. break;
  544. case "直射光":
  545. let directionalLightOptions = {
  546. targetPosition: new Cesium.Cartesian3.fromDegrees(
  547. gyData.cartesian[1].x,
  548. gyData.cartesian[1].y,
  549. gyData.cartesian[1].z
  550. ),
  551. color: Cesium.Color.fromCssColorString(gyData.gyColor),
  552. intensity: Number(gyData.gyIntensity),
  553. };
  554. let directionalLight = new Cesium.DirectionalLight(
  555. new Cesium.Cartesian3.fromDegrees(
  556. gyData.cartesian[0].x,
  557. gyData.cartesian[0].y,
  558. gyData.cartesian[0].z
  559. ),
  560. directionalLightOptions
  561. );
  562. scene.addLightSource(directionalLight);
  563. gyData.LightSource = directionalLight;
  564. break;
  565. default:
  566. break;
  567. }
  568. },
  569. /**
  570. * 删除灯光
  571. * @param isRemoveLightSource 是否删除临时灯光
  572. */
  573. clearLightSource(isRemoveLightSource = true) {
  574. for (let key of entityPointLightPairs.keys()) {
  575. viewer.entities.remove(key);
  576. if (isRemoveLightSource)
  577. scene.removeLightSource(entityPointLightPairs.get(key));
  578. }
  579. entityPointLightPairs.clear();
  580. for (let key of entitySpotLightPairs.keys()) {
  581. viewer.entities.remove(key);
  582. if (isRemoveLightSource)
  583. scene.removeLightSource(entitySpotLightPairs.get(key));
  584. }
  585. entitySpotLightPairs.clear();
  586. for (let key of entityDirectionalLightPairs.keys()) {
  587. viewer.entities.remove(key);
  588. if (isRemoveLightSource)
  589. scene.removeLightSource(entityDirectionalLightPairs.get(key));
  590. }
  591. entityDirectionalLightPairs.clear();
  592. },
  593. cartesianToWgs84(x, y, z) {
  594. var scene = viewer.scene;
  595. var positionCartesian = new Cesium.Cartesian3(x, y, z);
  596. var positionWGS84 =
  597. scene.globe.ellipsoid.cartesianToCartographic(positionCartesian);
  598. var longitude = Cesium.Math.toDegrees(positionWGS84.longitude);
  599. var latitude = Cesium.Math.toDegrees(positionWGS84.latitude);
  600. var height = positionWGS84.height;
  601. console.log(longitude + "," + latitude + "," + height);
  602. debugger;
  603. return { x: longitude, y: latitude, z: height };
  604. },
  605. },
  606. watch: {
  607. "dgyform.gyColor": function (val, oldVal) {
  608. if (this.dgyform.LightSource) {
  609. let color = Cesium.Color.fromCssColorString(val);
  610. this.dgyform.LightSource.color = color;
  611. }
  612. },
  613. "dgyform.gyDistance": function (val, oldVal) {
  614. if (this.dgyform.LightSource) {
  615. this.dgyform.LightSource.cutoffDistance = Number(val);
  616. }
  617. },
  618. "dgyform.gyDecay": function (val, oldVal) {
  619. if (this.dgyform.LightSource) {
  620. this.dgyform.LightSource.decay = Number(val);
  621. }
  622. },
  623. "dgyform.gyIntensity": function (val, oldVal) {
  624. if (this.dgyform.LightSource) {
  625. this.dgyform.LightSource.intensity = Number(val);
  626. }
  627. },
  628. },
  629. beforeDestroy() {
  630. this.clearLightSource(false);
  631. this.startNight(false);
  632. },
  633. };
  634. </script>
  635. <style lang="scss">
  636. @import "@/../../zt.scss";
  637. </style>
  638. <style lang="scss" scoped>
  639. .el-card {
  640. border: 0px solid #02a7f0;
  641. }
  642. .el-form-item {
  643. margin-bottom: 0;
  644. }
  645. </style>