月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-09-14 25d930f19475c075d75a10799c7dde4421c31ee9
图层管理,在线制图,地名定位修改
已修改4个文件
93 ■■■■■ 文件已修改
src/api/api.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/Map/menuData.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/layer/layerDetail.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/search/search.vue 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/api.js
@@ -100,3 +100,9 @@
export function selectByPolyline(params) {
  return request.get("/rasterAnalysis/selectByPolyline", { params: params });
}
//数据管理=>更新数简服务
export function publish_updateSjLayerStretch(params) {
  return request.post("/publish/updateSjLayerStretch", params);
}
src/assets/js/Map/menuData.js
@@ -226,13 +226,13 @@
      level: 1,
      checkImgUrl: "椭圆 3 拷贝 22.png",
    },
    {
      id: "t3",
      imgUrl: "清除.png",
      level: 1,
      name: "清除",
      checkImgUrl: "清除 拷贝 2.png",
    },
    // {
    //   id: "t3",
    //   imgUrl: "清除.png",
    //   level: 1,
    //   name: "清除",
    //   checkImgUrl: "清除 拷贝 2.png",
    // },
    {
      id: "t4",
      imgUrl: "形状 9.png",
src/views/layer/layerDetail.vue
@@ -83,7 +83,7 @@
          />
        </div>
      </div>
      <div
      <!-- <div
        class="selectBox"
        v-show="colorShow"
      >
@@ -101,8 +101,8 @@
          ></el-option>
        </el-select>
      </div>
      <div
      </div> -->
      <!-- <div
        class="selectBox"
        v-show="colorShow "
      >
@@ -133,10 +133,10 @@
              :style="item.domCss"
            ></div>
            <!-- <img :src="item.url" style="height: 30px; width: 100%" /> -->
          </el-option>
        </el-select>
      </div>
      </div> -->
      <div v-show="colorShow">
        <div class="selectBox">
          <el-button
@@ -168,6 +168,7 @@
import {
  publish_selectSjColorTables,
  publish_updateSjService,
  publish_updateSjLayerStretch,
} from "@/api/api";
import { ElMessage } from "element-plus";
import store from "@/store";
@@ -428,25 +429,31 @@
    geom = releaseLayer.value.geom;
  }
  var obj = {
    colorTable: color1, // 普通颜色表,可不设
    gradientColorTable: color2,
    // colorTable: color1, // 普通颜色表,可不设
    // gradientColorTable: color2,
    enhanceType: stretchValue.value, // 拉伸方式 0:不拉伸,1 线性拉伸,2 直方图均衡,3 标准差拉伸,4 伽马拉伸
    enhanceFactor: stretchNum.value, // 拉伸因子 null 或 小数
    dircode: "00", // 目录编码
    epsg: 104903, // 104903-月球2000,4326-WGS84
    ids: null, // 不要设定
    name: releaseLayer.value.cnName, // 当前服务名称
    nodata: 0, // 黑色-0,白色-255
    type: releaseLayer.value.type, // 影像-DOM,高程-
    geom: geom,
    pubid: releaseLayer.value.pubid,
    // dircode: "00", // 目录编码
    // epsg: 104903, // 104903-月球2000,4326-WGS84
    layerId: releaseLayer.value.id, // 不要设定
    // name: releaseLayer.value.cnName, // 当前服务名称
    // nodata: 0, // 黑色-0,白色-255
    // type: releaseLayer.value.type, // 影像-DOM,高程-
    // geom: geom,
    // pubid: releaseLayer.value.pubid,
  };
  publish_updateSjService(obj).then((res) => {
  store.state.loading = true;
  publish_updateSjLayerStretch(obj).then((res) => {
    if (res.code != 200) {
      return ElMessage(data.msg);
    }
    if (res.code == 200 && res.result > 0) {
      store.state.loading = false;
    store.state.restLayer = true;
    setSpatialClose();
    } else {
      store.state.loading = false;
    }
  });
  // const data = ;
  // console.log("1122223" + data.code);
@@ -465,7 +472,7 @@
    colorShow.value = true;
  }
});
getColorJson();
// getColorJson();
</script>
<style lang="less" scoped>
src/views/search/search.vue
@@ -115,6 +115,7 @@
// import config from "../../../public/config/config.js";
import { dataQuery_selectByPage } from "@/api/api.js";
import { ElMessage } from "element-plus";
import menuTool from "@/assets/js/Map/menuTool";
let searchValue = ref("");
const searchFLag = ref(false);
const tableData = ref([]);
@@ -129,25 +130,26 @@
const NumhandleChange = (value: number) => {};
const handleChange = (val: string[]) => {};
const setPoitCannel = () => {
  if (imageLabel) {
    imageLabel.deleteObject();
    imageLabel = null;
  }
  // if (imageLabel) {
  // imageLabel.deleteObject();
  // imageLabel = null;
  // }
  menuTool.setClearLocation("地名定位");
};
const setPointLocal = (res) => {
  if (imageLabel) {
    setPoitCannel();
  }
  var position = { X: res.lon, Y: res.lat, Altitude: 10 };
  imageLabel = window.sgworld.Creator.CreateImageLabel(
    position,
    config.StaticFileBaseUrl + "/Workers/image/location.png",
    {},
    0,
    "标签点"
  );
  var id = imageLabel.item.id;
  window.sgworld.Navigate.flyToObj(imageLabel.item);
  menuTool.setLocationPoint([res.lon, res.lat], "地名定位");
  // imageLabel = window.sgworld.Creator.CreateImageLabel(
  //   position,
  //   config.StaticFileBaseUrl + "/Workers/image/location.png",
  //   {},
  //   0,
  //   "标签点"
  // );
  // var id = imageLabel.item.id;
  // window.sgworld.Navigate.flyToObj(imageLabel.item);
  // window.earthCtrl.camera.flyTo(res.log, res.lat, 300, 9.5, -45, 0.0, 5);
};
const setInputCahgne = () => {