| | |
| | | ENV = 'development' |
| | | |
| | | # å¼åç¯å¢ |
| | | # VUE_APP_BASE_API = 'http://192.168.11.203/prod-api' |
| | | # VUE_APP_BASE_API = '/dev-api/' |
| | | |
| | | # www api |
| | | # VUE_APP_BASE_API = '/dev-api' |
| | | VUE_APP_BASE_API = 'http://192.168.11.203:80/prod-api/' |
| | | # è·¯ç±æå è½½ |
| | | VUE_CLI_BABEL_TRANSPILE_MODULES = true |
| | | |
| | | # å端æ¥å£å°å |
| | | # VUE_APP_SERVER_API_URL = 'http://192.168.11.51:8080' |
| | | # www api |
| | | # VUE_APP_SERVER_API_URL = 'http://192.168.11.58:8080' |
| | | |
| | | VUE_APP_SERVER_API_URL = 'http://192.168.11.203:80' |
| | | |
| | | # Mqttæ¶æ¯æå¡å¨è¿æ¥å°å |
| | |
| | | console.log(location) |
| | | console.log(location); |
| | | const host = location.origin; |
| | | |
| | | const config = { |
| | | apiServices: "http://192.168.11.24:12316/server/", |
| | | imageUrl: "", |
| | | sdkImg: host+"/visual/CimSDK/" |
| | | }; |
| | |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
| | | <link rel="icon" href="<%= BASE_URL %>logo.png"> |
| | | |
| | | <script src="CimSDK/Workers/jquery-3.5.0.min.js"></script> |
| | | <script src="CimSDK/Workers/layui/layui.js"></script> |
| | | <script src="CimSDK/CimSDK.min.js"></script> |
| | | <link rel="stylesheet" href="CimSDK/Workers/layui/css/layui.css"> |
| | | <link rel="stylesheet" href="CimSDK/CimSDK.min.css"> |
| | | <script src="./config/config.js"></script> |
| | | <script src="/visual/CimSDK/Workers/jquery-3.5.0.min.js"></script> |
| | | <script src="/visual/CimSDK/Workers/layui/layui.js"></script> |
| | | <script src="/visual/CimSDK/CimSDK.min.js"></script> |
| | | <link rel="stylesheet" href="/visual/CimSDK/Workers/layui/css/layui.css"> |
| | | <link rel="stylesheet" href="/visual/CimSDK/CimSDK.min.css"> |
| | | <script src="/config/config.js"></script> |
| | | <title> |
| | | <%= webpackConfig.name %> |
| | | </title> |
| | |
| | | params: query, |
| | | }); |
| | | } |
| | | export function modelDownloadFile(query) { |
| | | return request({ |
| | | url: 'model/downloadFile', |
| | | method: 'get', |
| | | params: query, |
| | | }); |
| | | export function modelDownloadFile(params) { |
| | | request.post('model/downloadFile', params, { responseType: 'blob' }).then((res) => { |
| | | const { data, headers } = res; |
| | | console.log(headers); |
| | | const fileName = headers['Content-Disposition'].replace(/\w+;filename=(.*)/, '$1'); |
| | | const blob = new Blob([data], { type: headers['Content-Type'] }); |
| | | let dom = document.createElement('a'); |
| | | let url = window.URL.createObjectURL(blob); |
| | | dom.href = url; |
| | | dom.download = decodeURI(fileName); |
| | | dom.style.display = 'none'; |
| | | document.body.appendChild(dom); |
| | | dom.click(); |
| | | dom.parentNode.removeChild(dom); |
| | | window.URL.revokeObjectURL(url); |
| | | }); |
| | | // return request({ |
| | | // url: 'model/downloadFile?guid=' + query, |
| | | // responseType: 'blob', |
| | | // }).then((res) => { |
| | | // const { data, headers } = res; |
| | | // const fileName = headers['Content-Disposition'].replace(/\w+;filename=(.*)/, '$1'); |
| | | // const blob = new Blob([data], { type: headers['Content-Type'] }); |
| | | // let dom = document.createElement('a'); |
| | | // let url = window.URL.createObjectURL(blob); |
| | | // dom.href = url; |
| | | // dom.download = decodeURI(fileName); |
| | | // dom.style.display = 'none'; |
| | | // document.body.appendChild(dom); |
| | | // dom.click(); |
| | | // dom.parentNode.removeChild(dom); |
| | | // window.URL.revokeObjectURL(url); |
| | | // }); |
| | | } |
| | | export function modelDownloadetaReq(query) { |
| | | return request({ |
| | | url: 'model/downloadMetaReq', |
| | | method: 'post', |
| | | data: query, |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | |
| | | export function modelSelectMetasByPage(query) { |
| | | return request({ |
| | | url: 'model/selectMetasByPage', |
| | | method: 'get', |
| | | params: query, |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import mapServer from '../../utils/mapServer/mapServer'; |
| | | |
| | | //é
ç½æ¥å£ => æ¥è¯¢ææ |
| | | export function zhangzitou_selectAllLine(params) { |
| | | return mapServer.get('/zhangzitou/selectAllLine', { params: params }); |
| | | } |
| | |
| | | const menuManager = { |
| | | pid: null, |
| | | pointFly: null, |
| | | colorAll: { |
| | | point: SmartEarth.Cesium.Color.fromCssColorString('#ff0000'), |
| | | polyline: SmartEarth.Cesium.Color.fromCssColorString('#ffff0050'), |
| | | polygon: SmartEarth.Cesium.Color.fromCssColorString('#ffff0050'), |
| | | }, |
| | | init(res) { |
| | | switch (res.pid) { |
| | | case 's1': //é
ç½å·¡æ£ |
| | |
| | | setMenuS5(res) { |
| | | switch (res.id) { |
| | | case 'a1': |
| | | case 'a3': |
| | | if (this.pointFly) { |
| | | this.pointFly.removeFromMap(); |
| | | } else { |
| | | earthCtrl.factory.createSimpleGraphic('billboard', {}, (entity) => { |
| | | const position = entity.position.getValue(); |
| | | const coordinate = earthCtrl.core.toDegrees(position); |
| | | this.pointFly = earthCtrl.camera.rotateCamera({ |
| | | lon: coordinate.lon, |
| | | lat: coordinate.lat, |
| | | distance: 1000, |
| | | pitch: -30, |
| | | }); |
| | | }); |
| | | } |
| | | return null; |
| | | break; |
| | | case 'a2': |
| | | return res.name; |
| | | break; |
| | | case 'a3': |
| | | earthCtrl.analysis.createIndoormode({ showHelp: true }); |
| | | return null; |
| | | break; |
| | | |
| | | default: |
| | | return null; |
| | | break; |
| | |
| | | }, |
| | | // æ ç» |
| | | setMenuS7(res) { |
| | | switch (res.id) { |
| | | case 'a1': |
| | | earthCtrl.factory.createSimpleGraphic('point', {}, (entity) => {}); |
| | | break; |
| | | case 'a2': |
| | | earthCtrl.factory.createSimpleGraphic('label', {}, (entity) => {}); |
| | | break; |
| | | case 'a3': |
| | | earthCtrl.factory.createSimpleGraphic('polyline', { showSize: false }, (entity) => {}); |
| | | break; |
| | | case 'a4': |
| | | earthCtrl.factory.createSimpleGraphic('rectangle', { showSize: false }, (entity) => {}); |
| | | break; |
| | | case 'a5': |
| | | earthCtrl.factory.createSimpleGraphic('polygon', { showSize: false }, (entity) => {}); |
| | | break; |
| | | case 'a6': |
| | | earthCtrl.factory.SimpleGraphic.clear(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | return null; |
| | | }, |
| | | // æµé |
| | | setMenuS8(res) { |
| | | return null; |
| | | const colorAll = this.colorAll; |
| | | switch (res.id) { |
| | | case 'a1': |
| | | earthCtrl.measure.clampLineDistance(colorAll, (e) => {}); |
| | | break; |
| | | case 'a2': |
| | | earthCtrl.measure.altitude(colorAll, (e) => {}); |
| | | break; |
| | | case 'a3': |
| | | earthCtrl.measure.surfaceArea( |
| | | { |
| | | ...colorAll, |
| | | tin: true, // æ¯å¦æ¾ç¤ºtinä¸è§ç½ |
| | | onlyTerrain: false, // æ¯å¦åªæµéç²¾ç»å°å½¢ |
| | | }, |
| | | (e) => {} |
| | | ); |
| | | break; |
| | | case 'a4': |
| | | earthCtrl.measure.planeArea(colorAll, (e) => {}); |
| | | break; |
| | | case 'a5': |
| | | earthCtrl.measure.horizontalDistance(colorAll, (e) => {}); |
| | | break; |
| | | case 'a6': |
| | | earthCtrl.measure.clearResult(); |
| | | break; |
| | | } |
| | | }, |
| | | // ç¹æ |
| | | setMenuS9(res) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import axios from "axios"; |
| | | const mapServer = axios.create({ |
| | | // axiosä¸è¯·æ±é
ç½®æbaseURLé项ï¼è¡¨ç¤ºè¯·æ±URLå
Œ
±é¨å |
| | | baseURL: config.apiServices, |
| | | // è¶
æ¶ |
| | | timeout: -1 |
| | | }); |
| | | export default mapServer; |
| | | |
| | |
| | | v-hasPermi="['iot:modelLibrary:add']">ä¿®æ¹</el-button> --> |
| | | <!-- <el-button size="small" type="danger" style="padding: 5px" icon="el-icon-delete" |
| | | v-hasPermi="['iot:modelLibrary:remove']">å é¤</el-button> --> |
| | | <el-button size="small" @click="setModelLibraryExport(scope.row)" type="warning" style="padding: 5px" icon="el-icon-download" |
| | | <el-button size="small" @click="setModelLibraryExport(scope.row)" type="warning" |
| | | style="padding: 5px" icon="el-icon-download" |
| | | v-hasPermi="['iot:modelLibrary:export']">ä¸è½½</el-button> |
| | | <!-- <el-button size="small" type="success" style="padding: 5px" |
| | | icon="el-icon-monitor">é¢è§</el-button> --> |
| | |
| | | <el-button>å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <iframe id="downFrame" ref="myIfream" src="" |
| | | style="display: none; border: 0; padding: 0; height: 0; width: 0"></iframe> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | modelSelectMappers, |
| | | modelInsertFiles, |
| | | modelDeleteMetas, |
| | | modelDownloadFile |
| | | modelDownloadFile, |
| | | modelDownloadetaReq, |
| | | } from '@/api/iot/modelLibrary'; |
| | | import { saveAs } from 'file-saver' |
| | | import configTools from '../../../assets/js/configTools'; |
| | | import { getToken } from "@/utils/auth"; |
| | | import $ from 'jquery' |
| | | import axios from 'axios'; |
| | | import request from '@/utils/request'; |
| | | export default { |
| | | name: 'modelLibirary', |
| | | dicts: ['iot_model_library_type'], |
| | |
| | | type: [{ required: true, message: 'è¯·éæ©æ¨¡åç±»å«', trigger: 'change' }], |
| | | path: [{ required: true, message: 'è¯·éæ©éè¦ä¸ä¼ çæ¨¡åæä»¶', trigger: 'change' }], |
| | | }, |
| | | multipleSelection: [] |
| | | multipleSelection: [], |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | setModelLibraryExport(row){ |
| | | modelDownloadFile({guid:row.guid}).then((response)=>{ |
| | | |
| | | }) |
| | | setModelLibraryExport(row) { |
| | | modelDownloadetaReq({ ids: [row.id] }).then((response) => { |
| | | if (response.code == 200) { |
| | | this.setModelDownloadFile(response.msg) |
| | | } else { |
| | | this.$message(response.msg); |
| | | } |
| | | }) |
| | | }, |
| | | setModelDownloadFile(res) { |
| | | const url = process.env.VUE_APP_BASE_API + "model/downloadFile?&guid=" + res |
| | | axios.get(url, { |
| | | headers: { |
| | | "Authorization": "Bearer " + getToken(), |
| | | "Content-Type": "application/x-www-form-urlencoded", |
| | | }, |
| | | responseType: "blob", |
| | | }).then(response => { |
| | | if (!response.headers) return |
| | | var elink = document.createElement('a'); |
| | | // 使ç¨å端æä¾çæä»¶å å½å |
| | | const fileName = response.headers['content-disposition'].split("''")[1]; |
| | | console.log(fileName); |
| | | elink.style.display = 'none'; |
| | | // æä»¶ä¸è½½å°åèµå¼ |
| | | elink.href = window.URL.createObjectURL(response.data); |
| | | let str = fileName; |
| | | if (fileName.indexOf("UTF-8''") > -1) { |
| | | str = fileName.replace("UTF-8''", '') |
| | | } |
| | | elink.download = str; |
| | | elink.click(); |
| | | this.$message({ |
| | | message: 'æä»¶å¯¼åºæå', |
| | | type: 'success' |
| | | }); |
| | | }) |
| | | }, |
| | | // æ·»å ä¸ç»´æ¨¡å |
| | | setModelLibraryAdd() { |
| | |
| | | this.title = ''; |
| | | this.setFromRest(); |
| | | document.getElementById('fileInput').value = ""; |
| | | this.selectMappers = null; |
| | | }, |
| | | setSsubmitForm(formName) { |
| | | if (!this.selectMappers) { |
| | | this.$message('ä¸ç»´æ¨¡åæªä¸ä¼ æ æ³æ°å¢'); |
| | | } |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | this.setModelInsertFiles(this.selectMappers) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div v-loading="loading" class="modelLibiraryBox"> |
| | | <el-card> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px" |
| | | style="margin-bottom: -20px"> |
| | | <el-form-item label="æå¡åç§°" prop="name"> |
| | | <el-input v-model="queryParams.name" placeholder="请è¾å
¥æ¨¡ååç§°" clearable size="small" |
| | | @keyup.enter.native="setQueryParamsQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="æå¡ç±»å«" prop="type"> |
| | | |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" |
| | | @click="setQueryParamsQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="setQueryParamsRest">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-card> |
| | | <el-card class="modelLibiraryContent"> |
| | | <div class="modelLibiraryTable"> |
| | | <el-table :data="templateList" border @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column label="模ååç§°" align="center" prop="name" /> |
| | | <el-table-column label="模åç±»å" align="center" prop="type" /> |
| | | <el-table-column label="模å大å°" align="center" prop="sizes" :formatter="formatterSize" /> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" :formatter="formatterTime" /> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width" width="240"> |
| | | <template slot-scope="scope"> |
| | | |
| | | <el-button v-show="!scope.row.url" size="small" @click="setModelLibraryExport(scope.row)" |
| | | type="success" style="padding: 5px" icon="el-icon-position" |
| | | v-hasPermi="['iot:modelLibrary:export']">åå¸</el-button> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false"> |
| | | <el-form ref="modelFrom" :model="modelFrom" :rules="rules" label-width="80px"> |
| | | <!-- <el-form-item label="模ååç§°" prop="name"> |
| | | <el-input v-model="modelFrom.name"></el-input> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item label="模åç±»å«" prop="type"> |
| | | <el-select v-model="modelFrom.type" style="width: 100%" placeholder="è¯·éæ©æ¨¡åç±»å«" clearable |
| | | size="small"> |
| | | <el-option v-for="dict in dict.type.iot_model_library_type" :key="dict.value" |
| | | :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> --> |
| | | <el-form-item label="模åå°å" prop="path"> |
| | | <div style="display: flex"> |
| | | <div style="flex: 1"> |
| | | <input style="display: none" @change="setFileChange" id="fileInput" type="file" |
| | | accept=".zip"></input> |
| | | <el-input disabled v-model="modelFrom.path" /> |
| | | </div> |
| | | <div style="margin-left: 10px"> |
| | | <el-link style="margin: 0px 10px" title="éæ©" :underline="false" icon="el-icon-plus" |
| | | @click="setFileCheck"></el-link> |
| | | <el-link style="margin: 0px 10px" title="ä¸ä¼ " :underline="false" icon="el-icon-upload2" |
| | | @click="setFileInset"></el-link> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="æè¿°"> |
| | | <el-input v-model="modelFrom.bak"></el-input> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <!-- <el-button type="primary" v-show="modelFrom.ids">ä¿® æ¹</el-button> --> |
| | | <el-button type="primary" @click="setSsubmitForm('modelFrom')">æ° å¢</el-button> |
| | | <el-button>å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import configTools from '../../../assets/js/configTools'; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { |
| | | modelSelectMetasByPage |
| | | } from '@/api/iot/modelServer'; |
| | | |
| | | export default { |
| | | name: 'modelserver', |
| | | |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | queryParams: { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | name: null, |
| | | type: null, |
| | | }, |
| | | // æ¯å¦ä¸ºç§æ· |
| | | isTenant: false, |
| | | templateList: [ |
| | | |
| | | ], |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | title: '', |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | modelFrom: { |
| | | name: '', |
| | | type: '', |
| | | path: '', |
| | | bak: '', |
| | | ids: '', |
| | | }, |
| | | selectPath: null, |
| | | selectMappers: null, |
| | | //表åéªè¯ |
| | | rules: { |
| | | name: [ |
| | | { |
| | | required: true, |
| | | message: '模ååç§°ä¸è½ä¸ºç©º', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | type: [{ required: true, message: 'è¯·éæ©æ¨¡åç±»å«', trigger: 'change' }], |
| | | path: [{ required: true, message: 'è¯·éæ©éè¦ä¸ä¼ çæ¨¡åæä»¶', trigger: 'change' }], |
| | | }, |
| | | multipleSelection: [], |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.init(); |
| | | }, |
| | | methods: { |
| | | init() { |
| | | if (this.$store.state.user.roles.indexOf('tenant') !== -1) { |
| | | this.isTenant = true; |
| | | } |
| | | |
| | | this.getList(); |
| | | }, |
| | | getSelectPath() { |
| | | modelSelectPath().then((response) => { |
| | | if (response.code == 200 && response.msg) { |
| | | this.selectPath = response.msg; |
| | | } else { |
| | | this.$message('模åä¸ä¼ è·¯å¾è·å失败: ' + response.msg); |
| | | } |
| | | }); |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.multipleSelection = val; |
| | | }, |
| | | //æ¥è¯¢ |
| | | setQueryParamsQuery() { |
| | | this.queryParams.pageIndex = 1; |
| | | this.getList(); |
| | | }, |
| | | // éç½® |
| | | setQueryParamsRest() { |
| | | this.queryParams = { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | name: null, |
| | | type: null, |
| | | } |
| | | this.getList(); |
| | | }, |
| | | // æç´¢ |
| | | getList() { |
| | | modelSelectMetasByPage(this.queryParams).then((response) => { |
| | | if (response.code == 200) { |
| | | |
| | | this.total = response.data.length; |
| | | this.templateList = response.data; |
| | | } else { |
| | | this.$message('æ¨¡åæ°æ®å表è·å失败ã'); |
| | | } |
| | | }) |
| | | }, |
| | | setModelLibraryRemove() { |
| | | if (this.multipleSelection.length <= 0) { |
| | | return this.$message('è¯·éæ©è¦å é¤çæ°æ®'); |
| | | } |
| | | const std = []; |
| | | this.multipleSelection.filter((response) => { |
| | | std.push(response.id); |
| | | }) |
| | | modelDeleteMetas({ ids: std.toString() }).then((response) => { |
| | | if (response.code == 200) { |
| | | this.$message({ |
| | | message: 'ä¸ç»´æ¨¡åå 餿å', |
| | | type: 'success' |
| | | }); |
| | | this.setQueryParamsQuery(); |
| | | } else { |
| | | this.$message('ä¸ç»´æ¨¡åå é¤å¤±è´¥'); |
| | | } |
| | | }) |
| | | }, |
| | | setModelLibraryExport(row) { |
| | | modelDownloadetaReq({ ids: [row.id] }).then((response) => { |
| | | if (response.code == 200) { |
| | | this.setModelDownloadFile(response.msg) |
| | | } else { |
| | | this.$message(response.msg); |
| | | } |
| | | }) |
| | | }, |
| | | setModelDownloadFile(res) { |
| | | axios.get(process.env.VUE_APP_BASE_API + "model/downloadFile?guid=" + res, { |
| | | responseType: 'blob', |
| | | headers: this.headers |
| | | }).then((response) => { |
| | | if (response.status === 200) { |
| | | var elink = document.createElement('a'); |
| | | console.log(response.headers['content-disposition']); |
| | | debugger |
| | | // 使ç¨å端æä¾çæä»¶å å½å |
| | | // const fileName = response.headers['content-disposition'].split('=')[1]; |
| | | // elink.style.display = 'none'; |
| | | // // æä»¶ä¸è½½å°åèµå¼ |
| | | // elink.href = window.URL.createObjectURL(response.data); |
| | | // let str = fileName; |
| | | // if (fileName.indexOf("UTF-8''") > -1) { |
| | | // str = fileName.replace("UTF-8''", '') |
| | | // } |
| | | // elink.download = str; |
| | | // elink.click(); |
| | | // this.$message({ |
| | | // message: 'æä»¶å¯¼åºæå', |
| | | // type: 'success' |
| | | // }); |
| | | } |
| | | }) |
| | | }, |
| | | // æ·»å ä¸ç»´æ¨¡å |
| | | setModelLibraryAdd() { |
| | | this.setFromRest(); |
| | | this.open = true; |
| | | this.title = 'æ·»å ä¸ç»´æ¨¡å'; |
| | | }, |
| | | setModelLibraryCannel() { |
| | | this.open = false; |
| | | this.title = ''; |
| | | this.setFromRest(); |
| | | document.getElementById('fileInput').value = ""; |
| | | this.selectMappers = null; |
| | | }, |
| | | setSsubmitForm(formName) { |
| | | if (!this.selectMappers) { |
| | | this.$message('ä¸ç»´æ¨¡åæªä¸ä¼ æ æ³æ°å¢'); |
| | | } |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | this.setModelInsertFiles(this.selectMappers) |
| | | } else { |
| | | console.log('error submit!!'); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | setModelInsertFiles(res) { |
| | | modelInsertFiles(JSON.stringify(res)).then((response) => { |
| | | if (response.code == 200) { |
| | | this.$message({ |
| | | message: 'ä¸ç»´æ¨¡åæ·»å æå', |
| | | type: 'success' |
| | | }); |
| | | this.setModelLibraryCannel(); |
| | | this.setQueryParamsQuery(); |
| | | } else { |
| | | this.$message('ä¸ç»´æ¨¡åæ·»å 失败'); |
| | | } |
| | | }) |
| | | }, |
| | | // æä»¶éæ© |
| | | setFileCheck() { |
| | | document.getElementById('fileInput').click(); |
| | | }, |
| | | |
| | | setFileChange() { |
| | | const inputFile = document.getElementById('fileInput').files; |
| | | if (inputFile.length > 0) { |
| | | this.modelFrom.path = inputFile[0].name; |
| | | } else { |
| | | this.$message('è·åä¸ä¼ æä»¶ä¿¡æ¯å¤±è´¥ï¼è¯·éæ°å°è¯'); |
| | | } |
| | | }, |
| | | // æä»¶ä¸ä¼ |
| | | setFileInset() { |
| | | if (!this.selectPath) { |
| | | this.getSelectPath(); |
| | | } |
| | | var formData = new FormData(); |
| | | const fs = document.getElementById('fileInput').files; |
| | | for (var i = 0, c = fs.length; i < c; i++) { |
| | | formData.append(fs[i].name, fs[i]); // fs.files[i].name,file |
| | | } |
| | | modelUploadFiles(this.selectPath, formData).then((response) => { |
| | | if (response.code == 200) { |
| | | this.$message({ |
| | | message: 'æ°æ®ä¸ä¼ æå', |
| | | type: 'success' |
| | | }); |
| | | this.setModelSelectMappers() |
| | | } else { |
| | | this.$message('æ°æ®ä¸ä¼ 失败'); |
| | | } |
| | | }) |
| | | }, |
| | | setModelSelectMappers() { |
| | | if (!this.selectPath) { |
| | | this.getSelectPath(); |
| | | } |
| | | this.selectMappers = null; |
| | | modelSelectMappers({ path: this.selectPath }).then((response) => { |
| | | if (response.code == 200) { |
| | | this.selectMappers = response.data; |
| | | } else { |
| | | this.$message('æ°æ®æ å°æ¥è¯¢å¤±è´¥'); |
| | | } |
| | | }) |
| | | }, |
| | | // 表åéç½® |
| | | setFromRest() { |
| | | this.modelFrom = { |
| | | name: '', |
| | | type: '', |
| | | path: '', |
| | | bak: '', |
| | | ids: '', |
| | | }; |
| | | }, |
| | | formatterSize(row, column, cellValue, index) { |
| | | return configTools.formatterSize(cellValue); |
| | | }, |
| | | formatterTime(row, column, cellValue, index) { |
| | | if (cellValue) { |
| | | return configTools.formatterTime(cellValue); |
| | | } else { |
| | | return null |
| | | } |
| | | |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .modelLibiraryBox { |
| | | padding: 6px; |
| | | width: 100%; |
| | | height: 100%; |
| | | position: absolute; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .modelLibiraryContent { |
| | | margin: 6px 0px; |
| | | flex: 1; |
| | | position: relative; |
| | | |
| | | ::v-deep .el-card__body { |
| | | padding: 15px !important; |
| | | } |
| | | |
| | | .modelLibiraryTable { |
| | | width: calc(100% - 30px); |
| | | height: calc(100% - 36px); |
| | | position: absolute; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | export default {}; |
| | | export default { |
| | | |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | <layer-manager ref="layerManager"></layer-manager> |
| | | <location ref="location"></location> |
| | | <knowledge ref="knowledge"></knowledge> |
| | | <lineRoaming ref="lineRoaming"></lineRoaming> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import menuManager from '@/assets/js/mapSdk/menuManager.js'; |
| | | import location from './location.vue'; |
| | | import knowledge from './knowledge.vue'; |
| | | import lineRoaming from './lineRoaming.vue'; |
| | | |
| | | export default { |
| | | name: 'mapView', |
| | | components: { layerManager, location, knowledge }, |
| | | components: { layerManager, location, knowledge, lineRoaming }, |
| | | data() { |
| | | return { |
| | | menuIsShow: false, |
| | |
| | | this.setPopCloseAll(); |
| | | const obj = menuManager.init(command); |
| | | if (obj) { |
| | | |
| | | this.setPopShow(obj); |
| | | |
| | | } |
| | | }, |
| | | setPopCloseAll() { |
| | |
| | | break; |
| | | case 'ç¥è¯å¾è°±': |
| | | this.$refs && this.$refs.knowledge && this.$refs.knowledge.open(); |
| | | break; |
| | | case '线路漫游': |
| | | this.$refs && this.$refs.lineRoaming && this.$refs.lineRoaming.open(); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | |
| | | .menuBox { |
| | | position: absolute; |
| | | z-index: 99999; |
| | | z-index: 40; |
| | | top: 20px; |
| | | right: 2px; |
| | | border-radius: 0 6px 6px 0; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <Popup ref="pop" top="20px" left="calc(100% - 600px)" :title="title" @close="close(true)" width="300px" :maxHeight="'700px'" @cancel="close(false)"> |
| | | <div class="menuBox"> |
| | | <el-form ref="form" label-width="80px"> |
| | | <el-form-item label="线路:"> |
| | | |
| | | </el-form-item> |
| | | <el-form-item label="线路:"> |
| | | |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button size="mini" >å¼å§æ¼«æ¸¸</el-button> |
| | | <el-button size="mini" >ç»ææ¼«æ¸¸</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </Popup> |
| | | </template> |
| | | |
| | | <script> |
| | | import Popup from '@/components/Tool/Popup.vue'; |
| | | import { |
| | | zhangzitou_selectAllLine |
| | | } from '@/api/mapView/map.js' |
| | | export default { |
| | | name: 'location', |
| | | components: { Popup }, |
| | | data() { |
| | | return { |
| | | title: '线路漫游', |
| | | }; |
| | | }, |
| | | |
| | | |
| | | methods: { |
| | | // å
³éå¼¹çª |
| | | close(isCloseBtn, removeLayer = true) { |
| | | // removeLayer && this.removeImageLayer(); |
| | | // éç½®dataå¼ |
| | | Object.assign(this.$data, this.$options.data()); |
| | | !isCloseBtn && this.$refs.pop.close(); |
| | | }, |
| | | // æå¼å¼¹çª |
| | | open() { |
| | | this.close(true); |
| | | this.$refs.pop.open(); |
| | | this.romaLineStart(); |
| | | }, |
| | | romaLineStart(){ |
| | | zhangzitou_selectAllLine({ |
| | | limit: 100000, |
| | | page: 1 |
| | | }).then((response)=>{ |
| | | console.log(response); |
| | | }) |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style></style> |
| | |
| | | <template> |
| | | <Popup ref="pop" top="20px" left="calc(100% - 600px)" :title="title" @close="close(true)" width="300px" @cancel="close(false)"> |
| | | <el-tree></el-tree> |
| | | <Popup ref="pop" top="20px" left="calc(100% - 600px)" :maxHeight="'700px'" :title="title" @close="close(true)" width="300px" @cancel="close(false)"> |
| | | <div> |
| | | <el-form label-width="60px" ref="modelFrom" :model="modelFrom" :rules="rules" append-to-body :close-on-click-modal="false"> |
| | | <el-form-item label="ç»åº¦" prop="lon"> |
| | | <el-input v-model="modelFrom.lon"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="纬度" prop="lat"> |
| | | <el-input v-model="modelFrom.lat"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="é«åº¦" prop="alt"> |
| | | <el-input v-model="modelFrom.alt"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" style="float: right; margin-right: 10px; margin-bottom: 10px" class="dialog-footer"> |
| | | <el-button type="primary" @click="setSsubmitForm('modelFrom')">å® ä½</el-button> |
| | | </div> |
| | | </div> |
| | | </Popup> |
| | | </template> |
| | | |
| | |
| | | data() { |
| | | return { |
| | | title: 'åæ å®ä½', |
| | | billboard: null, |
| | | |
| | | modelFrom: { |
| | | lon: '', |
| | | lat: '', |
| | | alt: '', |
| | | }, |
| | | rules: { |
| | | lon: [ |
| | | { |
| | | required: true, |
| | | message: 'ç»åº¦ä¸è½ä¸ºç©º', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | lat: [ |
| | | { |
| | | required: true, |
| | | message: '纬度ä¸è½ä¸ºç©º', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | alt: [ |
| | | { |
| | | required: true, |
| | | message: 'é«åº¦ä¸è½ä¸ºç©º', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | close(isCloseBtn, removeLayer = true) { |
| | | // removeLayer && this.removeImageLayer(); |
| | | // éç½®dataå¼ |
| | | this.setRemoveBillboard(); |
| | | Object.assign(this.$data, this.$options.data()); |
| | | !isCloseBtn && this.$refs.pop.close(); |
| | | |
| | | }, |
| | | // æå¼å¼¹çª |
| | | open() { |
| | | this.close(true); |
| | | this.$refs.pop.open(); |
| | | }, |
| | | setRemoveBillboard() { |
| | | if (this.billboard) { |
| | | Viewer.entities.remove(this.billboard); |
| | | this.billboard = null; |
| | | } |
| | | }, |
| | | setSsubmitForm(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | this.setRemoveBillboard(); |
| | | |
| | | const url = config.sdkImg + 'Workers/image/mark.png'; |
| | | console.log(url); |
| | | this.billboard = Viewer.entities.add({ |
| | | position: Cesium.Cartesian3.fromDegrees(this.modelFrom.lon, this.modelFrom.lat), // 设置å®ä½å¨å°çä¸çä½ç½® |
| | | billboard: { |
| | | image: url, // è®¾ç½®ä½ æ³æ¾ç¤ºçå¾ç |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 设置å¾çå¨å®ä½ä¸çä½ç½® |
| | | disableDepthTestDistance: Number.POSITIVE_INFINITY, // ç¦ç¨æ·±åº¦æµè¯ï¼ç¡®ä¿ä¸è¢«å°å½¢é®æ¡ |
| | | }, |
| | | }); |
| | | earthCtrl.userScene.flyTo(this.billboard); |
| | | } else { |
| | | console.log('error submit!!'); |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |