12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583 |
- <template>
- <div class="tool">
- <ul class="func">
- <li
- v-for="(item, index) in funcList"
- :key="index"
- :class="{ active: item.active }"
- @click="toolClickHandle(item)"
- >
- <p></p>
- <!-- {{ item.label }} -->
- </li>
- </ul>
- <div
- :class="{ help: true, active: helpActive }"
- v-show="false"
- @click="showHelp"
- ></div>
- <!-- 展示索引页面 -->
- <van-popup
- v-model:show="indexesShow"
- :class="'indexesListContent'"
- :style="{ background: 'transparent' }"
- :close-on-click-overlay="false"
- :closed="hideIndexesInfoDailog"
- >
- <!-- closeable
- close-icon="close" -->
- <div class="indexesList">
- <!-- <div class="header">
- <span>青浦行政服务中心</span>
- </div> -->
- <div class="listContent">
- <div class="header">
- <!-- <span>青浦行政服务中心</span> -->
- </div>
- <!-- <div class="title_container">
- <ul>
- <li
- v-for="(item, index) in cameraInfo"
- :key="index"
- :class="{ active: item.active }"
- @click="changeFloor(item)"
- >
- {{ item.name }}
- </li>
- </ul>
- </div> -->
- <div class="list_container">
- <div>
- <div
- class="first_content"
- v-for="(item, index) in cameraInfo"
- :key="index"
- >
- <div class="title">{{ item.name }}</div>
- <ul>
- <li
- v-for="(item_, index_) in item.children"
- :key="index_"
- :class="{ active: item_.active }"
- @click="changeView(item_)"
- >
- {{ item_.name }}
- </li>
- </ul>
- </div>
- </div>
- <!-- <ul>
- <li
- v-for="(item, index) in cameraInfoChildren"
- :key="index"
- :class="{ active: item.active }"
- @click="changeView(item)"
- >
- {{ item.name }}
- </li>
- </ul> -->
- </div>
- </div>
- </div>
- <div
- class="close"
- @click="hideIndexesInfoDailog"
- ></div>
- </van-popup>
- <!-- 展示点位文字信息 -->
- <van-popup
- v-model:show="pointShow"
- class="point_popup"
- :style="{ background: 'transparent' }"
- :close-on-click-overlay="false"
- :closed="hidePointInfoDailog"
- >
- <div class="pointInfoContent">
- <div v-html="pointInfos"></div>
- </div>
- <div
- class="close"
- @click="hidePointInfoDailog"
- ></div>
- </van-popup>
- <!-- 展示平面图 -->
- <van-popup
- v-model:show="planeShow"
- class="plane_popup"
- :style="{ background: 'transparent' }"
- :close-on-click-overlay="false"
- :closed="hidePlaneInfoDailog"
- >
- <!-- :style="{
- height: '460px',
- width: '100%',
- top: '55%',
- background: 'transparent',
- }" -->
- <div class="plane_container">
- <div class="image_container">
- <ul>
- <li
- v-for="(item, index) in planeArr"
- :key="index"
- v-show="item.active"
- >
- <img
- :src="item.src"
- alt=""
- />
- </li>
- <div
- class="close"
- @click="hidePlaneInfoDailog"
- ></div>
- </ul>
- </div>
- <div class="image_header">
- <ul>
- <li
- v-for="(item, index) in planeArr"
- :key="index"
- :class="{ active: item.active }"
- @click="choosePlane(index)"
- >
- {{ item.name }}
- </li>
- </ul>
- </div>
- </div>
- </van-popup>
- <!-- 展示帮助 -->
- <van-popup
- v-model:show="helpShow"
- class="help_popup"
- :style="{
- height: '180px',
- width: '75%',
- top: '50%',
- background: 'transparent'
- }"
- :close-on-click-overlay="false"
- :closed="hideHelpInfoDailog"
- >
- <div class="help_container">
- <div class="header">提示</div>
- <div class="content">
- 1. 选择模型中“ <span></span> ”可以移动,支持360°旋转
- <div>2. 使用工具栏内“索引”功能,可快速切换场景</div>
- </div>
- </div>
- <div
- class="close"
- @click="hideHelpInfoDailog"
- ></div>
- </van-popup>
- <!-- 展示点位可办事项 -->
- <van-popup
- v-model:show="doThingShow"
- class="doThing_popup"
- :style="{ background: 'transparent' }"
- :close-on-click-overlay="false"
- :closed="hidePointInfoDailog"
- >
- <div class="content">
- <div
- class="doThingFirstContent"
- v-if="doThingFirst.length != 0 && Object.getOwnPropertyNames(doThingSecond).length == 0"
- >
- <div class="header">部门</div>
- <div class="list">
- <ul>
- <li
- v-for="(item, index) in doThingFirst"
- :key="index"
- @click="chooseDBSecond(item)"
- >
- <span>{{ item.unit }}</span>
- <span v-if="item.chiles">({{ item.chiles.length }})</span>
- </li>
- </ul>
- </div>
- </div>
- <div
- class="doThingSecondContent"
- v-if="Object.getOwnPropertyNames(doThingSecond).length != 0"
- >
- <div class="header">青浦区{{ doThingSecond.unit }}</div>
- <div class="list">
- <van-collapse
- v-model="activeNames"
- accordion
- >
- <div
- v-for="(item, index) in doThingSecond.chiles"
- :key="index"
- >
- <van-collapse-item
- :title="item.name"
- :name="index + 1 + ''"
- v-if="item.chiles[0].name.length != 0"
- >
- <ul>
- <li
- v-for="(item_, index_) in item.chiles"
- :key="index_"
- @click="searchInfoAndJump(item_)"
- >
- {{ item_.name }}
- </li>
- </ul>
- </van-collapse-item>
- <span
- class="item"
- @click="searchInfoAndJump(item.chiles[0])"
- v-else
- >
- {{ item.name }}
- </span>
- </div>
- </van-collapse>
- </div>
- </div>
- </div>
- <div
- class="close"
- @click="closeDoThingPopup"
- ></div>
- <!-- v-if="Object.getOwnPropertyNames(doThingSecond).length == 0" -->
- <div
- class="back"
- @click="backDoThingPopup"
- v-if="Object.getOwnPropertyNames(doThingSecond).length != 0"
- ></div>
- </van-popup>
- <!-- 事项库 -->
- <van-popup
- v-model:show="showEventState"
- class="plane_popup"
- :style="{
- background: 'transparent'
- }"
- :close-on-click-overlay="false"
- :closed="hideEventListDailog"
- >
- <div class="plane_container_event">
- <div
- class="close"
- @click="hideEventListDailog"
- ></div>
- <div class="paramsBox">
- 关键字:<input
- type="text"
- v-model="eventData.params.where"
- /> 当前页:<input
- type="number"
- v-model="eventData.params.page"
- />
- 每页数:<input
- type="number"
- v-model="eventData.params.pageSize"
- />
- <div class="paramBtuBox">
- <div
- class="paramBtu"
- @click="reSetParam()"
- >重置</div>
- <div
- class="paramBtu"
- @click="showEvent()"
- >查询</div>
- </div>
- </div>
- <p
- v-for="(item, index) in eventData.data"
- :key="'event_' + index"
- >
- <span
- v-if="(item.link_ck || item.jsfs_ck) && (item.link_ws || item.jsfs_ws)"
- @click="windowOpenNewPage(item.link_ws || item.jsfs_ws)"
- >{{ item.link_ck || item.jsfs_ck }}</span>
- </p>
- </div>
- </van-popup>
- <van-popup
- v-model:show="tipsShow"
- class="tips"
- ><van-icon
- name="warning-o"
- style="color:red;margin-right:5px"
- />当前选项暂不支持跳转</van-popup>
- </div>
- </template>
- <script>
- import { postform } from "../utils/request.js";
- export default {
- data() {
- return {
- indexesTitleShow: false,
- indexesTitleStr: "",
- funcList: [],
- viewClickHandle: null,
- indexesShow: false,
- pointShow: false,
- planeShow: false,
- showEventState: false, // 事项库弹窗显示状态
- eventData: {
- url: systemConfig.eventUrl,
- data: [],
- params: {
- tableName: "ywtb_auditfwzn",
- page: 1,
- pageSize: 20,
- where: "",
- },
- },
- helpShow: false,
- doThingShow: false,
- pointInfos: "",
- doThingFirst: [],
- doThingSecond: {},
- Exection: null,
- cameraInfo: systemConfig.pointInfo.camera,
- mark: systemConfig.pointInfo.mark,
- positionPoint: systemConfig.positionPoint,
- cameraInfoChildren: [],
- planeArr: [
- {
- name: "一层1F",
- src: "./static/images/plane/plane1.png",
- active: true,
- },
- {
- name: "二层2F",
- src: "./static/images/plane/plane2.png",
- active: false,
- },
- {
- name: "三层3F",
- src: "./static/images/plane/plane3.png",
- active: false,
- },
- ],
- activeNames: "0",
- helpActive: false,
- tipsShow: false,
- };
- },
- mounted() {
- let that = this;
- this.funcList = [
- {
- label: "热点",
- changeActive: true,
- active: true,
- clickFunc: this.loadPoint,
- },
- {
- label: "索引",
- changeActive: true,
- active: false,
- clickFunc: this.showIndexes,
- },
- {
- label: "漫游",
- changeActive: true,
- active: false,
- clickFunc: this.lookaround,
- },
- {
- label: "复位",
- changeActive: false,
- active: false,
- clickFunc: this.setViewDefaultlocation,
- },
- {
- label: "平面图",
- changeActive: true,
- active: false,
- clickFunc: this.showPlane,
- },
- // {
- // label: "事项库",
- // changeActive: true,
- // active: false,
- // clickFunc: this.showEvent,
- // },
- ];
- window.cancelLookAround = this.cancelLookAround;
- setTimeout(() => {
- that.loadPoint(that.funcList[0]);
- that.loadPositionPoint();
- }, 1000);
- },
- methods: {
- // 事项库跳转
- windowOpenNewPage(linkUrl) {
- if (linkUrl) {
- window.location.href = linkUrl;
- }
- },
- // 工具栏点击事件
- toolClickHandle(item) {
- if (item.changeActive) item.active = !item.active;
- item.clickFunc(item);
- },
- // 暂无功能的提示
- undefinedFunction() {
- this.$toast("功能暂未开通");
- },
- // 展示索引弹窗
- showIndexes() {
- this.cameraInfo = this.cameraInfo.map(function (tdd) {
- tdd.active = false;
- return tdd;
- });
- this.cameraInfo[0].active = true;
- this.cameraInfoChildren = this.cameraInfo[0].children;
- this.indexesShow = true;
- },
- // 索引页面关闭
- hideIndexesInfoDailog() {
- this.indexesShow = false;
- this.funcList[1].active = false;
- },
- // 展示平面图弹窗
- showPlane() {
- this.planeShow = true;
- },
- hidePlaneInfoDailog() {
- this.planeShow = false;
- this.funcList[4].active = false;
- },
- // 事项库查询条件重置
- reSetParam() {
- this.eventData.params.where = "";
- this.eventData.params.page = 1;
- this.eventData.params.pageSize = 20;
- this.showEvent();
- },
- // 展示事项库弹窗
- showEvent() {
- let params_ = Object.assign({}, this.eventData.params);
- if (params_.where) {
- params_.where =
- "link_ck like '%" +
- params_.where +
- "%' or jsfs_ck like '%" +
- params_.where +
- "%'";
- }
- if (params_.page > 0) {
- params_.page -= 1;
- }
- postform(this.eventData.url, params_).then((res) => {
- if (!this.showEventState) {
- this.showEventState = true;
- }
- if (res.code == 200) {
- this.eventData.data = res.content;
- } else {
- this.eventData.message = res.message;
- }
- });
- },
- hideEventListDailog() {
- this.showEventState = false;
- this.funcList[5].active = false;
- },
- // 帮助弹窗
- showHelp() {
- this.helpShow = true;
- },
- hideHelpInfoDailog() {
- this.helpShow = false;
- },
- // 漫游
- lookaround(item) {
- let that = this;
- // 清除场景激活
- clearSceneActive();
- this.$store.commit("changeFenceng", true);
- hideTitle();
- // 关闭热点
- if (this.funcList[0].active == true) {
- this.funcList[0].active = false;
- this.funcList[0].clickFunc(this.funcList[0]);
- }
- // 叫号隐藏
- if (closeJH) closeJH();
- if (hideJH) hideJH();
- closeHull(0);
- unbindLimitCameraFunc();
- if (!item.active) {
- this.cancelLookAround();
- return;
- }
- let options = {
- lng: 121.12275503870025,
- lat: 31.153914277622604,
- pitch: -35,
- height: 140,
- };
- // rotateCamera({lng:121.12275503870025, lat:31.153914277622604, pitch: -35, height: 140});
- // // 相机绕点环绕飞行
- // function rotateCamera(options){
- var position = Cesium.Cartesian3.fromDegrees(
- options.lng,
- options.lat,
- 0.0
- );
- // 相机看点的角度,如果大于0那么则是从地底往上看,所以要为负值,这里取-30度
- var pitch = Cesium.Math.toRadians(options.pitch);
- // 给定飞行一周所需时间,比如30s, 那么每秒转动度数
- var angle = 360 / systemConfig.roveTime;
- // 给定相机距离点多少距离飞行
- var distance = options.height;
- var startTime = Cesium.JulianDate.fromDate(new Date());
- var stopTime = Cesium.JulianDate.addSeconds(
- startTime,
- 30,
- new Cesium.JulianDate()
- );
- globalVariable.viewer.clock.startTime = startTime.clone(); // 开始时间
- globalVariable.viewer.clock.stopTime = stopTime.clone(); // 结速时间
- globalVariable.viewer.clock.currentTime = startTime.clone(); // 当前时间
- globalVariable.viewer.clock.clockRange = Cesium.ClockRange.CLAMPED; // 行为方式
- globalVariable.viewer.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK; // 时钟设置为当前系统时间; 忽略所有其他设置。
- // 相机的当前heading
- var initialHeading = globalVariable.viewer.camera.heading;
- this.Exection = function TimeExecution() {
- // 当前已经过去的时间,单位s
- var delTime = Cesium.JulianDate.secondsDifference(
- globalVariable.viewer.clock.currentTime,
- globalVariable.viewer.clock.startTime
- );
- // 根据过去的时间,计算偏航角的变化
- var heading = Cesium.Math.toRadians(delTime * angle) + initialHeading;
- globalVariable.viewer.camera.lookAt(
- position,
- new Cesium.HeadingPitchRange(heading, pitch, distance)
- );
- if (
- Cesium.JulianDate.compare(
- globalVariable.viewer.clock.currentTime,
- globalVariable.viewer.clock.stopTime
- ) >= 0
- ) {
- that.cancelLookAround();
- }
- };
- globalVariable.viewer.clock.onTick.addEventListener(that.Exection);
- },
- cancelLookAround() {
- this.$store.commit("changeFenceng", false);
- returnDefault();
- if (this.Exection) {
- globalVariable.viewer.clock.onTick.removeEventListener(this.Exection);
- this.Exection = null;
- globalVariable.viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
- }
- bindLimitCameraFunc();
- this.funcList[2].active = false;
- // 叫号显示
- if (showJH) showJH();
- if (openJH) openJH();
- },
- // 复位
- setViewDefaultlocation(time) {
- // 清除场景激活
- clearSceneActive();
- // 取消漫游
- this.cancelLookAround();
- showTitle("大门");
- return new Promise((resolve, reject) => {
- this.$flyTo({
- lon: systemConfig.mapDefault.center.lon,
- lat: systemConfig.mapDefault.center.lat,
- h: systemConfig.mapDefault.height,
- heading: systemConfig.mapDefault.heading,
- pitch: systemConfig.mapDefault.pitch,
- roll: systemConfig.mapDefault.roll,
- time: 1,
- pitchAdjustHeight: 1000,
- callback: function () {},
- }).then(() => {
- resolve();
- });
- });
- },
- // 加载点位
- loadPoint(param) {
- let that = this;
- // function getGuid() {
- // return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
- // /[xy]/g,
- // function (c) {
- // var r = (Math.random() * 16) | 0,
- // v = c == "x" ? r : (r & 0x3) | 0x8;
- // return v.toString(16);
- // }
- // );
- // }
- // return;
- if (param.active) {
- if (globalVariable.hotMarkerArr.length == 0) {
- this.mark.map(function (item, index) {
- // item.name;
- // item.param.lon;
- // item.param.lat;
- // item.param.h;
- // item.type;
- let position = Cesium.Cartesian3.fromDegrees(
- item.param.lon,
- item.param.lat,
- // item.param.lat,
- item.param.h
- );
- let id = "entity_" + index;
- if (item.img.indexOf("gif") > -1) {
- let entity = globalVariable.viewer.entities.add({
- id: id,
- position: position,
- // billboard: {
- // width: item.sizeW,
- // height: item.sizeH,
- // scale: 1.0,
- // horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
- // verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
- // pixelOffset: new Cesium.Cartesian2(0, 0),
- // scaleByDistance: new Cesium.NearFarScalar(20, 0.6, 30, 0.8),
- // },
- // point: {
- // show: true, //是否显示,默认显示
- // pixelSize: 15,
- // },
- label: {
- text: item.name,
- font: "15pt Source Han Sans CN", //字体样式
- fillColor: Cesium.Color.WHITE, //字体颜色
- backgroundColor: Cesium.Color.fromCssColorString("#00000066"), //背景颜色
- showBackground: true, //是否显示背景颜色
- style: Cesium.LabelStyle.FILL, //label样式
- outlineWidth: 2,
- outlineColor: Cesium.Color.fromCssColorString("#00000066"), //背景颜色
- verticalOrigin: Cesium.VerticalOrigin.BOTTOM, //垂直位置
- horizontalOrigin: Cesium.HorizontalOrigin.CENTER, //水平位置
- pixelOffset: new Cesium.Cartesian2(0, -20), //偏移
- },
- });
- entity.infos = item;
- entity.callback = that.pointClickHandle;
- globalVariable.point_positions[id] = entity;
- globalVariable.hotMarkerArr.push(entity);
- // that.analysisImage(item.img, entity);
- } else {
- let entity = globalVariable.viewer.entities.add({
- id: id,
- position: position,
- // billboard: {
- // image: item.img,
- // width: item.sizeW,
- // height: item.sizeH,
- // scale: 1.0,
- // horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
- // verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
- // pixelOffset: new Cesium.Cartesian2(0, 0),
- // },
- label: {
- text: item.name,
- font: "15pt Source Han Sans CN", //字体样式
- fillColor: Cesium.Color.WHITE, //字体颜色
- backgroundColor: Cesium.Color.fromCssColorString("#00000066"), //背景颜色
- showBackground: true, //是否显示背景颜色
- style: Cesium.LabelStyle.FILL, //label样式
- outlineWidth: 2,
- outlineColor: Cesium.Color.fromCssColorString("#00000066"), //背景颜色
- verticalOrigin: Cesium.VerticalOrigin.BOTTOM, //垂直位置
- horizontalOrigin: Cesium.HorizontalOrigin.CENTER, //水平位置
- pixelOffset: new Cesium.Cartesian2(0, 23), //偏移
- },
- });
- entity.infos = item;
- entity.callback = that.pointClickHandle;
- globalVariable.point_positions[id] = entity;
- globalVariable.hotMarkerArr.push(entity);
- }
- // that.addGIF2(item, position, id);
- });
- } else {
- if (globalVariable.hotMarkerArr.length > 0)
- globalVariable.hotMarkerArr.map(function (item) {
- item.show = true;
- });
- }
- } else {
- if (globalVariable.hotMarkerArr.length > 0)
- globalVariable.hotMarkerArr.map(function (item) {
- item.show = false;
- });
- }
- return;
- globalVariable.viewer.scene.postRender.addEventListener(function () {
- globalVariable.hotMarkerArr.map(function (item) {
- var canvasPosition =
- globalVariable.viewer.scene.cartesianToCanvasCoordinates(
- item._position._value,
- new Cesium.Cartesian2()
- );
- if (
- Cesium.defined(canvasPosition) &&
- !isNaN(canvasPosition.x) &&
- !isNaN(canvasPosition.y)
- ) {
- document.getElementsByClassName(item.id)[0].style.display = "block";
- if (!document.getElementsByClassName(item.id)) return;
- document.getElementsByClassName(item.id)[0].style.top = `${
- canvasPosition.y - 15
- }px`;
- document.getElementsByClassName(item.id)[0].style.left = `${
- canvasPosition.x - 15
- }px`;
- } else {
- document.getElementsByClassName(item.id)[0].style.display = "none";
- }
- });
- });
- },
- addGIF2(item, position, id) {
- let c = globalVariable.viewer.scene.cartesianToCanvasCoordinates(
- position,
- new Cesium.Cartesian2()
- );
- //创建一个div
- var div = document.createElement("div");
- //为div创建属性class = "test"
- var divattr = document.createAttribute("class");
- divattr.value = "hotpoint image " + id;
- //把属性class = "test"添加到div
- div.setAttributeNode(divattr);
- document.getElementById("cesiumContainer").appendChild(div);
- //创建一个值为test的按钮
- var img = document.createElement("img");
- var imgAttr = document.createAttribute("src");
- imgAttr.value = item.img;
- img.style.width = "100%";
- img.style.height = "100%";
- img.setAttributeNode(imgAttr);
- div.appendChild(img);
- div.style.position = "absolute";
- div.style.width = "30px";
- div.style.height = "30px";
- div.style.top = `${c.y - 15}px`;
- div.style.left = `${c.x - 15}px`;
- },
- // 关闭可办事项
- closeDoThingPopup() {
- this.doThingShow = false;
- this.doThingFirst = [];
- this.doThingSecond = {};
- },
- // 返回至可办事项一级菜单
- backDoThingPopup() {
- this.doThingSecond = {};
- },
- // 选择可办事项展示
- chooseDBSecond(item) {
- this.doThingSecond = item;
- },
- // 可办事项地址查询并跳转
- searchInfoAndJump(item) {
- let that = this;
- if (item.executeNumber.length < 6) {
- // this.$message({
- // type: "info",
- // messsage: "当前选项无法跳转!",
- // });
- this.tipsShow = true;
- setTimeout(() => {
- that.tipsShow = false;
- }, 1500);
- return;
- }
- let params = {
- page: 0,
- pageSize: 10,
- tableName: "ywtb_auditfwzn",
- where: "item_code = '" + item.executeNumber + "'",
- };
- postform(this.eventData.url, params).then((res) => {
- if (res.code == 200) {
- // window.open(res.content[0].login_url); // 在safari中失效
- that.setCLJ(res.content[0].login_url);
- }
- });
- },
- // 页面跳转(为了结局在safari浏览器中无法跳转的问题)
- setCLJ(url) {
- let dom = document.createElement("a");
- dom.setAttribute("href", url);
- document.body.appendChild(dom);
- dom.click();
- setTimeout(() => {
- document.body.removeChild(dom);
- }, 100);
- },
- // 点位触发事件
- pointClickHandle(item) {
- let that = this;
- switch (item.type) {
- case 1:
- // 弹窗
- let strTo = ``;
- item.text.map(function (str) {
- strTo += str + "<br>";
- });
- this.pointInfos = strTo;
- this.pointShow = true;
- break;
- case 2:
- // 跳转
- if (this.$store.state.IsPC) {
- let openUrl = item.pc_url ? item.pc_url : item.url;
- window.open(openUrl, "_blank");
- } else {
- window.location.href = item.pc_url ? item.pc_url : item.url;
- }
- break;
- case 3:
- break;
- case 4:
- // 点位触发camera转换
- this.$flyTo({
- lon: item.camera.lon,
- lat: item.camera.lat,
- h: item.camera.h,
- heading: item.camera.heading,
- pitch: item.camera.pitch,
- roll: item.camera.roll,
- time: 1,
- pitchAdjustHeight: 1000,
- details: item,
- callback: function (item) {
- // closeHull(item.camera.sceneType);
- showTitle(item.details.areaName);
- },
- }).then(() => {});
- break;
- case 5:
- $.getJSON(item.json, function (arr) {
- that.doThingFirst = arr;
- that.doThingShow = true;
- });
- break;
- default:
- break;
- }
- },
- // 加载跳转点位
- loadPositionPoint() {
- let that = this;
- this.positionPoint.map(function (item, index) {
- // console.log(
- // item.areaName +
- // ":" +
- // Cesium.Math.toDegrees(item.lon) +
- // ", " +
- // Cesium.Math.toDegrees(item.lat)
- // );
- let id = "jump_" + index;
- let entity = globalVariable.viewer.entities.add({
- id: id,
- position: Cesium.Cartesian3.fromRadians(item.lon, item.lat, item.h),
- billboard: {
- image: "./static/images/position_point.png",
- width: 36,
- height: 18,
- scale: 1.0,
- horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
- verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
- pixelOffset: new Cesium.Cartesian2(0, 0),
- distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
- 0,
- 15
- ),
- },
- // label: {
- // text: item.areaName != "" ? item.areaName : "" + (index + 1),
- // // text: "" + (index + 1),
- // font: "10pt Source Han Sans CN", //字体样式
- // fillColor: Cesium.Color.WHITE, //字体颜色
- // backgroundColor: Cesium.Color.fromCssColorString("#00000066"), //背景颜色
- // showBackground: false, //是否显示背景颜色
- // style: Cesium.LabelStyle.FILL, //label样式
- // outlineWidth: 2,
- // outlineColor: Cesium.Color.fromCssColorString("#00000066"), //背景颜色
- // verticalOrigin: Cesium.VerticalOrigin.BOTTOM, //垂直位置
- // horizontalOrigin: Cesium.HorizontalOrigin.CENTER, //水平位置
- // pixelOffset: new Cesium.Cartesian2(0, 0), //偏移
- // },
- });
- entity.infos = item;
- entity.callback = that.jumpPositionEvent;
- globalVariable.point_positions[id] = entity;
- globalVariable.jumpPointArr.push(entity);
- });
- },
- // 跳转事件触发
- jumpPositionEvent(item) {
- showTitle(item.areaName);
- this.$flyTo({
- lon: Cesium.Math.toDegrees(item.lon),
- lat: Cesium.Math.toDegrees(item.lat),
- h: item.viewH,
- heading: Cesium.Math.toDegrees(globalVariable.viewer.camera.heading),
- pitch: 0, // globalVariable.viewer.camera.pitch,
- roll: 0, // globalVariable.viewer.camera.roll,
- time: 1,
- pitchAdjustHeight: 1000,
- details: item,
- callback: function () {},
- }).then(() => {
- // resolve();
- });
- },
- // 解析图片
- analysisImage(src, entity) {
- // return new Promise((resolve, reject) => {
- // if (src.indexOf("gif") > -1) {
- let can = document.createElement("canvas");
- let gif = gifler(src);
- gif.animate(can);
- gif.frames(can, function (ctx, frame) {
- // console.log(frame.buffer.toDataURL());
- entity.billboard.image = new Cesium.CallbackProperty(() => {
- // console.log(frame.buffer.toDataURL());
- return frame.buffer.toDataURL();
- }, false);
- // resolve(d);
- });
- // } else {
- // resolve(src);
- // }
- // });
- },
- // 切换视角
- changeView(item) {
- // 清除场景激活
- clearSceneActive();
- this.cancelLookAround();
- if (item.lon == null) {
- this.$toast("暂无当前位置信息");
- return;
- }
- if (item.showTitle) {
- showTitle(item.name);
- }
- this.$flyTo({
- lon: item.lon,
- lat: item.lat,
- h: item.h,
- heading: item.heading,
- pitch: item.pitch,
- roll: item.roll,
- time: 1,
- pitchAdjustHeight: 1000,
- details: item,
- callback: function (item) {
- closeHull(item.details.sceneType);
- },
- });
- this.indexesShow = false;
- this.funcList[1].active = false;
- },
- // 切换索引楼层
- changeFloor(item) {
- this.cameraInfo = this.cameraInfo.map(function (tdd) {
- tdd.active = false;
- return tdd;
- });
- item.active = true;
- this.cameraInfoChildren = item.children;
- },
- hidePointInfoDailog() {
- this.pointShow = false;
- },
- // 切换楼层
- choosePlane(index) {
- this.planeArr = this.planeArr.map(function (item, ind) {
- if (index == ind) {
- item.active = true;
- } else {
- item.active = false;
- }
- return item;
- });
- },
- },
- watch: {
- helpShow: {
- handler(newVal, oldVal) {
- if (newVal) {
- this.helpActive = true;
- } else {
- this.helpActive = false;
- }
- },
- },
- },
- };
- </script>
- <style lang="less" scoped>
- @media screen and (orientation: landscape) {
- .tool {
- position: absolute;
- right: 15px;
- top: 20px !important;
- z-index: 1;
- }
- }
- .tool {
- position: absolute;
- right: 15px !important;
- top: 35px !important;
- z-index: 1;
- .func {
- overflow: hidden;
- li {
- width: 30px;
- height: 30px;
- overflow: hidden;
- font-weight: bold;
- position: relative;
- margin-bottom: 6px;
- p {
- width: 100%;
- height: 100%;
- }
- &:nth-child(1) {
- p {
- background: url(~@/assets/img/tool/new_tb/hotpoint.png) center
- center/100% 100% no-repeat;
- }
- &.active p {
- background: url(~@/assets/img/tool/new_tb/hotpoint_active.png) center
- center/100% 100% no-repeat;
- }
- }
- &:nth-child(2) {
- p {
- background: url(~@/assets/img/tool/new_tb/indexes.png) center
- center/100% 100% no-repeat;
- }
- &.active p {
- background: url(~@/assets/img/tool/new_tb/indexes_active.png) center
- center/100% 100% no-repeat;
- }
- }
- &:nth-child(3) {
- p {
- background: url(~@/assets/img/tool/new_tb/pan.png) center center/100%
- 100% no-repeat;
- }
- &.active p {
- background: url(~@/assets/img/tool/new_tb/pan_active.png) center
- center/100% 100% no-repeat;
- }
- }
- &:nth-child(4) {
- p {
- background: url(~@/assets/img/tool/new_tb/reposition.png) center
- center/100% 100% no-repeat;
- }
- &.active p {
- background: url(~@/assets/img/tool/new_tb/reposition_active.png)
- center center/100% 100% no-repeat;
- }
- }
- &:nth-child(5) {
- p {
- background: url(~@/assets/img/tool/new_tb/plan.png) center center/100%
- 100% no-repeat;
- }
- &.active p {
- background: url(~@/assets/img/tool/new_tb/plan_active.png) center
- center/100% 100% no-repeat;
- }
- }
- &:nth-child(6) {
- p {
- background: url(~@/assets/img/tool/new_tb/event_library.png) center
- center/100% 100% no-repeat;
- }
- &.active p {
- background: url(~@/assets/img/tool/new_tb/event_library_active.png)
- center center/100% 100% no-repeat;
- }
- }
- }
- }
- .help {
- width: 50px;
- height: 50px;
- background: url(~@/assets/img/tool/new_tb/help.png) center center / 100%
- 100% no-repeat;
- &.active {
- background: url(~@/assets/img/tool/new_tb/help_active.png) center
- center/100% 100% no-repeat;
- }
- }
- :deep(.indexesListContent) {
- width: 394px;
- height: 380px;
- .indexesList {
- box-sizing: border-box;
- width: 100%;
- height: calc(100% - 34px);
- background: #33333366;
- border-radius: 2px;
- .listContent {
- padding: 5px 20px;
- box-sizing: border-box;
- width: 100%;
- height: 100%;
- overflow: hidden;
- overflow-y: auto;
- .header {
- width: 265.2px;
- height: 22.8px;
- overflow: hidden;
- position: relative;
- text-align: center;
- color: #ffffff;
- margin: 21px auto;
- background: url(~@/assets/img/tool/indexes_header.png) center center /
- 100% 100% no-repeat;
- }
- .list_container {
- width: 100%;
- // height: 50px;
- height: calc(100% - 61px);
- overflow: hidden;
- overflow-y: auto;
- .first_content {
- overflow: hidden;
- .title {
- color: #ffffff;
- font-size: 20px;
- }
- }
- li {
- width: 150px;
- height: 50px;
- margin: 5px calc(50% - 150px);
- float: left;
- line-height: 50px;
- text-align: center;
- font-size: 15px;
- color: #fefeff;
- position: relative;
- background: #ffffff33;
- border-radius: 2px;
- &:nth-child(2n) {
- margin-right: 0px;
- }
- &:nth-child(2n-1) {
- margin-left: 0px;
- }
- }
- }
- }
- }
- .close {
- width: 16px;
- height: 16px;
- margin: 4px 4px;
- background: url(~@/assets/img/tool/close.png) center center / 100% 100%
- no-repeat;
- position: absolute;
- top: 0px;
- right: 0px;
- }
- }
- :deep(.point_popup) {
- width: 394px;
- height: 380px;
- .pointInfoContent {
- width: 100%;
- height: 100%;
- font-size: 20px;
- padding: 20px 25px;
- box-sizing: border-box;
- line-height: 30px;
- color: #ffffff;
- background: #33333366;
- border-radius: 2px;
- div {
- width: 100%;
- height: 100%;
- overflow: hidden;
- overflow-y: auto;
- }
- }
- .close {
- width: 16px;
- height: 16px;
- margin: 4px 4px;
- background: url(~@/assets/img/tool/close.png) center center / 100% 100%
- no-repeat;
- position: absolute;
- top: 0px;
- right: 0px;
- }
- }
- :deep(.plane_popup) {
- width: 394px;
- height: 380px;
- .plane_container {
- width: 100%;
- &_event {
- padding: 1.5rem 1rem;
- width: calc(100% - 2rem);
- max-height: calc(100% - 3rem);
- overflow-x: hidden;
- background: rgba(0, 0, 0, 0.4);
- border-radius: 1rem;
- position: absolute;
- p {
- color: #ffffff;
- margin: 0.5rem 0;
- font-size: 1.2rem;
- font-weight: bold;
- }
- .paramsBox {
- max-width: calc(100% - 20px);
- font-size: 1rem;
- color: #dbdbdb;
- position: relative;
- input {
- color: #333;
- }
- .paramBtuBox {
- display: flex;
- justify-content: flex-end;
- .paramBtu {
- margin: 0.2rem 0.6rem;
- padding: 0.3rem 0.5rem;
- color: #ffffff;
- font-size: 1.2rem;
- background: #1fb4ffaa;
- border-radius: 0.3rem;
- }
- }
- }
- }
- }
- .image_header {
- color: #dbdbdb;
- font-size: 16px;
- height: 32px;
- background: rgba(0, 0, 0, 0.4);
- margin-top: 10px;
- ul {
- display: block;
- width: fit-content;
- height: 32px;
- margin: 0 auto;
- li {
- float: left;
- padding: 5px 10px;
- margin-right: 10px;
- height: 28px;
- box-sizing: border-box;
- font-size: 12px;
- &.active {
- border-bottom: 2px solid #ffc125;
- color: #ffffff;
- }
- }
- }
- }
- .image_container {
- display: block;
- width: 394px;
- height: 280px;
- margin: 0 auto;
- position: relative;
- background: #33333366;
- border-radius: 2px;
- ul {
- display: block;
- width: 100%;
- height: 100%;
- li {
- display: block;
- width: 100%;
- height: 100%;
- padding: 10px 10px;
- box-sizing: border-box;
- img {
- display: block;
- width: 100%;
- height: 100%;
- margin: 0 auto;
- object-fit: contain;
- }
- }
- }
- }
- .close {
- width: 16px;
- height: 16px;
- margin: 4px 4px;
- margin-right: 10px;
- background: url(~@/assets/img/tool/close.png) center center / 100% 100%
- no-repeat;
- position: absolute;
- top: 0px;
- right: 0px;
- }
- }
- :deep(.help_popup) {
- width: 394px;
- height: 380px;
- .help_container {
- box-sizing: border-box;
- overflow: hidden;
- overflow-y: auto;
- width: 100%;
- height: 100%;
- background: #33333366;
- border-radius: 2px;
- .header {
- color: #ffffff;
- font-size: 18px;
- margin-top: 10px;
- text-align: center;
- font-weight: bold;
- }
- .content {
- color: #ffffff;
- font-size: 16px;
- line-height: 32px;
- padding: 0 15px;
- span {
- display: inline-block;
- background: #1fb4ff;
- width: 16px;
- height: 16px;
- border-radius: 16px;
- }
- }
- }
- .close {
- width: 16px;
- height: 16px;
- margin: 4px 4px;
- background: url(~@/assets/img/tool/close.png) center center / 100% 100%
- no-repeat;
- position: absolute;
- top: 0px;
- right: 0px;
- }
- }
- :deep(.doThing_popup) {
- width: 394px;
- height: 380px;
- .content {
- width: 100%;
- height: 100%;
- font-size: 20px;
- padding: 25px 0px;
- box-sizing: border-box;
- line-height: 30px;
- color: #ffffff;
- background: #33333366;
- border-radius: 2px;
- .doThingFirstContent {
- width: 100%;
- height: 100%;
- .header {
- text-align: center;
- height: 30px;
- letter-spacing: 30px;
- text-indent: 30px;
- }
- .list {
- height: calc(100% - 30px);
- overflow: hidden;
- overflow-y: auto;
- li {
- width: 150px;
- height: 50px;
- margin: 5px calc(25% - 75px);
- float: left;
- line-height: 48.05px;
- text-align: center;
- font-size: 15px;
- color: #fefeff;
- position: relative;
- &::after {
- content: "";
- height: 2px;
- width: 120px;
- position: absolute;
- background: url(~@/assets/img/tool/indexes_point_bottom.png)
- center center / 100% 100% no-repeat;
- bottom: 0px;
- left: 15px;
- }
- &.active {
- color: #ffc44d;
- background: url(~@/assets/img/tool/indexes_point_active.png)
- center center / 100% 100% no-repeat;
- &::after {
- display: none;
- }
- }
- }
- }
- }
- .doThingSecondContent {
- width: 100%;
- height: 100%;
- .header {
- text-align: center;
- height: 30px;
- letter-spacing: 8px;
- text-indent: 8px;
- }
- .list {
- height: calc(100% - 30px);
- overflow: hidden;
- overflow-y: auto;
- .van-collapse {
- .item {
- display: inline-block;
- width: calc(100% - 32px);
- height: 24px;
- line-height: 24px;
- padding: 10px 0px;
- margin: 0px 16px;
- font-size: 12px;
- position: relative;
- border-bottom: 1px solid #ffffff;
- }
- .van-collapse-item {
- .van-cell {
- background: transparent;
- color: #ffffff;
- margin: 0px 16px;
- padding: 10px 0px;
- width: calc(100% - 32px);
- border-bottom: 1px solid #ffffff;
- font-size: 12px;
- .van-cell__right-icon:before {
- color: #ffffff;
- }
- .van-cell__title {
- line-height: 20.75px;
- }
- }
- .van-collapse-item__content {
- background: transparent;
- padding-top: 0px;
- padding-bottom: 0px;
- margin: 0px 16px;
- padding: 0 0;
- li {
- min-height: 20.75px;
- line-height: 20.75px;
- padding: 10px 0px;
- color: #ffffff;
- border-bottom: 1px solid rgba(235, 237, 240);
- text-indent: 20px;
- font-size: 12px;
- }
- }
- :deep(.van-collapse-item--border:after) {
- border-top: 0px;
- }
- }
- }
- }
- }
- }
- .close {
- width: 16px;
- height: 16px;
- margin: 4px 4px;
- background: url(~@/assets/img/tool/close.png) center center / 100% 100%
- no-repeat;
- position: absolute;
- top: 0px;
- right: 0px;
- }
- .back {
- width: 24px;
- height: 24px;
- background: url(~@/assets/img/tool/back.png) center center / 100% 100%
- no-repeat;
- position: absolute;
- top: 0px;
- left: 0px;
- border-radius: 50px;
- }
- }
- }
- :deep(.hotpoint) {
- img {
- width: 100%;
- height: 100%;
- }
- }
- :deep(.tips) {
- font-size: 8px;
- padding: 5px 5px;
- border-radius: 2px;
- top: 4vh;
- left: 14vh;
- }
- </style>
|