index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960
  1. <template>
  2. <div class="base-container">
  3. <fnHeader></fnHeader>
  4. <div class="top-bg"></div>
  5. <el-upload
  6. ref="uploadRef"
  7. class="upload-demo"
  8. :limit="1"
  9. :on-exceed="handleExceed"
  10. :on-success="onSuccess"
  11. :before-upload="beforeUpload"
  12. action="https://feiniaotech-dev.sysuimars.cn/site/plugin_ownership/uploadFile"
  13. :headers="headerUpload"
  14. >
  15. <template #trigger>
  16. <div class="btn blue" :class="{ 'disabled-button': !disabledForm && isEdit }">
  17. <el-icon><Upload /></el-icon>
  18. <span>RTK点位数据导入</span>
  19. </div>
  20. </template>
  21. </el-upload>
  22. <div class="top">
  23. <!-- <div class="back btn" @click="goBack">
  24. <img class="icon" src="@/assets/images/common/back-icon.png" alt="" />
  25. <span>返回</span>
  26. </div> -->
  27. <el-select
  28. v-model="locationVal"
  29. filterable
  30. remote
  31. :disabled="!disabledForm && isEdit"
  32. effect="dark"
  33. reserve-keyword
  34. placeholder="搜索地区"
  35. :remote-method="remoteMethod"
  36. :loading="loading"
  37. @change="handleSearchRes"
  38. class="v-select"
  39. >
  40. <template #prefix>
  41. <el-icon class="el-input__icon"><search /></el-icon>
  42. </template>
  43. <el-option
  44. v-for="(item, index) in locationOptions.list"
  45. :key="index"
  46. :label="item.title"
  47. :value="item.point"
  48. >
  49. <span>{{ item.title }}</span>
  50. <span class="sub-title">{{ item.province }}{{ item.city }}{{ item.district }}</span>
  51. </el-option>
  52. </el-select>
  53. <div class="search">
  54. <div class="add btn" :class="{ 'disabled-button': !disabledForm && isEdit }" @click="handleAdd">
  55. <el-icon><Plus /></el-icon>
  56. <span>创建</span>
  57. </div>
  58. <div class="upload btn" :class="{ 'disabled-button': !disabledForm && isEdit }" @click="handleExport">
  59. <img class="icon" src="@/assets/images/common/back-icon.png" alt="" />
  60. <span>导出</span>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="content">
  65. <el-form :inline="true" :model="formInlineSearch" class="search-form" ref="formInlineRef">
  66. <el-form-item label="农场地址">
  67. <el-input v-model="formInlineSearch.address" placeholder="请输入农场地址" clearable />
  68. </el-form-item>
  69. <el-form-item label="农场名称">
  70. <el-input v-model="formInlineSearch.farmName" placeholder="请输入农场名称" clearable />
  71. </el-form-item>
  72. <el-form-item label="作物物种">
  73. <el-input v-model="formInlineSearch.speciesTypeName" placeholder="请输入作物物种" clearable />
  74. </el-form-item>
  75. <el-form-item label="客户姓名">
  76. <el-input v-model="formInlineSearch.masterName" placeholder="请输入客户姓名" clearable />
  77. </el-form-item>
  78. <el-form-item label="联系电话">
  79. <el-input v-model="formInlineSearch.masterTel" placeholder="请输入联系电话" clearable />
  80. </el-form-item>
  81. <div class="button">
  82. <el-button
  83. class="btn"
  84. :class="{ 'disabled-button': !disabledForm && isEdit }"
  85. type="primary"
  86. @click="onSearch"
  87. >查询</el-button
  88. >
  89. <el-button class="btn reset" :class="{ 'disabled-button': !disabledForm && isEdit }" @click="onRest"
  90. >重置</el-button
  91. >
  92. </div>
  93. </el-form>
  94. <div class="box">
  95. <div class="map-box" :class="{ 'cursor-pointer': mouseStyle }">
  96. <div ref="mapRef" class="map"></div>
  97. </div>
  98. <div class="tool-group">
  99. <!-- <div class="btn" @click="handleCancel">
  100. <img class="icon" src="@/assets/images/common/back-black-icon.png" alt="" />
  101. <span>撤销</span>
  102. </div> -->
  103. <!-- <div
  104. class="btn"
  105. @click="handleDeletePoint"
  106. v-show="mapData.selectPointArr.length > 0 && !disabledForm"
  107. >
  108. <el-icon size="15"><CloseBold /></el-icon>
  109. <span>删除点</span>
  110. </div> -->
  111. <div class="btn delete" @click="handleDelete" v-show="mapData.selectPointArr.length > 0">
  112. <el-icon size="15" color="#fff"><CloseBold /></el-icon>
  113. <span>删除地块</span>
  114. </div>
  115. </div>
  116. <div class="edit-popup" v-show="isEdit">
  117. <div class="edit-title">
  118. <div class="name">
  119. <img src="@/assets/images/common/chart-icon.png" alt="" />
  120. <span>地块属性</span>
  121. </div>
  122. <div class="btn-group">
  123. <div v-show="disabledForm" class="edit" @click="handleEdit">编辑</div>
  124. <div v-show="!disabledForm" class="edit" @click="handleDeletePoint">删除点</div>
  125. <div
  126. v-show="mapData.selectPointArr.length > 0"
  127. class="edit ml"
  128. :class="{ 'disabled-button': !disabledForm }"
  129. @click="handlePrint"
  130. >
  131. 打印
  132. </div>
  133. </div>
  134. </div>
  135. <div class="edit-cont">
  136. <el-form
  137. :inline="true"
  138. ref="ruleFormRef"
  139. :disabled="disabledForm"
  140. :model="formInline"
  141. :rules="rules"
  142. label-position="top"
  143. class="form-inline"
  144. >
  145. <el-form-item label="农场地址" prop="address">
  146. <el-input v-model="formInline.address" placeholder="请输入农场地址" clearable />
  147. </el-form-item>
  148. <el-form-item label="农场名称" prop="farmName">
  149. <el-input v-model="formInline.farmName" placeholder="请输入农场名称" clearable />
  150. </el-form-item>
  151. <el-form-item label="创建时间">
  152. <el-input v-model="formInline.createDate" clearable disabled />
  153. </el-form-item>
  154. <el-form-item label="农场面积">
  155. <el-input v-model="formInline.mu" disabled clearable />
  156. </el-form-item>
  157. <el-form-item label="作物物种" prop="speciesTypeName">
  158. <el-input v-model="formInline.speciesTypeName" placeholder="请输入作物物种" clearable />
  159. </el-form-item>
  160. <el-form-item label="客户姓名" prop="masterName">
  161. <el-input v-model="formInline.masterName" placeholder="请输入姓名" clearable />
  162. </el-form-item>
  163. <el-form-item label="联系电话" prop="masterTel">
  164. <el-input v-model="formInline.masterTel" placeholder="请输入联系电话" clearable />
  165. </el-form-item>
  166. </el-form>
  167. <div class="list-box" v-show="pointList.length > 0">
  168. <span>边界点经纬度</span>
  169. <div class="list-cont">
  170. <div class="list-item" v-for="(item, index) in pointList" :key="index">
  171. <span>A{{ index + 1 }}</span>
  172. <div class="item-box">北纬{{ item[1] }}</div>
  173. <div class="item-box">东经{{ item[0] }}</div>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. <div class="edit-footer">
  179. <div @click="onCancel" class="btn cancel">取消</div>
  180. <div @click="onSubmit" class="btn save">保存</div>
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. <!-- 导出弹窗 -->
  187. <el-dialog v-model="dialogVisible" width="82%" center :show-close="false" modal-class="dialog-dark">
  188. <div>
  189. <el-table :data="gridData" border max-height="600" class="table-dark">
  190. <el-table-column property="farmName" label="农场名称" show-overflow-tooltip />
  191. <el-table-column property="address" label="农场地址" width="230" show-overflow-tooltip />
  192. <el-table-column property="createDate" label="创建时间" width="170" />
  193. <el-table-column property="mu" label="农场面积">
  194. <template #default="scope">
  195. <span>{{ scope.row.mu }}亩</span>
  196. </template>
  197. </el-table-column>
  198. <el-table-column property="speciesTypeName" label="作物物种" />
  199. <el-table-column property="masterName" label="客户姓名" />
  200. <el-table-column property="masterTel" width="120" label="联系电话" />
  201. <el-table-column property="points" label="边界点经纬度" width="480" show-overflow-tooltip />
  202. </el-table>
  203. </div>
  204. <template #footer>
  205. <div class="dialog-footer">
  206. <el-button class="btn" @click="dialogVisible = false">取消</el-button>
  207. <el-button class="btn" type="primary" @click="handleDowload"> 下载 </el-button>
  208. </div>
  209. </template>
  210. </el-dialog>
  211. <Pdf
  212. :title="formInline.id + ''"
  213. :showDialog="pdfShow"
  214. @closeDialog="pdfShow = false"
  215. v-if="formInline.id && pdfShow"
  216. :rowId="formInline.id"
  217. ></Pdf>
  218. </template>
  219. <script setup>
  220. import { onMounted, ref, reactive, watchEffect, watch } from "vue";
  221. import fnHeader from "@/components/fnHeader.vue";
  222. import AuthenticMap from "./authenticMap";
  223. import { mapData } from "./authenticMap";
  224. import { useRouter } from "vue-router";
  225. import { ElMessage, ElMessageBox } from "element-plus";
  226. import { dateFormat } from "@/utils/date_util";
  227. import { exportExcel, parseMultiPolygon } from "@/utils/index";
  228. import { useStore } from "vuex";
  229. import Pdf from "./Pdf";
  230. const pdfShow = ref(false);
  231. const mouseStyle = ref(1);
  232. const router = useRouter();
  233. const store = useStore();
  234. let authenticMap = new AuthenticMap();
  235. const mapRef = ref();
  236. const userInfo = JSON.parse(sessionStorage.getItem("userinfo"));
  237. const location = ref(userInfo.location);
  238. onMounted(() => {
  239. authenticMap.initMap(location.value, mapRef.value);
  240. getList();
  241. });
  242. // 获取地块列表
  243. const plotList = ref([]);
  244. const getList = (callback) => {
  245. authenticMap.clearLayer();
  246. return VE_API.authentic.getList(formInlineSearch).then(({ code, data }) => {
  247. plotList.value = data || [];
  248. const geom = [];
  249. data.forEach((item) => {
  250. geom.push({ featureWkt: item.geom, ...item });
  251. });
  252. authenticMap.setAreaGeometry(geom);
  253. authenticMap.addPoint(data);
  254. callback && callback(geom);
  255. });
  256. };
  257. // 搜索
  258. const locationVal = ref("");
  259. const loading = ref(false);
  260. const MAP_KEY = "CZLBZ-LJICQ-R4A5J-BN62X-YXCRJ-GNBUT";
  261. const handleSearchRes = (v) => {
  262. authenticMap.setMapCenter(v);
  263. onRest();
  264. };
  265. const locationOptions = reactive({
  266. list: [],
  267. });
  268. const remoteMethod = async (keyword) => {
  269. if (keyword) {
  270. locationOptions.list = [];
  271. loading.value = true;
  272. const params = {
  273. key: MAP_KEY,
  274. keyword,
  275. // location: location.value,
  276. location: "22.574540836684672,113.1093017627431",
  277. };
  278. await VE_API.old_mini_map.getCtiyList({ word: keyword }).then(({ data }) => {
  279. if (data && data.length) {
  280. data.forEach((item) => {
  281. item.point = item.location.lat + "," + item.location.lng;
  282. locationOptions.list.push(item);
  283. });
  284. }
  285. });
  286. VE_API.old_mini_map.search(params).then(({ data }) => {
  287. loading.value = false;
  288. data.forEach((item) => {
  289. item.point = item.location.lat + "," + item.location.lng;
  290. locationOptions.list.push(item);
  291. });
  292. });
  293. } else {
  294. locationOptions.list = [];
  295. }
  296. };
  297. const validatePhoneNumber = (rule, value, callback) => {
  298. const phoneRegex = /^[1][3-9]\d{9}$/;
  299. if (!value) {
  300. callback(new Error("请输入联系电话"));
  301. } else if (!phoneRegex.test(value)) {
  302. callback(new Error("手机号码格式不正确"));
  303. } else {
  304. callback();
  305. }
  306. };
  307. const rules = {
  308. address: [{ required: true, message: "请输入农场地址", trigger: "change" }],
  309. farmName: [{ required: true, message: "请输入农场名称", trigger: "change" }],
  310. speciesTypeName: [{ required: true, message: "请输入作物物种", trigger: "change" }],
  311. masterName: [{ required: true, message: "请输入姓名", trigger: "change" }],
  312. masterTel: [{ required: true, validator: validatePhoneNumber, trigger: "change" }],
  313. };
  314. const ruleFormRef = ref(null);
  315. const initForm = {
  316. id: "",
  317. address: "",
  318. farmName: "",
  319. createDate: "",
  320. mu: "",
  321. speciesTypeName: "",
  322. masterName: "",
  323. masterTel: "",
  324. geom: "",
  325. };
  326. const formInline = reactive({
  327. ...initForm,
  328. });
  329. const disabledForm = ref(false);
  330. // 筛选
  331. const formInlineRef = ref(null);
  332. const formInlineSearch = reactive({
  333. ...initForm,
  334. });
  335. const onSearch = () => {
  336. authenticMap.search(formInlineSearch);
  337. };
  338. const onRest = () => {
  339. Object.assign(formInlineSearch, initForm);
  340. isUpdata.value = false;
  341. onCancel();
  342. };
  343. const isEdit = ref(false);
  344. const typeStr = ref("");
  345. // 编辑
  346. const handleEdit = () => {
  347. typeStr.value = "edit";
  348. disabledForm.value = false;
  349. mapData.disabledForm = false;
  350. authenticMap.startModify();
  351. };
  352. // 取消
  353. const isUpdata = ref(true);
  354. const onCancel = () => {
  355. isEdit.value = false;
  356. store.commit("authentic/SET_ISEDIT_STATUS", false);
  357. if (isUpdata.value) {
  358. authenticMap.cancelDraw();
  359. } else {
  360. Object.assign(formInlineSearch, initForm);
  361. getList((geoms) => {
  362. authenticMap.allUnSelect();
  363. });
  364. }
  365. authenticMap.setPoint("point");
  366. authenticMap.clearMapData("isEdit", false, formInline.id);
  367. authenticMap.endDraw();
  368. };
  369. // 保存
  370. const onSubmit = () => {
  371. if (!ruleFormRef.value) return;
  372. ruleFormRef.value.validate((valid, fields) => {
  373. if (valid) {
  374. formInline.mu = formInline.mu.split("亩")[0];
  375. VE_API.authentic.saveData(formInline).then((res) => {
  376. store.commit("authentic/SET_ISEDIT_STATUS", false);
  377. isUpdata.value = false;
  378. disabledForm.value = true;
  379. mapData.disabledForm = true;
  380. Object.assign(formInlineSearch, initForm);
  381. authenticMap.endDraw();
  382. getList().then(() => {
  383. isRefresh.value = false;
  384. isEdit.value = false;
  385. authenticMap.allUnSelect();
  386. authenticMap.clearMapData();
  387. // authenticMap.getSelectPointArr(
  388. // point.id || plotList.value[plotList.value.length - 1].id
  389. // );
  390. });
  391. });
  392. }
  393. });
  394. };
  395. //上传
  396. const uploadRef = ref(null);
  397. const headerUpload = { token: store.getters.token };
  398. // 校验文件格式和大小
  399. const beforeUpload = (file) => {
  400. const isCsv = file.type === "application/vnd.ms-excel" || file.type === "text/csv" || file.name.endsWith(".csv");
  401. updateFormInline({ ...initForm });
  402. ruleFormRef.value.resetFields();
  403. onCancel()
  404. if (!isCsv) {
  405. ElMessage.error("上传文件只能是 CSV 格式!");
  406. }
  407. return isCsv;
  408. };
  409. const handleExceed = (files) => {
  410. uploadRef.value.clearFiles();
  411. const file = files[0];
  412. uploadRef.value.handleStart(file);
  413. };
  414. const heightArr = ref([]);
  415. const onSuccess = (res) => {
  416. typeStr.value = "upload";
  417. if (res.code === 0) {
  418. ElMessage.success("上传成功");
  419. store.commit("authentic/SET_ISEDIT_STATUS", true);
  420. isEdit.value = true;
  421. disabledForm.value = false;
  422. formInline.createDate = dateFormat(new Date(), "YYYY-mm-dd HH:MM:SS");
  423. const geom = [{ featureWkt: res.data.geom, ...res.data }];
  424. authenticMap.setAreaGeometry(geom);
  425. authenticMap.fit([res.data.geom]);
  426. updatePointList("upload");
  427. heightArr.value = res.data.height;
  428. const arr = pointList.value.map((item, index) => {
  429. return [...item, res.data.height[index]];
  430. });
  431. getArea(arr);
  432. authenticMap.startModify("upload");
  433. uploadRef.value.clearFiles();
  434. } else {
  435. ElMessage.error("上传失败");
  436. }
  437. };
  438. // 获取面积/亩
  439. const getArea = (arr) => {
  440. VE_API.authentic.getArea(arr).then((res) => {
  441. const area = (res.data / 666.67).toFixed(2);
  442. formInline.mu = area + "亩";
  443. });
  444. };
  445. // 打印
  446. const handlePrint = () => {
  447. pdfShow.value = true;
  448. };
  449. // 返回
  450. const goBack = () => {
  451. router.go(-1);
  452. };
  453. function updateFormInline(newData, name) {
  454. Object.assign(formInline, newData);
  455. }
  456. // 删除地块
  457. const handleDelete = () => {
  458. const id = mapData.selectPointArr.map((item) => item.values_.id);
  459. if (id.length < 0) return ElMessage("请选择地块");
  460. ElMessageBox.confirm("您确定删除该地块吗?", "提示", {
  461. confirmButtonText: "确认",
  462. cancelButtonText: "取消",
  463. type: "warning",
  464. })
  465. .then(() => {
  466. VE_API.authentic.deleteData(id).then((res) => {
  467. isUpdata.value = false;
  468. onCancel();
  469. });
  470. })
  471. .catch(() => {});
  472. };
  473. // 创建
  474. const isRefresh = ref(true);
  475. const handleAdd = () => {
  476. typeStr.value = "add";
  477. isRefresh.value = false;
  478. isEdit.value = false;
  479. if (isUpdata.value) {
  480. authenticMap.cancelDraw();
  481. authenticMap.allUnSelect();
  482. } else {
  483. getList();
  484. isUpdata.value = true;
  485. }
  486. updateFormInline({ ...initForm });
  487. ruleFormRef.value.resetFields();
  488. pointList.value = [];
  489. authenticMap.clearMapData("curPointData", {});
  490. authenticMap.clearMapData("isEdit", false);
  491. authenticMap.setPoint("point");
  492. authenticMap.startDraw();
  493. };
  494. // 删除点
  495. const handleDeletePoint = () => {
  496. authenticMap.removePoint(() => {
  497. updatePointList(typeStr.value);
  498. });
  499. };
  500. // 撤销
  501. const handleCancel = () => {
  502. authenticMap.undoLastDraw();
  503. };
  504. // 导出
  505. const gridData = ref([]);
  506. const dialogVisible = ref(false);
  507. const handleExport = () => {
  508. if (mapData.selectPointArr.length < 1) return ElMessage("请选择地块");
  509. const ids = mapData.selectPointArr.map((item) => item.values_.id);
  510. VE_API.authentic.exportData(ids).then(({ data }) => {
  511. gridData.value = data.map((item) => {
  512. return {
  513. ...item,
  514. createDate: dateFormat(new Date(item.createDate), "YYYY-mm-dd HH:MM:SS"),
  515. };
  516. });
  517. dialogVisible.value = true;
  518. });
  519. };
  520. // 下载
  521. const handleDowload = () => {
  522. const fieldLabels = [
  523. "农场名称",
  524. "农场地址",
  525. "创建时间",
  526. "农场面积",
  527. "作物物种",
  528. "客户姓名",
  529. "联系电话",
  530. "边界点经纬度",
  531. ];
  532. const fieldKeys = [
  533. "farmName",
  534. "address",
  535. "createDate",
  536. "mu",
  537. "speciesTypeName",
  538. "masterName",
  539. "masterTel",
  540. "points",
  541. ];
  542. const fileName = "农场数据" + dateFormat(new Date(), "YYYY-mm-dd HH:MM");
  543. exportExcel(gridData.value, fieldLabels, fieldKeys, fileName);
  544. };
  545. const pointList = ref([]);
  546. // 获取编辑回显数据
  547. const getDetailsData = (id) => {
  548. VE_API.authentic.getDetails({ id }).then(({ data }) => {
  549. isEdit.value = true;
  550. disabledForm.value = true;
  551. mapData.disabledForm = true;
  552. data.createDate = dateFormat(new Date(data.createDate), "YYYY-mm-dd HH:MM:SS");
  553. updateFormInline({ ...data });
  554. formInline.mu = data.mu + "亩";
  555. // 经纬度列表
  556. let arr = JSON.parse(data.points);
  557. // 删除最后数组最后一项闭合数据
  558. arr.pop();
  559. pointList.value = arr;
  560. });
  561. };
  562. // 添加经纬度列表
  563. const updatePointList = (type) => {
  564. const { geometryArr, area } = authenticMap.getAreaGeometry(type);
  565. const lastItem = geometryArr[geometryArr.length - 1];
  566. formInline.geom = lastItem.featureWkt;
  567. let result = parseMultiPolygon(lastItem.featureWkt);
  568. result.pop();
  569. pointList.value = result;
  570. //判断是否是导入数据,
  571. if (store.state.authentic.isEditStatus) {
  572. const arr = pointList.value.map((item, index) => {
  573. return [...item, heightArr.value[index]];
  574. });
  575. if (arr[0][2]) {
  576. getArea(arr);
  577. }
  578. } else {
  579. formInline.mu = area + "亩";
  580. }
  581. };
  582. watchEffect(() => {
  583. if (mapData.isEditArea) {
  584. isUpdata.value = false;
  585. updatePointList("edit");
  586. }
  587. });
  588. watch(
  589. () => mapData.isEdit,
  590. (newVale, oldValue) => {
  591. if (newVale && mapData.selectPointArr.length < 2 && !isRefresh.value) {
  592. isEdit.value = true;
  593. disabledForm.value = false;
  594. mapData.disabledForm = false;
  595. isUpdata.value = true;
  596. formInline.createDate = dateFormat(new Date(), "YYYY-mm-dd HH:MM:SS");
  597. updatePointList("add");
  598. authenticMap.startModify();
  599. }
  600. }
  601. );
  602. watch(
  603. () => mapData.selectPointArr,
  604. (newVale, oldValue) => {
  605. if (mapData.selectPointArr.length === 1) {
  606. const obj = mapData.selectPointArr[0];
  607. const id = obj.values_.id;
  608. getDetailsData(id);
  609. mapData.curPointData = obj.values_;
  610. } else {
  611. if (isRefresh.value) {
  612. isEdit.value = false;
  613. authenticMap.endDraw();
  614. isRefresh.value = true;
  615. }
  616. if (mapData.selectPointArr.length === 0 || mapData.selectPointArr.length > 1) {
  617. isEdit.value = false;
  618. }
  619. }
  620. }
  621. );
  622. </script>
  623. <style lang="scss" scoped>
  624. ::v-deep {
  625. .el-upload-list {
  626. display: none;
  627. }
  628. }
  629. .base-container {
  630. width: 100%;
  631. height: 100vh;
  632. color: #fff;
  633. box-sizing: border-box;
  634. z-index: 1;
  635. position: relative;
  636. .top-bg {
  637. position: absolute;
  638. top: 0;
  639. width: 100%;
  640. height: 74px;
  641. background: #101010;
  642. z-index: -1;
  643. }
  644. .upload-demo {
  645. display: flex;
  646. align-items: center;
  647. justify-content: flex-end;
  648. padding-right: 20px;
  649. background: #101010;
  650. }
  651. .blue {
  652. background: #2199f8;
  653. }
  654. .btn {
  655. display: flex;
  656. align-items: center;
  657. padding: 6px 16px;
  658. border-radius: 4px;
  659. cursor: pointer;
  660. .icon {
  661. width: 13px;
  662. height: 13px;
  663. }
  664. span {
  665. margin-left: 10px;
  666. }
  667. }
  668. .disabled-button {
  669. pointer-events: none;
  670. opacity: 0.5;
  671. cursor: not-allowed;
  672. }
  673. .top {
  674. display: flex;
  675. justify-content: space-between;
  676. // justify-content: flex-end;
  677. width: 100%;
  678. height: 40px;
  679. background: #101010;
  680. padding: 17px 20px 0 20px;
  681. box-sizing: border-box;
  682. display: flex;
  683. align-items: center;
  684. .back {
  685. border: 1px solid rgba(255, 255, 255, 0.4);
  686. }
  687. .v-select {
  688. width: 300px;
  689. ::v-deep {
  690. .el-select__wrapper {
  691. background: #101010;
  692. box-shadow: none;
  693. border: 1px solid rgba(255, 255, 255, 0.7);
  694. .el-select__input {
  695. color: #fff;
  696. }
  697. }
  698. }
  699. }
  700. .search {
  701. display: flex;
  702. align-items: center;
  703. justify-content: flex-end;
  704. width: 60%;
  705. .input-with-select {
  706. margin-left: 25px;
  707. }
  708. .upload {
  709. background: #2199f8;
  710. margin-left: 25px;
  711. }
  712. .add {
  713. background: #fff;
  714. color: #000;
  715. margin-left: 25px;
  716. }
  717. }
  718. }
  719. .content {
  720. width: 100%;
  721. height: calc(100% - 74px - 40px - 32px);
  722. box-sizing: border-box;
  723. background: #101010;
  724. padding: 13px 20px 20px 20px;
  725. .search-form {
  726. height: 40px;
  727. margin: 5px 0;
  728. display: flex;
  729. // justify-content: flex-end;
  730. justify-content: space-between;
  731. ::v-deep {
  732. .el-form-item__label {
  733. color: #fff;
  734. }
  735. .el-form-item__content {
  736. width: 190px;
  737. }
  738. .el-input__wrapper {
  739. background: #101010;
  740. box-shadow: none;
  741. border: 1px solid rgba(255, 255, 255, 0.7);
  742. .el-input__inner {
  743. color: #fff;
  744. }
  745. }
  746. }
  747. .button {
  748. display: flex;
  749. .btn {
  750. width: 84px;
  751. &.reset {
  752. margin-left: 25px;
  753. }
  754. }
  755. }
  756. }
  757. .box {
  758. border: 1px solid rgba(255, 255, 255, 0.4);
  759. border-radius: 8px;
  760. padding: 20px;
  761. box-sizing: border-box;
  762. background: #232323;
  763. width: 100%;
  764. height: calc(100% - 50px);
  765. position: relative;
  766. .map-box {
  767. width: 100%;
  768. height: 100%;
  769. border-radius: 4px;
  770. border: 1px solid rgba(255, 255, 255, 0.4);
  771. .map {
  772. width: 100%;
  773. height: 100%;
  774. }
  775. }
  776. .tool-group {
  777. position: absolute;
  778. display: flex;
  779. right: calc(500px + 36px);
  780. top: 42px;
  781. .btn {
  782. background: #fff;
  783. color: #000;
  784. margin-right: 10px;
  785. }
  786. .delete {
  787. background: #e45c5c;
  788. color: #fff;
  789. }
  790. }
  791. .edit-popup {
  792. width: 500px;
  793. height: calc(100% - 53px - 20px);
  794. position: absolute;
  795. top: 36px;
  796. right: 36px;
  797. border: 1px solid rgba(255, 255, 255, 0.4);
  798. border-radius: 8px;
  799. background: #232323;
  800. .edit-title {
  801. padding: 0 10px;
  802. background: rgba(68, 68, 68, 0.4);
  803. border-bottom: 1px solid rgba(68, 68, 68, 0.4);
  804. display: flex;
  805. align-items: center;
  806. justify-content: space-between;
  807. .btn-group {
  808. display: flex;
  809. .ml {
  810. margin-left: 20px;
  811. }
  812. }
  813. .name {
  814. display: flex;
  815. padding: 12px 0px;
  816. align-items: center;
  817. }
  818. span {
  819. margin-left: 8px;
  820. font-size: 18px;
  821. font-family: "SOURCEHANTIFINE";
  822. }
  823. .edit {
  824. color: #2199f8;
  825. padding: 6px 20px;
  826. border: 1px solid #2199f8;
  827. border-radius: 4px;
  828. cursor: pointer;
  829. }
  830. }
  831. .edit-cont {
  832. padding: 16px;
  833. width: calc(100% - 32px);
  834. height: calc(100% - 64px - 84px);
  835. .form-inline {
  836. height: 320px;
  837. ::v-deep {
  838. .el-input {
  839. width: 200px;
  840. --el-input-placeholder-color: #666666;
  841. }
  842. .el-form-item__label {
  843. color: #bbbbbb;
  844. }
  845. .el-input__wrapper {
  846. background: #232323;
  847. border: 1px solid #444444;
  848. box-shadow: none;
  849. .el-input__inner {
  850. color: #fff;
  851. }
  852. }
  853. }
  854. }
  855. .list-box {
  856. width: 100%;
  857. height: calc(100% - 320px);
  858. span {
  859. color: #bbbbbb;
  860. }
  861. .list-cont {
  862. width: 100%;
  863. height: calc(100% - 20px);
  864. border-radius: 4px;
  865. margin-top: 5px;
  866. background: rgba(68, 68, 68, 0.4);
  867. padding: 12px 16px;
  868. box-sizing: border-box;
  869. overflow-y: auto;
  870. .list-item {
  871. width: 100%;
  872. margin-bottom: 8px;
  873. display: flex;
  874. align-items: center;
  875. .item-box {
  876. padding: 8px;
  877. border: 1px solid #444444;
  878. border-radius: 4px;
  879. margin-left: 10px;
  880. }
  881. }
  882. }
  883. }
  884. }
  885. .edit-footer {
  886. width: 100%;
  887. height: 64px;
  888. display: flex;
  889. align-items: center;
  890. justify-content: flex-end;
  891. box-sizing: border-box;
  892. padding: 12px 16px;
  893. border-top: 1px solid rgba(68, 68, 68, 0.4);
  894. background: rgba(68, 68, 68, 0.4);
  895. .btn {
  896. padding: 10px 35px;
  897. }
  898. .cancel {
  899. border: 1px solid rgba(255, 255, 255, 0.4);
  900. margin-right: 16px;
  901. }
  902. .save {
  903. background: #2199f8;
  904. }
  905. }
  906. }
  907. }
  908. }
  909. }
  910. .dialog-footer {
  911. .btn {
  912. width: 200px;
  913. height: 40px;
  914. }
  915. }
  916. </style>