index.vue 40 KB

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