提交 d928407d 作者: 翁进城

build: rollup打包配置整合与相应代码优化

上级 9e254f63
流水线 #9330 已失败 于阶段
{
"presets": ["@babel/preset-env"]
}
\ No newline at end of file
...@@ -10,6 +10,7 @@ import MMCUavList from "./src/components/MMCUavList"; ...@@ -10,6 +10,7 @@ import MMCUavList from "./src/components/MMCUavList";
import MMCMQTT from './src/plugins/MMCMQTT'; import MMCMQTT from './src/plugins/MMCMQTT';
import MMCGroundStation from "./src/plugins/MMCGroundStation"; import MMCGroundStation from "./src/plugins/MMCGroundStation";
import MMCFlightControlCenter from './src/components/MMCFlightControlCenter'; import MMCFlightControlCenter from './src/components/MMCFlightControlCenter';
// import MMCFlightControlCenter from './dist';
import SymbolIcon from './src/components/symbol-icon'; import SymbolIcon from './src/components/symbol-icon';
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"description": "科比特前端标准化组件", "description": "科比特前端标准化组件",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "build": "rm -rf dist & rollup -c"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
...@@ -15,10 +15,12 @@ ...@@ -15,10 +15,12 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.24.5", "@babel/core": "^7.24.5",
"@babel/preset-env": "^7.24.5", "@babel/preset-env": "^7.24.5",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-url": "^8.0.2", "@rollup/plugin-url": "^8.0.2",
"rollup": "^4.17.2", "rollup": "^4.17.2",
"rollup-plugin-scss": "^4.0.0",
"rollup-plugin-terser": "^7.0.2", "rollup-plugin-terser": "^7.0.2",
"rollup-plugin-vue": "^5.1.9", "rollup-plugin-vue": "^5.1.9",
"sass": "^1.62.1", "sass": "^1.62.1",
......
...@@ -3,9 +3,11 @@ const { terser } = require("rollup-plugin-terser"); ...@@ -3,9 +3,11 @@ const { terser } = require("rollup-plugin-terser");
const resolve = require("@rollup/plugin-node-resolve"); const resolve = require("@rollup/plugin-node-resolve");
const url = require("@rollup/plugin-url"); const url = require("@rollup/plugin-url");
const commonjs = require("@rollup/plugin-commonjs"); const commonjs = require("@rollup/plugin-commonjs");
const babel = require("@rollup/plugin-babel");
const scss = require("rollup-plugin-scss");
module.exports = { module.exports = {
input: "./src/components/MMCFlightControlCenter/index.vue", input: "./index.js",
output: { output: {
dir: "dist", dir: "dist",
format: "es", format: "es",
...@@ -28,6 +30,10 @@ module.exports = { ...@@ -28,6 +30,10 @@ module.exports = {
return true; return true;
}, // <---- this solves default issue }, // <---- this solves default issue
}), }),
babel({
exclude: "node_modules/**",
}),
scss(),
terser(), terser(),
], ],
external: (...args) => { external: (...args) => {
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
<script> <script>
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import { User } from "../../api";
import _3dList from "./lib/3d"; import _3dList from "./lib/3d";
import _2dList from './lib/2d'; import _2dList from './lib/2d';
......
...@@ -73,10 +73,11 @@ ...@@ -73,10 +73,11 @@
</template> </template>
<script> <script>
import jiantouIMG from './assets/images/jiantou.png';
export default { export default {
data() { data() {
return { return {
jian: require("./assets/images/jiantou.png"), jian: jiantouIMG,
dakai: false, //变长变短 dakai: false, //变长变短
productType: false, // 产品类型 productType: false, // 产品类型
}; };
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</template> </template>
<script> <script>
const echarts = require("echarts"); import echarts from 'echarts';
export default { export default {
name: "C0Chart", name: "C0Chart",
data() { data() {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</template> </template>
<script> <script>
const echarts = require("echarts"); import echarts from 'echarts';
export default { export default {
name: "NO2", name: "NO2",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</template> </template>
<script> <script>
const echarts = require("echarts"); import echarts from 'echarts';
export default { export default {
name: "Ox", name: "Ox",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</template> </template>
<script> <script>
const echarts = require("echarts"); import echarts from 'echarts';
export default { export default {
name: "PM", name: "PM",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</template> </template>
<script> <script>
const echarts = require("echarts"); import echarts from 'echarts';
export default { export default {
name: "PM10", name: "PM10",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</template> </template>
<script> <script>
const echarts = require("echarts"); import echarts from 'echarts';
export default { export default {
name: "PM2", name: "PM2",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</template> </template>
<script> <script>
const echarts = require("echarts"); import echarts from 'echarts';
export default { export default {
name: "SO2", name: "SO2",
......
...@@ -533,6 +533,7 @@ ...@@ -533,6 +533,7 @@
<script> <script>
import { MMC_Gimbal_Z60S } from "./js/index_1.js"; import { MMC_Gimbal_Z60S } from "./js/index_1.js";
import { MMC_Gimbal_Z60R } from "./js/index.js"; import { MMC_Gimbal_Z60R } from "./js/index.js";
import svgMB from "./mb.svg";
let targetPoint = null; let targetPoint = null;
export default { export default {
props: { props: {
...@@ -683,7 +684,7 @@ export default { ...@@ -683,7 +684,7 @@ export default {
targetPoint = window.viewer.entities.add({ targetPoint = window.viewer.entities.add({
position: new Cesium.CallbackProperty(() => this.position, false), position: new Cesium.CallbackProperty(() => this.position, false),
billboard: { billboard: {
image: require("./mb.svg"), image: svgMB,
width: 32, width: 32,
height: 32, height: 32,
}, },
......
...@@ -497,6 +497,7 @@ ...@@ -497,6 +497,7 @@
<script> <script>
import { MMC_Gimbal_Z60S } from './js/index_1.js'; import { MMC_Gimbal_Z60S } from './js/index_1.js';
import { MMC_Gimbal_ZT60R } from './js/index.js'; import { MMC_Gimbal_ZT60R } from './js/index.js';
import svgMB from "./mb.svg";
let targetPoint = null; let targetPoint = null;
export default { export default {
props: { props: {
...@@ -647,7 +648,7 @@ export default { ...@@ -647,7 +648,7 @@ export default {
targetPoint = window.viewer.entities.add({ targetPoint = window.viewer.entities.add({
position: new Cesium.CallbackProperty(() => this.position, false), position: new Cesium.CallbackProperty(() => this.position, false),
billboard: { billboard: {
image: require('./mb.svg'), image: svgMB,
width: 32, width: 32,
height: 32 height: 32
} }
......
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdReadFileList extends Mavlink20 { class CmdReadFileList extends Mavlink20 {
...@@ -28,4 +28,4 @@ class CmdReadFileList extends Mavlink20 { ...@@ -28,4 +28,4 @@ class CmdReadFileList extends Mavlink20 {
} }
module.exports = CmdReadFileList export default CmdReadFileList
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdRecordName extends Mavlink20 { class CmdRecordName extends Mavlink20 {
...@@ -24,4 +24,4 @@ class CmdRecordName extends Mavlink20 { ...@@ -24,4 +24,4 @@ class CmdRecordName extends Mavlink20 {
} }
} }
module.exports = CmdRecordName export default CmdRecordName
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdRecordState extends Mavlink20 { class CmdRecordState extends Mavlink20 {
...@@ -20,4 +20,4 @@ class CmdRecordState extends Mavlink20 { ...@@ -20,4 +20,4 @@ class CmdRecordState extends Mavlink20 {
return super.pack(this, this.crc_extra, jspack.Pack(this.format, [this.state, this.result])) return super.pack(this, this.crc_extra, jspack.Pack(this.format, [this.state, this.result]))
} }
} }
module.exports = CmdRecordState export default CmdRecordState
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdSaveFile extends Mavlink20 { class CmdSaveFile extends Mavlink20 {
format = '<BB100A'; format = '<BB100A';
......
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdServoAngle extends Mavlink20 { class CmdServoAngle extends Mavlink20 {
...@@ -23,4 +23,4 @@ class CmdServoAngle extends Mavlink20 { ...@@ -23,4 +23,4 @@ class CmdServoAngle extends Mavlink20 {
} }
module.exports = CmdServoAngle export default CmdServoAngle
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdSetSystemVolume extends Mavlink20 { class CmdSetSystemVolume extends Mavlink20 {
...@@ -21,4 +21,4 @@ class CmdSetSystemVolume extends Mavlink20 { ...@@ -21,4 +21,4 @@ class CmdSetSystemVolume extends Mavlink20 {
} }
module.exports = CmdSetSystemVolume export default CmdSetSystemVolume
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
import Mavlink20 from "./mavlink20" import Mavlink20 from './mavlink20';
// mavlink20.GPI_MEDIA_STREAM_UPLOAD_START = 10 // 流上传开始 // mavlink20.GPI_MEDIA_STREAM_UPLOAD_START = 10 // 流上传开始
// mavlink20.GPI_MEDIA_STREAM_UPLOAD_STOP = 11 // 流上传停止 // mavlink20.GPI_MEDIA_STREAM_UPLOAD_STOP = 11 // 流上传停止
......
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdStreamUpData extends Mavlink20 { class CmdStreamUpData extends Mavlink20 {
...@@ -22,4 +22,4 @@ class CmdStreamUpData extends Mavlink20 { ...@@ -22,4 +22,4 @@ class CmdStreamUpData extends Mavlink20 {
} }
module.exports = CmdStreamUpData export default CmdStreamUpData
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20") import Mavlink20 from './mavlink20';
class CmdTts extends Mavlink20 { class CmdTts extends Mavlink20 {
...@@ -22,7 +22,7 @@ class CmdTts extends Mavlink20 { ...@@ -22,7 +22,7 @@ class CmdTts extends Mavlink20 {
} }
module.exports = CmdTts export default CmdTts
// let tts = new CmdTts("hello world") // let tts = new CmdTts("hello world")
......
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20Header = require("./mavlink20_header") import Mavlink20Header from './mavlink20_header';
class Mavlink20 { class Mavlink20 {
...@@ -45,4 +45,4 @@ class Mavlink20 { ...@@ -45,4 +45,4 @@ class Mavlink20 {
} }
module.exports = Mavlink20 export default Mavlink20
\ No newline at end of file \ No newline at end of file
...@@ -8,4 +8,4 @@ class Mavlink20BadData { ...@@ -8,4 +8,4 @@ class Mavlink20BadData {
} }
} }
module.exports = Mavlink20BadData export default Mavlink20BadData
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
class Mavlink20Header { class Mavlink20Header {
msgId; msgId;
...@@ -22,4 +22,4 @@ class Mavlink20Header { ...@@ -22,4 +22,4 @@ class Mavlink20Header {
} }
} }
module.exports = Mavlink20Header export default Mavlink20Header
\ No newline at end of file \ No newline at end of file
const CmdReadFileList = require("./cmd_read_file_list") import CmdReadFileList from './cmd_read_file_list';
module.exports = { export default {
100100: { format: '<BBB100A', type: CmdReadFileList, order_map: [0, 1, 2, 3], crc_extra: 250 }, 100100: { format: '<BBB100A', type: CmdReadFileList, order_map: [0, 1, 2, 3], crc_extra: 250 },
} }
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20") import Mavlink20 from './mavlink20';
const Mavlink20Header = require("./mavlink20_header") import Mavlink20Header from './mavlink20_header';
const Mavlink20BadData = require("./mavlink20_bad_data") import Mavlink20BadData from './mavlink20_bad_data';
const Mavlink20Map = require("./mavlink20_map") import Mavlink20Map from './mavlink20_map';
// Buffer web polyfill // Buffer web polyfill
class Buffer { class Buffer {
...@@ -326,4 +326,4 @@ class MAVLink20Processor extends Mavlink20 { ...@@ -326,4 +326,4 @@ class MAVLink20Processor extends Mavlink20 {
} }
module.exports = MAVLink20Processor export default MAVLink20Processor
\ No newline at end of file \ No newline at end of file
...@@ -80,4 +80,4 @@ PcmRecorder.prototype.onaudioprocess = function (e) { ...@@ -80,4 +80,4 @@ PcmRecorder.prototype.onaudioprocess = function (e) {
this.cb && this.cb(data) this.cb && this.cb(data)
} }
} }
module.exports = PcmRecorder export default PcmRecorder
\ No newline at end of file \ No newline at end of file
import svg001 from './assets/images/observe/001.svg';
import svg002 from './assets/images/observe/002.svg';
import svg004 from './assets/images/observe/004.svg';
import svg005 from './assets/images/observe/005.svg';
import svg006 from './assets/images/observe/006.svg';
import svg007 from './assets/images/observe/007.svg';
import svg009 from './assets/images/observe/009.svg';
import svg010 from './assets/images/observe/010.svg';
import svg011 from './assets/images/observe/011.svg';
import svg019 from './assets/images/observe/019.svg';
import png008 from './assets/images/observe/008.png';
import png014 from './assets/images/observe/014.png';
import png015 from './assets/images/observe/015.png';
import png016 from './assets/images/observe/016.png';
import png017 from './assets/images/observe/017.png';
import png018 from './assets/images/observe/018.png';
import pngZ40S from './assets/images/observe/MMC_Gimbal_Z40S.png';
import pngZT60R from './assets/images/observe/MMC_Gimbal_ZT60R.png'
import svgGAS from './assets/images/observe/MMC_Gimbal_GAS.svg'
export default { export default {
type_list: [ type_list: [
{ {
...@@ -36,28 +58,28 @@ export default { ...@@ -36,28 +58,28 @@ export default {
list: [ list: [
{ {
title: '高清变焦相机', title: '高清变焦相机',
icon: require('./assets/images/observe/001.svg'), icon: svg001,
name: 'DJI_H20T', name: 'DJI_H20T',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./DJI_H20T') component: () => import('./DJI_H20T')
}, },
{ {
title: '高清变焦相机', title: '高清变焦相机',
icon: require('./assets/images/observe/001.svg'), icon: svg001,
name: 'MMC_Gimbal_Z40', name: 'MMC_Gimbal_Z40',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./MMC_Gimbal_Z40') component: () => import('./MMC_Gimbal_Z40')
}, },
{ {
title: '高清变焦相机', title: '高清变焦相机',
icon: require('./assets/images/observe/001.svg'), icon: svg001,
name: 'MMC_Gimbal_Z40N', name: 'MMC_Gimbal_Z40N',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./MMC_Gimbal_Z40N') component: () => import('./MMC_Gimbal_Z40N')
}, },
{ {
title: '高清变焦相机Z33N', title: '高清变焦相机Z33N',
icon: require('./assets/images/observe/001.svg'), icon: svg001,
name: 'MMC_Gimbal_Z33N', name: 'MMC_Gimbal_Z33N',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./MMC_Gimbal_Z33N') component: () => import('./MMC_Gimbal_Z33N')
...@@ -65,7 +87,7 @@ export default { ...@@ -65,7 +87,7 @@ export default {
// Z40高清相机 // Z40高清相机
{ {
title: '高清变焦相机Z20', title: '高清变焦相机Z20',
icon: require('./assets/images/observe/014.png'), icon: png014,
name: 'MMC_Gimbal_Z20', name: 'MMC_Gimbal_Z20',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./MMC_Gimbal_Z20') component: () => import('./MMC_Gimbal_Z20')
...@@ -73,7 +95,7 @@ export default { ...@@ -73,7 +95,7 @@ export default {
// Z40S高清相机 // Z40S高清相机
{ {
title: '高清变焦相机Z40S', title: '高清变焦相机Z40S',
icon: require('./assets/images/observe/MMC_Gimbal_Z40S.png'), icon: pngZ40S,
name: 'MMC_Gimbal_Z40S', name: 'MMC_Gimbal_Z40S',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./MMC_Gimbal_Z40S') component: () => import('./MMC_Gimbal_Z40S')
...@@ -81,7 +103,7 @@ export default { ...@@ -81,7 +103,7 @@ export default {
// ZT60R高清相机 // ZT60R高清相机
{ {
title: '高清变焦相机ZT60R', title: '高清变焦相机ZT60R',
icon: require('./assets/images/observe/MMC_Gimbal_ZT60R.png'), icon: pngZT60R,
name: 'MMC_Gimbal_ZT60R', name: 'MMC_Gimbal_ZT60R',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./MMC_Gimbal_ZT60R/index.vue') component: () => import('./MMC_Gimbal_ZT60R/index.vue')
...@@ -89,7 +111,7 @@ export default { ...@@ -89,7 +111,7 @@ export default {
// ZT60R高清相机 // ZT60R高清相机
{ {
title: '高清变焦相机ZT60R', title: '高清变焦相机ZT60R',
icon: require('./assets/images/observe/MMC_Gimbal_ZT60R.png'), icon: pngZT60R,
name: 'MMC_Gimbal_Z60R', name: 'MMC_Gimbal_Z60R',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./MMC_Gimbal_Z60R/index.vue') component: () => import('./MMC_Gimbal_Z60R/index.vue')
...@@ -97,28 +119,28 @@ export default { ...@@ -97,28 +119,28 @@ export default {
// Z30Pro高清相机 // Z30Pro高清相机
{ {
title: '高清变焦相机Z30Pro', title: '高清变焦相机Z30Pro',
icon: require('./assets/images/observe/015.png'), icon: png015,
name: 'MMC_Gimbal_Z30Pro', name: 'MMC_Gimbal_Z30Pro',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./MMC_Gimbal_Z30Pro/index.vue') component: () => import('./MMC_Gimbal_Z30Pro/index.vue')
}, },
{ {
title: '喊话器', title: '喊话器',
icon: require('./assets/images/observe/002.svg'), icon: svg002,
name: 'MMC_Gimbal_P0_Pro', name: 'MMC_Gimbal_P0_Pro',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./MMC_Gimbal_P0_Pro') component: () => import('./MMC_Gimbal_P0_Pro')
}, },
{ {
title: '喊话器', title: '喊话器',
icon: require('./assets/images/observe/002.svg'), icon: svg002,
name: 'MMC_Gimbal_P1_4G', name: 'MMC_Gimbal_P1_4G',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./PagerP1_New') component: () => import('./PagerP1_New')
}, },
{ {
title: '探照灯', title: '探照灯',
icon: require('./assets/images/observe/004.svg'), icon: svg004,
name: 'MMC_Gimbal_L60', name: 'MMC_Gimbal_L60',
type: [3, 4], type: [3, 4],
component: () => import('./MMC_Gimbal_L60') component: () => import('./MMC_Gimbal_L60')
...@@ -126,97 +148,97 @@ export default { ...@@ -126,97 +148,97 @@ export default {
// 探照灯L50 // 探照灯L50
{ {
title: '探照灯', title: '探照灯',
icon: require('./assets/images/observe/016.png'), icon: png016,
name: 'MMC_Gimbal_L50', name: 'MMC_Gimbal_L50',
type: [3, 4], type: [3, 4],
component: () => import('./MMC_Gimbal_L50') component: () => import('./MMC_Gimbal_L50')
}, },
{ {
title: '红外热成像', title: '红外热成像',
icon: require('./assets/images/observe/003.svg'), icon: png016,
name: 'MMC_Gimbal_ZT1', name: 'MMC_Gimbal_ZT1',
type: [3, 4, 5, 6], type: [3, 4, 5, 6],
component: () => import('./MMC_Gimbal_ZT1') component: () => import('./MMC_Gimbal_ZT1')
}, },
{ {
title: '抛投', title: '抛投',
icon: require('./assets/images/observe/006.svg'), icon: svg006,
name: 'MMC_Gimbal_S1', name: 'MMC_Gimbal_S1',
type: [5, 6], type: [5, 6],
component: () => import('./MMC_Gimbal_S1') component: () => import('./MMC_Gimbal_S1')
}, },
{ {
title: '喷火器', title: '喷火器',
icon: require('./assets/images/observe/008.png'), icon: png008,
name: 'MMC_Gimbal_FF6', name: 'MMC_Gimbal_FF6',
type: [5], type: [5],
component: () => import('./MMC_Gimbal_FF6') component: () => import('./MMC_Gimbal_FF6')
}, },
{ {
title: '水体采样器', title: '水体采样器',
icon: require('./assets/images/observe/017.png'), icon: png017,
name: 'MMC_Gimbal_QS', name: 'MMC_Gimbal_QS',
type: [5], type: [5],
component: () => import('./MMC_Gimbal_QS') component: () => import('./MMC_Gimbal_QS')
}, },
{ {
title: '双光', title: '双光',
icon: require('./assets/images/observe/007.svg'), icon: svg007,
name: 'MMC_Gimbal_ZT30N', name: 'MMC_Gimbal_ZT30N',
type: [6], type: [6],
component: () => import('./MMC_Gimbal_ZT30N') component: () => import('./MMC_Gimbal_ZT30N')
}, },
{ {
title: '霹雳火', title: '霹雳火',
icon: require('./assets/images/observe/005.svg'), icon: svg005,
name: 'MMC_Gimbal_S79', name: 'MMC_Gimbal_S79',
type: [7], type: [7],
component: () => import('./MMC_Gimbal_S79') component: () => import('./MMC_Gimbal_S79')
}, },
{ {
title: '催泪弹', title: '催泪弹',
icon: require('./assets/images/observe/009.svg'), icon: svg009,
name: 'MMC_Gimbal_FE8', name: 'MMC_Gimbal_FE8',
type: [7, 8], type: [7, 8],
component: () => import('./MMC_Gimbal_FE8') component: () => import('./MMC_Gimbal_FE8')
}, },
{ {
title: '破窗灭火器', title: '破窗灭火器',
icon: require('./assets/images/observe/010.svg'), icon: svg010,
name: 'MMC_Gimbal_FB1', name: 'MMC_Gimbal_FB1',
type: [7], type: [7],
component: () => import('./MMCGimbalFB1') component: () => import('./MMCGimbalFB1')
}, },
{ {
title: '网枪', title: '网枪',
icon: require('./assets/images/observe/011.svg'), icon: svg011,
name: 'MMC_Gimbal_FN3', name: 'MMC_Gimbal_FN3',
type: [7, 8], type: [7, 8],
component: () => import('./MMCGimbalFN3') component: () => import('./MMCGimbalFN3')
}, },
{ {
title: '喊话器P3', title: '喊话器P3',
icon: require('./assets/images/observe/002.svg'), icon: svg002,
name: 'MMC_Gimbal_P3', name: 'MMC_Gimbal_P3',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./PagerP1_New') component: () => import('./PagerP1_New')
}, },
{ {
title: '驱散器', title: '驱散器',
icon: require('./assets/images/observe/018.png'), icon: png018,
name: 'MMC_Gimbal_P4', name: 'MMC_Gimbal_P4',
type: [1, 2, 3, 4, 5, 6, 8], type: [1, 2, 3, 4, 5, 6, 8],
component: () => import('./PagerP1_New') component: () => import('./PagerP1_New')
}, },
{ {
title: '干粉灭火器', title: '干粉灭火器',
icon: require('./assets/images/observe/019.svg'), icon: svg019,
name: 'MMC_Gimbal_FE3', name: 'MMC_Gimbal_FE3',
component: () => import('./MMC_Gimbal_FE3') component: () => import('./MMC_Gimbal_FE3')
}, },
{ {
title: '多气体检测', title: '多气体检测',
icon: require('./assets/images/observe/MMC_Gimbal_GAS.svg'), icon: svgGAS,
name: 'MMC_Gimbal_G6', name: 'MMC_Gimbal_G6',
component: () => import('./MMC_Gimbal_GAS/index.vue') component: () => import('./MMC_Gimbal_GAS/index.vue')
} }
......
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdReadFileList extends Mavlink20 { class CmdReadFileList extends Mavlink20 {
...@@ -28,4 +28,4 @@ class CmdReadFileList extends Mavlink20 { ...@@ -28,4 +28,4 @@ class CmdReadFileList extends Mavlink20 {
} }
module.exports = CmdReadFileList export default CmdReadFileList
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdRecordName extends Mavlink20 { class CmdRecordName extends Mavlink20 {
...@@ -24,4 +24,4 @@ class CmdRecordName extends Mavlink20 { ...@@ -24,4 +24,4 @@ class CmdRecordName extends Mavlink20 {
} }
} }
module.exports = CmdRecordName export default CmdRecordName
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdRecordState extends Mavlink20 { class CmdRecordState extends Mavlink20 {
...@@ -20,4 +20,4 @@ class CmdRecordState extends Mavlink20 { ...@@ -20,4 +20,4 @@ class CmdRecordState extends Mavlink20 {
return super.pack(this, this.crc_extra, jspack.Pack(this.format, [this.state, this.result])) return super.pack(this, this.crc_extra, jspack.Pack(this.format, [this.state, this.result]))
} }
} }
module.exports = CmdRecordState export default CmdRecordState
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdSaveFile extends Mavlink20 { class CmdSaveFile extends Mavlink20 {
format = '<BB100A'; format = '<BB100A';
......
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdServoAngle extends Mavlink20 { class CmdServoAngle extends Mavlink20 {
...@@ -23,4 +23,4 @@ class CmdServoAngle extends Mavlink20 { ...@@ -23,4 +23,4 @@ class CmdServoAngle extends Mavlink20 {
} }
module.exports = CmdServoAngle export default CmdServoAngle
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdSetSystemVolume extends Mavlink20 { class CmdSetSystemVolume extends Mavlink20 {
...@@ -21,4 +21,4 @@ class CmdSetSystemVolume extends Mavlink20 { ...@@ -21,4 +21,4 @@ class CmdSetSystemVolume extends Mavlink20 {
} }
module.exports = CmdSetSystemVolume export default CmdSetSystemVolume
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
import Mavlink20 from "./mavlink20" import Mavlink20 from './mavlink20';
// mavlink20.GPI_MEDIA_STREAM_UPLOAD_START = 10 // 流上传开始 // mavlink20.GPI_MEDIA_STREAM_UPLOAD_START = 10 // 流上传开始
// mavlink20.GPI_MEDIA_STREAM_UPLOAD_STOP = 11 // 流上传停止 // mavlink20.GPI_MEDIA_STREAM_UPLOAD_STOP = 11 // 流上传停止
......
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20"); import Mavlink20 from './mavlink20';
class CmdStreamUpData extends Mavlink20 { class CmdStreamUpData extends Mavlink20 {
...@@ -22,4 +22,4 @@ class CmdStreamUpData extends Mavlink20 { ...@@ -22,4 +22,4 @@ class CmdStreamUpData extends Mavlink20 {
} }
module.exports = CmdStreamUpData export default CmdStreamUpData
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20") import Mavlink20 from './mavlink20';
class CmdTts extends Mavlink20 { class CmdTts extends Mavlink20 {
...@@ -22,7 +22,7 @@ class CmdTts extends Mavlink20 { ...@@ -22,7 +22,7 @@ class CmdTts extends Mavlink20 {
} }
module.exports = CmdTts export default CmdTts
// let tts = new CmdTts("hello world") // let tts = new CmdTts("hello world")
......
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20Header = require("./mavlink20_header") import Mavlink20Header from './mavlink20_header';
class Mavlink20 { class Mavlink20 {
......
...@@ -8,4 +8,4 @@ class Mavlink20BadData { ...@@ -8,4 +8,4 @@ class Mavlink20BadData {
} }
} }
module.exports = Mavlink20BadData export default Mavlink20BadData
\ No newline at end of file \ No newline at end of file
const jspack = require("jspack").jspack import jspack from 'jspack';
class Mavlink20Header { class Mavlink20Header {
msgId; msgId;
...@@ -22,4 +22,4 @@ class Mavlink20Header { ...@@ -22,4 +22,4 @@ class Mavlink20Header {
} }
} }
module.exports = Mavlink20Header export default Mavlink20Header
\ No newline at end of file \ No newline at end of file
const CmdReadFileList = require("./cmd_read_file_list") import CmdReadFileList from './cmd_read_file_list';
module.exports = { export default {
100100: { format: '<BBB100A', type: CmdReadFileList, order_map: [0, 1, 2, 3], crc_extra: 250 }, 100100: { format: '<BBB100A', type: CmdReadFileList, order_map: [0, 1, 2, 3], crc_extra: 250 },
} }
const jspack = require("jspack").jspack import jspack from 'jspack';
const Mavlink20 = require("./mavlink20") import Mavlink20 from './mavlink20';
const Mavlink20Header = require("./mavlink20_header") import Mavlink20Header from './mavlink20_header';
const Mavlink20BadData = require("./mavlink20_bad_data") import Mavlink20BadData from './mavlink20_bad_data';
const Mavlink20Map = require("./mavlink20_map") import Mavlink20Map from './mavlink20_map';
// Buffer web polyfill // Buffer web polyfill
class Buffer { class Buffer {
...@@ -326,4 +326,4 @@ class MAVLink20Processor extends Mavlink20 { ...@@ -326,4 +326,4 @@ class MAVLink20Processor extends Mavlink20 {
} }
module.exports = MAVLink20Processor export default MAVLink20Processor
\ No newline at end of file \ No newline at end of file
...@@ -80,4 +80,4 @@ PcmRecorder.prototype.onaudioprocess = function (e) { ...@@ -80,4 +80,4 @@ PcmRecorder.prototype.onaudioprocess = function (e) {
this.cb && this.cb(data) this.cb && this.cb(data)
} }
} }
module.exports = PcmRecorder export default PcmRecorder
\ No newline at end of file \ No newline at end of file
...@@ -118,7 +118,9 @@ ...@@ -118,7 +118,9 @@
<script> <script>
import data from "./data"; import data from "./data";
import { Viewer, Utils } from "../../../../../../lib/cesium"; import { Utils } from "../../../../../../lib/cesium";
import pngGJ from '../../assets/images/gj.png';
export default { export default {
props: ["uavId","list"], props: ["uavId","list"],
inject: ["g_cesium_layer", "g_collection"], inject: ["g_cesium_layer", "g_collection"],
...@@ -230,7 +232,7 @@ export default { ...@@ -230,7 +232,7 @@ export default {
lat: item.latitude, lat: item.latitude,
alt: 0, alt: 0,
}), }),
image: require(`../../assets/images/gj.png`), image: pngGJ,
scale: 1, scale: 1,
width: 54, width: 54,
height: 89, height: 89,
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
:key="j" :key="j"
class="obstacle-bar__item" class="obstacle-bar__item"
:class="`bar${i}-${j}`" :class="`bar${i}-${j}`"
:src="require(`./assets/images/bar${i}-${j}.png`)" :src="pngList[`bar${i}-${j}`]"
/> />
</template> </template>
</div> </div>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
:key="j" :key="j"
class="obstacle-bar__item" class="obstacle-bar__item"
:class="`bar${i}-${j}`" :class="`bar${i}-${j}`"
:src="require(`./assets/images/bar${i}-${j}.png`)" :src="pngList[`bar${i}-${j}`]"
/> />
</template> </template>
</div> </div>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
:key="j" :key="j"
class="obstacle-bar__item" class="obstacle-bar__item"
:class="`bar${i}-${j}`" :class="`bar${i}-${j}`"
:src="require(`./assets/images/bar${i}-${j}.png`)" :src="pngList[`bar${i}-${j}`]"
/> />
</template> </template>
</div> </div>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
:key="j" :key="j"
class="obstacle-bar__item" class="obstacle-bar__item"
:class="`bar${i}-${j}`" :class="`bar${i}-${j}`"
:src="require(`./assets/images/bar${i}-${j}.png`)" :src="pngList[`bar${i}-${j}`]"
/> />
</template> </template>
</div> </div>
...@@ -68,6 +68,19 @@ ...@@ -68,6 +68,19 @@
</template> </template>
<script> <script>
import pngBar1_1 from './assets/images/bar1-1.png';
import pngBar1_2 from './assets/images/bar1-2.png';
import pngBar1_3 from './assets/images/bar1-3.png';
import pngBar2_1 from './assets/images/bar2-1.png';
import pngBar2_2 from './assets/images/bar2-2.png';
import pngBar2_3 from './assets/images/bar2-3.png';
import pngBar3_1 from './assets/images/bar3-1.png';
import pngBar3_2 from './assets/images/bar3-2.png';
import pngBar3_3 from './assets/images/bar3-3.png';
import pngBar4_1 from './assets/images/bar4-1.png';
import pngBar4_2 from './assets/images/bar4-2.png';
import pngBar4_3 from './assets/images/bar4-3.png';
//每一个显示块对应避障数组的映射关系 //每一个显示块对应避障数组的映射关系
let angleMap = new Map(); let angleMap = new Map();
angleMap.set("1-1", [32, 33]); angleMap.set("1-1", [32, 33]);
...@@ -116,6 +129,20 @@ export default { ...@@ -116,6 +129,20 @@ export default {
3: -1, 3: -1,
4: -1, 4: -1,
}, },
pngList: {
"bar1-1": pngBar1_1,
"bar1-2": pngBar1_2,
"bar1-3": pngBar1_3,
"bar2-1": pngBar2_1,
"bar2-2": pngBar2_2,
"bar2-3": pngBar2_3,
"bar3-1": pngBar3_1,
"bar3-2": pngBar3_2,
"bar3-3": pngBar3_3,
"bar4-1": pngBar4_1,
"bar4-2": pngBar4_2,
"bar4-3": pngBar4_3,
}
}; };
}, },
computed: { computed: {
......
...@@ -98,6 +98,12 @@ import { Utils } from "../../../../../../lib/cesium"; ...@@ -98,6 +98,12 @@ import { Utils } from "../../../../../../lib/cesium";
import { mapState } from "vuex"; import { mapState } from "vuex";
import { flightTaskAPI } from "../../../../../../api"; import { flightTaskAPI } from "../../../../../../api";
import { nanoid } from "nanoid"; import { nanoid } from "nanoid";
import svgFace from './assets/images/face.svg';
import svgCar from './assets/images/car.svg';
import svgPeople from './assets/images/people.svg';
import svgSwim from './assets/images/swim.svg';
import svgYan from './assets/images/yan.svg';
import svgThings from './assets/images/things.svg';
export default { export default {
props: { props: {
...@@ -130,42 +136,42 @@ export default { ...@@ -130,42 +136,42 @@ export default {
type: "人脸识别", type: "人脸识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/face.svg"), img: svgFace,
}, },
{ {
id: 2, id: 2,
type: "车牌识别", type: "车牌识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/car.svg"), img: svgCar,
}, },
{ {
id: 3, id: 3,
type: "人流识别", type: "人流识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/people.svg"), img: svgPeople,
}, },
{ {
id: 4, id: 4,
type: "游泳识别", type: "游泳识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/swim.svg"), img: svgSwim,
}, },
{ {
id: 7, id: 7,
type: "烟雾识别", type: "烟雾识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/yan.svg"), img: svgYan,
}, },
{ {
id: 6, id: 6,
type: "异物识别", type: "异物识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/things.svg"), img: svgThings,
}, },
], ],
lineNameAI: "", lineNameAI: "",
...@@ -296,42 +302,42 @@ export default { ...@@ -296,42 +302,42 @@ export default {
type: "人脸识别", type: "人脸识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/face.svg"), img: svgFace,
}, },
{ {
id: 2, id: 2,
type: "车牌识别", type: "车牌识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/car.svg"), img: svgCar,
}, },
{ {
id: 3, id: 3,
type: "人流识别", type: "人流识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/people.svg"), img: svgPeople,
}, },
{ {
id: 4, id: 4,
type: "游泳识别", type: "游泳识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/swim.svg"), img: svgSwim,
}, },
{ {
id: 7, id: 7,
type: "烟雾识别", type: "烟雾识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/yan.svg"), img: svgYan,
}, },
{ {
id: 6, id: 6,
type: "异物识别", type: "异物识别",
switch: false, switch: false,
check: false, check: false,
img: require("./assets/images/things.svg"), img: svgThings,
}, },
]; ];
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
@click="change(item,true)" @click="change(item,true)"
v-if="item.id != 5" v-if="item.id != 5"
class="w30 h36 ml10 mr10" class="w30 h36 ml10 mr10"
:src="require(`./img/select/${item.id}.svg`)" :src="item.img"
></el-image> ></el-image>
<div v-else class="tc lh34 ml11" @click="handclickFn" title="主画面切换">切换</div> <div v-else class="tc lh34 ml11" @click="handclickFn" title="主画面切换">切换</div>
</div> </div>
...@@ -17,35 +17,43 @@ ...@@ -17,35 +17,43 @@
</div> </div>
</template> </template>
<script> <script>
// import API from "../../../../../../api"; import svg0 from "./img/select/0.svg";
import svg1 from "./img/select/1.svg";
import svg2 from "./img/select/2.svg";
import svg3 from "./img/select/3.svg";
import svg5 from "./img/select/5.svg";
import svg12 from "./img/select/12.svg";
import svg13 from "./img/select/13.svg";
import svg23 from "./img/select/23.svg";
export default { export default {
data() { data() {
return { return {
imgList: [ imgList: [
{ id: 1 }, { id: 1, img: svg1 },
{ id: 2 }, { id: 2, img: svg2 },
{ id: 3 }, { id: 3, ima: svg3 },
{ id: 5 }, { id: 5, img: svg5 },
{ id: 12 }, { id: 12, img: svg12 },
{ id: 13 }, { id: 13, img: svg13 },
{ id: 23 }, { id: 23, img: svg23 },
{ id: 0 } { id: 0, img: svg0 },
], ],
key: 1, key: 1,
flag: false, flag: false,
isShow: false, isShow: false,
controlflag: true controlflag: true,
}; };
}, },
props: { props: {
data: { data: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
}, },
uavData: { uavData: {
type: Object, type: Object,
default: () => ({}) default: () => ({}),
} },
}, },
inject: ["uav_This", "NXdata"], inject: ["uav_This", "NXdata"],
watch: { watch: {
...@@ -62,17 +70,17 @@ export default { ...@@ -62,17 +70,17 @@ export default {
this.key = value.modeType; this.key = value.modeType;
} }
}, },
deep: true deep: true,
} },
}, },
created() { created() {
// 查询清流拼接状态(视频融合是几分屏) // 查询清流拼接状态(视频融合是几分屏)
const streamData = { const streamData = {
data: { data: {
data: {}, data: {},
messageID: 1032 messageID: 1032,
}, },
type: 528 type: 528,
}; };
this.$emit("fn", streamData); this.$emit("fn", streamData);
// this.handclickFn() // this.handclickFn()
...@@ -89,9 +97,9 @@ export default { ...@@ -89,9 +97,9 @@ export default {
} */ } */
}, },
getImg(key) { getImg(key) {
let arr = this.imgList.filter(item => item.id == key); let arr = this.imgList.filter((item) => item.id == key);
if (arr) { if (arr) {
let img = require(`./img/default/${arr[0].id}.svg`); let img = arr[0].img;
return img; return img;
} }
return ""; return "";
...@@ -107,11 +115,11 @@ export default { ...@@ -107,11 +115,11 @@ export default {
let streamData = { let streamData = {
data: { data: {
data: { data: {
modeType: item.id modeType: item.id,
}, },
messageID: 1033 messageID: 1033,
}, },
type: 528 type: 528,
}; };
this.$emit("fn", streamData); this.$emit("fn", streamData);
console.log(streamData, "streamData"); console.log(streamData, "streamData");
...@@ -138,16 +146,16 @@ export default { ...@@ -138,16 +146,16 @@ export default {
data: { data: {
data: { data: {
fuseFlag: true, fuseFlag: true,
controlflag: this.controlflag controlflag: this.controlflag,
}, },
messageID: 1018 messageID: 1018,
}, },
type: 528 type: 528,
}; };
console.log(streamData, "streamData"); console.log(streamData, "streamData");
this.$emit("fn", streamData); this.$emit("fn", streamData);
} },
} },
}; };
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
......
...@@ -422,6 +422,12 @@ import Obstacle from "./components/obstacle"; ...@@ -422,6 +422,12 @@ import Obstacle from "./components/obstacle";
import PointList from "./components/pointList"; import PointList from "./components/pointList";
import videoModelChange from "./components/videoModelChange"; import videoModelChange from "./components/videoModelChange";
import fkutils from "./methods/utils"; import fkutils from "./methods/utils";
import 车牌检测 from './assets/images/车牌检测.svg';
import 火焰烟雾 from './assets/images/火焰烟雾.svg';
import 异物检测 from './assets/images/异物检测.svg';
import 跌倒检测 from './assets/images/跌倒检测.svg';
import 游泳检测 from './assets/images/游泳检测.svg';
export default { export default {
name: "Player", name: "Player",
...@@ -462,7 +468,7 @@ export default { ...@@ -462,7 +468,7 @@ export default {
title: "车牌识别", title: "车牌识别",
aiType: 12, aiType: 12,
class: "right28 top40", class: "right28 top40",
Img: require("./assets/images/车牌检测.svg"), Img: 车牌检测,
}, },
// { // {
// title: "绿化带分割", // title: "绿化带分割",
...@@ -480,7 +486,7 @@ export default { ...@@ -480,7 +486,7 @@ export default {
title: "车辆类型检测", title: "车辆类型检测",
aiType: 9, aiType: 9,
class: "right66 top40", class: "right66 top40",
Img: require("./assets/images/车辆检测.svg"), Img: 车辆检测,
}, },
// { // {
// title: "车辆朝向", // title: "车辆朝向",
...@@ -492,25 +498,25 @@ export default { ...@@ -492,25 +498,25 @@ export default {
title: "火焰烟雾", title: "火焰烟雾",
aiType: 7, aiType: 7,
class: "right-88 top40", class: "right-88 top40",
Img: require("./assets/images/火焰烟雾.svg"), Img: 火焰烟雾,
}, },
{ {
title: "异物检测", title: "异物检测",
aiType: 6, aiType: 6,
class: "right-11 top40", class: "right-11 top40",
Img: require("./assets/images/异物检测.svg"), Img: 异物检测,
}, },
{ {
title: "跌倒检测", title: "跌倒检测",
aiType: 5, aiType: 5,
class: "right-50 top40", class: "right-50 top40",
Img: require("./assets/images/跌倒检测.svg"), Img: 跌倒检测,
}, },
{ {
title: "游泳检测", title: "游泳检测",
aiType: 4, aiType: 4,
class: " right66", class: " right66",
Img: require("./assets/images/游泳检测.svg"), Img: 游泳检测,
}, },
], ],
ygisCenterFlag: false, ygisCenterFlag: false,
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
import axios from 'axios'; import axios from 'axios';
import { Utils } from "../../../../../lib/cesium"; import { Utils } from "../../../../../lib/cesium";
import { zoomTo } from "./zoomTo"; import { zoomTo } from "./zoomTo";
import pngAisu from '../assets/images/aisu.png';
import pngAier from '../assets/images/aier.png';
import pngAiing from '../assets/images/aiing.png';
// 识别类型 4 代表游泳 5:跌倒检测 6:异物检测7:火焰烟雾8:车辆朝向9:车辆类型检测 10:车道分割线 11:绿化带分割12:车牌识别 // 识别类型 4 代表游泳 5:跌倒检测 6:异物检测7:火焰烟雾8:车辆朝向9:车辆类型检测 10:车道分割线 11:绿化带分割12:车牌识别
let urlList = { let urlList = {
...@@ -45,7 +48,7 @@ export default { ...@@ -45,7 +48,7 @@ export default {
lat: Number(this.uavData.locationCoordinate3D.latitude), lat: Number(this.uavData.locationCoordinate3D.latitude),
alt: Number(this.uavData.locationCoordinate3D.altitude), alt: Number(this.uavData.locationCoordinate3D.altitude),
}), }),
image: require(`../assets/images/${flag ? 'aisu' : 'aier'}.png`), image: flag ? pngAisu : pngAier,
scale: 1, scale: 1,
width: 54, width: 54,
height: 89, height: 89,
...@@ -703,7 +706,7 @@ export default { ...@@ -703,7 +706,7 @@ export default {
lat: Number(this.uavData.locationCoordinate3D.latitude), lat: Number(this.uavData.locationCoordinate3D.latitude),
alt: Number(this.uavData.locationCoordinate3D.altitude), alt: Number(this.uavData.locationCoordinate3D.altitude),
}), }),
image: require("../assets/images/aiing.png"), image: pngAiing,
scale: 1, scale: 1,
width: 54, width: 54,
height: 89, height: 89,
......
<template>
<div>
<div class="ctx-box">
<div class="form-box" v-show="!visible">
<el-form :model="airline" :rules="rules">
<el-form-item label="航线名称">
<el-input v-model="airline.filename" placeholder="请输入航线名称" />
</el-form-item>
<el-form-item label="起始位置" prop="destination">
<div class="item-group">
<el-autocomplete :popper-append-to-body='false' v-model="start.name" :fetch-suggestions="handle_query_address_async"
placeholder="请输入起始位置" :trigger-on-focus="false" @select="
(item) => {
handle_select_address(item, 'start');
}
" clearable>
<template slot-scope="{ item }">
<div>
<span style="font-size: 14px; color: #333">{{
item.name
}}</span>
<span style="font-size: 12px; color: #999; margin-left: 12px">{{ item.address }}</span>
</div>
</template>
</el-autocomplete>
<div @click="handle_pick('start')" class="el-icon-location-outline"></div>
</div>
</el-form-item>
<el-form-item label="目的位置" prop="destination">
<div class="item-group">
<el-autocomplete :popper-append-to-body='false' v-model="end.name" :fetch-suggestions="handle_query_address_async" placeholder="请输入目标位置"
:trigger-on-focus="false" @select="
(item) => {
handle_select_address(item, 'end');
}
" clearable>
<template slot-scope="{ item }">
<div>
<span style="font-size: 14px; color: #333">{{
item.name
}}</span>
<span style="font-size: 12px; color: #999; margin-left: 12px">{{ item.address }}</span>
</div>
</template>
</el-autocomplete>
<div @click="handle_pick('end')" class="el-icon-location-outline"></div>
</div>
</el-form-item>
<el-form-item label="默认高度">
<div class="item-group">
<el-input v-model="airline.height" />
<span class="unit">( m )</span>
</div>
</el-form-item>
<el-form-item label="默认速度" prop="baseSpeed">
<div class="item-group">
<el-input v-model="airline.baseSpeed" />
<span class="unit">( m/s )</span>
</div>
</el-form-item>
</el-form>
<div class="bottom-box cp" @click="handle_autoPlan">飞行航线</div>
</div>
</div>
<div class="choose" v-show="visible">
<div class="ctx-box mt25">
<span class="aotu_tip">已自动规划{{ planlist.length }}条航线:</span>
<div class="planlist" v-for="(item, index) in planlist" :key="index">
<el-radio model="radio" :label="item.name">航线A:距离{{ item.distance / 1000 }}km,时长{{
item.duration
}}s</el-radio>
</div>
</div>
<div class="btns">
<div @click="close" class="btn ml80 cp">重新规划</div>
<div @click="handle_sava" class="btn ml50 cp">保存</div>
</div>
</div>
</div>
</template>
<script>
import API from "@/api";
import { Utils } from "@/lib/cesium";
import axios2 from "axios";
let SWXT_AUTOPLAN_URL = "http://32.128.12.138:21009/service/lbs/route/driving3";
let handler = null;
let data_srouce = null;
let location_icon = null;
let positions = [];
export default {
data() {
var validateSpeed = (rule, value, callback) => {
if (value < 2 || value > 15) {
return callback(new Error("速度最大值为15,最小值为2"));
}
};
return {
rules: {
baseSpeed: [
{ validator: validateSpeed, required: false, trigger: "blur" },
],
},
visible: false,
airline: {
filename: "",
baseSpeed: 2,
height: 100,
destination: null,
start: null,
},
planlist: [],
start: {
name: "",
lng: 0,
lat: 0,
},
end: {
name: "",
lng: 0,
lat: 0,
},
radio: "1",
positionsArr: [], //四维图新接口返回的所有航点(加了高度)
positionsArr_y: [], //四维图新接口返回的所有航点
lineDistance: 0, //四维图新接口返回的所有距离
lineTime: "", //四维图新接口返回的用时
};
},
inject: ["g_cesium_layer", "change_page"],
methods: {
// 点击自动航线的数据处理
async handle_autoPlan() {
// if (this.airline.filename == "") {
// this.$message.info('请输入航线名称!')
// } else if(this.airline.height>15 || this.airline.height<2){
// this.$$message.info("航线速度允许最大值为15,最小值为2!请重新输入!")
// }else {
this.visible = true;
// let data = {
// data: {
// rows: [
// {
// distance: 3366,
// duration: 553,
// niIds:
// "36546132,1,47;36546348,0,14;5119103,0,52;5106931,0,116;5106932,0,8;88050931,0,388;88050932,0,29;49719812,0,52;49719813,0,30;5106942,0,8;32083179,1,31;32083178,1,48;5224350,1,49;5119076,1,8;5119075,0,9;5224359,0,39;64858180,0,74;64858181,0,13;5230535,0,35;17430867,0,32;17430868,0,52;17430861,0,6;17430862,0,161;79278741,0,89;79278742,0,4;35802389,0,14;35802391,0,27;35802392,0,28;35802388,0,32;35802386,0,27;35802384,0,25;35802382,0,37;19497879,0,61;79278650,0,71;79278651,0,92;17430784,1,89;17430783,1,46;5119128,0,19;9226583,0,5;9226589,0,12;9226600,0,21;79278614,1,35;79278615,1,17;79278611,0,31;9226583,1,5;5119128,1,19;17430783,0,46;17430784,0,89;79278645,0,73;79278646,0,44;5227435,0,183;33254441,0,135;33254442,0,14;49512318,0,54;49512340,0,14;49512367,0,36;49512368,0,23;14663945,0,55;14663946,0,49;15781919,0,68;15781920,0,45;61613576,0,26;61613577,0,32;5117564,0,36;5117567,0,11;5117565,0,36;5119051,1,30;61613575,1,27;61613574,1,45;63929499,0,14;63929500,0,19;76828946,0,55;",
// routelatlon:
// "120.14201,33.3824;120.14248,33.38251;120.14248,33.38251;120.14251,33.38239;120.1426,33.3821;120.14264,33.38193;120.14264,33.38193;120.14301,33.38193;120.14364,33.38189;120.14389,33.38187;120.14398,33.38186;120.14444,33.38187;120.14524,33.38175;120.14571,33.38165;120.14615,33.38155;120.14646,33.38145;120.1467,33.38136;120.1469,33.38125;120.14709,33.38117;120.14744,33.38093;120.14779,33.38067;120.1479,33.38058;120.14801,33.38049;120.14838,33.38014;120.14859,33.37994;120.14864,33.37988;120.14878,33.37963;120.14899,33.37924;120.14921,33.37884;120.14921,33.37884;120.14926,33.37884;120.14932,33.37883;120.14963,33.37907;120.14974,33.37915;120.14985,33.37925;120.15022,33.37952;120.15032,33.3796;120.1506,33.37981;120.15087,33.38001;120.15106,33.38015;120.15129,33.38032;120.15134,33.38036;120.15174,33.38065;120.152,33.38082;120.15272,33.38124;120.15272,33.38124;120.15337,33.3807;120.1534,33.38067;120.15343,33.38064;120.15353,33.38055;120.15373,33.38037;120.15393,33.38018;120.15417,33.37996;120.15436,33.37978;120.15439,33.37975;120.15453,33.37961;120.15479,33.37936;120.15521,33.37894;120.1557,33.37845;120.15577,33.3784;120.15636,33.37784;120.15636,33.37784;120.15565,33.3773;120.15529,33.37702;120.15529,33.37702;120.15515,33.37714;120.15512,33.37718;120.15504,33.37727;120.15493,33.37743;120.15493,33.37743;120.1553,33.3775;120.1553,33.3775;120.15538,33.37736;120.15538,33.37736;120.15512,33.37718;120.15512,33.37718;120.15515,33.37714;120.15529,33.37702;120.15529,33.37702;120.15565,33.3773;120.15636,33.37784;120.15699,33.37824;120.15737,33.37848;120.15768,33.37866;120.15784,33.37877;120.15818,33.37901;120.15888,33.37954;120.15999,33.38033;120.1601,33.38041;120.1601,33.38041;120.16035,33.38004;120.16039,33.37999;120.16047,33.37988;120.16067,33.3796;120.16079,33.37942;120.16109,33.37899;120.16135,33.37861;120.16147,33.37843;120.16169,33.37808;120.16192,33.37772;120.16207,33.37752;120.16224,33.37727;120.16224,33.37727;120.16227,33.37729;120.16227,33.37729;120.16231,33.37732;120.16214,33.37755;120.16205,33.37767;120.16203,33.3777;120.16199,33.37776;120.16176,33.37812;120.16176,33.37812;120.16188,33.37819;120.16205,33.37828;120.16205,33.37828;120.16225,33.37804;120.16232,33.37799;120.1624,33.37799;120.16249,33.37804;",
// trafficSpeeds: "?x72",
// },
// ],
// },
// errcode: 0,
// errmsg: "",
// };
let sPoint = this.start.lng + "," + this.start.lat;
let ePoint = this.end.lng + "," + this.end.lat;
let data = await axios2
.get(SWXT_AUTOPLAN_URL, {
params: {
sPoint: sPoint,
ePoint: ePoint,
st: 4,
appKey: "f31add2975584a2b8c1d606e3f112f5a",
},
})
.then((res) => {
return res.data.data;
});
// let data1 = data.rows[0].routelatlon.replace(/\;/g, ",").split(",");
// let data_y = data.rows[0].routelatlon.replace(/\;/g, ",").split(",");
// this.positionsArr_y = data_y
// .slice(0, data_y.length - 1)
// .map((item) => item * 1);
let item = data.rows[0].item
console.log("item", item)
let crr = []
item.forEach(v => {
console.log("vv-->", v);
let arr = v.turnlatlon.split(",")
crr.push(Number(arr[0]), Number(arr[1]))
})
console.log("crr:", crr);
this.positionsArr_y = crr
// this.positionsArr_y = item.reduce((total, item, index) => {
// console.log("885885");
// let arr = item.split(",")
// total.push(arr[0], arr[1])
// console.log("total:", total);
// return total
// },[])
// this.positionsArr_y = data.rows[0].item.reduce((total, item, index) => {
// let arr = item.split(",")
// total.push(arr[0], arr[1])
// console.log("total:", total);
// return total
// },[])
console.log("positionsArr_y:", this.positionsArr_y);
this.positionsArr = this.positionsArr_y.reduce((total, item, index) => {
total.push(item);
if ((index + 1) % 2 === 0) {
total.push(10);
}
return total;
}, []);
console.log("positionsArr:", this.positionsArr);
this.lineDistance = data.rows[0].distance;
this.duration = data.rows[0].duration;
this.planlist = data.rows;
this.handle_autoPlan_map();
// }
},
// 点击自动航线的地图显示
async handle_autoPlan_map() {
const _this = this;
let cesium_layer = this.g_cesium_layer();
let viewer = cesium_layer.viewer();
if (this.positionsArr.length > 2) {
let potiion = Utils.transformWGS842Cartesian({
lng: Number(_this.end.lng),
lat: Number(_this.end.lat),
alt: 20000,
});
console.log("potiion:", potiion);
viewer.camera.flyTo({
destination: potiion,
});
}
data_srouce = new Cesium.CustomDataSource("airway_autoedit");
await viewer.dataSources.add(data_srouce);
let entities = data_srouce.entities;
console.log("map-_this.positionsArr", _this.positionsArr);
entities.add({
polyline: {
width: 3,
arcType: Cesium.ArcType.NONE,
material: new Cesium.PolylineArrowMaterialProperty(
Cesium.Color.PURPLE
),
positions: new Cesium.CallbackProperty(() => {
return Cesium.Cartesian3.fromDegreesArrayHeights(
_this.positionsArr
);
}, false),
},
});
},
handle_query_address_async(address, cb) {
API.MAP.Geo({ keywords: address })
.then((res) => {
cb(res.data.data.rows);
})
.catch((e) => cb([]));
},
close() {
this.visible = false;
},
// 表单位置信息索引
handle_select_address(item, type) {
if (item) {
let location = item.location.split(",");
this[type].name = item.name;
this[type].lng = Number(location[0]);
this[type].lat = Number(location[1]);
let cesium_layer = this.g_cesium_layer();
let viewer = cesium_layer.viewer();
let potiion = Utils.transformWGS842Cartesian({
lng: this[type].lng,
lat: this[type].lat,
alt: 1000,
});
viewer.camera.flyTo({
destination: potiion,
});
this.init_location_icon(potiion);
}
},
// handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
// handler.setInputAction(async (movement) => {
// let windowPosition = movement.position;
// let pickedObject = viewer.scene.pick(windowPosition);
// let position = Utils.getCartesian3FromPX(viewer, movement.position);
// console.log("position-->",position);
// let wgs84 = Utils.transformCartesian2WGS84(position);
// let address = await API.MAP.Regeo({
// location: `${wgs84.lng},${wgs84.lat}`,
// });
// console.log("address-->", address);
// if (address) {
// this[type].name = address;
// this[type].lng = wgs84.lng;
// this[type].lat = wgs84.lat;
// } else {
// this.$el_message("地址解析失败", () => {}, "error");
// }
// }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
// },
// 点击表单旁图标定位
async handle_pick(type) {
handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
handler.setInputAction(async (movement) => {
let position = Utils.getCartesian3FromPX(viewer, movement.position);
let wgs84 = Utils.transformCartesian2WGS84(position);
let address = await API.MAP.Regeo({
location: `${wgs84.lng},${wgs84.lat}`,
});
if (address) {
this[type].name = address;
this[type].lng = wgs84.lng;
this[type].lat = wgs84.lat;
// 生成图标
data_srouce = new Cesium.CustomDataSource("airway_edit");
await viewer.dataSources.add(data_srouce);
let entities = data_srouce.entities;
entities.add({
position: new Cesium.CallbackProperty(() => {
return Cesium.Cartesian3.fromDegrees(
Number(this[type].lng),
Number(this[type].lat)
);
}, false),
billboard: {
width: 36,
height: 36,
image: require(`@/assets/images/icons/${type}Point.png`),
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.Bottom,
// heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance: Number.POSITIVE_INFINITY,
},
});
} else {
this.$el_message("地址解析失败", () => { }, "error");
}
handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN) &&
(handler = null);
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
},
init_location_icon(position) {
let cesium_layer = this.g_cesium_layer();
let viewer = cesium_layer.viewer();
if (location_icon) {
location_icon.position = position;
} else {
location_icon = viewer.entities.add({
position,
billboard: {
width: 36,
height: 36,
image: require("@/assets/images/icons/icon_location.png"),
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.Bottom,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
},
});
}
},
// 点击保存
handle_sava() {
let points = this.positionsArr_y;
let arr = [];
for (var i = 0; i < points.length; i = i + 2) {
arr.push({
lon: points[i],
lat: points[i + 1],
alt: 0,
pitch: 0,
gimbalPitch: 0,
action: [],
uuid: i + "HHYYHH" + i + 1,
});
}
const reqObj = {
filename: this.airline.filename,
line: {
baseSpeed: this.airline.baseSpeed,
},
points: arr,
baseSpeed: this.airline.baseSpeed,
};
this.airline.baseSpeed = Number(this.airline.baseSpeed);
let options = {
distance: this.lineDistance,
flightCourseJson: JSON.stringify(reqObj),
flightName: this.airline.filename,
pointCount: points.length,
time: parseInt(this.lineDistance / this.airline.baseSpeed),
destination: this.end.name,
lng: this.end.lng,
lat: this.end.lat,
};
(this.airline = {
filename: "",
baseSpeed: 100.0,
height: 100.0,
destination: null,
start: null,
}),
this.$emit("add", options);
},
destroy_cesium_handler() {
let viewer = window.viewer;
viewer.scene.globe.depthTestAgainstTerrain = false;
if (handler) {
// handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
handler && handler.destroy() && (handler = null);
handler = null;
}
if (data_srouce) {
data_srouce.entities.removeAll();
viewer.dataSources.remove(data_srouce, true);
data_srouce = null;
this.positionsArr = [];
this.start.lng = 0;
this.start.lat = 0;
this.end.lng = 0;
this.end.lat = 0;
}
},
// clear_entities() {
// noFlyEntities.forEach((item) => {
// viewer.entities.remove(item);
// });
// electricFenceEntities.forEach((item) => {
// viewer.entities.remove(item);
// });
// noFlyEntities = [];
// electricFenceEntities = [];
// },
change_close() {
let viewer = window.viewer;
viewer.scene.globe.depthTestAgainstTerrain = false;
// this.change_page();
},
},
computed: {
cesium_layer() {
return this.g_cesium_layer();
},
},
destroyed() {
this.destroy_cesium_handler();
// this.clear_entities();
},
};
</script>
<style lang=scss scoped>
@import "~@/styles/var.scss";
@import "~@/styles/mixins.scss";
.title-box {
height: 56px;
box-sizing: border-box;
padding-left: 112px;
position: relative;
display: flex;
justify-content: space-between;
margin-right: 80px;
.title {
font-family: PangMenZhengDao;
font-size: 22px;
color: #dce9ff;
font-weight: 400;
line-height: 3.2;
margin-right: 30px;
}
.select {
font-family: PangMenZhengDao;
font-size: 22px;
color: #00ffff;
text-align: center;
font-weight: 400;
}
&::before {
content: " ";
display: block;
position: absolute;
height: 1px;
left: 0;
bottom: 0;
right: 0;
background-image: linear-gradient(270deg,
rgba(0, 117, 221, 0) 0%,
#3ea4d5 50%,
rgba(0, 117, 221, 0) 100%);
}
.right-box {
flex: 1;
display: flex;
font-family: PangMenZhengDao;
font-size: 18px;
color: #20f0f0;
text-align: center;
font-weight: 400;
line-height: 3.8;
.before-point {
margin-right: 12px;
}
.before-point,
.after-point {
cursor: pointer;
user-select: none;
margin-left: 15px;
&.disabled {
cursor: not-allowed;
}
}
.no {
margin: 0 10px;
}
}
}
.ctx-box {
height: calc(100% - 56px - 88px);
box-sizing: border-box;
padding: 25px 0px 0px 70px;
overflow: auto;
.form-box {
::v-deep .el-form {
.divider {
@include linear_gradient_border(0, auto, 0, 0);
height: 22px;
}
.el-form-item {
.item-group {
display: flex;
align-items: center;
.unit {
font-family: MicrosoftYaHeiUI;
font-size: 18px;
color: rgb(179, 201, 203);
font-weight: 400;
margin-left: 12px;
}
.iconfont {
color: rgb(179, 201, 203);
font-size: 30px;
margin-left: 0.3em;
cursor: pointer;
}
.el-icon-location-outline {
color: rgb(179, 201, 203);
font-size: 30px;
margin-left: 0.3em;
cursor: pointer;
}
}
.el-form-item__label {
font-family: Microsoft YaHei;
font-size: 16px;
color: #ccedff;
text-align: right;
font-weight: 400;
}
.el-input {
width: 356px;
height: 40px;
border: 1px solid #08c2d1;
.el-input__inner {
width: 100%;
border: none;
border-radius: 0;
background-color: #000000;
color: #fff;
}
}
.el-input-number {
width: 356px;
.el-input-number__decrease,
.el-input-number__increase {
bottom: 1px;
background: #606266;
color: #f5f7fa;
border-radius: 0;
border: none;
}
.el-input-number__decrease {
left: 1px;
}
.el-input-number__increase {
right: -1px;
}
}
}
}
}
}
.bottom-box {
position: absolute;
bottom: 50px;
left: 150px;
width: 300px;
height: 50px;
background-color: #08c2d1;
font-family: PangMenZhengDao;
font-size: 22px;
color: #dce9ff;
text-align: center;
line-height: 50px;
font-weight: 400;
}
.btns {
display: flex;
justify-content: space-between;
position: absolute;
bottom: 50px;
.btn {
width: 200px;
height: 50px;
background-color: #08c2d1;
font-family: PangMenZhengDao;
font-size: 22px;
color: #dce9ff;
text-align: center;
line-height: 50px;
font-weight: 400;
}
}
::v-deep .el-radio,
.el-radio__inner,
.el-radio__input {
display: block;
width: 20px;
height: 20px;
.el-radio__inner {
width: 20px;
height: 20px;
}
}
/deep/ .el-radio {
margin-bottom: 20px;
}
/deep/ .el-radio__label {
font-family: MicrosoftYaHeiUI;
font-size: 18px;
color: #ccedff;
text-align: right;
font-weight: 400;
line-height: 20px;
margin-left: 20px;
}
.aotu_tip {
color: #fff;
font-size: 18px;
line-height: 18px;
margin-bottom: 26px;
display: block;
}
</style>
\ No newline at end of file
<template>
<div class="cpt-command-airway-edit">
<div class="header" v-interact>
<div class="hd-box">手动规划</div>
<div style="color: #08c2d1" class="hd-box cp">
<!-- <div @click="change_airway" v-if="isShow">
<span
class="iconfont"
:class="flag ? 'icon-shebeiliebiao' : 'icon-shebeiliebiao'"
></span>
<span class="ml5 mr5">{{ flag ? "鹰巢" : "无人机" }}</span>
<span
class="iconfont icon-shujushangchuan"
:class="flag ? 'icon-shujushangchuan' : 'icon-shujushangchuan'"
></span>
</div> -->
</div>
<div class="hd-box cp mr20" @click="exit">关闭</div>
</div>
<manual
:nestData="data"
v-if="visibleFlag"
:flag="flag"
@add="testEmit"
></manual>
<autoPlan v-if="!visibleFlag" :flag="flag" @add="testEmit"></autoPlan>
</div>
</template>
<script>
import autoPlan from "./autoPlan";
import manual from "./manual";
import dayjs from "dayjs";
let entitie = null;
export default {
components: {
autoPlan,
manual,
},
props: {
//为true是 规划航线为鹰巢
flag: {
type: Boolean,
default: false,
},
// 是否展示切换按钮
data: {
type: Object || Array,
default: () => {},
},
},
data() {
return {
// 手动规划还是自动规划
visibleFlag: true,
};
},
watch: {
data: {
handler(value) {
this.showAreaFn(value);
},
immediate: true,
deep: true,
},
},
beforeDestroy() {
window.viewer.entities.remove(entitie);
},
methods: {
showAreaFn(data) {
if (entitie) {
window.viewer.entities.remove(entitie);
}
let positions = Cesium.Cartesian3.fromDegrees(
Number(data.longitude),
Number(data.latitude),
0
);
let ellipse = {
semiMinorAxis: 2500,
material: Cesium.Color.fromCssColorString("#2f6947").withAlpha(0.7),
semiMajorAxis: 2500,
rotation: Cesium.Math.toRadians(-40.0),
outline: true,
outlineWidth: 4,
stRotation: Cesium.Math.toRadians(90),
};
let entities = this.createAreaPoint(window.viewer, {
id: "showArea" + data.id + "yc",
position: positions,
title: data.name,
ellipse,
});
entitie = entities;
},
createAreaPoint(viewer, { position, title, id, ellipse, longitude }) {
let point = viewer.entities.add({
id: id || null,
name: "pointArea",
position,
ellipse: ellipse,
longitude: longitude || null,
// label: {
// text: title,
// font: "14pt monospace",
// style: Cesium.LabelStyle.FILL_AND_OUTLINE,
// outlineWidth: 2,
// verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
// pixelOffset: new Cesium.Cartesian3(0.0, 32, 0.0),
// disableDepthTestDistance: Number.POSITIVE_INFINITY,
// },
});
return point;
},
exit() {
// 为false时为飞控中心创建航线
this.$emit("quit");
},
testEmit(item) {
this.$emit("add", item);
},
},
inject: ["g_cesium_layer"],
};
</script>
<style lang="scss" scoped>
@import "~@/styles/var.scss";
@import "~@/styles/mixins.scss";
.cpt-command-airway-edit {
position: absolute;
left: 100px;
top: 54px;
width: 560px;
box-sizing: border-box;
background: rgba(0, 23, 79, 0.7);
box-shadow: 0 2px 4px 0 rgba(1, 162, 255, 0.35),
inset 0 0 40px 0 rgba(0, 184, 255, 0.5);
border-radius: 13px;
z-index: 4;
.header {
display: flex;
justify-content: space-between;
align-items: center;
height: 44px;
background: rgba(16, 65, 215, 0.2);
box-shadow: inset 0 0 15px 0 rgba(0, 182, 255, 0.6);
border-radius: 10px 10px 0 0;
}
.hd-box {
font-family: MicrosoftYaHei-Bold;
font-size: 18px;
color: #00ffff;
letter-spacing: 0;
font-weight: 700;
margin-left: 20px;
}
.ctx-box {
height: calc(100% - 56px - 88px);
box-sizing: border-box;
padding: 25px 0px 0px 58px;
overflow: auto;
.form-box {
::v-deep .el-form {
.divider {
@include linear_gradient_border(0, auto, 0, 0);
height: 22px;
}
.el-form-item {
.item-group {
display: flex;
align-items: center;
.unit {
font-family: MicrosoftYaHeiUI;
font-size: 18px;
color: rgb(179, 201, 203);
font-weight: 400;
margin-left: 12px;
}
.iconfont {
color: rgb(179, 201, 203);
font-size: 30px;
margin-left: 0.3em;
cursor: pointer;
}
.el-icon-location-outline {
color: rgb(179, 201, 203);
font-size: 30px;
margin-left: 0.3em;
cursor: pointer;
}
}
.el-form-item__label {
font-family: Microsoft YaHei;
font-size: 16px;
color: #ccedff;
text-align: right;
font-weight: 400;
}
.el-input {
width: 356px;
height: 40px;
border: 1px solid #08c2d1;
.el-input__inner {
width: 100%;
border: none;
border-radius: 0;
background-color: #000000;
color: #fff;
}
}
.el-input-number {
width: 356px;
.el-input-number__decrease,
.el-input-number__increase {
bottom: 1px;
background: #606266;
color: #f5f7fa;
border-radius: 0;
border: none;
}
.el-input-number__decrease {
left: 1px;
}
.el-input-number__increase {
right: -1px;
}
}
}
}
}
}
.bottom-box {
box-sizing: border-box;
padding-bottom: 20px;
height: 88px;
display: flex;
justify-content: space-evenly;
align-items: center;
@include linear_gradient_border(0, auto, 0, 0);
.iconfont {
cursor: pointer;
font-size: 44px;
color: #08c2d1;
}
}
}
</style>
<style lang="scss">
.actions-box {
.title-box {
display: flex;
align-items: center;
.title {
font-size: 14px;
width: 70px;
}
}
.list-box {
max-height: 210px;
overflow: auto;
margin-top: 12px;
.action-item {
background-color: #ececec;
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1px solid #fff;
box-sizing: border-box;
padding: 12px;
&:hover {
background-color: #ccc;
}
.item-inner {
display: flex;
align-items: center;
}
.iconfont {
color: red;
cursor: pointer;
font-size: 20px;
}
}
}
}
</style>
<template>
<div>
<div class="right-box mt10">
<div class="before-point" :class="{ disabled: action.curr_index <= 0 }" @click="handle_before_point">
上一航点
</div>
<div class="no">
<span class="current">{{ action.curr_index }}</span>
/
<span class="total">{{ airline.points.length == 0 ? 0 : airline.points.length }}
</span>
</div>
<div class="after-point" :class="{
disabled: action.curr_index >= airline.points.length,
}" @click="handle_after_point">
下一航点
</div>
</div>
<div class="ctx-box">
<div class="form-box">
<el-form ref="form" :model="form" :rules="rules" label-width="96px">
<el-form-item label="航线名称">
<el-input :disabled="true" v-model="airline.filename" />
</el-form-item>
<el-form-item label="航线速度">
<div class="item-group">
<el-input oninput="value=value.replace(/[^0-9.]/g,'')" v-model="airline.line.baseSpeed" />
<span class="unit">( m/s )</span>
</div>
</el-form-item>
<el-form-item label="目标位置" prop="destination">
<div class="item-group" :title="form.destination">
<el-autocomplete :popper-append-to-body='false' v-model="destination.name" :fetch-suggestions="handle_query_address_async"
placeholder="请输入目标位置" :trigger-on-focus="false" @select="handle_select_address" clearable>
<template slot-scope="{ item }">
<div>
<span style="font-size: 14px; color: #333">{{
item.name
}}</span>
<span style="font-size: 12px; color: #999; margin-left: 12px">{{ item.address }}</span>
</div>
</template>
</el-autocomplete>
<div @click="handle_pick" class="el-icon-location-outline"></div>
</div>
</el-form-item>
<!-- <div class="divider"></div> -->
<el-form-item label="选择鹰巢" v-if="flag" prop="nestId">
<el-select v-model="form.nestId" :popper-append-to-body="false">
<el-option v-for="item in getNestListForLineList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="场景" prop="scene">
<el-select v-model="scene" :popper-append-to-body="false" @change="handle_change">
<el-option v-for="item in scene_list" :key="item.id" :label="item.name" :value="item.name" />
</el-select>
</el-form-item>
<el-form-item label="纬度" prop="lat">
<el-input v-model="form.lat" oninput="value=value.replace(/[^0-9.]/g,'')" />
</el-form-item>
<el-form-item label="经度" prop="lon">
<el-input v-model="form.lon" oninput="value=value.replace(/[^0-9.]/g,'')" />
</el-form-item>
<el-form-item label="高度" prop="alt">
<div class="item-group">
<el-input @change="(val) => handle_change_field('alt', val)" v-model.number="form.alt"
oninput="value=value.replace(/[^0-9.]/g,'')" />
<span class="unit">( m )</span>
</div>
</el-form-item>
<el-form-item label="偏航角">
<div class="item-group">
<el-input-number @change="(val) => handle_change_field('pitch', val)" v-model="form.pitch" :min="-90"
:max="90" label="描述文字" oninput="value=value.replace(/[^0-9.]/g,'')"></el-input-number>
<span class="unit">( ° )</span>
</div>
</el-form-item>
<el-form-item label="俯仰角">
<div class="item-group">
<el-input-number @change="(val) => handle_change_field('gimbalPitch', val)" v-model="form.gimbalPitch"
:min="-90" :max="90" label="描述文字" oninput.native="value=value.replace(/[^0-9.]/g,'')"></el-input-number>
<span class="unit">( ° )</span>
</div>
</el-form-item>
<el-form-item label="航线标签" prop="lat">
<el-select v-model="labvalue" multiple placeholder="请选择航线标签">
<el-option v-for="item in LablistL" :key="item.id" :label="item.labelName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="航点动作" prop="actions">
<el-link @click="handle_show_action" style="color: #409eff">{{ form.actions.length }}个动作<i
class="el-icon-d-arrow-right"></i>
</el-link>
</el-form-item>
</el-form>
</div>
</div>
<div class="bottom-box">
<!-- <div class="iconfont icon-zengjia" title="添加"></div> -->
<div @click="handle_save_line" class="iconfont icon-baocun" title="保存航线"></div>
<div @click="handle_remove_point" class="iconfont icon-shanchu" title="删除航点"></div>
</div>
<!-- <el-dialog
center
title="新增航点动作"
:visible.sync="action.visible"
width="500px"
top="20em"
:append-to-body="true"
:close-on-click-modal="false"
@close="
action.visible = false;
action.list = [];
"
> -->
<div class="w500 action-list" v-if="action.visible">
<div class="header">
<div class="hd-box">新增航点动作</div>
<div class="hd-box cp mr20" @click="
action.visible = false;
action.list = [];
">
关闭
</div>
</div>
<div class="actions-box">
<div class="title-box">
<div class="title">航点动作</div>
<el-dropdown trigger="click">
<el-button size="small" type="primary" icon="el-icon-plus">增加</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(item, index) in action.types" :key="index">
<div @click="handle_add_action(item)">{{ item.label }}</div>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="list-box">
<div class="action-item" v-for="(item, index) in action.list" :key="index">
<div class="item-label">{{ item.label }}</div>
<div v-if="item.input" class="item-input">
<component :is="item.input" :min="item.min" :max="item.max" v-model="item.actionParam" />
</div>
<div @click="handle_delete_action(index, item)" class="iconfont icon-shanchu" title="删除"></div>
</div>
</div>
</div>
<span class="footer">
<el-button size="small" @click="
action.visible = false;
action.list = [];
">取 消</el-button>
<el-button size="small" type="primary" @click="handle_save_action">确 定</el-button>
</span>
</div>
<!-- </el-dialog> -->
</div>
</template>
<script>
import API from "@/api";
import { Utils } from "@/lib/cesium";
import { nanoid } from "nanoid";
import dayjs from "dayjs";
import { mapGetters } from "vuex";
let positions = [];
let handler = null;
let data_srouce = null;
let location_icon = null;
let noFlyEntities = [];
let electricFenceEntities = [];
let point_index = null;
let point_uuid = null;
let point_uuid_next = null;
let isEditting = false;
export default {
components: {},
data() {
let validateLon = (rule, value, callback) => {
// let reg =
// /^[\-\+]?(0?\d{1,2}\.\d{1,5}|1[0-7]?\d{1}\.\d{1,5}|180\.0{1,5})$/;
console.log("value", value);
if (value < -180 || value > 180) {
callback(new Error("请输入正确经度值(-180.0-180.0)"));
} else {
callback();
}
};
let validateLat = (rule, value, callback) => {
// let reg = /^[\-\+]?([0-8]?\d{1}\.\d{1,5}|90\.0{1,5})$/;
console.log("value", value);
if (value < -90 || value > 90) {
callback(new Error("请输入正确纬度值(-90.0-90.0)"));
} else {
callback();
}
};
let validateAlt = (rule, value, callback) => {
if (value > 150) {
callback(new Error("航点高度不可超过150m"));
} else {
callback();
}
};
let validateNestId = (rule, value, callback) => {
if (!value) {
callback(new Error("请选择鹰巢"));
} else {
callback();
}
};
return {
labvalue: [],
LablistL: [],
getNestListForLineList: [],
rules: {
lat: [{ validator: validateLat, trigger: "change" }],
lon: [{ validator: validateLon, trigger: "change" }],
alt: [{ validator: validateAlt, trigger: "change" }],
nestId: [{ validator: validateNestId, trigger: "change" }],
},
time: null,
visibleFlag: true,
isGetAddress: false,
form: {
lon: 0,
lat: 0,
alt: 100,
pitch: 0, //-180~180
gimbalPitch: 0, //0~-90
actions: [],
nestId: null
},
destination: {
name: "",
lng: 0,
lat: 0,
},
airline: {
filename: null,
line: {
// baseSpeed: 10,
baseSpeed: 2,
},
points: [],
},
action: {
visible: false,
types: [
{
label: "悬停(s)",
input: "el-input-number",
min: 0,
max: 32000,
actionType: "STAY",
actionParam: 10,
},
{
label: "拍照",
actionType: "START_TAKE_PHOTO",
actionParam: 0,
},
{
label: "开始录像",
actionType: "START_RECORD",
actionParam: 0,
},
{
label: "停止录像",
actionType: "STOP_RECORD",
actionParam: 0,
},
],
list: [],
curr_index: 0,
},
scene: "巡查",
scene_list: [
{ name: "巡查", id: 1 },
{ name: "预警", id: 2 },
{ name: "侦察", id: 3 },
{ name: "服务", id: 4 },
{ name: "救援", id: 5 },
{ name: "处置", id: 6 },
{ name: "打击", id: 7 },
{ name: "宣传", id: 8 },
],
};
},
props: {
flag: {
type: Boolean,
default: true
},
nestData: {
type: Object||Array,
default: ()=>{},
},
},
// watch: {
// labvalue (val, value) {
// console.log("val", val)
// console.log("value", value)
// },
// deep: true
// },
async mounted() {
this.getlable();
this.init_cesium_handler();
let filename = ""
if(this.user_info.departmentId == 1){
filename = `巡特警支队-${this.scene}`;
}else{
filename = `${this.user_info.parentDepName ? this.user_info.parentDepName + "-" : ""
}${this.user_info.departmentName}-${this.scene}`;
}
let res = await API.AIRSPACE.GetFlightLineCount({ flightName: filename });
let filename_count = res + 1;
filename_count =
filename_count < 10 ? "0" + filename_count : filename_count;
this.airline.filename = filename + filename_count;
// this.get_air_space_list();
// this.get_electric_fence_list();
// this.get_institutional_fence_list();
this.getNestListForLine()
},
beforeDestroy() {
this.destroy_cesium_handler();
this.clear_entities();
},
methods: {
async getNestListForLine() {
this.getNestListForLineList = await API.AIRWAY.getNestListForLine();
},
async getlable() {
this.LablistL = await API.AIRWAY.labelList();
let {id,address,name} =this.nestData
if(id) {
console.log(this.nestData,'this.nestData');
this.form.nestId=id
// this.destination.name =this.nestData.address
this.destination.name =address||name
}
},
async handle_change() {
let filename = ""
if(this.user_info.departmentId == 1){
filename = `巡特警支队-${this.scene}`;
}else{
filename = `${this.user_info.parentDepName ? this.user_info.parentDepName + "-" : ""
}${this.user_info.departmentName}-${this.scene}`;
}
let res = await API.AIRSPACE.GetFlightLineCount({ flightName: filename });
let filename_count = res + 1;
filename_count =
filename_count < 10 ? "0" + filename_count : filename_count;
this.airline.filename = filename + filename_count;
},
init_point(data) {
Object.keys(data).map((key) => {
if (this.form.hasOwnProperty(key)) {
this.form[key] = data[key];
}
});
},
testEmit(item) {
this.$emit("add", item);
},
reset_form() {
let alt = this.form.alt;
let nestId = this.form.nestId;
this.$refs["form"] && this.$refs["form"].resetFields();
//继承上一个点的高度
this.form.alt = alt;
//继承上一个点的鹰巢id
this.form.nestId = nestId;
},
handle_before_point() {
let points = this.airline.points;
if (this.action.curr_index - 1 > 0) {
this.action.curr_index -= 1;
this.init_point(points[this.action.curr_index - 1]);
}
},
handle_after_point() {
try {
let points = this.airline.points;
if (this.action.curr_index + 1 <= points.length) {
this.action.curr_index += 1;
this.init_point(points[this.action.curr_index - 1]);
}
} catch (error) { }
},
handler_current_point(index) {
let points = this.airline.points;
this.action.curr_index = index;
this.init_point(points[this.action.curr_index]);
},
handle_save_point() {
this.airline.points.push({ ...this.form });
},
handle_remove_point() {
let index = this.action.curr_index - 1;
let points = this.airline.points;
let point = points[index];
if (point) {
points.splice(index, 1);
positions.splice(index, 1);
this.remove_point(point);
this.remove_label(point);
/**
* 如果后面没有点
*/
let after = points[index];
if (!after) {
if (index - 1 < 0) {
this.action.curr_index = 0;
} else {
this.action.curr_index -= 1;
}
}
points.length
? this.init_point(points[this.action.curr_index - 1])
: this.reset_form();
}
},
/**
* 显示动作弹窗
*/
handle_show_action() {
this.action.list = [];
this.action.list.push(...this.form.actions);
this.action.visible = true;
},
handle_add_action(item) {
this.action.list.push({ ...item });
},
handle_delete_action(index, item) {
this.action.list.splice(index, 1);
},
/**
* 关闭动作弹窗
*/
handle_save_action() {
this.form.actions = [];
this.form.actions.push(...this.action.list);
this.action.visible = false;
let point = this.airline.points[this.action.curr_index - 1];
point.actions = [];
point.actions.push(...this.action.list);
},
handle_change_field(key, value) {
let point = this.airline.points[this.action.curr_index];
if (point) {
point[key] = value * 1;
}
},
remove_point(point) {
data_srouce.entities.removeById(point.uuid);
},
create_point(uuid, position) {
let wgs84 = Utils.transformCartesian2WGS84(position);
let points = this.airline.points;
if (data_srouce && this.visibleFlag) {
let entities = data_srouce.entities;
entities.add({
name: "airline_point",
id: uuid,
position: Utils.transformWGS842Cartesian({
lng: wgs84.lng,
lat: wgs84.lat,
alt: wgs84.alt + 10,
}),
point: {
pixelSize: 20,
color: Cesium.Color.RED,
fillColor: Cesium.Color.RED,
// heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND, // supermap版本会导致拖动显示错误
},
label: {
text: new Cesium.CallbackProperty(() => {
let index = points.findIndex((item) => item.uuid === uuid);
return String(index + 1);
}, false),
scale: 0.5,
font: "bold 24px Microsoft YaHei",
fillColor: Cesium.Color.WHITE,
horizontalOrigin: Cesium.VerticalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.CENTER,
disableDepthTestDistance: Number.POSITIVE_INFINITY,
showBackground: false,
outlineWidth: 0,
},
});
}
},
remove_label(point) {
data_srouce.entities.removeById(`label_${point.uuid}`);
},
create_label(uuid, before, after, alt) {
if (data_srouce) {
let entities = data_srouce.entities;
let before_wgs84 = Utils.transformCartesian2WGS84(before);
let after_wgs84 = Utils.transformCartesian2WGS84(after);
let center_lng = (before_wgs84.lng + after_wgs84.lng) / 2;
let cetner_lat = (before_wgs84.lat + after_wgs84.lat) / 2;
let alt = (after_wgs84.alt + before_wgs84.alt) / 2;
let position = Utils.transformWGS842Cartesian({
lng: center_lng,
lat: cetner_lat,
alt: alt + 10,
});
let text = `${Cesium.Cartesian3.distance(before, after).toFixed(2)} m`;
entities.add({
id: `label_${uuid}`,
position: position,
label: {
text: text,
scale: 0.5,
font: "bold 30px Microsoft YaHei",
fillColor: Cesium.Color.fromCssColorString("#fff"),
horizontalOrigin: Cesium.VerticalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
disableDepthTestDistance: Number.POSITIVE_INFINITY,
showBackground: true,
backgroundPadding: new Cesium.Cartesian2(10, 10),
},
});
}
},
update_label(uuid, before, after) {
let entities = data_srouce.entities;
let id = `label_${uuid}`;
let entity = entities.getById(id);
let before_wgs84 = Utils.transformCartesian2WGS84(before);
let after_wgs84 = Utils.transformCartesian2WGS84(after);
let center_lng = (before_wgs84.lng + after_wgs84.lng) / 2;
let cetner_lat = (before_wgs84.lat + after_wgs84.lat) / 2;
let alt = (after_wgs84.alt + before_wgs84.alt) / 2;
let position = Utils.transformWGS842Cartesian({
lng: center_lng,
lat: cetner_lat,
alt: alt + 10,
});
let text = `${Cesium.Cartesian3.distance(before, after).toFixed(2)} m`;
entity.position = position;
entity.label.text = text;
},
debounce(fn, wait) {
clearTimeout(this.time);
this.time = null;
this.time = setTimeout(() => {
fn.apply(this, arguments);
this.destination.name = ''
}, wait);
},
save_line() {
let sourceType = null;
let nestId = null;
if (this.flag) {
sourceType = 2
nestId = this.form.nestId;
} else {
sourceType = 1
}
let points = this.airline.points;
let distance = points.reduce((total, item, index) => {
let dist = 0;
if (points[index + 1]) {
let cd = Cesium.Cartesian3.distance(
Utils.transformWGS842Cartesian({ lng: item.lon, lat: item.lat }),
Utils.transformWGS842Cartesian({
lng: points[index + 1].lon,
lat: points[index + 1].lat,
})
);
// dist = total + cd;
dist = cd;
}
console.log(distance, "distance");
return total + parseInt(dist);
}, 0);
this.airline.baseSpeed = Number(this.airline.baseSpeed)
let options = {
distance,
flightCourseJson: JSON.stringify(this.airline),
flightName: this.airline.filename,
pointCount: points.length,
time: parseInt(distance / this.airline.line.baseSpeed),
destination: this.destination.name,
lng: this.destination.lng,
lat: this.destination.lat,
labelIds: this.labvalue,
sourceType,
nestId
};
this.$emit("add", options);
},
handle_save_line() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.debounce(this.save_line, 1000);
} else {
return false;
}
});
},
async init_cesium_handler() {
let viewer = window.viewer;
let currentPoint;
// 修复规划航线时
viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(
Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK
);
if (data_srouce) {
data_srouce.entities.removeAll();
viewer.dataSources.remove(data_srouce, true);
data_srouce = null;
positions = [];
}
data_srouce = new Cesium.CustomDataSource("airway_edit");
await viewer.dataSources.add(data_srouce);
let entities = data_srouce.entities;
let polyline = entities.add({
polyline: {
material: Cesium.Color.RED,
width: 3,
positions: new Cesium.CallbackProperty(() => {
return positions.map((item) => {
let wgs84 = Utils.transformCartesian2WGS84(item);
return Utils.transformWGS842Cartesian({
lng: wgs84.lng,
lat: wgs84.lat,
alt: wgs84.alt + 10,
});
});
}, false),
},
});
// viewer.scene.globe.depthTestAgainstTerrain = true;
handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
handler.setInputAction(async (movement) => {
let windowPosition = movement.position;
let pickedObject = viewer.scene.pick(windowPosition);
if (this.isGetAddress) {
let position = Utils.getCartesian3FromPX(viewer, movement.position);
let wgs84 = Utils.transformCartesian2WGS84(position);
let address = await API.MAP.Regeo({
location: `${wgs84.lng},${wgs84.lat}`,
});
if (address) {
this.destination.name = address;
this.destination.lng = wgs84.lng;
this.destination.lat = wgs84.lat;
} else {
this.$el_message("地址解析失败", () => { }, "error");
}
this.isGetAddress = false;
return;
}
if (
Cesium.defined(pickedObject) &&
pickedObject.id?.name === "airline_point"
) {
// 航点编辑
let entity = pickedObject.id;
point_uuid = entity.id;
let points = this.airline.points;
let index = points.findIndex((item) => item.uuid === entity.id);
if (index > -1) {
point_index = index;
if (index + 1 < points.length) {
point_uuid_next = points[index + 1].uuid;
}
this.handler_current_point(index);
}
currentPoint = entity;
isEditting = true;
viewer.scene.screenSpaceCameraController.enableRotate = false;
viewer.scene.screenSpaceCameraController.enableZoom = false;
}
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
handler.setInputAction(async (movement) => {
let windowPosition = movement.position;
let pickedObject = viewer.scene.pick(windowPosition);
if (pickedObject) {
console.log("pickedObject", JSON.stringify(pickedObject.id.id));
}
if (this.isGetAddress) {
let position = Utils.getCartesian3FromPX(viewer, movement.position);
let wgs84 = Utils.transformCartesian2WGS84(position);
let address = await API.MAP.Regeo({
location: `${wgs84.lng},${wgs84.lat}`,
});
if (address) {
this.destination.name = address;
this.destination.lng = wgs84.lng;
this.destination.lat = wgs84.lat;
} else {
this.$el_message("地址解析失败", () => { }, "error");
}
this.isGetAddress = false;
return;
}
if (
Cesium.defined(pickedObject) &&
pickedObject.id?.name === "airline_point"
) {
// 航点编辑
// let entity = pickedObject.id;
// point_uuid = entity.id;
// let points = this.airline.points;
// let index = points.findIndex((item) => item.uuid === entity.id);
// if (index > -1) {
// point_index = index;
// if (index + 1 < points.length) {
// point_uuid_next = points[index + 1].uuid;
// }
// this.handler_current_point(index);
// }
// currentPoint = entity;
// isEditting = true;
// viewer.scene.screenSpaceCameraController.enableRotate = false;
// viewer.scene.screenSpaceCameraController.enableZoom = false;
} else {
// 航点添加
let position = Utils.getCartesian3FromPX(viewer, movement.position);
if (Cesium.defined(position) && this.visibleFlag) {
this.reset_form();
if (positions.length + 1) {
let points = this.airline.points;
if (this.action.curr_index <= points.length + 1) {
this.action.curr_index = points.length + 1;
} else {
this.action.curr_index += 1;
}
}
positions.push(position);
let wgs84 = Utils.transformCartesian2WGS84(position);
this.form.lon = wgs84.lng;
this.form.lat = wgs84.lat;
let uuid = (this.form.uuid = nanoid());
this.handle_save_point();
if (positions.length > 1) {
let before = positions[positions.length - 2];
let after = positions[positions.length - 1];
this.create_label(uuid, before, after);
}
this.create_point(uuid, position);
}
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
// 对鼠标移动事件的监听
handler.setInputAction((event) => {
if (isEditting && currentPoint) {
// let windowPosition = event.startPosition;
// let ellipsoid = viewer.scene.globe.ellipsoid;
// let cartesian = viewer.camera.pickEllipsoid(windowPosition, ellipsoid);
let cartesian = Utils.getCartesian3FromPX(
viewer,
event.startPosition
);
if (!cartesian) {
return;
}
currentPoint.position = cartesian;
if (!(typeof point_index == undefined) && positions?.length > 1) {
positions[point_index] = cartesian;
let current_wgs84 = Utils.transformCartesian2WGS84(cartesian);
this.airline.points[point_index].lon = current_wgs84.lng;
this.airline.points[point_index].lat = current_wgs84.lat;
if (point_index === this.action.curr_index) {
this.form.lon = current_wgs84.lng;
this.form.lat = current_wgs84.lat;
}
if (point_index > 0) {
this.update_label(
point_uuid,
cartesian,
positions[point_index - 1]
);
}
if (point_uuid_next) {
this.update_label(
point_uuid_next,
cartesian,
positions[point_index + 1]
);
}
}
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
// 对鼠标抬起事件的监听
handler.setInputAction((event) => {
point_index = null;
point_uuid_next = null;
isEditting = false;
currentPoint = undefined;
// viewer.render()
setTimeout(() => {
viewer.scene.screenSpaceCameraController.enableRotate = true;
viewer.scene.screenSpaceCameraController.enableZoom = true;
}, 300);
}, Cesium.ScreenSpaceEventType.LEFT_UP);
},
destroy_cesium_handler() {
let viewer = window.viewer;
viewer.scene.globe.depthTestAgainstTerrain = false;
if (handler) {
handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
// handler && handler.destroy() && (handler = null);
handler = null;
}
if (data_srouce) {
console.log(data_srouce, 'data_srouce');
data_srouce.entities.removeAll();
// viewer.dataSources.remove(data_srouce, true);
data_srouce = null;
positions = [];
}
},
handle_pick() {
this.isGetAddress = true;
},
handle_query_address_async(address, cb) {
API.MAP.Geo({ keywords: address })
.then((res) => {
cb(res.data.data.rows);
})
.catch((e) => cb([]));
},
handle_select_address(item) {
if (item) {
let location = item.location.split(",");
this.destination.name = item.name;
this.destination.lng = Number(location[0]);
this.destination.lat = Number(location[1]);
let cesium_layer = this.g_cesium_layer();
let viewer = cesium_layer.viewer();
let potiion = Utils.transformWGS842Cartesian({
lng: this.destination.lng,
lat: this.destination.lat,
alt: 1000,
});
viewer.camera.flyTo({
destination: potiion,
});
this.init_location_icon(potiion);
}
},
init_location_icon(position) {
let cesium_layer = this.g_cesium_layer();
let viewer = cesium_layer.viewer();
if (location_icon) {
location_icon.position = position;
} else {
location_icon = viewer.entities.add({
position,
billboard: {
width: 36,
height: 36,
image: require("@/assets/images/icons/icon_location.png"),
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.Bottom,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
},
});
}
},
destroy_location_icon() {
if (!location_icon) {
return location_icon;
}
let cesium_layer = this.g_cesium_layer();
let viewer = cesium_layer.viewer();
viewer.entities.remove(location_icon);
location_icon = null;
},
async get_air_space_list() {
let res = await API.AIRSPACE.GetNotFlyAreas();
res.forEach((item) => {
let positions = item.region.split(" ").join(",").split(",");
if (positions.length > 0) {
}
let hierarchy = Cesium.Cartesian3.fromDegreesArray(positions);
let position = Cesium.BoundingSphere.fromPoints(hierarchy).center;
if (item.regionType === "POLYGON") {
if (positions.length % 2 !== 0) return;
if (item.typeId === 1) {
var entity = viewer.entities.add({
name: "Red polygon on surface",
position,
label: {
text: item.name,
font: "14px monospace",
horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian2(5, 5),
disableDepthTestDistance: Number.POSITIVE_INFINITY,
},
polygon: {
hierarchy,
material: Cesium.Color.RED.withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.BLACK,
},
});
noFlyEntities.push(entity);
}
}
});
},
async get_electric_fence_list() {
let res = await API.AIRSPACE.GetAreaList();
res.forEach((item) => {
let positions = item.region.split(" ").join(",").split(",");
if (item.regionType === "POLYGON") {
if (positions.length % 2 !== 0) return;
let hierarchy = Cesium.Cartesian3.fromDegreesArray(positions);
let position = Cesium.BoundingSphere.fromPoints(hierarchy).center;
if (item.typeId === 2) {
var entity = viewer.entities.add({
name: "Red polygon on surface",
position,
label: {
text: item.name,
font: "14px monospace",
horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian2(5, 5),
disableDepthTestDistance: Number.POSITIVE_INFINITY,
},
polygon: {
hierarchy,
material: Cesium.Color.GREEN.withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.BLACK,
},
});
electricFenceEntities.push(entity);
}
}
});
},
async get_institutional_fence_list() {
let res = await API.AIRSPACE.GetCurrentAreaList();
res.forEach((item) => {
let positions = item.region.split(" ").join(",").split(",");
if (item.regionType === "POLYGON") {
if (positions.length % 2 !== 0) return;
let hierarchy = Cesium.Cartesian3.fromDegreesArray(positions);
let position = Cesium.BoundingSphere.fromPoints(hierarchy).center;
if (item.typeId === 2) {
var entity = viewer.entities.add({
name: "Red polygon on surface",
position,
label: {
text: item.name,
font: "14px monospace",
horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian2(5, 5),
disableDepthTestDistance: Number.POSITIVE_INFINITY,
},
polygon: {
hierarchy,
material: Cesium.Color.CYAN.withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.BLACK,
},
});
electricFenceEntities.push(entity);
}
}
});
},
clear_entities() {
noFlyEntities.forEach((item) => {
viewer.entities.remove(item);
});
electricFenceEntities.forEach((item) => {
viewer.entities.remove(item);
});
noFlyEntities = [];
electricFenceEntities = [];
},
change_close() {
let viewer = window.viewer;
viewer.scene.globe.depthTestAgainstTerrain = false;
// this.change_page();
},
},
computed: {
...mapGetters(["user_info"]),
cesium_layer() {
return this.g_cesium_layer();
},
},
inject: ["g_cesium_layer"],
};
</script>
<style lang="scss" scoped>
@import "~@/styles/var.scss";
@import "~@/styles/mixins.scss";
@import "~@/styles/form.scss";
// /deep/.el-scrollbar {
// width: 355px !important;
// }
// /deep/.el-select-dropdown {
// /deep/.el-scrollbar {
// /deep/.el-select-dropdown__wrap {
// width: 355px !important;
// }
// }
// }
::v-deep {
.el-select {
width: 355px;
.el-input {
height: 100%;
}
}
}
.cpt-command-airway-edit {
position: absolute;
left: 100px;
top: 140px;
width: 600px;
height: 770px;
box-sizing: border-box;
background: url("~@/assets/images/plate_bg_01.png") no-repeat;
background-size: 100% 100%;
z-index: 4;
.img-close {
position: absolute;
right: 30px;
top: 20px;
cursor: pointer;
&:hover {
opacity: 0.7;
}
}
.title-box {
height: 56px;
box-sizing: border-box;
padding-left: 112px;
position: relative;
display: flex;
justify-content: space-between;
margin-right: 80px;
.title {
font-family: PangMenZhengDao;
font-size: 22px;
color: #dce9ff;
font-weight: 400;
// line-height: 3.2;
margin-right: 30px;
}
.select {
font-family: PangMenZhengDao;
font-size: 22px;
color: #00ffff;
text-align: center;
font-weight: 400;
}
&::before {
content: " ";
display: block;
position: absolute;
height: 1px;
left: 0;
bottom: 0;
right: 0;
background-image: linear-gradient(270deg,
rgba(0, 117, 221, 0) 0%,
#3ea4d5 50%,
rgba(0, 117, 221, 0) 100%);
}
}
.ctx-box {
margin-top: 10px;
height: calc(100% - 56px - 80px);
box-sizing: border-box;
overflow: auto;
.form-box {
::v-deep .el-form {
.divider {
@include linear_gradient_border(0, auto, 0, 0);
height: 12px;
}
.el-form-item {
.item-group {
display: flex;
align-items: center;
.unit {
font-family: MicrosoftYaHeiUI;
font-size: 18px;
color: rgb(179, 201, 203);
font-weight: 400;
margin-left: 12px;
}
.iconfont {
color: rgb(179, 201, 203);
font-size: 30px;
margin-left: 0.3em;
cursor: pointer;
}
.el-icon-location-outline {
color: rgb(179, 201, 203);
font-size: 30px;
margin-left: 0.3em;
cursor: pointer;
}
}
.el-form-item__label {
font-family: Microsoft YaHei;
font-size: 16px;
color: #ccedff;
text-align: right;
font-weight: 400;
}
.el-select-dropdown {
min-width: 356px !important;
}
.el-input {
width: 356px;
height: 40px;
.el-input__inner {
width: 100%;
font-family: MicrosoftYaHeiUI;
font-size: 15px;
color: #08c2d1;
background: rgba(2, 31, 51, 0.7);
border: 1px solid #06b6e0;
}
}
.el-input-number {
width: 356px;
.el-input-number__decrease,
.el-input-number__increase {
bottom: 1px;
opacity: 0.5;
background: #06b6e0;
color: #f5f7fa;
border-radius: 0;
border: none;
}
.el-input-number__decrease {
left: 1px;
}
.el-input-number__increase {
right: px;
}
}
}
}
}
}
.bottom-box {
box-sizing: border-box;
// padding-bottom: 20px;
// height: 88px;
display: flex;
justify-content: space-evenly;
align-items: center;
@include linear_gradient_border(0, auto, 0, 0);
.iconfont {
cursor: pointer;
font-size: 44px;
color: #08c2d1;
}
}
// 动作列表
.action-list {
position: fixed;
left: 40%;
top: 30%;
background: rgba(0, 23, 79, 0.7);
box-shadow: 0 2px 4px 0 rgba(1, 162, 255, 0.35),
inset 0 0 40px 0 rgba(0, 184, 255, 0.5);
border-radius: 13px;
.header {
display: flex;
justify-content: space-between;
align-items: center;
height: 44px;
background: rgba(16, 65, 215, 0.2);
box-shadow: inset 0 0 15px 0 rgba(0, 182, 255, 0.6);
border-radius: 10px 10px 0 0;
}
.hd-box {
font-family: MicrosoftYaHei-Bold;
font-size: 18px;
color: #00ffff;
letter-spacing: 0;
font-weight: 700;
margin-left: 20px;
}
.actions-box {
.title-box {
display: flex;
align-items: center;
.title {
font-size: 24px;
width: 120px;
}
}
.list-box {
max-height: 210px;
overflow: auto;
margin-top: 12px;
padding: 0 20px;
::v-deep {
.el-input-number {
margin-left: 180px;
.el-input {
width: 180px;
}
}
}
.action-item {
display: flex;
align-items: center;
justify-content: space-between;
border-top: 1px solid #fff;
box-sizing: border-box;
padding: 12px;
&:hover {
background-color: #ccc;
}
.item-inner {
display: flex;
align-items: center;
}
.iconfont {
color: red;
cursor: pointer;
font-size: 20px;
}
}
}
}
.footer {
display: flex;
justify-content: center;
margin-top: 20px;
margin-bottom: 10px;
}
}
.right-box {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
font-weight: 400;
// line-height: 3.8;
margin-top: 10px;
font-family: PangMenZhengDao;
font-size: 18px;
color: #00ffff;
text-align: right;
font-weight: 400;
.before-point {
margin-right: 12px;
}
.before-point,
.after-point {
cursor: pointer;
user-select: none;
margin-left: 15px;
&.disabled {
cursor: not-allowed;
}
}
.no {
margin: 0 10px;
}
}
}
</style>
<style lang="scss">
</style>
\ No newline at end of file
<template>
<div class="cpt-nest-dialog">
<div class="dialog-ctx" :style="containerStyle" :class="{ collapse,changeHeightStyle }">
<div v-if="showTitle" class="dialog-title">
{{ title }}
<div class="nav__left">
<slot name="nav__left"></slot>
</div>
<div class="nav__right " @click='handleClose'>
<slot name="nav__right"></slot>
</div>
</div>
<div class="dialog-bd">
<slot></slot>
</div>
<img v-if="isCollapse" @click="collapse = !collapse" src="~@/assets/images/observe/fckernel/collapse.png"
class="icon-collapse" />
<div class="wih100 h24 pa bottom0 nest-dialog_bottom cp pt5 tc" @click='changeHeight'>
<div class="w24 h24 dib " :class="changeHeightStyle ? 'xbStyle':'' "> <img src="~@/assets/images/observe/fckernel/xb.png" alt=""> </div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
title: {
type: String,
default: () => "",
},
showTitle: {
type: Boolean,
default: () => false,
},
containerStyle: {
type: Object,
default: () => ({}),
},
isCollapse: {
type: Boolean,
default: () => true,
},
isCollapse2: {
type: Boolean,
default: () => false,
}
},
data() {
return {
collapse: false,
changeHeightStyle: false
};
},
methods: {
changeHeight() {
this.changeHeightStyle = !this.changeHeightStyle
},
handleClose() {
this.$emit("close");
},
},
};
</script>
<style lang="scss" scoped>
.cpt-nest-dialog {
position: absolute;
width: 100%;
z-index: 99;
.nest-dialog_bottom {
background: rgba(13, 82, 143, 0.60);
}
.changeHeightStyle {
height: 637px !important;
}
.xbStyle{
transform:rotateX(141deg) ;
}
.dialog-ctx {
position: absolute;
width: 476px;
height: 648px;
background: rgba(9, 32, 87, 0.70);
border: 1px solid #70DAF9;
background-position: center;
background-repeat: no-repeat;
background-size: 100% 100%;
top: 90px;
left: 116px;
box-sizing: border-box;
display: flex;
flex-direction: column;
transform: translateY(0);
transition: 0.3s;
&.collapse {
transform: translateX(-100%);
}
.dialog-title {
width: 100%;
height: 32px;
line-height: 32px;
background-image: linear-gradient(180deg, #9198FF 0%, rgba(45, 81, 153, 0.22) 40%, #05091A 100%);
border: 1px solid #70DAF9;
box-shadow: inset 0 0 10px 2px #3F9DFF;
flex-shrink: 0;
margin: 0 auto;
background-size: 100% 100%;
color: #fff;
text-align: center;
font-family: Microsoft YaHei;
font-weight: bold;
font-size: 16px;
color: #92d9ff;
letter-spacing: 0;
text-align: center;
font-weight: 700;
position: relative;
.nav__left {
position: absolute;
left: 0;
top: 0;
bottom: 0;
}
.nav__right {
position: absolute;
right: 0;
top: 0;
bottom: 0;
}
}
.dialog-bd {
flex: 1;
box-sizing: border-box;
overflow: auto;
}
.icon-close {
position: absolute;
top: 15px;
right: 13px;
font-size: 18px;
color: #2edfff;
cursor: pointer;
&:hover {
opacity: 0.8;
}
}
.icon-collapse {
position: absolute;
right: -24px;
top: 50%;
transform: translateY(-50%);
height: 80px;
z-index: 1;
cursor: pointer;
}
}
}
</style>
\ No newline at end of file
<template>
<svg class="symbol-svg-icon" aria-hidden="true">
<use :xlink:href="iconName"></use>
</svg>
</template>
<script>
import "@/assets/fonts/ali/iconfont.js";
export default {
name: "symbol-icon",
props: {
icon: {
type: String,
required: true,
},
},
computed: {
iconName() {
return `#icon-${this.icon}`;
},
},
};
</script>
<style>
.symbol-svg-icon {
width: 28px;
height: 28px;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
</style>
\ No newline at end of file
<!-- 飞控中心头部 -->
<template>
<div class="cpt-fckernel-header">
<div class="title">飞控中心</div>
<div class="nav-list"
@click="go_home">
<div class="nav-item"
v-for="(item, index) in list"
:key="item.id"
:class="`${index <= list.length / 2 - 1 ? '_1' : '_2'} ${
curr_val === item.id ? 'selected' : undefined
}`"
@click.stop="handle_change_nav(item)">
<div class="text-box">{{ item.label }}</div>
</div>
</div>
<div class="date-box">
<div class="yyyy">{{ date}}</div>
<div class="week-box">
<div class="week">{{ week }}</div>
<div class="hhmm">{{ time }}</div>
</div>
</div>
</div>
</template>
<script>
import dayjs from "dayjs";
export default {
props: {
value: {
type: Number | String,
default: 0,
},
},
data () {
return {
now: null,
curr_val: 0,
list: [
{ id: 1, label: "无人机应用" },
{ id: 2, label: "鹰巢应用" },
],
week_map: {
0: "天",
1: "一",
2: "二",
3: "三",
4: "四",
5: "五",
6: "六",
},
};
},
watch: {
value: {
handler (value) {
this.curr_val = value;
},
deep: true,
immediate: true,
},
},
methods: {
handle_change_nav (item) {
if(item.id==1){
this.$store.commit("device/SET_VIDEO", false);
}else{}
this.curr_val = item.id;
this.$emit("input", this.curr_val);
this.$emit("nav-click", item);
},
go_home () {
let { href } = this.$router.resolve({ path: "/home" });
window.open(href, "_self");
setTimeout(() => {
this.$router.go(0);
}, 100);
},
},
computed: {
date () {
let { now } = this;
return now ? `${now.format("YYYY/MM/DD")}` : "0000/00/00";
},
week () {
let { now, week_map } = this;
return now ? `周${week_map[now.day()]}` : "周N/A";
},
time () {
let { now } = this;
return now ? `${now.format("HH:mm")}` : "00:00";
},
},
mounted () {
setInterval(() => {
this.now = dayjs();
}, 500);
},
created () {
this.now = dayjs();
},
};
</script>
<style lang="scss" scoped>
.cpt-fckernel-header {
height: 91px;
background-color: black;
position: fixed;
top: 0;
left: 0;
right: 0;
background: center url("~@/assets/images/observe/fckernel/01_header_bg.png")
no-repeat;
background-size: cover;
.title {
font-size: 32px;
font-family: Microsoft YaHei;
font-weight: bold;
text-align: center;
line-height: 80px;
background-image: linear-gradient(0deg, #e3aa77, #f9ecd3, #e3aa77);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.nav-list {
width: 590px;
height: 77px;
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
display: flex;
justify-content: space-between;
.nav-item {
width: 223px;
height: 77px;
box-sizing: border-box;
background: center url("~@/assets/images/observe/fckernel/nav-item.png")
no-repeat;
background-size: cover;
text-align: center;
cursor: pointer;
transition: 0.3s;
&:hover,
&.selected {
background: center
url("~@/assets/images/observe/fckernel/nav-item-selected.png")
no-repeat;
.text-box {
color: #3df1ff;
}
}
.text-box {
line-height: 77px;
font-family: Microsoft YaHei Bold;
font-size: 20px;
color: #aab8d1;
font-weight: 700;
transition: 0.3s;
}
&._2 {
transform: scaleX(-1);
.text-box {
transform: scaleX(-1);
}
}
}
}
.date-box {
display: flex;
flex-direction: column;
justify-content: center;
position: absolute;
left: 20px;
top: 0;
height: 60px;
box-sizing: border-box;
.yyyy {
font-family: Microsoft YaHei;
font-size: 16px;
color: #ffffff;
letter-spacing: 0;
font-weight: 400;
margin-bottom: 3px;
}
.week-box {
display: flex;
justify-content: space-between;
.week {
font-family: Microsoft YaHei;
font-size: 16px;
color: #ffffff;
letter-spacing: 0;
font-weight: 400;
}
.hhmm {
font-family: Microsoft YaHei;
font-size: 16px;
color: #ffffff;
letter-spacing: 0;
font-weight: 400;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="nset_control_box">
<div class="nset_control_box_header lh34">
<slot name="nset__left" ></slot>
<slot name="nset__right" ></slot>
</div>
<div class="nset_control_box_area p10 pb30" :class="{changeHeightStyle}">
<slot></slot>
</div>
<div @click='changeHeight' class="wih100 h24 pa bottom0 cp nset_control_box_bottom tc">
<div class="w24 h24 dib " :class="changeHeightStyle ? 'xbStyle':'' "> <img
src="~@/assets/images/observe/fckernel/xb.png" alt=""> </div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
changeHeightStyle: false
}
},
methods: {
changeHeight() {
this.changeHeightStyle = !this.changeHeightStyle
},
},
}
</script>
<style lang="scss" scoped>
.nset_control_box {
min-height: 200px;
background: rgba(9, 32, 87, 0.70);
border: 1px solid #70DAF9;
position: absolute;
left: calc(50% - 352px);
top: 70px;
min-width: 700px;
.nset_control_box_header {
display: flex;
justify-content: space-between;
height: 32px;
background-image: linear-gradient(180deg, #9198FF 0%, rgba(45, 81, 153, 0.22) 40%, #05091A 100%);
border: 1px solid #70DAF9;
box-shadow: inset 0 0 10px 2px #3F9DFF;
}
.nset_control_box_bottom {
background: rgba(13, 82, 143, 0.60);
}
.xbStyle {
transform: rotateX(141deg);
}
.changeHeightStyle {
height: 300px;
}
}
</style>
\ No newline at end of file
<template>
<div class="w440 h177 noticeBox">
<div class="headerBox" v-interact>
<div class=" jcsb">
<div class="jcsb title">
<div style="border:1px solid #FFBD36;background-color:#FFBD36 ; " class="w1 h16 mr10"></div>
{{ title }}
</div>
<div class="cp" @click="$emit('exit')" style="color: #70DAF9;">
关闭
</div>
</div>
</div>
<div class="contant pt34 ">
<div class="mb34 cf pl22 pr22">
{{ content }}
</div>
<div class="jcsb pl76 pr76">
<div class="w122 h32 tc lh32 cf cp btn" @click="$emit('close')">{{ leftText }}</div>
<div v-if="flag" class="w122 h32 tc lh32 cf cp btn ml10 mr10" @click="$emit('qzjg')">强制接管</div>
<div class="w122 h32 tc lh32 cf cp btn" @click="$emit('handle')">{{ rightText }}</div>
</div>
</div>
</div>
</template>
<script>
import API from "@/api";
export default {
data() {
return {
}
},
props: {
title: {
'type': String,
default: '提示'
},
content: {
'type': String,
default: '某某某某某某某某某某某某单位请求接管000000无人机无人机无人机'
},
leftText: {
'type': String,
default: '拒绝'
},
rightText: {
'type': String,
default: '同意'
},
flag:{
'type': Boolean,
default: ()=>{ false}
}
},
methods: {
},
}
</script>
<style lang="scss" scoped>
.noticeBox {
position: absolute;
left: 50%;
top: 40%;
transform: translateX(-50%);
z-index: 99;
background: rgba(9, 32, 87, 0.70);
border: 1px solid #70DAF9;
.headerBox {
background-image: linear-gradient(180deg, #9198FF 0%, rgba(45, 81, 153, 0.22) 40%, #05091A 100%);
border: 1px solid #70DAF9;
box-shadow: inset 0 0 10px 2px #3F9DFF;
padding: 5px 14px;
.title {
font-family: MicrosoftYaHei-Bold;
font-size: 16px;
color: #70DAF9;
letter-spacing: 0;
font-weight: 700;
}
}
.contant {
height: 146px;
text-align: center;
.btn {
background-image: linear-gradient(180deg, #9198FF 0%, rgba(45, 81, 153, 0.22) 40%, #05091A 100%);
border: 1px solid #70DAF9;
box-shadow: inset 0 0 10px 2px #3F9DFF;
}
}
}
</style>
\ No newline at end of file
...@@ -6,6 +6,7 @@ import ElementUI from "element-ui"; ...@@ -6,6 +6,7 @@ import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css"; import "element-ui/lib/theme-chalk/index.css";
// import MMCSTL from 'mmc-stl-vue2'; // import MMCSTL from 'mmc-stl-vue2';
import MMCSTL from '../../index'; import MMCSTL from '../../index';
// import MMCSTL from '../../dist/index';
// Vue.config.productionTip = false // Vue.config.productionTip = false
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论