index.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515
  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. } else if (mouseToolState.value.graphicsType !== 'text') {
  378. const newOptions = drawTool.drawGraphics(mouseToolState.value);
  379. // 绘制完成事件
  380. initDrawMethod(newOptions);
  381. }
  382. menuActive3.value = index;
  383. } else {
  384. handleExitMenuActive();
  385. }
  386. };
  387. // 切换菜单、设置后退出菜单选中
  388. const handleExitMenuActive = (noClearActive?: boolean) => {
  389. if (!noClearActive) {
  390. menuActive3.value = '';
  391. }
  392. showTextEdit.value = false;
  393. drawing.value = false;
  394. mouseToolState.value.graphicsType = '';
  395. const drawTool = getDrawTool();
  396. drawTool.closeDraw();
  397. };
  398. const handleTextEdit = () => {
  399. const drawTool = getDrawTool();
  400. const map = drawTool.getMap();
  401. drawTool.closeDraw();
  402. // 监听地图点击事件
  403. map.on('click', handleClickMap);
  404. };
  405. const handleClickMap = (e) => {
  406. // 获取点击位置的经纬度
  407. if (AMapType.includes(props.activeMap)) {
  408. lnglat.value = [e.lnglat.lng, e.lnglat.lat];
  409. } else {
  410. lnglat.value = e.coordinate;
  411. }
  412. showTextEdit.value = true;
  413. };
  414. const addText = (textEditState) => {
  415. const data = {
  416. graphicsType: 'text',
  417. type: 'text',
  418. lineWidth: mouseToolState.value.lineWidth,
  419. color: mouseToolState.value.color,
  420. title: '文本',
  421. text: textEditState.text,
  422. fontColor: textEditState.fontColor,
  423. fontSize: textEditState.fontSize,
  424. lnglat: lnglat.value
  425. };
  426. showTextEdit.value = false;
  427. drawing.value = true;
  428. mouseToolState.value = data;
  429. // 绘制完成事件
  430. const drawTool = getDrawTool();
  431. const res = drawTool.drawGraphics(mouseToolState.value);
  432. overlays.push(res.text);
  433. overlaysData.push(res.data);
  434. commit(deepClone(overlaysData));
  435. res.text.on('rightclick', handleRightClick);
  436. const map = drawTool.getMap();
  437. // 监听地图点击事件
  438. if (AMapType.includes(props.activeMap)) {
  439. map.off('click', handleClickMap);
  440. } else {
  441. map.un('click', handleClickMap);
  442. }
  443. sendWebSocket(data);
  444. close();
  445. };
  446. const close = () => {
  447. const drawTool = getDrawTool();
  448. drawTool.closeDraw();
  449. drawing.value = false;
  450. menuActive3.value = '';
  451. mouseToolState.value.graphicsType = '';
  452. };
  453. watch(
  454. mouseToolState,
  455. () => {
  456. if (mouseToolState.value.graphicsType !== 'text') {
  457. const map = getMap();
  458. if (AMapType.includes(props.activeMap)) {
  459. map.off('click', handleClickMap);
  460. } else {
  461. map.un('click', handleClickMap);
  462. }
  463. }
  464. },
  465. {
  466. deep: true
  467. }
  468. );
  469. // 初始化绘制完成回调
  470. const initDrawMethod = (options) => {
  471. const drawTool = getDrawTool();
  472. const mouseTool = drawTool.getMouseTool();
  473. let onDraw;
  474. if (AMapType.includes(props.activeMap)) {
  475. onDraw = (event) => {
  476. mouseTool.off('draw', onDraw);
  477. close();
  478. const obj = event.obj;
  479. const id = nanoid();
  480. obj._opts.extData = {
  481. id: id
  482. };
  483. const data: any = deepClone(options);
  484. data.id = id;
  485. if (options.type == 'marker') {
  486. const position = obj.getPosition();
  487. data.lnglat = [position.lng, position.lat];
  488. data.latitude = position.lat;
  489. data.longitude = position.lng;
  490. data.icon = data.iconName;
  491. data.image = data.iconName;
  492. data.imageHover = data.iconName;
  493. data.visible = true;
  494. obj.setLabel({
  495. content: '<div>' + data.title + '</div>',
  496. direction: 'top'
  497. });
  498. } else {
  499. if (options.type == 'circle') {
  500. data.center = [obj.getCenter().lng, obj.getCenter().lat];
  501. data.radius = obj.getRadius() / 100000;
  502. } else {
  503. const path = obj.getPath();
  504. // 将AMap.LngLat对象数组转换为经纬度数组
  505. const pathArr = path.map((lngLat) => {
  506. // 返回经度和纬度的数组
  507. return [lngLat.lng, lngLat.lat];
  508. });
  509. if (options.type !== 'straightLine') {
  510. pathArr.push(pathArr[0]);
  511. }
  512. data.path = pathArr;
  513. }
  514. }
  515. if (options.type == 'measureArea') {
  516. const AMap = getDrawTool().getAMap();
  517. const map = getMap();
  518. // 计算区域面积
  519. const area = Math.round(AMap.GeometryUtil.ringArea(data.path));
  520. const text = new AMap.Text({
  521. position: data.path[data.path.length - 1],
  522. text: '区域面积' + area + '平方米',
  523. offset: new AMap.Pixel(-20, -20)
  524. });
  525. data.area = area;
  526. map.add(text);
  527. overlays.push([obj, text]);
  528. overlaysData.push(data);
  529. commit(deepClone(overlaysData));
  530. } else {
  531. overlays.push(obj);
  532. overlaysData.push(data);
  533. commit(deepClone(overlaysData));
  534. console.log(overlaysData);
  535. }
  536. // 右击进入编辑
  537. obj.on('rightclick', handleRightClick);
  538. // 发送
  539. sendWebSocket(data);
  540. };
  541. mouseTool.on('draw', onDraw);
  542. } else {
  543. onDraw = (event) => {
  544. mouseTool.un('draw', onDraw);
  545. close();
  546. const feature = event.feature;
  547. const geometry = feature.getGeometry();
  548. const id = nanoid();
  549. feature.set('id', id);
  550. const data: any = deepClone(options);
  551. data.id = id;
  552. if (options.type == 'marker') {
  553. const img = new Image();
  554. img.onload = () => {
  555. // 图片加载完成后,可以访问其 width 和 height 属性
  556. const width = img.width;
  557. const height = img.height;
  558. const style = new Style({
  559. image: new Icon({
  560. src: options.icon,
  561. anchor: [0.5, 0.5], // 图标锚点,通常是图标的中心点
  562. anchorXUnits: 'fraction',
  563. anchorYUnits: 'fraction',
  564. size: [width, height],
  565. scale: !!options.size[0] ? options.size[0] / width : 1
  566. })
  567. });
  568. feature.setStyle(style);
  569. };
  570. const position = geometry.getCoordinates();
  571. data.lnglat = position;
  572. data.longitude = position[0];
  573. data.latitude = position[1];
  574. data.icon = data.iconName;
  575. data.image = data.iconName;
  576. data.imageHover = data.iconName;
  577. data.visible = true;
  578. img.src = options.icon; // 设置图片的 URL,触发加载
  579. } else {
  580. if (options.type == 'circle') {
  581. data.center = geometry.getCenter();
  582. data.radius = geometry.getRadius();
  583. } else {
  584. const coordinates = geometry.getCoordinates();
  585. if (options.type !== 'straightLine') {
  586. data.path = coordinates[0];
  587. } else {
  588. data.path = coordinates;
  589. }
  590. }
  591. }
  592. if (options.type == 'measureArea') {
  593. // 计算区域面积
  594. const area = turf.area(turf.polygon([data.path]));
  595. data.area = area;
  596. overlays.push(feature);
  597. overlaysData.push(data);
  598. commit(deepClone(overlaysData));
  599. } else {
  600. overlays.push(feature);
  601. overlaysData.push(data);
  602. commit(deepClone(overlaysData));
  603. console.log(overlaysData);
  604. }
  605. // 右击进入编辑
  606. feature.on('rightclick', handleRightClick);
  607. // 发送
  608. sendWebSocket(data);
  609. };
  610. mouseTool.on('drawend', onDraw);
  611. }
  612. };
  613. const handleEndDraw = (options, obj) => {
  614. const drawTool = getDrawTool();
  615. drawing.value = false;
  616. menuActive3.value = '';
  617. mouseToolState.value.graphicsType = '';
  618. drawTool.setDrawEndMethod();
  619. const id = nanoid();
  620. obj._opts.extData = {
  621. id: id
  622. };
  623. const data: any = deepClone(options);
  624. data.id = id;
  625. if (data.type === 'anyLine') {
  626. const path = obj.getPath();
  627. // 将AMap.LngLat对象数组转换为经纬度数组
  628. const pathArr = path.map((lngLat) => {
  629. // 返回经度和纬度的数组
  630. return [lngLat.lng, lngLat.lat];
  631. });
  632. pathArr.push(pathArr[0]);
  633. data.path = pathArr;
  634. }
  635. overlays.push(obj);
  636. overlaysData.push(data);
  637. commit(deepClone(overlaysData));
  638. sendWebSocket(data);
  639. };
  640. // 协同标绘发送新增
  641. const sendWebSocket = (data) => {
  642. if (!collaboration.value || !webSock) return;
  643. webSock.send(
  644. JSON.stringify({
  645. operation: 'add', // 必填
  646. id: data.id,
  647. name: data.title, // 必填
  648. content: JSON.stringify(data), // 必填
  649. visible: '1'
  650. })
  651. );
  652. };
  653. // 图形右击事件
  654. let rightClickObj;
  655. let initContextMenu = false;
  656. const handleRightClick = (event) => {
  657. rightClickObj = event.target;
  658. const contextMenu = getDrawTool().getContextMenu();
  659. if (!initContextMenu) {
  660. // 右键删除按钮
  661. contextMenu.addItem(
  662. '删除',
  663. function () {
  664. contextMenu.close();
  665. deleteGraphics();
  666. },
  667. 0
  668. );
  669. initContextMenu = true;
  670. }
  671. contextMenu.open(getMap(), event.lnglat);
  672. };
  673. // 删除图形
  674. const deleteGraphics = () => {
  675. const id = rightClickObj.getExtData()?.id;
  676. if (id) {
  677. for (let i = 0; i < overlays.length; i++) {
  678. const overlay = Array.isArray(overlays[i]) ? overlays[i][0] : overlays[i];
  679. if (overlay?.getExtData().id === id) {
  680. removeOverlayByIndex(i);
  681. commit(deepClone(overlaysData));
  682. rightClickObj = null;
  683. }
  684. }
  685. }
  686. };
  687. // 撤销绘制
  688. const handleUndo = () => {
  689. // drawing.value = false;
  690. const previous = history.value[history.value.length - 2];
  691. if (history.value.length > 1) {
  692. if (currentState.value.length > previous.length) {
  693. // 撤销新增
  694. removeOverlayByIndex(currentState.value.length - 1);
  695. } else {
  696. let restoreData;
  697. for (let i = 0; i < previous.length; i++) {
  698. let index = 0;
  699. for (let k = 0; k < currentState.value.length; k++) {
  700. if (previous[i].id !== currentState.value[k].id) {
  701. index++;
  702. } else {
  703. break;
  704. }
  705. }
  706. if (index === previous.length - 1) {
  707. restoreData = previous[i];
  708. break;
  709. }
  710. }
  711. if (restoreData) {
  712. const obj = getDrawTool().createGraphics(restoreData);
  713. overlays.push(obj);
  714. }
  715. }
  716. undo();
  717. console.log(history.value, future.value, currentState.value);
  718. }
  719. };
  720. // 移除所有覆盖物
  721. const removeAllOverlay = () => {
  722. const map = getMap();
  723. overlays.forEach((item, index) => {
  724. if (Array.isArray(item)) {
  725. item.forEach((overlay) => {
  726. // 移除地图上覆盖物
  727. map.remove(overlay);
  728. });
  729. } else {
  730. // 移除地图上覆盖物
  731. map.remove(item);
  732. }
  733. });
  734. overlays = [];
  735. overlaysData = [];
  736. };
  737. // 根据索引移除覆盖物
  738. const removeOverlayByIndex = (index: number) => {
  739. const map = getMap();
  740. if (Array.isArray(overlays[index])) {
  741. overlays[index].forEach((overlay) => {
  742. // 移除地图上覆盖物
  743. map.remove(overlay);
  744. });
  745. } else {
  746. // 移除地图上覆盖物
  747. map.remove(overlays[index]);
  748. if (collaboration.value) {
  749. console.log(
  750. JSON.stringify({
  751. operation: 'delete',
  752. id: overlays[index].getExtData()?.id
  753. })
  754. );
  755. webSock.send(
  756. JSON.stringify({
  757. operation: 'delete',
  758. id: overlays[index].getExtData()?.id
  759. })
  760. );
  761. }
  762. }
  763. overlays.splice(index, 1);
  764. overlaysData.splice(index, 1);
  765. };
  766. // 历史预案
  767. const queryParams = reactive({
  768. page: 1,
  769. pageSize: 9,
  770. pattern_name: ''
  771. });
  772. const patternList = ref([]);
  773. let total = ref(0);
  774. let editData = ref({
  775. id: '',
  776. pattern_name: '',
  777. content: {}
  778. });
  779. let showEdit = ref(false);
  780. const handleSubmit = () => {
  781. showEdit.value = false;
  782. editData.value = {
  783. id: '',
  784. pattern_name: '',
  785. content: {}
  786. };
  787. getList();
  788. };
  789. const handleQuery = () => {
  790. queryParams.page = 1;
  791. getList();
  792. };
  793. // 获取预案列表
  794. const getList = () => {
  795. // if (menuActive1.value === 1 && menu.value[menuActive1.value].name == '历史预案') {
  796. getPatternList(queryParams).then((res) => {
  797. patternList.value = res.data;
  798. total.value = res.total;
  799. });
  800. // }
  801. };
  802. const handleDelete = (id: number) => {
  803. proxy?.$modal.confirm('是否确认删除选择的数据项?').then(() => {
  804. deletePatternById(id).then(() => {
  805. getList();
  806. });
  807. });
  808. };
  809. const handleEdit = (id) => {
  810. getPatternInfo(id).then((res) => {
  811. editData.value = res.data;
  812. editData.value.id = id;
  813. });
  814. showEdit.value = true;
  815. };
  816. const handleShare = (type, id?: string) => {
  817. shareState.type = type;
  818. shareState.id = id;
  819. shareState.showShare = true;
  820. };
  821. const handleCloseShare = () => {
  822. shareState.type = '';
  823. shareState.id = '';
  824. };
  825. const handleCloseCollaboration = () => {
  826. closeCollaboration({ pattern_id: patternId.value }).then(() => {
  827. collaboration.value = false;
  828. });
  829. };
  830. const handleSaveCollaboration = () => {};
  831. let showForm = ref(false);
  832. let form = ref({
  833. pattern_id: '',
  834. user_id_list: [],
  835. name: '',
  836. pattern_name: '',
  837. visible: 'false',
  838. content: ''
  839. });
  840. const handleShareConfirm = (data) => {
  841. if (shareState.type === '1') {
  842. // 协同标绘
  843. const userIdList = [];
  844. data.forEach((item) => {
  845. userIdList.push(item.userId);
  846. });
  847. let list = [];
  848. currentState.value.forEach((item) => {
  849. list.push({
  850. name: item.title,
  851. visible: 'true',
  852. content: JSON.stringify(item)
  853. });
  854. });
  855. form.value = {
  856. pattern_id: nanoid(),
  857. user_id_list: userIdList,
  858. pattern_name: '',
  859. bz_list: list
  860. };
  861. showForm.value = true;
  862. } else {
  863. // 分享
  864. }
  865. shareState.type = '';
  866. shareState.id = '';
  867. };
  868. const getWebSocketData = (data) => {
  869. if (data && data.length > 0) {
  870. const data2 = [];
  871. const data3 = deepClone(data);
  872. data.forEach((item) => {
  873. if (!!item.content) {
  874. const parseContent = JSON.parse(item.content);
  875. if (parseContent.type === 'marker' && !!parseContent.icon) {
  876. parseContent.icon = getImageUrl(parseContent.icon);
  877. }
  878. data2.push(parseContent);
  879. }
  880. });
  881. const res = getMapUtils().drawData(data2);
  882. removeAllOverlay();
  883. res.forEach((item, index) => {
  884. item.on('rightclick', handleRightClick);
  885. overlays.push(item);
  886. overlaysData.push(data3[index]);
  887. });
  888. commit(deepClone(overlaysData));
  889. currentState.value = data;
  890. }
  891. console.log('接收数据', data);
  892. };
  893. const handleSendForm = () => {
  894. if (!form.value.pattern_name) {
  895. return proxy?.$modal.msgWarning('请填写预案名称');
  896. }
  897. webSock = createWebSocket('uhvw60vX7MpeWSWcXqK8S', getWebSocketData);
  898. patternId.value = 'uhvw60vX7MpeWSWcXqK8S';
  899. // createCollaboration(form.value).then(() => {
  900. // patternId.value = form.value.pattern_id;
  901. // webSock = createWebSocket(form.value.pattern_id, getWebSocketData);
  902. showForm.value = false;
  903. collaboration.value = true;
  904. proxy?.$modal.msgSuccess('开启协同标绘成功');
  905. // });
  906. };
  907. const handleShowDialog = () => {
  908. editData.value = {
  909. id: '',
  910. pattern_name: '',
  911. content: currentState.value
  912. };
  913. showEdit.value = true;
  914. };
  915. let showSetting = ref(false);
  916. const handleOpenSetting = () => {
  917. showSetting.value = true;
  918. handleExitMenuActive();
  919. getTemplateTreeData();
  920. };
  921. const handleQuitSetting = () => {
  922. showSetting.value = false;
  923. getTemplateTreeData();
  924. };
  925. const handleShowSetting = (item, index) => {
  926. menu.value[0].children.forEach((menu2) => {
  927. menu2.children.forEach((item2) => {
  928. item2.showSetting = item.name === item2.name;
  929. });
  930. });
  931. };
  932. const handleSendData = (data) => {
  933. const { type, content } = data;
  934. if (type === 'update') {
  935. webSock.send(
  936. JSON.stringify({
  937. operation: 'update',
  938. id: content.id,
  939. name: content.name,
  940. content: content.content,
  941. visible: content.visible
  942. })
  943. );
  944. }
  945. };
  946. let dataURL = ref('');
  947. // 页面元素转图片
  948. const handleScreenshot = () => {
  949. let map = getMap();
  950. let canvasBox;
  951. if (AMapType.includes(props.activeMap)) {
  952. canvasBox = map.Iv;
  953. } else {
  954. canvasBox = map.targetElement_;
  955. }
  956. // 手动创建一个 canvas 标签
  957. const canvas = document.createElement('canvas');
  958. if (canvasBox) {
  959. // 获取父级的宽高
  960. const width = parseInt(window.getComputedStyle(canvasBox).width) / containerScale().scaleX;
  961. const height = parseInt(window.getComputedStyle(canvasBox).height) / containerScale().scaleX;
  962. canvas.style.width = width + 'px';
  963. canvas.style.height = height + 'px';
  964. const options = {
  965. backgroundColor: null, // 设置背景色为透明
  966. useCORS: true, //是否尝试使用CORS从服务器加载图像,解决跨域问题
  967. tainttest: true, // 是否在渲染前测试图片
  968. logging: false // 不启动日志调试
  969. };
  970. // canvasBox是要截图的元素,options是一些相关配置
  971. html2canvas(canvasBox, options).then((canvas) => {
  972. // toDataURL 图片格式转成 base64
  973. dataURL.value = canvas.toDataURL('image/png');
  974. // 新建一个a标签
  975. var oA = document.createElement('a');
  976. oA.download = '截图'; // 设置下载的文件名
  977. oA.href = dataURL.value;
  978. document.body.appendChild(oA);
  979. oA.click(); // 模拟点击a标签
  980. oA.remove(); // 下载之后把创建的元素删除
  981. });
  982. }
  983. };
  984. let showLayer = ref(false);
  985. let handleShowLayer = () => {
  986. showLayer.value = true;
  987. };
  988. onMounted(() => {
  989. getTemplateTreeData();
  990. getList();
  991. });
  992. </script>
  993. <style lang="scss" scoped>
  994. .menu-content {
  995. width: 1584px;
  996. height: 1772px;
  997. background: url('@/assets/images/map/rightMenu/onlinePlotting/dialog.png') no-repeat;
  998. padding: 130px 45px 20px 50px;
  999. font-size: 36px;
  1000. position: relative;
  1001. color: #ffffff;
  1002. }
  1003. .title {
  1004. font-size: 60px;
  1005. position: absolute;
  1006. top: 30px;
  1007. left: 140px;
  1008. }
  1009. :deep(.el-color-dropdown__link-btn) {
  1010. display: none;
  1011. }
  1012. .line {
  1013. display: flex;
  1014. justify-content: space-between;
  1015. align-items: center;
  1016. }
  1017. .tabs1 {
  1018. margin-top: 45px;
  1019. display: flex;
  1020. .tab {
  1021. width: 316px;
  1022. height: 77px;
  1023. line-height: 77px;
  1024. background: url('@/assets/images/map/rightMenu/onlinePlotting/tab.png') no-repeat;
  1025. cursor: pointer;
  1026. font-size: 44px;
  1027. color: #b7c1d5;
  1028. font-family: YouSheBiaoTiHei;
  1029. padding-left: 60px;
  1030. &:hover {
  1031. width: 317px;
  1032. height: 83px;
  1033. color: #ffffff;
  1034. background: url('@/assets/images/map/rightMenu/onlinePlotting/tabActive.png') no-repeat;
  1035. }
  1036. }
  1037. .tab_active {
  1038. width: 317px;
  1039. height: 83px;
  1040. color: #ffffff;
  1041. background: url('@/assets/images/map/rightMenu/onlinePlotting/tabActive.png') no-repeat;
  1042. }
  1043. }
  1044. .btn1 {
  1045. width: 440px;
  1046. height: 150px;
  1047. background: url('@/assets/images/map/rightMenu/onlinePlotting/btn1.png') no-repeat;
  1048. background-size: 100% 100%;
  1049. display: flex;
  1050. justify-content: center;
  1051. align-items: center;
  1052. cursor: pointer;
  1053. font-size: 32px;
  1054. color: #edfaff;
  1055. margin-bottom: -55px;
  1056. .icon1 {
  1057. width: 42px;
  1058. height: 42px;
  1059. background: url('@/assets/images/map/rightMenu/onlinePlotting/screenshot.png') no-repeat;
  1060. margin-right: 12px;
  1061. }
  1062. }
  1063. .btn2 {
  1064. width: 278px;
  1065. height: 78px;
  1066. background: url('@/assets/images/map/rightMenu/btn.png') no-repeat;
  1067. display: flex;
  1068. justify-content: center;
  1069. align-items: center;
  1070. cursor: pointer;
  1071. font-size: 32px;
  1072. color: #edfaff;
  1073. margin-bottom: -57px;
  1074. .icon1 {
  1075. width: 42px;
  1076. height: 42px;
  1077. background: url('@/assets/images/map/rightMenu/onlinePlotting/screenshot.png') no-repeat;
  1078. margin-right: 12px;
  1079. }
  1080. }
  1081. .box1 {
  1082. margin-top: 20px;
  1083. display: flex;
  1084. justify-content: space-between;
  1085. align-items: center;
  1086. width: 1490px;
  1087. height: 96px;
  1088. background: url('@/assets/images/map/rightMenu/onlinePlotting/box1.png') no-repeat;
  1089. padding: 25px 30px;
  1090. .box-item {
  1091. display: flex;
  1092. align-items: center;
  1093. }
  1094. }
  1095. .btn {
  1096. display: flex;
  1097. align-items: center;
  1098. cursor: pointer;
  1099. .revoke-icon {
  1100. width: 48px;
  1101. height: 50px;
  1102. margin-right: 10px;
  1103. background: url('@/assets/images/map/rightMenu/onlinePlotting/revoke.png') no-repeat;
  1104. }
  1105. .delete-icon {
  1106. width: 50px;
  1107. height: 50px;
  1108. margin-right: 10px;
  1109. background: url('@/assets/images/map/rightMenu/onlinePlotting/delete.png') no-repeat;
  1110. }
  1111. .edit-icon {
  1112. width: 46px;
  1113. height: 46px;
  1114. margin-right: 10px;
  1115. background: url('@/assets/images/map/rightMenu/onlinePlotting/edit.png') no-repeat;
  1116. }
  1117. .cancel-icon {
  1118. width: 50px;
  1119. height: 50px;
  1120. margin-right: 10px;
  1121. background: url('@/assets/images/map/rightMenu/onlinePlotting/cancel.png') no-repeat;
  1122. }
  1123. .save-icon {
  1124. width: 46px;
  1125. height: 46px;
  1126. margin-right: 10px;
  1127. background: url('@/assets/images/map/rightMenu/onlinePlotting/save.png') no-repeat;
  1128. }
  1129. .share-icon {
  1130. width: 46px;
  1131. height: 48px;
  1132. margin-right: 10px;
  1133. background: url('@/assets/images/map/rightMenu/onlinePlotting/share.png') no-repeat;
  1134. }
  1135. .setting-icon {
  1136. width: 48px;
  1137. height: 50px;
  1138. margin-right: 10px;
  1139. background: url('@/assets/images/map/rightMenu/onlinePlotting/setting.png') no-repeat;
  1140. }
  1141. .template-icon {
  1142. width: 41px;
  1143. height: 44px;
  1144. margin-right: 3px;
  1145. background: url('@/assets/images/map/rightMenu/onlinePlotting/template.png') no-repeat;
  1146. background-size: 100% 100%;
  1147. }
  1148. .categoryImport-icon {
  1149. width: 39px;
  1150. height: 43px;
  1151. margin-right: 3px;
  1152. background: url('@/assets/images/map/rightMenu/onlinePlotting/categoryImport.png') no-repeat;
  1153. background-size: 100% 100%;
  1154. }
  1155. .merge-icon {
  1156. width: 52px;
  1157. height: 52px;
  1158. margin-right: 10px;
  1159. background: url('@/assets/images/map/rightMenu/onlinePlotting/merge.png') no-repeat;
  1160. }
  1161. }
  1162. .line2 {
  1163. width: 3px;
  1164. height: 24px;
  1165. background-color: #a7ccdf;
  1166. margin: 0 38px;
  1167. }
  1168. .tabs2 {
  1169. width: 300px;
  1170. min-width: 300px;
  1171. height: 1240px;
  1172. background: url('@/assets/images/map/rightMenu/onlinePlotting/tabBg.png') no-repeat;
  1173. background-size: 300px 1188px;
  1174. overflow-y: auto;
  1175. padding: 30px 0;
  1176. .tab {
  1177. width: 100%;
  1178. height: 99px;
  1179. cursor: pointer;
  1180. color: #eaf3fc;
  1181. font-size: 38px;
  1182. padding: 0 60px;
  1183. display: flex;
  1184. align-items: center;
  1185. &:hover {
  1186. background: url('@/assets/images/map/rightMenu/onlinePlotting/tabActive2.png') no-repeat;
  1187. }
  1188. }
  1189. .tab_active {
  1190. background: url('@/assets/images/map/rightMenu/onlinePlotting/tabActive2.png') no-repeat;
  1191. }
  1192. }
  1193. .tab-content {
  1194. display: flex;
  1195. margin-top: 20px;
  1196. .tab-content2 {
  1197. padding: 20px 45px;
  1198. display: flex;
  1199. flex-direction: column;
  1200. .line {
  1201. height: 100px;
  1202. }
  1203. .line3 {
  1204. display: flex;
  1205. }
  1206. .tab-list {
  1207. width: 100%;
  1208. flex: 1;
  1209. overflow-x: hidden;
  1210. overflow-y: auto;
  1211. display: flex;
  1212. flex-wrap: wrap;
  1213. align-content: baseline;
  1214. .icon {
  1215. width: 160px;
  1216. height: 88px;
  1217. margin-bottom: 20px;
  1218. }
  1219. .tab {
  1220. &:nth-child(3n-1) {
  1221. margin: 40px 46px 0;
  1222. }
  1223. }
  1224. .setting-btn {
  1225. position: absolute;
  1226. bottom: 18px;
  1227. right: 13px;
  1228. width: 83px;
  1229. height: 82px;
  1230. background: url('@/assets/images/map/rightMenu/onlinePlotting/setting2.png') no-repeat;
  1231. background-size: 100% 100%;
  1232. cursor: pointer;
  1233. }
  1234. .setting-menu {
  1235. position: absolute;
  1236. bottom: -310px;
  1237. right: 0;
  1238. z-index: 99;
  1239. width: 200px;
  1240. height: 284px;
  1241. border: 4px solid #2c81ff;
  1242. background-color: #091432;
  1243. //box-shadow: inset 0 0 60px #596891;
  1244. padding: 30px 5px;
  1245. &::after {
  1246. content: '';
  1247. width: 40px;
  1248. height: 40px;
  1249. border-top: 4px solid #2c81ff;
  1250. border-left: 4px solid #2c81ff;
  1251. border-bottom: 4px solid transparent;
  1252. border-right: 4px solid transparent;
  1253. position: absolute;
  1254. top: -20px;
  1255. right: 30px;
  1256. transform: rotate(45deg);
  1257. background-color: #091432;
  1258. }
  1259. .menu-item {
  1260. width: 100%;
  1261. display: flex;
  1262. align-items: center;
  1263. justify-content: center;
  1264. color: #a7b3c5;
  1265. font-size: 32px;
  1266. height: 72px;
  1267. cursor: pointer;
  1268. .icon-switch {
  1269. display: inline-block;
  1270. width: 36px;
  1271. height: 36px;
  1272. background: url('@/assets/images/map/rightMenu/onlinePlotting/switch1.png') no-repeat;
  1273. background-size: 100% 100%;
  1274. margin-right: 16px;
  1275. }
  1276. .icon-eye {
  1277. display: inline-block;
  1278. width: 36px;
  1279. height: 30px;
  1280. background: url('@/assets/images/map/rightMenu/onlinePlotting/show1.png') no-repeat;
  1281. background-size: 100% 100%;
  1282. margin-right: 16px;
  1283. }
  1284. .icon-eye2 {
  1285. display: inline-block;
  1286. width: 36px;
  1287. height: 35px;
  1288. background: url('@/assets/images/map/rightMenu/onlinePlotting/hide1.png') no-repeat;
  1289. background-size: 100% 100%;
  1290. margin-right: 16px;
  1291. }
  1292. .icon-delete {
  1293. display: inline-block;
  1294. width: 32px;
  1295. height: 33px;
  1296. background: url('@/assets/images/map/rightMenu/onlinePlotting/delete1.png') no-repeat;
  1297. background-size: 100% 100%;
  1298. margin-right: 16px;
  1299. }
  1300. &:hover {
  1301. color: #00fde7;
  1302. background: #1e3b77;
  1303. .icon-switch {
  1304. background: url('@/assets/images/map/rightMenu/onlinePlotting/switch2.png') no-repeat;
  1305. background-size: 100% 100%;
  1306. }
  1307. .icon-eye {
  1308. background: url('@/assets/images/map/rightMenu/onlinePlotting/show2.png') no-repeat;
  1309. background-size: 100% 100%;
  1310. }
  1311. .icon-eye2 {
  1312. background: url('@/assets/images/map/rightMenu/onlinePlotting/hide2.png') no-repeat;
  1313. background-size: 100% 100%;
  1314. }
  1315. .icon-delete {
  1316. background: url('@/assets/images/map/rightMenu/onlinePlotting/delete2.png') no-repeat;
  1317. background-size: 100% 100%;
  1318. }
  1319. }
  1320. }
  1321. }
  1322. }
  1323. .tab {
  1324. width: 333px;
  1325. height: 235px;
  1326. background: url('@/assets/images/map/rightMenu/onlinePlotting/box2.png') no-repeat;
  1327. padding: 27px;
  1328. cursor: pointer;
  1329. position: relative;
  1330. font-size: 38px;
  1331. color: #eaf3fc;
  1332. display: flex;
  1333. flex-direction: column;
  1334. justify-content: center;
  1335. align-items: center;
  1336. margin-top: 40px;
  1337. &:hover {
  1338. background: url('@/assets/images/map/rightMenu/onlinePlotting/boxHover2.png') no-repeat;
  1339. }
  1340. .checked1 {
  1341. position: absolute;
  1342. top: 30px;
  1343. right: 30px;
  1344. width: 32px;
  1345. height: 32px;
  1346. background: url('@/assets/images/map/rightMenu/onlinePlotting/checked1.png') no-repeat;
  1347. }
  1348. .checked2 {
  1349. position: absolute;
  1350. top: 30px;
  1351. right: 30px;
  1352. width: 36px;
  1353. height: 36px;
  1354. background: url('@/assets/images/map/rightMenu/onlinePlotting/checked2.png') no-repeat;
  1355. }
  1356. }
  1357. .tab_active {
  1358. background: url('@/assets/images/map/rightMenu/onlinePlotting/boxActive2.png') no-repeat;
  1359. }
  1360. }
  1361. }
  1362. .tipTitle {
  1363. position: absolute;
  1364. top: 0;
  1365. left: -2745px;
  1366. z-index: 2;
  1367. padding: 10px 30px;
  1368. font-size: 38px;
  1369. color: #fff;
  1370. background-color: rgba(0, 0, 0, 0.4);
  1371. border-radius: 10px;
  1372. }
  1373. .tab-content3 {
  1374. .custom-table {
  1375. width: 100%;
  1376. color: #000;
  1377. .table-header {
  1378. display: flex;
  1379. font-size: 38px;
  1380. width: 100%;
  1381. background-color: #194ba0;
  1382. .th {
  1383. padding: 25px 30px;
  1384. flex: 1;
  1385. color: #edfaff;
  1386. &:last-child {
  1387. flex: unset;
  1388. width: 620px;
  1389. }
  1390. }
  1391. }
  1392. .tr {
  1393. display: flex;
  1394. font-size: 38px;
  1395. width: 1487px;
  1396. background: url('@/assets/images/map/rightMenu/onlinePlotting/tr.png') no-repeat;
  1397. background-size: 100% 100%;
  1398. margin-top: 10px;
  1399. &:hover {
  1400. background: url('@/assets/images/map/rightMenu/onlinePlotting/trActive.png') no-repeat;
  1401. }
  1402. .td {
  1403. padding: 25px 30px;
  1404. color: #edfaff;
  1405. flex: 1;
  1406. .icon {
  1407. margin: 0 10px;
  1408. cursor: pointer;
  1409. }
  1410. }
  1411. .td2 {
  1412. flex: unset;
  1413. width: 620px;
  1414. display: flex;
  1415. justify-content: center;
  1416. align-items: center;
  1417. }
  1418. }
  1419. }
  1420. }
  1421. .color-container {
  1422. width: 80px;
  1423. height: 50px;
  1424. display: flex;
  1425. justify-content: center;
  1426. align-items: center;
  1427. position: relative;
  1428. background-color: #0d3980;
  1429. border: 4px solid #0b5fbb;
  1430. margin-left: 20px;
  1431. :deep(.el-color-picker) {
  1432. height: 60px !important;
  1433. }
  1434. &::before {
  1435. content: '';
  1436. position: absolute;
  1437. top: 0;
  1438. left: 0;
  1439. width: 12px;
  1440. height: 12px;
  1441. background: url('@/assets/images/inputIcon1.png') no-repeat;
  1442. }
  1443. &::after {
  1444. content: '';
  1445. position: absolute;
  1446. right: 0;
  1447. bottom: 0;
  1448. width: 12px;
  1449. height: 12px;
  1450. background: url('@/assets/images/inputIcon2.png') no-repeat;
  1451. }
  1452. }
  1453. .params-box {
  1454. margin: 30px 0;
  1455. }
  1456. .footer {
  1457. display: flex;
  1458. justify-content: flex-end;
  1459. margin-top: 30px;
  1460. padding-right: 40px;
  1461. :deep(.el-pagination__total) {
  1462. color: #a7ccdf;
  1463. font-size: 32px;
  1464. }
  1465. :deep(.el-pagination) {
  1466. .btn-next,
  1467. .btn-prev {
  1468. background-color: transparent;
  1469. border: none;
  1470. .el-icon {
  1471. font-size: 22px;
  1472. color: #a7ccdf;
  1473. }
  1474. }
  1475. .el-pager li {
  1476. width: 64px;
  1477. height: 64px;
  1478. line-height: 64px;
  1479. text-align: center;
  1480. font-size: 32px;
  1481. color: #a7ccdf;
  1482. background-color: #0e3064;
  1483. border: 1px solid #0c57a7;
  1484. margin: 0 6px;
  1485. &:hover {
  1486. background-color: #038dff;
  1487. border: 1px solid #038dff;
  1488. }
  1489. }
  1490. .el-pager li.is-active {
  1491. background-color: #038dff;
  1492. border: 1px solid #038dff;
  1493. }
  1494. }
  1495. }
  1496. .btn-box {
  1497. display: flex;
  1498. align-items: center;
  1499. }
  1500. </style>