suerprisePlus
2024-06-27 6ae4841b48665145aa469d574fbadb988a9c498c
演示1版本
已修改15个文件
767 ■■■■■ 文件已修改
package-lock.json 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/config/config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/api.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/map/mapConfig.js 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/map/mapInfo.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/map/mapJsonLayer.js 275 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/map/mapView.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/map/modelLayer.js 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/msg/msgData.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Chat/chatList.vue 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Chat/enterBox.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Chat/index.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/chartView/index.vue 203 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/homePage/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json
@@ -9660,6 +9660,11 @@
      "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
      "dev": true
    },
    "indento": {
      "version": "1.1.13",
      "resolved": "https://registry.npmjs.org/indento/-/indento-1.1.13.tgz",
      "integrity": "sha512-YZWk3mreBEM7sBPddsiQnW9Z8SGg/gNpFfscJq00HCDS7pxcQWWWMSVKJU7YkTRyDu1Zv2s8zaK8gQWKmCXHlg=="
    },
    "indexes-of": {
      "version": "1.0.1",
      "resolved": "https://registry.npmmirror.com/indexes-of/-/indexes-of-1.0.1.tgz",
@@ -10417,6 +10422,14 @@
      "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==",
      "dev": true
    },
    "json2md": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/json2md/-/json2md-2.0.1.tgz",
      "integrity": "sha512-VbwmZ83qmUfKBS2pUOHlzNKEZFPBeJSbzEok3trMYyboZUgdHNn1XZfc1uT8UZs1GHCrmRUBXCfqw4YmmQuOhw==",
      "requires": {
        "indento": "^1.1.13"
      }
    },
    "json5": {
      "version": "2.2.3",
      "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz",
package.json
@@ -22,6 +22,7 @@
    "core-js": "^3.6.4",
    "element-ui": "^2.13.1",
    "jsencrypt": "^3.3.2",
    "json2md": "^2.0.1",
    "jwchat": "^0.2.3",
    "vue": "^2.6.11",
    "vue-markdown": "^2.2.4",
public/config/config.js
@@ -6,7 +6,7 @@
  loadTime: 2000,
  //间隔多久回消息
  retTime: 2000,
  apiUrl: "http://192.168.11.41:7777/",
  apiUrl: "/api/",
  // apiUrl: "http://106.120.22.26:5367/",
  imgUrl: webHost + "/image/",
  modelBase: {
src/api/api.js
@@ -1,12 +1,18 @@
import service from "../utils/service.js";
export function getAIMessage(params) {
  //请求地址
  // return service.get("/api/v1/chat?message=" + params);
  // return service.get("/v1/chat?message=" + params);
  // return service.get("/intention?message=" + params);
  // return service.get("/api/v1/mix?message=" + params);
  return service.get("/api/v1/intent?message=" + params);
  return service.get("/v1/mix?message=" + params);
  // return service.get("/v1/intent?message=" + params);
}
export function getChartMessage(params) {
  //请求地址
  return service.get("/v1/chat?message=" + params);
  // return service.get("/v1/intent?message=" + params);
}
export function getV1Fastgpt(params){
  return service.get("/api/v1/fastgpt?message=" + params);
  return service.get("/v1/fastgpt?message=" + params);
}
src/assets/js/map/mapConfig.js
@@ -1,4 +1,6 @@
import * as turf from "@turf/turf";
const json2md = require("json2md");
const mapConfig = {
  flyToImageryLayer(res) {
    earthCtrl.userScene.flyTo(res);
@@ -9,15 +11,97 @@
      steps: 10,
      properties: { foo: "bar" }
    });
    console.log(buffered);
    const coord = buffered.geometry.coordinates[0];
    const std = coord.map((item) => {
      const rs = turf.toMercator(turf.point(item));
      return rs.geometry.coordinates
      return rs.geometry.coordinates;
    });
    buffered.geometry.coordinates[0] =std
    buffered.geometry.coordinates[0] = std;
    return buffered;
  },
  setScanList(response, filed) {
    const obj = [];
    for (var i in response) {
      const item = response[i];
      if (item[filed]) {
        const count = "count_" + filed;
        obj.push(item[filed] + " : " + item[count]);
      }
    }
    if (filed == "weaponname") {
      return "发现疑似 " + obj.toString().replaceAll(",", "个; ");
    }else if(filed==='targettype'){
      return "发现 " + obj.toString().replaceAll(",", "个; ");
    }
    return "暂无信息";
  },
  setArrList(list, flag) {
    var result = [];
    const item = list.split("{");
    for (var i in item) {
      if (item[i]) {
        if (item[i].indexOf(",") > -1) {
          result.push({
            p: item[i].replaceAll('"','').replaceAll('}','')
          });
        } else {
          result.push({
            h6: item[i].replaceAll('"','')
          });
        }
      }
    }
    return result;
  },
  setJsonToMd(res) {
    // const data = {
    //     "name": "John Doe",
    //     "age": 30,
    //     "hobbies": ["reading", "programming"]
    // }
    return json2md(res);
    // return json2md([
    //   { h1: "JSON To Markdown" },
    //   { blockquote: "A JSON to Markdown converter." },
    //   {
    //     img: [
    //       {
    //         title: "Some image",
    //         source: "https://www.bizhigq.com/pc-img/2023-05/g2246.jpg"
    //       },
    //       {
    //         title: "Another image",
    //         source:
    //           "https://desk-fd.zol-img.com.cn/t_s960x600c5/g2/M00/0B/08/Cg-4WlUwdDWIZ7zKAAqGM6NxoXkAABuAQPwTs0ACoZL265.jpg"
    //       },
    //       {
    //         title: "Yet another image",
    //         source:
    //           "https://pic4.zhimg.com/v2-f72106aeb21976228c3f0dff703cbc35_r.jpg"
    //       }
    //     ]
    //   },
    //   { h2: "特性" },
    //   { ul: ["易于使用", "您可以程序化地生成 Markdown 内容", "..."] },
    //   { h2: "如何贡献" },
    //   { ol: ["创建项目分支", "开始你的工作", "提出 pull request"] },
    //   { h2: "代码块" },
    //   { p: "下面你可以看到一个代码块示例。" },
    //   {
    //     code: {
    //       language: "js",
    //       content: [
    //         "function sum (a, b) {",
    //         "   return a + b",
    //         "}",
    //         "sum(1, 2)"
    //       ]
    //     }
    //   }
    // ]);
  }
};
export default mapConfig;
src/assets/js/map/mapInfo.js
@@ -30,9 +30,23 @@
    });
  },
  setEntityQueryInput(){
    earthCtrl.camera.flyTo(120.27012029869624, 14.794107005718674, 2921.642108119077, 0, -90, 0, 2);
    // earthCtrl.camera.flyTo(120.27012029869624, 14.794107005718674, 2921.642108119077, 0, -90, 0, 2);
    // earthCtrl.camera.flyTo(120.298738742, 14.80902903, 2921.642108119077, 0, -90, 0, 2);
     earthCtrl.camera.flyTo(
      120.25011537497547,
      14.785109412061856,
      2921.642108119077,
      57, -45, 0, 2
      );
  },
  setFlyTo(res){
    earthCtrl.camera.flyTo(
      res.longitude,
      res.latitude,
      res.height,
      0, -90, 0, 2
      );
  }
 
};
export default mapInfo;
src/assets/js/map/mapJsonLayer.js
@@ -17,6 +17,10 @@
  url: null,
  coord: null,
  rectangularSensor: null,
  targetList: [],
  linePath: null,
  richTextPoint1: null,
  wfsLayer:null,
  init(url) {
    this.url = url;
    this.getJsonLayer();
@@ -73,7 +77,7 @@
    });
  },
  setQyeryData(res) {
    this.setTitleSetRest();
    // this.setTitleSetRest();
    if (res.indexOf("海军陆战队") > -1) {
      this.setQueryExtent2();
    } else if (res.indexOf("军事目标") > -1) {
@@ -93,9 +97,28 @@
    encrypt.setPublicKey(modelLayer.publickey + "");
    return encrypt.encrypt(res);
  },
  setQueryTF2(name) {
    const obj = "weaponname = '" + name + "'" + "";
  async setQueryFlywire() {
    const obj = "ejfl = '美空军指挥中心'" + "";
    const filed = this.getPublickey(obj);
    const layer = modelLayer.layers.filter((item) => {
      if (item.name == "建筑") {
        return item;
      }
    });
    if (layer.length <= 0) return;
    const data = getQueryEentity({
      token: getToken(),
      start: 1,
      count: 0,
      containCount: true,
      layerid: layer[0].id,
      dbid: modelLayer.dbid,
      where: filed
    });
  },
  setQueryTF2(name) {
    // const obj = "weaponname like '%" + name + "%'" + "";
    const filed = this.getPublickey(name);
    const layer = modelLayer.layers.filter((item) => {
      if (item.name == "武器点") {
        return item;
@@ -113,9 +136,10 @@
    }).then((response) => {
      if (response.code != 200) return;
      const geom = response.data.items[0];
      const position = [geom._x, geom._y, 0];
      const cylinder = {
        radius: 1000, //半径
        radius: 1500, //半径
        angle: 30, //扫描角度(可选)
        speed: 5, //倍速(可选)
        stackPartitions: 80, //横向网格数(可选)
@@ -126,10 +150,44 @@
        position,
        cylinder
      );
      Viewer.zoomTo(this.rectangularSensor.item);
      // Viewer.zoomTo(this.rectangularSensor.item);
    });
  },
  setQueryByFiled(name, color, label) {
  setQueryByFiled(name, color) {
    const filed = this.getPublickey(name);
    var objItem = mapServer.listData.filter((item) => {
      if (item.type === "Tileset") {
        return item;
      }
    });
    if (objItem.length <= 0) return;
    var tileset = objItem[0];
    getQueryEentity({
      token: getToken(),
      start: 1,
      count: 0,
      containCount: true,
      layerid: tileset.layerId,
      dbid: modelLayer.dbid,
      where: filed
    }).then((response) => {
      if (response.code != 200) return;
      var std = [];
      const items = response.data.items;
      items.map((item) => {
        std.push(item.seid);
      });
      nextTick(() => {
        if (std.length > 0) {
          this.setTilesetColorChange(tileset, std, color);
        }
      });
    });
  },
  setQueryByFiledList(list, flag) {
    const result = list[flag];
    const name = result.name;
    const color = result.color;
    const obj = "targettype = '" + name + "'" + "";
    const filed = this.getPublickey(obj);
    var objItem = mapServer.listData.filter((item) => {
@@ -152,17 +210,41 @@
      var std = [];
      const items = response.data.items;
      items.map((item) => {
        if (item.targettype == name) {
          std.push(item.seid);
        }
        // if (item.targettype == name) {
        std.push(item.seid);
        // }.
      });
      nextTick(() => {
        if (std.length <= 0) return;
        this.setTilesetColorChange(tileset, std, color);
        if (std.length > 0) {
          this.targetList.push({
            ids: std,
            color: color
          });
        }
        flag = flag + 1;
        if (flag >= list.length) {
          this.setTilesetColorChangeTarget();
        } else {
          this.setQueryByFiledList(list, flag);
        }
      });
    });
  },
  setTitleSetRest() {
    this.targetList = [];
    if(this.wfsLayer){
      // this.wfsLayer.removeFromMap();
      this.wfsLayer.destroy();
    }
    if (this.linePath) {
      this.linePath.clear();
      this.linePath = null;
    }
    if (this.richTextPoint1) {
      this.richTextPoint1.deleteObject();
      this.richTextPoint1 = null;
    }
    if (this.rectangularSensor) {
      this.rectangularSensor.wall.forEach((wall) => {
        Viewer.entities.remove(wall);
@@ -193,12 +275,46 @@
          const id = feature.getProperty("id");
          if (ids.indexOf(id) > -1) {
            return new SmartEarth.Cesium.Color.fromCssColorString(color);
          } else {
            return new SmartEarth.Cesium.Color.fromCssColorString("#FFFFFF");
          }
        }
      }
    });
  },
  setTilesetColorChangeTarget() {
    var objItem = mapServer.listData.filter((item) => {
      if (item.type === "Tileset") {
        return item;
      }
    });
    if (objItem.length <= 0) return;
    var tileset = objItem[0].layer;
    const list = this.targetList;
    tileset.style = new Cesium.Cesium3DTileStyle({
      color: {
        evaluateColor: (feature) => {
          const id = feature.getProperty("id");
          for (var i in list) {
            if (list[i].ids.indexOf(id) > -1) {
              return new SmartEarth.Cesium.Color.fromCssColorString(
                list[i].color
              );
            }
          }
          // if (ids.indexOf(id) > -1) {
          //   return new SmartEarth.Cesium.Color.fromCssColorString(color);
          // }
        }
      }
    });
  },
  setAddWfsLayer(){
    this.wfsLayer = earthCtrl.factory.createWfsLayer('polygon', {
      urls: 'https://cim.smartearth.cn/SEserver/wfsserver/SubicBayWeapon_wfs',
      layer: 'weapons',
      outlineColor:'#ff0000',
      alpha:0,
    })
  },
  getTileSet() {
    var objItem = mapServer.listData.filter((item) => {
@@ -211,13 +327,13 @@
    }
    return objItem[0];
  },
  setQueryExtent2() {
  setQueryExtent2(res, boolen) {
    const tileset = this.getTileSet();
    if (!tileset) {
      return;
    }
    const obj = "ejfl like '%空军基地%'";
    const filed = this.getPublickey(obj);
    //
    const filed = this.getPublickey(res);
    getQueryEentity({
      token: getToken(),
      start: 1,
@@ -229,10 +345,133 @@
    }).then((response) => {
      if (response.code != 200) return;
      const items = response.data.items[0];
      this.getQueryGeomExtent(items, tileset.layerId);
      const obj_val = response.data.items.filter((rs) => {
        if (rs.seid == "1_b810b88e1c7144bcb1c73eb6f45c3cf0") {
          return rs;
        }
      });
      if (boolen) {
        this.getQueryGeomExtent(obj_val[0], tileset.layerId);
      } else {
        this.getshowQueryExtentLabel(obj_val[0]);
      }
    });
  },
  getshowQueryExtentLabel(res) {
    this.richTextPoint1 = earthCtrl.factory.createRichTextPoint(
      res.ejfl,
      [res.lon, res.lat],
      {
        fontColor: "#ffff00",
        fontSize: 18
      },
      "0"
    );
    const center = { lon: res.lon, lat: res.lat };
    const cities = [
      {
        lon: 120.26923413,
        lat: 14.7887635155
      },
      {
        lon: 120.266906151,
        lat: 14.799529948
      },
      {
        lon: 120.267382051,
        lat: 14.788105695
      },
      {
        lon: 120.26710735,
        lat: 14.7993756478
      },
      {
        lon: 120.286842844,
        lat: 14.7924281921
      },
      {
        lon: 120.286923225,
        lat: 14.7933412456
      },
      {
        lon: 120.266707102,
        lat: 14.7996392512
      },
      {
        lon: 120.268701861,
        lat: 14.7886095373
      },
      {
        lon: 120.270684963,
        lat: 14.7919831852
      },
      {
        lon: 120.266265954,
        lat: 14.7999317012
      },
      {
        lon: 120.269896499,
        lat: 14.7901043245
      },
      {
        lon: 120.286600837,
        lat: 14.7926858017
      },
      {
        lon: 120.286991515,
        lat: 14.7927451318
      },
      {
        lon: 120.286760149,
        lat: 14.7930139536
      },
      {
        lon: 120.28633835,
        lat: 14.7929774056
      },
      {
        lon: 120.266684567,
        lat: 14.7877010021
      },
      {
        lon: 120.283448259,
        lat: 14.7972858134
      },
      {
        lon: 120.286503613,
        lat: 14.7932728306
      },
      {
        lon: 120.286649886,
        lat: 14.7935912152
      }
    ];
    let pathOption = {
      width: 3, //线宽(可选)
      color: "#00ffff", //线颜色(可选),
      LightSpot: true, //是否使用光点效果(可选)
      LightSpotColor: "#ffffff" ,//光点颜色(可选)
      height: 100
    };
    this.linePath = earthCtrl.factory.createTrailLinePath(
      center,
      cities,
      pathOption
    );
  },
  getQueryGeomExtent(items, layerid) {
    var geom = mapConfig.setPointToCrical(items.lon, items.lat, 1);
    const token = getToken();
src/assets/js/map/mapView.js
@@ -21,7 +21,9 @@
    Viewer.scene.globe.baseColor = Cesium.Color.fromCssColorString("#A9A9A9"); //设置地球颜色
    // 清空默认底图
    Viewer.imageryLayers.removeAll();
  //   earthCtrl.factory.createTerrainLayer({sourceType: "ctb",
  //     url: 'https://tiles1.geovisearth.com/base/v1/terrain?token=486dac3bec56d7d7c2a581c150be2bd937462f1e8f3bc9c78b5658b396122405'
  // });
    mapServer.addServer({
      sourceType: "arcgis",
      url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"
@@ -30,6 +32,7 @@
      sourceType: "tms",
      url: "http://192.168.11.41:9001/gisserver/tmsserver/SubicBayArea"
    });
    modelLayer.init();
    mapInfo.setEntityQueryInput();
    // const url = layerJson.getQueryUrl("SubicBayAreaVector_wfs", "GeoEntity");
src/assets/js/map/modelLayer.js
@@ -23,16 +23,15 @@
    this.modelBase = config.modelBase;
    this.getSettingPublicKey();
    const token = getToken();
    console.log("token", token);
    if (token) {
      this.getModelLayerList();
    } else {
      getPublickey().then((response) => {
        const password = this.modelBase.password;
        const userId = this.modelBase.userId;
        const publickey = response.data;
        this.publickey = response.data;
        const encrypt = new JSEncrypt();
        encrypt.setPublicKey(publickey);
        encrypt.setPublicKey(this.publickey);
        let encrypted = encrypt.encrypt(password.substring(0, 50)) + "";
        let submit = {
          userid: userId,
@@ -92,6 +91,53 @@
      }
    });
  },
  getQueryGroupBy(layer, filed, ction) {
    const layerId = this.layers.filter((item) => {
      if (item.name == layer) {
        return item;
      }
    });
    if (layerId.length <= 0) {
      return;
    }
    const url =
      config.modelBase.url +
      config.modelBase.geo +
      "/entitydbdata/query/entity";
    const obj = [
      {
        type: "count",
        field: filed,
        outfield: "count_" + filed
      }
    ];
    axios
      .post(
        url,
        {
          layerid: layerId[0].id,
          dbid: this.dbid,
          token: getToken(),
          statistics: JSON.stringify(obj),
          containCount: true,
          groupby: filed
        },
        {
          headers: {
            Authorization: getToken(),
            "Content-Type": "application/x-www-form-urlencoded"
          }
        }
      )
      .then((response) => {
        ction(response);
      })
      .catch((error) => {
        error;
      });
  },
  setLayerQuery() {
    const token = getToken();
    this.geom = mapConfig.setPointToCrical(120.27, 14.79, null);
@@ -178,7 +224,6 @@
        }
      )
      .then((response) => {
        console.log("List", response);
        that.setLayerFilter(response.data.data.items);
      });
  },
@@ -193,7 +238,6 @@
    const a = [];
    // rs.filter((item) => {
    //   if (item.targettype == "军事目标") {
    //     console.log(item);
    //     // a.push(["${id} === '" + item.sid + "'",  "color('#FF0000', 0.5)"]);
    //   }
    // });
@@ -204,7 +248,6 @@
      'color("purple", 0.5)'
    ]);
    a.push(["true", "color('#E8F1F2', 0.5)"]);
    console.log(tileset);
    tileset.style = new Cesium.Cesium3DTileStyle({
      // color: "vec4(1.0,1.0,1.0, 1.0)", // 红色
      color: {
@@ -219,11 +262,9 @@
    });
    //   window.Cesium.when(tileset.readyPromise, function(tileset) {
    //     var tilesetId = tileset.id;
    //     console.log('Tileset ID: ' + tilesetId);
    // });
    //   tileset.readyPromise.then( (item)=> {
    //     tileset.tileVisible.addEventListener( (tile)=> {
    //       console.log(tile);
    //     })
    //   })
  }
src/assets/js/msg/msgData.js
@@ -24,6 +24,16 @@
      }
    ]);
  },
  getJsonToMdData(res){
    this.mine = true;
    var url = config.imgUrl + aiData.aiRole_img;
   return this.getMsg(url, [
      {
        type: "markdown",
        val: res
      }
    ])
  },
  getRagData(res, more, msg) {
 
    return [
src/components/Chat/chatList.vue
@@ -1,10 +1,10 @@
<template>
  <div class="body">
    <div :style="pageConfig.width | setWidth">
  <div class="body webBody">
    <div :class="$store.state.setScreenFlag ? 'webmainBox_Active' : 'webmainBox'">
      <div class="web__main" ref="main">
        <div class="web__main-item" v-for="(item, index) in list" :key="loding(index)"
          :class="{ 'web__main-item--mine': item.mine }">
          <div class="web__main_content">
            <div>
              <img :src="item.img" />
@@ -44,6 +44,9 @@
                  </div>
                  <div v-else-if="res.type == 'loader'">
                    <span v-html="handleDetail(res.val)" ref="content"></span>
                  </div>
                  <div v-else-if="res.type == 'markdown'">
                    <vue-markdown :source="res.val" class="newConcentLeft my-markdown"></vue-markdown>
                  </div>
                  <div style="margin-bottom:10px" v-else-if="res.type == 'rag'">
                    <div v-show="res.acction">
@@ -271,6 +274,19 @@
}
</style>
<style scoped>
.webBody {
  display: flex;
  justify-content: center;
}
.webmainBox {
  width: 50%;
}
.webmainBox_Active {
  width: 90%;
}
.web__main-item {
  position: relative;
  font-size: 0;
@@ -278,6 +294,7 @@
  /* padding-left: 60px; */
  min-height: 68px;
  text-align: left;
}
.web__main-user,
@@ -544,6 +561,35 @@
    /* 结束旋转 div 元素 */
  }
}
.newConcentLeft {
  margin: 16px;
  font-family: PingFangSC, PingFang SC;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  text-align: left;
  font-style: normal;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.newConcentLeft img {
  width: 75%;
}
.newConcentLeft table {
  width: 100%;
}
.newConcentLeft pre {
  white-space: normal;
}
</style>
src/components/Chat/enterBox.vue
@@ -76,6 +76,7 @@
  overflow: hidden;
  height: 100%;
  display: flex;
  margin-top: 20px;
}
.web_flex_input {
  flex: 1;
src/components/Chat/index.vue
@@ -5,7 +5,10 @@
    </div>
    <div class="toolBox">
      <!-- <tools :tools="toolConfig" class="tools" @emoji="bindEmoji" /> -->
      <EnterBox @submit="enter" v-model="msg" />
      <div    :class=" $store.state.setScreenFlag ? 'isActive' : 'Active' ">
        <EnterBox @submit="enter" v-model="msg" />
      </div>
    </div>
  </div>
</template>
@@ -114,18 +117,26 @@
.taleBox {
  height: calc(100% - 100px);
  width: 100%;
  overflow: auto;
  overflow-x: hidden;
  padding-top: 15px;
  padding-left: 10px;
  padding-right: 10px;
}
.toolBox {
  height:60px;
  height: 60px;
  width: 100%;
  display: flex;
  justify-content: center;
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04); */
}
.isActive{
  width: 90% !important;
}
.Active{
  width: 50% !important;
}
</style>
<style>
.scroll-container {
src/views/chartView/index.vue
@@ -12,11 +12,16 @@
import msgData from "../../assets/js/msg/msgData";
import store from "../../store";
import bus from "./../../assets/js/bus.js";
import { getAIMessage, getV1Fastgpt } from "../../api/api.js";
import { getAIMessage, getV1Fastgpt, getChartMessage } from "../../api/api.js";
import { getQueryEentity } from "../../api/modelBase.js";
import mapInfo from "../../assets/js/map/mapInfo.js";
import axios from "axios";
import layerJson from "../../assets/js/map/mapJsonLayer.js";
import { factors } from "@turf/turf";
import mapConfig from "../../assets/js/map/mapConfig.js";
import { getToken } from "../../utils/auth.js";
import modelLayer from "../../assets/js/map/modelLayer.js";
export default {
  name: "jwChat",
@@ -69,7 +74,16 @@
    // this.setLoading();
    setTimeout(() => {
      this.setMsgStart("您好");
    }, config.loadTime);
    }, 1000);
    setTimeout(() => {
      const obj = mapConfig.setJsonToMd([{
        h6: "警告: 菲律宾苏比克湾区域检测出异常军事目标!"
      }, {
        p: "异常代号:4r5as5s001"
      }]);
      var roleMsg = msgData.getJsonToMdData(obj);
      this.list.push(roleMsg)
    }, 3000);
    bus.$on("mapInfo", (res) => {
      if (res) {
        // this.setMapInfo(res);
@@ -93,6 +107,13 @@
    //   });
  },
  methods: {
    getMd() {
      const obj = mapConfig.setJsonToMd();
      const length = this.list.length - 1;
      var roleMsg = msgData.getJsonToMdData(obj);
      this.list[length].list = roleMsg.list
      this.loading = false;
    },
    bindEnter() {
      const msg = this.inputMsg;
@@ -104,14 +125,107 @@
      setTimeout(() => {
        this.setMsgStart(msg);
      }, 200);
    },
    getQueryGroupBy(layer, filed) {
      const layerId = modelLayer.layers.filter((item) => {
        if (item.name == layer) {
          return item;
        }
      });
      if (layerId.length <= 0) {
        return;
      }
      const obj = [
        {
          type: "count",
          field: filed,
          outfield: "count_" + filed
        }
      ];
      return {
        layerid: layerId[0].id,
        dbid: modelLayer.dbid,
        token: getToken(),
        statistics: JSON.stringify(obj),
        containCount: true,
        groupby: filed
      }
    },
    async getQueryEentityGroupBy(res, filed) {
      const data = await getQueryEentity(res);
      const message = mapConfig.setScanList(data.data, filed)
      this.getMsg("ai", message);
    },
    async getQueryEentityDescription(res) {
      const std = [];
      const str = [];
      const data = await getQueryEentity({
        token: res.token,
        start: 1,
        count: 0,
        containCount: true,
        layerid: res.layerid,
        dbid: res.dbid,
      });
      const items = data.data.items;
      items.map(rs => {
        var name = rs["weaponname"]
        if (name) {
          var boolen = true;
          if (str.length == 0) {
            boolen = true;
          } else if (str.indexOf(name) > -1) {
            boolen = false;
          } else {
            boolen = true;
          }
          if (boolen) {
            const obj = mapConfig.setArrList(rs["descriptio"])
            for (var i in obj) {
              std.push(obj[i])
            }
            str.push(name)
          }
        }
      })
      const jstomd = mapConfig.setJsonToMd(std)
      const length = this.list.length - 1;
      var roleMsg = msgData.getJsonToMdData(jstomd);
      this.list[length].list = roleMsg.list
      this.loading = false;
    },
    async setMsgStart(res) {
      if (res.indexOf("军事目标") > -1 || res.indexOf("民宅") > -1 || res.indexOf("经济目标") > -1 || res.indexOf("海军陆战队") > -1 || res.indexOf("堤丰") > -1) {
        this.$store.state.setScreenFlag = true;
        this.list.splice(-1, 1);
        this.loading = false;
        layerJson.setQyeryData(res);
      } else if (res.indexOf("markDown") > -1) {
        setTimeout(() => {
          this.getMd();
        }, 2000);
      } else if (res.indexOf("scanWeapon") > -1) {
        this.setQueryMapPlan("scanWeapon")
      } else if (res.indexOf("weaponParameters") > -1) {
        this.setQueryMapPlan("weaponParameters")
      } else if (res.indexOf("searchTarget") > -1) {
        this.setQueryMapPlan("searchTarget")
      } else if (res.indexOf("searchStrikeableTarget") > -1) {
        this.setQueryMapPlan("searchStrikeableTarget")
      } else if (res.indexOf("USAFCommandCenterQuery") > -1) {
        this.setQueryMapPlan("USAFCommandCenterQuery")
      } else if (res.indexOf("attackUSAFCommandCenter") > -1) {
        this.setQueryMapPlan("attackUSAFCommandCenter")
      } else if (res.indexOf("defenceRangeTyphoonSystem") > -1) {
        this.setQueryMapPlan("defenceRangeTyphoonSystem")
      }
      // else if(res.indexOf("苏比克湾") > -1){
      //   this.$store.state.setScreenFlag = true;
@@ -128,8 +242,8 @@
        this.setV1Fastgpt(res)
      } else {
        const data = await getAIMessage(res);
        if (data.code == 200) {
        if (data.status == 200) {
          if (data.content) {
            this.getMsg("ai", data.content);
          } else {
@@ -139,13 +253,85 @@
            this.$store.state.setScreenFlag = true;
            this.$nextTick(() => {
              setTimeout(() => {
                mapInfo.init(data.name);
                this.setQueryMapPlan(data.name)
              }, 1000);
            });
          }
        }
      }
    },
    setQueryMapPlan(res) {
      if (this.$store.state.setScreenFlag == false) {
        this.$store.state.setScreenFlag = true;
      }
      layerJson.setTitleSetRest();
      mapInfo.setEntityQueryInput();
      switch (res) {
        case "scanWeapon":
          mapInfo.setFlyTo({
            "longitude": 120.26907736668211,
            "latitude": 14.791708841800627,
            "height": 1371.1909347746105
          });
          var obj = this.getQueryGroupBy("武器", "weaponname")
          this.getQueryEentityGroupBy(obj, "weaponname")
          layerJson.setAddWfsLayer();
          break;
        case "weaponParameters":
          var obj = this.getQueryGroupBy("武器", "description")
          this.getQueryEentityDescription(obj)
          break;
        case "searchTarget":
          var obj = this.getQueryGroupBy("建筑", "targettype")
          this.getQueryEentityGroupBy(obj, "targettype")
          var list = [{
            name: "军事目标",
            color: "#409EFF"
          }, {
            name: "民宅",
            color: "#808080"
          }, {
            name: "经济目标",
            color: "#FFFF00"
          }
          ]
          layerJson.setQueryByFiledList(list, 0)
          break;
        case "searchStrikeableTarget":
          var obj = "strikeable = 'TRUE'" + "";
          layerJson.setQueryByFiled(obj, "#FF0000", false)
          this.getMsg("ai", "相关信息已在地图模块展示");
          break;
        case "USAFCommandCenterQuery":
          var obj = "ejfl like '%空军基地%'";
          layerJson.setQueryExtent2(obj, false)
          this.getMsg("ai", "相关信息已在地图模块展示");
          break;
        case "attackUSAFCommandCenter":
          var obj = "ejfl like '%空军基地%'";
          layerJson.setQueryExtent2(obj, true)
          this.getMsg("ai", "相关信息已在地图模块展示");
          break;
        case "defenceRangeTyphoonSystem":
          var obj = "weaponname like '%" + name + "%'" + "";
          layerJson.setQueryTF2(obj)
          this.getMsg("ai", "相关信息已在地图模块展示");
          break;
        default:
          mapInfo.init(res);
          break;
      }
    },
    setRagMoreList(res) {
      const obj = this.$store.state.ragList
      const val_data = obj.filter(item => {
@@ -196,8 +382,9 @@
    },
    async setV1Fastgpt(res) {
      const data = await getV1Fastgpt(res);
      const length = this.list.length - 1;
      const obj = data[0].quoteList
      this.$store.state.ragList.push({
        quest: res,
@@ -223,13 +410,13 @@
    },
    getMsg(type, msg) {
      var roleMsg = msgData.getRole(type, msg);
      if (this.loading) {
        this.loading = false;
        this.list[this.list.length - 1].list = roleMsg.msg.list;
      } else {
        this.list.push(roleMsg.msg);
src/views/homePage/index.vue
@@ -65,14 +65,15 @@
.chartContent .chartBox {
  flex: 1;
  display: flex;
  justify-content: center;
  /* justify-content: center; */
  /* 
  height: (100% - 38px);
*/
}
.leftContent {
  width: 40%;
  width: 100%;
  height: 100%;
  transition: 1s ease-out;
  display: flex;