index.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529
  1. <template>
  2. <div class="menu-content">
  3. <div class="gradient-text title">实时标绘</div>
  4. <div v-show="collaboration" style="display: flex; align-items: center; justify-content: flex-end; height: 90px">
  5. <div class="btn2" style="margin-left: 10px" @click="handleCloseCollaboration">关闭协同</div>
  6. <div class="btn2" style="margin-left: 10px" @click="handleSaveCollaboration">保存</div>
  7. </div>
  8. <div class="line">
  9. <div class="tabs1">
  10. <div v-for="(item, index) in menu" :key="index" :class="menuActive1 === index ? 'tab tab_active' : 'tab'" @click="clickTab(index)">
  11. {{ item.name }}
  12. </div>
  13. </div>
  14. <div class="btn-box">
  15. <div class="btn1" @click="handleScreenshot">
  16. <div class="icon1" />
  17. 当前地图截图导出
  18. </div>
  19. <div v-show="!collaboration" class="btn2" @click="handleShare('1')">协同标绘</div>
  20. <div v-show="collaboration" class="btn2" @click="handleShowLayer">查看图层</div>
  21. </div>
  22. </div>
  23. <div v-if="menuActive1 === 0" class="content">
  24. <div class="box1">
  25. <div v-show="!showSetting" class="box-item">
  26. <div class="btn" @click="handleUndo">
  27. <div class="revoke-icon"></div>
  28. 撤回
  29. </div>
  30. <div class="line2"></div>
  31. <div class="btn">
  32. <div class="delete-icon"></div>
  33. 删除
  34. </div>
  35. <div class="line2"></div>
  36. <div class="btn" @click="handleShowDialog">
  37. <div class="save-icon"></div>
  38. 保存
  39. </div>
  40. </div>
  41. <div v-show="showSetting" class="box-item">
  42. <div class="btn" @click="handleQuitSetting">
  43. <div class="revoke-icon"></div>
  44. 退出设置
  45. </div>
  46. </div>
  47. <div class="box-item">
  48. <div class="btn">
  49. <i class="template-icon" />
  50. 模板导入
  51. </div>
  52. <div class="line2"></div>
  53. <div class="btn">
  54. <i class="categoryImport-icon" />
  55. 分类导入
  56. </div>
  57. <div class="line2"></div>
  58. <div class="btn" @click="handleOpenSetting">
  59. <i class="setting-icon" />
  60. 设置
  61. </div>
  62. </div>
  63. </div>
  64. <div class="tab-content">
  65. <div class="tabs2">
  66. <div
  67. v-for="(item, index) in menu[menuActive1].children"
  68. :key="index"
  69. :class="menuActive2 === index ? 'tab tab_active' : 'tab'"
  70. @click="clickTab2(index)"
  71. >
  72. {{ item.name }}
  73. </div>
  74. </div>
  75. <div class="tab-content2">
  76. <div v-show="menuActive2 === 0" class="line3">
  77. <LineWidthSelect v-model="mouseToolState.lineWidth" :options="lineWidthOptions" />
  78. <div class="color-container">
  79. <el-color-picker v-model="mouseToolState.color" popper-class="custom-color-picker" show-alpha />
  80. </div>
  81. </div>
  82. <div v-if="menu[menuActive1] && menu[menuActive1].children && menu[menuActive1].children[menuActive2]" class="tab-list">
  83. <div
  84. v-for="(item, index) in menu[menuActive1].children[menuActive2].children"
  85. :key="index"
  86. :class="menuActive3 === index ? 'tab tab_active' : 'tab'"
  87. :style="{ cursor: showSetting ? 'default' : 'pointer' }"
  88. @click="clickTab3(item, index)"
  89. >
  90. <div v-show="!showSetting" :class="menuActive3 === index ? 'checked2' : 'checked1'"></div>
  91. <img :src="getImageUrl(item.image)" class="icon" />
  92. {{ item.name }}
  93. <div v-if="!!showSetting" class="setting-btn" @click="handleShowSetting(item)" />
  94. <div v-if="item.showSetting" class="setting-menu">
  95. <div class="menu-item" @click="handleShowSwitch(item)">
  96. <i class="icon-switch" />
  97. <span>更换</span>
  98. </div>
  99. <div class="menu-item" @click="handleMenuItemHide(item)">
  100. <i class="icon-eye" />
  101. <span>{{ item.visible === '0' ? '隐藏' : '显示' }}</span>
  102. </div>
  103. <div class="menu-item" @click="handleMenuItemDelete(item)">
  104. <i class="icon-delete" />
  105. <span>删除</span>
  106. </div>
  107. </div>
  108. </div>
  109. <div v-if="showSetting" class="tab" @click="handleShowAddClass">
  110. <el-icon color="#7495b4" :size="80"><Plus /></el-icon>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <div v-else-if="menuActive1 === 1" class="tab-content3">
  117. <!-- <div class="box1">-->
  118. <!-- <div class="box-item">-->
  119. <!-- <div class="btn">-->
  120. <!-- <div class="merge-icon"></div>-->
  121. <!-- 合并-->
  122. <!-- </div>-->
  123. <!-- </div>-->
  124. <!-- </div>-->
  125. <div class="params-box">
  126. <el-input v-model="queryParams.pattern_name" class="custom-input" placeholder="请输入" @input="handleQuery">
  127. <template #prefix>
  128. <el-icon class="el-input__icon"><search /></el-icon>
  129. </template>
  130. </el-input>
  131. </div>
  132. <div class="custom-table">
  133. <div class="table-header">
  134. <div class="th">预案名称</div>
  135. <div class="th">操作</div>
  136. </div>
  137. <div v-for="(item, index) in patternList" :key="index" class="tr">
  138. <div class="td">
  139. <div>{{ item.pattern_name }}</div>
  140. </div>
  141. <div class="td td2">
  142. <div class="btn" @click="handleDelete(item.id)">
  143. <div class="delete-icon"></div>
  144. 删除
  145. </div>
  146. <div class="line2"></div>
  147. <div class="btn" @click="handleEdit(item.id)">
  148. <div class="edit-icon"></div>
  149. 编辑
  150. </div>
  151. <div class="line2"></div>
  152. <div class="btn" @click="handleShare('2', item.id)">
  153. <div class="share-icon"></div>
  154. 分享
  155. </div>
  156. </div>
  157. </div>
  158. <div class="footer">
  159. <el-pagination
  160. v-model:current-page="queryParams.page"
  161. v-model:page-size="queryParams.pageSize"
  162. background
  163. :hide-on-single-page="true"
  164. layout="total, prev, pager, next"
  165. :total="total"
  166. @current-change="getList"
  167. />
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. <!--添加修改分类弹窗-->
  173. <EditClassDialog
  174. v-if="showAddDialog"
  175. :id="selectEditId"
  176. v-model="showAddDialog"
  177. :template-id="selectTemplateId"
  178. @update-data="getTemplateTreeData"
  179. />
  180. <!--添加文字-->
  181. <TextEdit v-model="showTextEdit" @add-text="addText" />
  182. <!--绘制提示信息-->
  183. <div v-show="tipTitle !== ''" class="tipTitle">{{ tipTitle }}</div>
  184. <!--保存修改弹窗-->
  185. <EditDialog v-if="showEdit" v-model="showEdit" :edit-data="editData" @submit="handleSubmit" />
  186. <Contact v-if="shareState.showShare" v-model="shareState.showShare" @close="handleCloseShare" @confirm="handleShareConfirm" />
  187. <Dialog v-if="showForm" v-model="showForm" custom-show title="协同标绘" height="auto" type="xs" @close="showForm = false" @confirm="handleSendForm">
  188. <div style="display: flex; align-items: center">
  189. <div style="font-size: 36px">预案名称:</div>
  190. <el-input v-model="form.pattern_name" class="custom-input" placeholder="请输入" style="flex: 1" />
  191. </div>
  192. </Dialog>
  193. <LayerDetail v-if="showLayer" v-model="showLayer" :pattern-id="patternId" @handle-send-data="handleSendData" />
  194. </template>
  195. <script lang="ts" setup name="OnlinePlotting">
  196. import { nanoid } from 'nanoid';
  197. import { deepClone } from '@/utils';
  198. import { useHistory } from '@/hooks/useHistory';
  199. import {
  200. changeVisibleClassification,
  201. closeCollaboration,
  202. createCollaboration,
  203. deleteClassificationCreate,
  204. deletePatternById,
  205. getPatternInfo,
  206. getPatternList,
  207. getTemplateTree
  208. } from '@/api/globalMap/onlinePlotting';
  209. import EditClassDialog from './EditClassDialog.vue';
  210. import TextEdit from './TextEdit.vue';
  211. import EditDialog from './EditDialog.vue';
  212. import { Search } from '@element-plus/icons-vue';
  213. import html2canvas from 'html2canvas';
  214. import LayerDetail from './LayerDetail.vue';
  215. import { createWebSocket } from '@/utils/websocket';
  216. import { showSuccessMsg } from '@/utils/notification';
  217. import * as turf from '@turf/turf';
  218. import Style from 'ol/style/Style';
  219. import Icon from 'ol/style/Icon';
  220. const props = defineProps({
  221. activeMap: String
  222. });
  223. const AMapType = ['vectorgraph', 'satellite'];
  224. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  225. const getMapUtils = inject('getMapUtils');
  226. const getDrawTool = inject('getDrawTool');
  227. const getMap = inject('getMap');
  228. const containerScale = inject('containerScale');
  229. const { currentState, commit, undo, history, future } = useHistory();
  230. const emits = defineEmits(['getCollaborationData']);
  231. const getImageUrl = (name: string) => {
  232. return import.meta.env.VITE_APP_BASE_API + import.meta.env.VITE_APP_BASE_DOWNLOAD_API + name;
  233. };
  234. let drawing = ref(false);
  235. const mouseToolState = ref<MouseTool>({
  236. color: 'rgba(248, 1, 2, 1)',
  237. lineWidth: '1',
  238. graphicsType: ''
  239. });
  240. const menuActive1 = ref<string | number>(0);
  241. const menuActive2 = ref<string | number>(0);
  242. const menuActive3 = ref<string | number>('');
  243. const menu = ref([
  244. {
  245. name: '标绘工具',
  246. children: []
  247. },
  248. {
  249. name: '历史预案',
  250. children: []
  251. }
  252. ]);
  253. const lineWidthOptions = reactive([
  254. { name: '1像素', value: '1' },
  255. { name: '2像素', value: '2' },
  256. { name: '3像素', value: '3' }
  257. ]);
  258. let showTextEdit = ref(false);
  259. let lnglat = ref([]);
  260. // 协同
  261. let collaboration = ref(false);
  262. let webSock;
  263. // 分享
  264. let shareState = reactive({
  265. type: '',
  266. showShare: false,
  267. id: ''
  268. });
  269. let patternId = ref('');
  270. let shareId = ref('');
  271. let overlays = [];
  272. let overlaysData = [];
  273. watch(
  274. () => drawing,
  275. () => {
  276. if (!drawing.value) {
  277. menuActive3.value = '';
  278. }
  279. }
  280. );
  281. const tipTitle = computed(() => {
  282. let res = '';
  283. if (
  284. menu.value[menuActive1.value] &&
  285. menu.value[menuActive1.value].children &&
  286. menu.value[menuActive1.value].children[menuActive2.value] &&
  287. menu.value[menuActive1.value].children[menuActive2.value].children &&
  288. menu.value[menuActive1.value].children[menuActive2.value].children[menuActive3.value]
  289. ) {
  290. const data = menu.value[menuActive1.value].children[menuActive2.value].children[menuActive3.value];
  291. if (data.value === 'straightArrow') {
  292. res = '单击开始、单击结束';
  293. } else if (['rectangle', 'polygon', 'anyLine', 'circle'].includes(data.value)) {
  294. res = '鼠标按住拖曳,松开鼠标结束标绘';
  295. } else if (['straightLine', 'measureArea'].includes(data.value)) {
  296. res = '单击开始,移动,单击改变方向,双击结束';
  297. }
  298. }
  299. return res;
  300. });
  301. // 获取模板分类树
  302. const getTemplateTreeData = () => {
  303. getTemplateTree({ visible: showSetting.value ? '' : '1' }).then((res) => {
  304. menu.value[0].children = res.data;
  305. });
  306. };
  307. let showAddDialog = ref(false);
  308. let selectTemplateId = ref('');
  309. let selectEditId = ref('');
  310. // 显示现在分类弹窗
  311. const handleShowAddClass = () => {
  312. selectTemplateId.value = menu.value[menuActive1.value].children[menuActive2.value].template_id;
  313. selectEditId.value = '';
  314. showAddDialog.value = true;
  315. };
  316. const handleShowSwitch = (item) => {
  317. selectTemplateId.value = menu.value[menuActive1.value].children[menuActive2.value].template_id;
  318. item.showSetting = false;
  319. selectEditId.value = item.classification_id;
  320. showAddDialog.value = true;
  321. };
  322. const handleMenuItemHide = (item) => {
  323. item.showSetting = false;
  324. const newVisible = item.visible === '0' ? '1' : '0';
  325. changeVisibleClassification({ classification_id: item.classification_id, visible: newVisible }).then(() => {
  326. showSuccessMsg(newVisible === '0' ? '隐藏成功' : '显示成功');
  327. getTemplateTreeData();
  328. });
  329. };
  330. const handleMenuItemDelete = (item) => {
  331. item.showSetting = false;
  332. deleteClassificationCreate(item.classification_id).then(() => {
  333. showSuccessMsg('删除成功');
  334. getTemplateTreeData();
  335. });
  336. };
  337. // 点击一级菜单
  338. const clickTab = (value: number) => {
  339. menuActive1.value = value;
  340. };
  341. // 点击二级菜单
  342. const clickTab2 = (value: number) => {
  343. menuActive2.value = value;
  344. handleExitMenuActive();
  345. };
  346. // 点击三级菜单
  347. const clickTab3 = (item, index) => {
  348. if (showSetting.value) return;
  349. handleExitMenuActive(true);
  350. const type = item.value;
  351. if (mouseToolState.value.graphicsType !== type || (mouseToolState.value.graphicsType === 'marker' && mouseToolState.value.title !== item.name)) {
  352. if (type === 'text') {
  353. mouseToolState.value.graphicsType = type;
  354. mouseToolState.value.title = item.name;
  355. handleTextEdit();
  356. } else if (type === 'marker') {
  357. const data = {
  358. graphicsType: type,
  359. lineWidth: mouseToolState.value.lineWidth,
  360. color: mouseToolState.value.color,
  361. icon: getImageUrl(item.image),
  362. iconName: item.image,
  363. size: item.size,
  364. title: item.name
  365. };
  366. drawing.value = true;
  367. mouseToolState.value = data;
  368. } else {
  369. showTextEdit.value = false;
  370. drawing.value = true;
  371. mouseToolState.value.graphicsType = type;
  372. mouseToolState.value.title = item.name;
  373. }
  374. const drawTool = getDrawTool();
  375. if (mouseToolState.value.graphicsType === 'anyLine') {
  376. drawTool.setDrawEndMethod(handleEndDraw);
  377. }
  378. if (mouseToolState.value.graphicsType !== 'text') {
  379. const newOptions = drawTool.drawGraphics(mouseToolState.value);
  380. // 绘制完成事件
  381. initDrawMethod(newOptions);
  382. }
  383. menuActive3.value = index;
  384. } else {
  385. handleExitMenuActive();
  386. }
  387. };
  388. // 切换菜单、设置后退出菜单选中
  389. const handleExitMenuActive = (noClearActive?: boolean) => {
  390. if (!noClearActive) {
  391. menuActive3.value = '';
  392. }
  393. showTextEdit.value = false;
  394. drawing.value = false;
  395. mouseToolState.value.graphicsType = '';
  396. const drawTool = getDrawTool();
  397. drawTool.closeDraw();
  398. };
  399. const handleTextEdit = () => {
  400. const drawTool = getDrawTool();
  401. const map = drawTool.getMap();
  402. drawTool.closeDraw();
  403. // 监听地图点击事件
  404. map.on('click', handleClickMap);
  405. };
  406. const handleClickMap = (e) => {
  407. // 获取点击位置的经纬度
  408. if (AMapType.includes(props.activeMap)) {
  409. lnglat.value = [e.lnglat.lng, e.lnglat.lat];
  410. } else {
  411. lnglat.value = e.coordinate;
  412. }
  413. showTextEdit.value = true;
  414. };
  415. const addText = (textEditState) => {
  416. const data = {
  417. graphicsType: 'text',
  418. type: 'text',
  419. lineWidth: mouseToolState.value.lineWidth,
  420. color: mouseToolState.value.color,
  421. title: '文本',
  422. text: textEditState.text,
  423. fontColor: textEditState.fontColor,
  424. fontSize: textEditState.fontSize,
  425. lnglat: lnglat.value
  426. };
  427. showTextEdit.value = false;
  428. drawing.value = true;
  429. mouseToolState.value = data;
  430. // 绘制完成事件
  431. const drawTool = getDrawTool();
  432. const res = drawTool.drawGraphics(mouseToolState.value);
  433. overlays.push(res.text);
  434. overlaysData.push(res.data);
  435. commit(deepClone(overlaysData));
  436. res.text.on('rightclick', handleRightClick);
  437. const map = drawTool.getMap();
  438. // 监听地图点击事件
  439. if (AMapType.includes(props.activeMap)) {
  440. map.off('click', handleClickMap);
  441. } else {
  442. map.un('click', handleClickMap);
  443. }
  444. sendWebSocket(data);
  445. close();
  446. };
  447. const close = () => {
  448. const drawTool = getDrawTool();
  449. drawTool.closeDraw();
  450. drawing.value = false;
  451. menuActive3.value = '';
  452. mouseToolState.value.graphicsType = '';
  453. };
  454. watch(
  455. mouseToolState,
  456. () => {
  457. if (mouseToolState.value.graphicsType !== 'text') {
  458. const map = getMap();
  459. if (AMapType.includes(props.activeMap)) {
  460. map.off('click', handleClickMap);
  461. } else {
  462. map.un('click', handleClickMap);
  463. }
  464. }
  465. },
  466. {
  467. deep: true
  468. }
  469. );
  470. // 初始化绘制完成回调
  471. const initDrawMethod = (options) => {
  472. const drawTool = getDrawTool();
  473. const mouseTool = drawTool.getMouseTool();
  474. let onDraw;
  475. if (AMapType.includes(props.activeMap)) {
  476. onDraw = (event) => {
  477. mouseTool.off('draw', onDraw);
  478. close();
  479. const obj = event.obj;
  480. const id = nanoid();
  481. obj._opts.extData = {
  482. id: id
  483. };
  484. const data: any = deepClone(options);
  485. data.id = id;
  486. if (options.type == 'marker') {
  487. const position = obj.getPosition();
  488. data.lnglat = [position.lng, position.lat];
  489. data.latitude = position.lat;
  490. data.longitude = position.lng;
  491. data.icon = data.iconName;
  492. data.image = data.iconName;
  493. data.imageHover = data.iconName;
  494. data.visible = true;
  495. obj.setLabel({
  496. content: '<div>' + data.title + '</div>',
  497. direction: 'top'
  498. });
  499. } else {
  500. if (options.type == 'circle') {
  501. data.center = [obj.getCenter().lng, obj.getCenter().lat];
  502. data.radius = obj.getRadius() / 100000;
  503. } else {
  504. const path = obj.getPath();
  505. // 将AMap.LngLat对象数组转换为经纬度数组
  506. const pathArr = path.map((lngLat) => {
  507. // 返回经度和纬度的数组
  508. return [lngLat.lng, lngLat.lat];
  509. });
  510. if (options.type !== 'straightLine') {
  511. pathArr.push(pathArr[0]);
  512. }
  513. data.path = pathArr;
  514. }
  515. }
  516. if (options.type == 'measureArea') {
  517. const AMap = getDrawTool().getAMap();
  518. const map = getMap();
  519. // 计算区域面积
  520. const area = Math.round(AMap.GeometryUtil.ringArea(data.path));
  521. const text = new AMap.Text({
  522. position: data.path[data.path.length - 1],
  523. text: '区域面积' + area + '平方米',
  524. offset: new AMap.Pixel(-20, -20)
  525. });
  526. data.area = area;
  527. map.add(text);
  528. overlays.push([obj, text]);
  529. overlaysData.push(data);
  530. commit(deepClone(overlaysData));
  531. } else {
  532. overlays.push(obj);
  533. overlaysData.push(data);
  534. commit(deepClone(overlaysData));
  535. console.log(overlaysData);
  536. }
  537. // 右击进入编辑
  538. obj.on('rightclick', handleRightClick);
  539. // 发送
  540. sendWebSocket(data);
  541. };
  542. mouseTool.on('draw', onDraw);
  543. } else {
  544. onDraw = (event) => {
  545. mouseTool.un('draw', onDraw);
  546. close();
  547. const feature = event.feature;
  548. const geometry = feature.getGeometry();
  549. const id = nanoid();
  550. feature.set('id', id);
  551. const data: any = deepClone(options);
  552. data.id = id;
  553. if (options.type == 'marker') {
  554. const img = new Image();
  555. img.onload = () => {
  556. // 图片加载完成后,可以访问其 width 和 height 属性
  557. const width = img.width;
  558. const height = img.height;
  559. const style = new Style({
  560. image: new Icon({
  561. src: options.icon,
  562. anchor: [0.5, 0.5], // 图标锚点,通常是图标的中心点
  563. anchorXUnits: 'fraction',
  564. anchorYUnits: 'fraction',
  565. size: [width, height],
  566. scale: !!options.size[0] ? options.size[0] / width : 1
  567. })
  568. });
  569. feature.setStyle(style);
  570. };
  571. const position = geometry.getCoordinates();
  572. data.lnglat = position;
  573. data.longitude = position[0];
  574. data.latitude = position[1];
  575. data.icon = data.iconName;
  576. data.image = data.iconName;
  577. data.imageHover = data.iconName;
  578. data.visible = true;
  579. img.src = options.icon; // 设置图片的 URL,触发加载
  580. } else {
  581. if (options.type == 'circle') {
  582. data.center = geometry.getCenter();
  583. data.radius = geometry.getRadius();
  584. } else {
  585. const coordinates = geometry.getCoordinates();
  586. if (options.type !== 'straightLine') {
  587. data.path = coordinates[0];
  588. } else {
  589. data.path = coordinates;
  590. }
  591. }
  592. }
  593. if (options.type == 'measureArea') {
  594. // 计算区域面积
  595. const area = turf.area(turf.polygon([data.path]));
  596. data.area = area;
  597. overlays.push(feature);
  598. overlaysData.push(data);
  599. commit(deepClone(overlaysData));
  600. } else {
  601. overlays.push(feature);
  602. overlaysData.push(data);
  603. commit(deepClone(overlaysData));
  604. console.log(overlaysData);
  605. }
  606. // 右击进入编辑
  607. feature.on('rightclick', handleRightClick);
  608. // 发送
  609. sendWebSocket(data);
  610. };
  611. if (!!mouseTool) {
  612. mouseTool.on('drawend', onDraw);
  613. }
  614. }
  615. };
  616. const handleEndDraw = (options, obj) => {
  617. const drawTool = getDrawTool();
  618. drawing.value = false;
  619. menuActive3.value = '';
  620. mouseToolState.value.graphicsType = '';
  621. drawTool.setDrawEndMethod();
  622. const id = nanoid();
  623. let data;
  624. if (AMapType.includes(props.activeMap)) {
  625. obj._opts.extData = {
  626. id: id
  627. };
  628. data = deepClone(options);
  629. data.id = id;
  630. if (data.type === 'anyLine') {
  631. const path = obj.getPath();
  632. // 将AMap.LngLat对象数组转换为经纬度数组
  633. const pathArr = path.map((lngLat) => {
  634. // 返回经度和纬度的数组
  635. return [lngLat.lng, lngLat.lat];
  636. });
  637. pathArr.push(pathArr[0]);
  638. data.path = pathArr;
  639. }
  640. } else {
  641. obj.set('id', id);
  642. data = deepClone(options);
  643. data.id = id;
  644. if (data.type === 'anyLine') {
  645. const path = obj.getGeometry().getCoordinates();
  646. data.path = path;
  647. }
  648. }
  649. overlays.push(obj);
  650. overlaysData.push(data);
  651. commit(deepClone(overlaysData));
  652. sendWebSocket(data);
  653. };
  654. // 协同标绘发送新增
  655. const sendWebSocket = (data) => {
  656. if (!collaboration.value || !webSock) return;
  657. webSock.send(
  658. JSON.stringify({
  659. operation: 'add', // 必填
  660. id: data.id,
  661. name: data.title, // 必填
  662. content: JSON.stringify(data), // 必填
  663. visible: '1'
  664. })
  665. );
  666. };
  667. // 图形右击事件
  668. let rightClickObj;
  669. let initContextMenu = false;
  670. const handleRightClick = (event) => {
  671. rightClickObj = event.target;
  672. const contextMenu = getDrawTool().getContextMenu();
  673. if (!initContextMenu) {
  674. // 右键删除按钮
  675. contextMenu.addItem(
  676. '删除',
  677. function () {
  678. contextMenu.close();
  679. deleteGraphics();
  680. },
  681. 0
  682. );
  683. initContextMenu = true;
  684. }
  685. contextMenu.open(getMap(), event.lnglat);
  686. };
  687. // 删除图形
  688. const deleteGraphics = () => {
  689. const id = rightClickObj.getExtData()?.id;
  690. if (id) {
  691. for (let i = 0; i < overlays.length; i++) {
  692. const overlay = Array.isArray(overlays[i]) ? overlays[i][0] : overlays[i];
  693. if (overlay?.getExtData().id === id) {
  694. removeOverlayByIndex(i);
  695. commit(deepClone(overlaysData));
  696. rightClickObj = null;
  697. }
  698. }
  699. }
  700. };
  701. // 撤销绘制
  702. const handleUndo = () => {
  703. // drawing.value = false;
  704. const previous = history.value[history.value.length - 2];
  705. if (history.value.length > 1) {
  706. if (currentState.value.length > previous.length) {
  707. // 撤销新增
  708. removeOverlayByIndex(currentState.value.length - 1);
  709. } else {
  710. let restoreData;
  711. for (let i = 0; i < previous.length; i++) {
  712. let index = 0;
  713. for (let k = 0; k < currentState.value.length; k++) {
  714. if (previous[i].id !== currentState.value[k].id) {
  715. index++;
  716. } else {
  717. break;
  718. }
  719. }
  720. if (index === previous.length - 1) {
  721. restoreData = previous[i];
  722. break;
  723. }
  724. }
  725. if (restoreData) {
  726. const obj = getDrawTool().createGraphics(restoreData);
  727. overlays.push(obj);
  728. }
  729. }
  730. undo();
  731. console.log(history.value, future.value, currentState.value);
  732. }
  733. };
  734. // 移除所有覆盖物
  735. const removeAllOverlay = () => {
  736. const map = getMap();
  737. overlays.forEach((item, index) => {
  738. if (Array.isArray(item)) {
  739. item.forEach((overlay) => {
  740. // 移除地图上覆盖物
  741. map.remove(overlay);
  742. });
  743. } else {
  744. // 移除地图上覆盖物
  745. map.remove(item);
  746. }
  747. });
  748. overlays = [];
  749. overlaysData = [];
  750. };
  751. // 根据索引移除覆盖物
  752. const removeOverlayByIndex = (index: number) => {
  753. const map = getMap();
  754. if (Array.isArray(overlays[index])) {
  755. overlays[index].forEach((overlay) => {
  756. // 移除地图上覆盖物
  757. map.remove(overlay);
  758. });
  759. } else {
  760. // 移除地图上覆盖物
  761. map.remove(overlays[index]);
  762. if (collaboration.value) {
  763. console.log(
  764. JSON.stringify({
  765. operation: 'delete',
  766. id: overlays[index].getExtData()?.id
  767. })
  768. );
  769. webSock.send(
  770. JSON.stringify({
  771. operation: 'delete',
  772. id: overlays[index].getExtData()?.id
  773. })
  774. );
  775. }
  776. }
  777. overlays.splice(index, 1);
  778. overlaysData.splice(index, 1);
  779. };
  780. // 历史预案
  781. const queryParams = reactive({
  782. page: 1,
  783. pageSize: 9,
  784. pattern_name: ''
  785. });
  786. const patternList = ref([]);
  787. let total = ref(0);
  788. let editData = ref({
  789. id: '',
  790. pattern_name: '',
  791. content: {}
  792. });
  793. let showEdit = ref(false);
  794. const handleSubmit = () => {
  795. showEdit.value = false;
  796. editData.value = {
  797. id: '',
  798. pattern_name: '',
  799. content: {}
  800. };
  801. getList();
  802. };
  803. const handleQuery = () => {
  804. queryParams.page = 1;
  805. getList();
  806. };
  807. // 获取预案列表
  808. const getList = () => {
  809. // if (menuActive1.value === 1 && menu.value[menuActive1.value].name == '历史预案') {
  810. getPatternList(queryParams).then((res) => {
  811. patternList.value = res.data;
  812. total.value = res.total;
  813. });
  814. // }
  815. };
  816. const handleDelete = (id: number) => {
  817. proxy?.$modal.confirm('是否确认删除选择的数据项?').then(() => {
  818. deletePatternById(id).then(() => {
  819. getList();
  820. });
  821. });
  822. };
  823. const handleEdit = (id) => {
  824. getPatternInfo(id).then((res) => {
  825. editData.value = res.data;
  826. editData.value.id = id;
  827. });
  828. showEdit.value = true;
  829. };
  830. const handleShare = (type, id?: string) => {
  831. shareState.type = type;
  832. shareState.id = id;
  833. shareState.showShare = true;
  834. };
  835. const handleCloseShare = () => {
  836. shareState.type = '';
  837. shareState.id = '';
  838. };
  839. const handleCloseCollaboration = () => {
  840. closeCollaboration({ pattern_id: patternId.value }).then(() => {
  841. collaboration.value = false;
  842. });
  843. };
  844. const handleSaveCollaboration = () => {};
  845. let showForm = ref(false);
  846. let form = ref({
  847. pattern_id: '',
  848. user_id_list: [],
  849. name: '',
  850. pattern_name: '',
  851. visible: 'false',
  852. content: ''
  853. });
  854. const handleShareConfirm = (data) => {
  855. if (shareState.type === '1') {
  856. // 协同标绘
  857. const userIdList = [];
  858. data.forEach((item) => {
  859. userIdList.push(item.userId);
  860. });
  861. let list = [];
  862. currentState.value.forEach((item) => {
  863. list.push({
  864. name: item.title,
  865. visible: 'true',
  866. content: JSON.stringify(item)
  867. });
  868. });
  869. form.value = {
  870. pattern_id: nanoid(),
  871. user_id_list: userIdList,
  872. pattern_name: '',
  873. bz_list: list
  874. };
  875. showForm.value = true;
  876. } else {
  877. // 分享
  878. }
  879. shareState.type = '';
  880. shareState.id = '';
  881. };
  882. const getWebSocketData = (data) => {
  883. if (data && data.length > 0) {
  884. const data2 = [];
  885. const data3 = deepClone(data);
  886. data.forEach((item) => {
  887. if (!!item.content) {
  888. const parseContent = JSON.parse(item.content);
  889. if (parseContent.type === 'marker' && !!parseContent.icon) {
  890. parseContent.icon = getImageUrl(parseContent.icon);
  891. }
  892. data2.push(parseContent);
  893. }
  894. });
  895. const res = getMapUtils().drawData(data2);
  896. removeAllOverlay();
  897. res.forEach((item, index) => {
  898. item.on('rightclick', handleRightClick);
  899. overlays.push(item);
  900. overlaysData.push(data3[index]);
  901. });
  902. commit(deepClone(overlaysData));
  903. currentState.value = data;
  904. }
  905. console.log('接收数据', data);
  906. };
  907. const handleSendForm = () => {
  908. if (!form.value.pattern_name) {
  909. return proxy?.$modal.msgWarning('请填写预案名称');
  910. }
  911. // webSock = createWebSocket('MbHKSVA00Y2tQG1Y_u8kL', getWebSocketData);
  912. // patternId.value = 'MbHKSVA00Y2tQG1Y_u8kL';
  913. createCollaboration(form.value).then(() => {
  914. patternId.value = form.value.pattern_id;
  915. webSock = createWebSocket(form.value.pattern_id, getWebSocketData);
  916. showForm.value = false;
  917. collaboration.value = true;
  918. proxy?.$modal.msgSuccess('开启协同标绘成功');
  919. });
  920. };
  921. const handleShowDialog = () => {
  922. editData.value = {
  923. id: '',
  924. pattern_name: '',
  925. content: currentState.value
  926. };
  927. showEdit.value = true;
  928. };
  929. let showSetting = ref(false);
  930. const handleOpenSetting = () => {
  931. showSetting.value = true;
  932. handleExitMenuActive();
  933. getTemplateTreeData();
  934. };
  935. const handleQuitSetting = () => {
  936. showSetting.value = false;
  937. getTemplateTreeData();
  938. };
  939. const handleShowSetting = (item, index) => {
  940. menu.value[0].children.forEach((menu2) => {
  941. menu2.children.forEach((item2) => {
  942. item2.showSetting = item.name === item2.name;
  943. });
  944. });
  945. };
  946. const handleSendData = (data) => {
  947. const { type, content } = data;
  948. if (type === 'update') {
  949. webSock.send(
  950. JSON.stringify({
  951. operation: 'update',
  952. id: content.id,
  953. name: content.name,
  954. content: content.content,
  955. visible: content.visible
  956. })
  957. );
  958. }
  959. };
  960. let dataURL = ref('');
  961. // 页面元素转图片
  962. const handleScreenshot = () => {
  963. let map = getMap();
  964. let canvasBox;
  965. if (AMapType.includes(props.activeMap)) {
  966. canvasBox = map.Iv;
  967. } else {
  968. canvasBox = map.targetElement_;
  969. }
  970. // 手动创建一个 canvas 标签
  971. const canvas = document.createElement('canvas');
  972. if (canvasBox) {
  973. // 获取父级的宽高
  974. const width = parseInt(window.getComputedStyle(canvasBox).width) / containerScale().scaleX;
  975. const height = parseInt(window.getComputedStyle(canvasBox).height) / containerScale().scaleX;
  976. canvas.style.width = width + 'px';
  977. canvas.style.height = height + 'px';
  978. const options = {
  979. backgroundColor: null, // 设置背景色为透明
  980. useCORS: true, //是否尝试使用CORS从服务器加载图像,解决跨域问题
  981. tainttest: true, // 是否在渲染前测试图片
  982. logging: false // 不启动日志调试
  983. };
  984. // canvasBox是要截图的元素,options是一些相关配置
  985. html2canvas(canvasBox, options).then((canvas) => {
  986. // toDataURL 图片格式转成 base64
  987. dataURL.value = canvas.toDataURL('image/png');
  988. // 新建一个a标签
  989. var oA = document.createElement('a');
  990. oA.download = '截图'; // 设置下载的文件名
  991. oA.href = dataURL.value;
  992. document.body.appendChild(oA);
  993. oA.click(); // 模拟点击a标签
  994. oA.remove(); // 下载之后把创建的元素删除
  995. });
  996. }
  997. };
  998. let showLayer = ref(false);
  999. let handleShowLayer = () => {
  1000. showLayer.value = true;
  1001. };
  1002. onMounted(() => {
  1003. getTemplateTreeData();
  1004. getList();
  1005. });
  1006. </script>
  1007. <style lang="scss" scoped>
  1008. .menu-content {
  1009. width: 1584px;
  1010. height: 1772px;
  1011. background: url('@/assets/images/map/rightMenu/onlinePlotting/dialog.png') no-repeat;
  1012. padding: 130px 45px 20px 50px;
  1013. font-size: 36px;
  1014. position: relative;
  1015. color: #ffffff;
  1016. }
  1017. .title {
  1018. font-size: 60px;
  1019. position: absolute;
  1020. top: 30px;
  1021. left: 140px;
  1022. }
  1023. :deep(.el-color-dropdown__link-btn) {
  1024. display: none;
  1025. }
  1026. .line {
  1027. display: flex;
  1028. justify-content: space-between;
  1029. align-items: center;
  1030. }
  1031. .tabs1 {
  1032. margin-top: 45px;
  1033. display: flex;
  1034. .tab {
  1035. width: 316px;
  1036. height: 77px;
  1037. line-height: 77px;
  1038. background: url('@/assets/images/map/rightMenu/onlinePlotting/tab.png') no-repeat;
  1039. cursor: pointer;
  1040. font-size: 44px;
  1041. color: #b7c1d5;
  1042. font-family: YouSheBiaoTiHei;
  1043. padding-left: 60px;
  1044. &:hover {
  1045. width: 317px;
  1046. height: 83px;
  1047. color: #ffffff;
  1048. background: url('@/assets/images/map/rightMenu/onlinePlotting/tabActive.png') no-repeat;
  1049. }
  1050. }
  1051. .tab_active {
  1052. width: 317px;
  1053. height: 83px;
  1054. color: #ffffff;
  1055. background: url('@/assets/images/map/rightMenu/onlinePlotting/tabActive.png') no-repeat;
  1056. }
  1057. }
  1058. .btn1 {
  1059. width: 440px;
  1060. height: 150px;
  1061. background: url('@/assets/images/map/rightMenu/onlinePlotting/btn1.png') no-repeat;
  1062. background-size: 100% 100%;
  1063. display: flex;
  1064. justify-content: center;
  1065. align-items: center;
  1066. cursor: pointer;
  1067. font-size: 32px;
  1068. color: #edfaff;
  1069. margin-bottom: -55px;
  1070. .icon1 {
  1071. width: 42px;
  1072. height: 42px;
  1073. background: url('@/assets/images/map/rightMenu/onlinePlotting/screenshot.png') no-repeat;
  1074. margin-right: 12px;
  1075. }
  1076. }
  1077. .btn2 {
  1078. width: 278px;
  1079. height: 78px;
  1080. background: url('@/assets/images/map/rightMenu/btn.png') no-repeat;
  1081. display: flex;
  1082. justify-content: center;
  1083. align-items: center;
  1084. cursor: pointer;
  1085. font-size: 32px;
  1086. color: #edfaff;
  1087. margin-bottom: -57px;
  1088. .icon1 {
  1089. width: 42px;
  1090. height: 42px;
  1091. background: url('@/assets/images/map/rightMenu/onlinePlotting/screenshot.png') no-repeat;
  1092. margin-right: 12px;
  1093. }
  1094. }
  1095. .box1 {
  1096. margin-top: 20px;
  1097. display: flex;
  1098. justify-content: space-between;
  1099. align-items: center;
  1100. width: 1490px;
  1101. height: 96px;
  1102. background: url('@/assets/images/map/rightMenu/onlinePlotting/box1.png') no-repeat;
  1103. padding: 25px 30px;
  1104. .box-item {
  1105. display: flex;
  1106. align-items: center;
  1107. }
  1108. }
  1109. .btn {
  1110. display: flex;
  1111. align-items: center;
  1112. cursor: pointer;
  1113. .revoke-icon {
  1114. width: 48px;
  1115. height: 50px;
  1116. margin-right: 10px;
  1117. background: url('@/assets/images/map/rightMenu/onlinePlotting/revoke.png') no-repeat;
  1118. }
  1119. .delete-icon {
  1120. width: 50px;
  1121. height: 50px;
  1122. margin-right: 10px;
  1123. background: url('@/assets/images/map/rightMenu/onlinePlotting/delete.png') no-repeat;
  1124. }
  1125. .edit-icon {
  1126. width: 46px;
  1127. height: 46px;
  1128. margin-right: 10px;
  1129. background: url('@/assets/images/map/rightMenu/onlinePlotting/edit.png') no-repeat;
  1130. }
  1131. .cancel-icon {
  1132. width: 50px;
  1133. height: 50px;
  1134. margin-right: 10px;
  1135. background: url('@/assets/images/map/rightMenu/onlinePlotting/cancel.png') no-repeat;
  1136. }
  1137. .save-icon {
  1138. width: 46px;
  1139. height: 46px;
  1140. margin-right: 10px;
  1141. background: url('@/assets/images/map/rightMenu/onlinePlotting/save.png') no-repeat;
  1142. }
  1143. .share-icon {
  1144. width: 46px;
  1145. height: 48px;
  1146. margin-right: 10px;
  1147. background: url('@/assets/images/map/rightMenu/onlinePlotting/share.png') no-repeat;
  1148. }
  1149. .setting-icon {
  1150. width: 48px;
  1151. height: 50px;
  1152. margin-right: 10px;
  1153. background: url('@/assets/images/map/rightMenu/onlinePlotting/setting.png') no-repeat;
  1154. }
  1155. .template-icon {
  1156. width: 41px;
  1157. height: 44px;
  1158. margin-right: 3px;
  1159. background: url('@/assets/images/map/rightMenu/onlinePlotting/template.png') no-repeat;
  1160. background-size: 100% 100%;
  1161. }
  1162. .categoryImport-icon {
  1163. width: 39px;
  1164. height: 43px;
  1165. margin-right: 3px;
  1166. background: url('@/assets/images/map/rightMenu/onlinePlotting/categoryImport.png') no-repeat;
  1167. background-size: 100% 100%;
  1168. }
  1169. .merge-icon {
  1170. width: 52px;
  1171. height: 52px;
  1172. margin-right: 10px;
  1173. background: url('@/assets/images/map/rightMenu/onlinePlotting/merge.png') no-repeat;
  1174. }
  1175. }
  1176. .line2 {
  1177. width: 3px;
  1178. height: 24px;
  1179. background-color: #a7ccdf;
  1180. margin: 0 38px;
  1181. }
  1182. .tabs2 {
  1183. width: 300px;
  1184. min-width: 300px;
  1185. height: 1240px;
  1186. background: url('@/assets/images/map/rightMenu/onlinePlotting/tabBg.png') no-repeat;
  1187. background-size: 300px 1188px;
  1188. overflow-y: auto;
  1189. padding: 30px 0;
  1190. .tab {
  1191. width: 100%;
  1192. height: 99px;
  1193. cursor: pointer;
  1194. color: #eaf3fc;
  1195. font-size: 38px;
  1196. padding: 0 60px;
  1197. display: flex;
  1198. align-items: center;
  1199. &:hover {
  1200. background: url('@/assets/images/map/rightMenu/onlinePlotting/tabActive2.png') no-repeat;
  1201. }
  1202. }
  1203. .tab_active {
  1204. background: url('@/assets/images/map/rightMenu/onlinePlotting/tabActive2.png') no-repeat;
  1205. }
  1206. }
  1207. .tab-content {
  1208. display: flex;
  1209. margin-top: 20px;
  1210. .tab-content2 {
  1211. padding: 20px 45px;
  1212. display: flex;
  1213. flex-direction: column;
  1214. .line {
  1215. height: 100px;
  1216. }
  1217. .line3 {
  1218. display: flex;
  1219. }
  1220. .tab-list {
  1221. width: 100%;
  1222. flex: 1;
  1223. overflow-x: hidden;
  1224. overflow-y: auto;
  1225. display: flex;
  1226. flex-wrap: wrap;
  1227. align-content: baseline;
  1228. .icon {
  1229. width: 160px;
  1230. height: 88px;
  1231. margin-bottom: 20px;
  1232. }
  1233. .tab {
  1234. &:nth-child(3n-1) {
  1235. margin: 40px 46px 0;
  1236. }
  1237. }
  1238. .setting-btn {
  1239. position: absolute;
  1240. bottom: 18px;
  1241. right: 13px;
  1242. width: 83px;
  1243. height: 82px;
  1244. background: url('@/assets/images/map/rightMenu/onlinePlotting/setting2.png') no-repeat;
  1245. background-size: 100% 100%;
  1246. cursor: pointer;
  1247. }
  1248. .setting-menu {
  1249. position: absolute;
  1250. bottom: -310px;
  1251. right: 0;
  1252. z-index: 99;
  1253. width: 200px;
  1254. height: 284px;
  1255. border: 4px solid #2c81ff;
  1256. background-color: #091432;
  1257. //box-shadow: inset 0 0 60px #596891;
  1258. padding: 30px 5px;
  1259. &::after {
  1260. content: '';
  1261. width: 40px;
  1262. height: 40px;
  1263. border-top: 4px solid #2c81ff;
  1264. border-left: 4px solid #2c81ff;
  1265. border-bottom: 4px solid transparent;
  1266. border-right: 4px solid transparent;
  1267. position: absolute;
  1268. top: -20px;
  1269. right: 30px;
  1270. transform: rotate(45deg);
  1271. background-color: #091432;
  1272. }
  1273. .menu-item {
  1274. width: 100%;
  1275. display: flex;
  1276. align-items: center;
  1277. justify-content: center;
  1278. color: #a7b3c5;
  1279. font-size: 32px;
  1280. height: 72px;
  1281. cursor: pointer;
  1282. .icon-switch {
  1283. display: inline-block;
  1284. width: 36px;
  1285. height: 36px;
  1286. background: url('@/assets/images/map/rightMenu/onlinePlotting/switch1.png') no-repeat;
  1287. background-size: 100% 100%;
  1288. margin-right: 16px;
  1289. }
  1290. .icon-eye {
  1291. display: inline-block;
  1292. width: 36px;
  1293. height: 30px;
  1294. background: url('@/assets/images/map/rightMenu/onlinePlotting/show1.png') no-repeat;
  1295. background-size: 100% 100%;
  1296. margin-right: 16px;
  1297. }
  1298. .icon-eye2 {
  1299. display: inline-block;
  1300. width: 36px;
  1301. height: 35px;
  1302. background: url('@/assets/images/map/rightMenu/onlinePlotting/hide1.png') no-repeat;
  1303. background-size: 100% 100%;
  1304. margin-right: 16px;
  1305. }
  1306. .icon-delete {
  1307. display: inline-block;
  1308. width: 32px;
  1309. height: 33px;
  1310. background: url('@/assets/images/map/rightMenu/onlinePlotting/delete1.png') no-repeat;
  1311. background-size: 100% 100%;
  1312. margin-right: 16px;
  1313. }
  1314. &:hover {
  1315. color: #00fde7;
  1316. background: #1e3b77;
  1317. .icon-switch {
  1318. background: url('@/assets/images/map/rightMenu/onlinePlotting/switch2.png') no-repeat;
  1319. background-size: 100% 100%;
  1320. }
  1321. .icon-eye {
  1322. background: url('@/assets/images/map/rightMenu/onlinePlotting/show2.png') no-repeat;
  1323. background-size: 100% 100%;
  1324. }
  1325. .icon-eye2 {
  1326. background: url('@/assets/images/map/rightMenu/onlinePlotting/hide2.png') no-repeat;
  1327. background-size: 100% 100%;
  1328. }
  1329. .icon-delete {
  1330. background: url('@/assets/images/map/rightMenu/onlinePlotting/delete2.png') no-repeat;
  1331. background-size: 100% 100%;
  1332. }
  1333. }
  1334. }
  1335. }
  1336. }
  1337. .tab {
  1338. width: 333px;
  1339. height: 235px;
  1340. background: url('@/assets/images/map/rightMenu/onlinePlotting/box2.png') no-repeat;
  1341. padding: 27px;
  1342. cursor: pointer;
  1343. position: relative;
  1344. font-size: 38px;
  1345. color: #eaf3fc;
  1346. display: flex;
  1347. flex-direction: column;
  1348. justify-content: center;
  1349. align-items: center;
  1350. margin-top: 40px;
  1351. &:hover {
  1352. background: url('@/assets/images/map/rightMenu/onlinePlotting/boxHover2.png') no-repeat;
  1353. }
  1354. .checked1 {
  1355. position: absolute;
  1356. top: 30px;
  1357. right: 30px;
  1358. width: 32px;
  1359. height: 32px;
  1360. background: url('@/assets/images/map/rightMenu/onlinePlotting/checked1.png') no-repeat;
  1361. }
  1362. .checked2 {
  1363. position: absolute;
  1364. top: 30px;
  1365. right: 30px;
  1366. width: 36px;
  1367. height: 36px;
  1368. background: url('@/assets/images/map/rightMenu/onlinePlotting/checked2.png') no-repeat;
  1369. }
  1370. }
  1371. .tab_active {
  1372. background: url('@/assets/images/map/rightMenu/onlinePlotting/boxActive2.png') no-repeat;
  1373. }
  1374. }
  1375. }
  1376. .tipTitle {
  1377. position: absolute;
  1378. top: 0;
  1379. left: -2745px;
  1380. z-index: 2;
  1381. padding: 10px 30px;
  1382. font-size: 38px;
  1383. color: #fff;
  1384. background-color: rgba(0, 0, 0, 0.4);
  1385. border-radius: 10px;
  1386. }
  1387. .tab-content3 {
  1388. .custom-table {
  1389. width: 100%;
  1390. color: #000;
  1391. .table-header {
  1392. display: flex;
  1393. font-size: 38px;
  1394. width: 100%;
  1395. background-color: #194ba0;
  1396. .th {
  1397. padding: 25px 30px;
  1398. flex: 1;
  1399. color: #edfaff;
  1400. &:last-child {
  1401. flex: unset;
  1402. width: 620px;
  1403. }
  1404. }
  1405. }
  1406. .tr {
  1407. display: flex;
  1408. font-size: 38px;
  1409. width: 1487px;
  1410. background: url('@/assets/images/map/rightMenu/onlinePlotting/tr.png') no-repeat;
  1411. background-size: 100% 100%;
  1412. margin-top: 10px;
  1413. &:hover {
  1414. background: url('@/assets/images/map/rightMenu/onlinePlotting/trActive.png') no-repeat;
  1415. }
  1416. .td {
  1417. padding: 25px 30px;
  1418. color: #edfaff;
  1419. flex: 1;
  1420. .icon {
  1421. margin: 0 10px;
  1422. cursor: pointer;
  1423. }
  1424. }
  1425. .td2 {
  1426. flex: unset;
  1427. width: 620px;
  1428. display: flex;
  1429. justify-content: center;
  1430. align-items: center;
  1431. }
  1432. }
  1433. }
  1434. }
  1435. .color-container {
  1436. width: 80px;
  1437. height: 50px;
  1438. display: flex;
  1439. justify-content: center;
  1440. align-items: center;
  1441. position: relative;
  1442. background-color: #0d3980;
  1443. border: 4px solid #0b5fbb;
  1444. margin-left: 20px;
  1445. :deep(.el-color-picker) {
  1446. height: 60px !important;
  1447. }
  1448. &::before {
  1449. content: '';
  1450. position: absolute;
  1451. top: 0;
  1452. left: 0;
  1453. width: 12px;
  1454. height: 12px;
  1455. background: url('@/assets/images/inputIcon1.png') no-repeat;
  1456. }
  1457. &::after {
  1458. content: '';
  1459. position: absolute;
  1460. right: 0;
  1461. bottom: 0;
  1462. width: 12px;
  1463. height: 12px;
  1464. background: url('@/assets/images/inputIcon2.png') no-repeat;
  1465. }
  1466. }
  1467. .params-box {
  1468. margin: 30px 0;
  1469. }
  1470. .footer {
  1471. display: flex;
  1472. justify-content: flex-end;
  1473. margin-top: 30px;
  1474. padding-right: 40px;
  1475. :deep(.el-pagination__total) {
  1476. color: #a7ccdf;
  1477. font-size: 32px;
  1478. }
  1479. :deep(.el-pagination) {
  1480. .btn-next,
  1481. .btn-prev {
  1482. background-color: transparent;
  1483. border: none;
  1484. .el-icon {
  1485. font-size: 22px;
  1486. color: #a7ccdf;
  1487. }
  1488. }
  1489. .el-pager li {
  1490. width: 64px;
  1491. height: 64px;
  1492. line-height: 64px;
  1493. text-align: center;
  1494. font-size: 32px;
  1495. color: #a7ccdf;
  1496. background-color: #0e3064;
  1497. border: 1px solid #0c57a7;
  1498. margin: 0 6px;
  1499. &:hover {
  1500. background-color: #038dff;
  1501. border: 1px solid #038dff;
  1502. }
  1503. }
  1504. .el-pager li.is-active {
  1505. background-color: #038dff;
  1506. border: 1px solid #038dff;
  1507. }
  1508. }
  1509. }
  1510. .btn-box {
  1511. display: flex;
  1512. align-items: center;
  1513. }
  1514. </style>