zhangzengfei
2020-09-03 3efae02a275998bc3f8d8ed780fcf884da72683e
desktop: 应用修改为接口获取
5个文件已删除
2个文件已添加
2个文件已修改
569 ■■■■■ 已修改文件
public/apps.json 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Pool/BaseManageData.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/app.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/desktop/index/App.vue 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/desktop/index/mock/userData-copy.json 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/desktop/index/mock/userData.json 173 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/faceCapture/index/App.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/faceCapture/index/api.ts 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/faceCapture/index/main.ts 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/apps.json
New file
@@ -0,0 +1,160 @@
{
  "code": "200",
  "success": true,
  "data": [
    {
      "id": "5",
      "name": "gb28181",
      "src": "../../images/app-mid/GB-config.png",
      "alt": "GB28181配置",
      "type": "2",
      "url": "/view/gb28181",
      "title": "GB28181配置",
      "width": 600,
      "height": 670
    },
    {
      "id": "12",
      "name": "cameraVideo",
      "src": "../../images/app-mid/monitor.png",
      "alt": "实时监控",
      "type": "2",
      "url": "/view/cameraVideo",
      "title": "实时监控",
      "width": 1328,
      "height": 690
    },
    {
      "id": "9",
      "name": "algorithmManage",
      "src": "../../images/app-mid/algorithm-store.png",
      "alt": "应用中心",
      "type": "2",
      "url": "/view/ai",
      "title": "应用中心",
      "width": 1243,
      "height": 670
    },
    {
      "id": "1",
      "name": "cameraAccess",
      "src": "../../images/app-mid/camera-access.png",
      "alt": "camera-access",
      "type": "2",
      "url": "/view/cameraAccess",
      "title": "摄像机配置",
      "width": 1200,
      "height": 670
    },
    {
      "id": "2",
      "name": "dataStack",
      "src": "../../images/app-mid/datastack-config.png",
      "alt": "datastack-config",
      "type": "2",
      "url": "/view/cameraAccess?dataStack=1",
      "title": "数据栈配置",
      "width": 1200,
      "height": 670
    },
    {
      "id": "4",
      "name": "datapush",
      "src": "../../images/app-mid/data-push.png",
      "alt": "data-push",
      "type": "2",
      "url": "/view/datapush",
      "title": "数据推送",
      "width": 1024,
      "height": 512
    },
    {
      "id": "7",
      "name": "library",
      "src": "../../images/app-mid/library.png",
      "alt": "比对库管理",
      "type": "2",
      "url": "/view/library",
      "title": "比对库管理",
      "width": 1200,
      "height": 670
    },
    {
      "id": "11",
      "name": "analysisPower",
      "src": "../../images/app-mid/hashrate-manage.png",
      "alt": "算力管理",
      "type": "2",
      "url": "/view/analysisPower",
      "title": "算力管理",
      "width": 1200,
      "height": 670
    },
    {
      "id": "13",
      "name": "search",
      "src": "../../images/app-mid/search.png",
      "alt": "统计查询",
      "type": "2",
      "url": "/view/search",
      "title": "统计查询",
      "width": 1344,
      "height": 675
    },
    {
      "id": "15",
      "name": "syslog",
      "src": "../../images/app-mid/log-manage.png",
      "alt": "日志管理",
      "type": "2",
      "url": "/view/syslog",
      "title": "日志管理",
      "width": 1200,
      "height": 600
    },
    {
      "id": "17",
      "name": "settings",
      "src": "../../images/app-mid/settings.png",
      "alt": "系统设置",
      "type": "2",
      "url": "/view/settings",
      "title": "系统设置",
      "width": 1200,
      "height": 650
    },
    {
      "id": "18",
      "name": "vindicate",
      "src": "../../images/app-mid/vindicate.png",
      "alt": "系统维护",
      "type": "2",
      "url": "/view/vindicate",
      "title": "系统维护",
      "width": 760,
      "height": 534
    },
    {
      "id": "19",
      "name": "heatCamera",
      "src": "../../images/app-mid/algorithm-manage.png",
      "alt": "热力图",
      "type": "2",
      "url": "/view/heatCamera",
      "title": "热力图",
      "width": 760,
      "height": 600
    },
    {
      "id": "20",
      "name": "areaManage",
      "src": "../../images/app-mid/device.png",
      "alt": "摄像机区域管理",
      "type": "2",
      "url": "/view/areaManage",
      "title": "摄像机区域管理",
      "width": 1200,
      "height": 600
    }
  ]
}
src/Pool/BaseManageData.ts
@@ -21,7 +21,7 @@
  public size: number;
  public contentValue: string = "";
  public tableId: number;
  public orderName: string = "id";
  public orderName: string = "createTime";
  public orderType: string = "desc";
  public faceUrl: string = "";
  public threshold: number = 60;
src/api/app.ts
New file
@@ -0,0 +1,9 @@
import request from "@/scripts/httpRequest";
export const getApps = (query: any) => {
  return request({
    url: "/apps.json",
    method: "get",
    params: query
  });
};
src/pages/desktop/index/App.vue
@@ -1,5 +1,5 @@
<template>
  <div id="app" @contextmenu.prevent="">
  <div id="app" @contextmenu.prevent>
    <tools></tools>
    <desktop></desktop>
    <tools-entry ref="dock_model"></tools-entry>
@@ -17,22 +17,19 @@
import ToolsEntry from './components/ToolsEntry';
import axios from 'axios'
import { getApps } from '@/api/app'
export default {
  name: 'app',
  components: {
    Desktop, NotificationCenter, NoticeTip, Tools, ToolsEntry
  },
  mounted() {
    document.getElementById('app').style.backgroundImage = process.env.VUE_APP_MAIN_URL;
    let _that = this;
    let user_res = require("./mock/userData.json")
    if (user_res.success) {
      user_res.data.docks.forEach(function (item) {
        _that.$store.commit('desktop/addDock', item);
      });
    }
    this.showApps();
    let _that = this;
    let msgResp = require("./mock/messages.json")
    if (msgResp.success) {
      msgResp.data.forEach(function (item) {
@@ -56,6 +53,17 @@
    }, 1000);
  },
  methods: {
    showApps() {
      let _that = this;
      getApps().then(rsp => {
        if (rsp && rsp.success) {
          rsp.data.forEach(function (item) {
            _that.$store.commit('desktop/addDock', item);
          });
        }
      })
    },
    addMessage: function (message, ding) {
      this.$store.dispatch('desktop/addMessage', message);
      // if (ding) {
@@ -66,7 +74,7 @@
    addWeather: function (weather) {
      this.$store.commit('desktop/addWeather', weather);
    },
    screenShot(dock){
    screenShot(dock) {
      //找到当前的iframe
      let curIframe = Array.from(document.querySelectorAll('iframe')).find(iframe => iframe.src.indexOf(dock.url) >= 0);
      //保存当前应用快照
@@ -86,10 +94,10 @@
        //   type: "3",
        //   screenshot: shotSrc
        // });
        this.$store.commit('desktop/shotscreen', {id:dock.id, src:shotSrc});
        this.$store.commit('desktop/shotscreen', { id: dock.id, src: shotSrc });
      }).catch(e => {
        this.$store.commit('desktop/shotscreen', {id:dock.id, src:''});
        this.$store.commit('desktop/shotscreen', { id: dock.id, src: '' });
      });
    }
  }
src/pages/desktop/index/mock/userData-copy.json
File was deleted
src/pages/desktop/index/mock/userData.json
File was deleted
src/pages/faceCapture/index/App.vue
File was deleted
src/pages/faceCapture/index/api.ts
File was deleted
src/pages/faceCapture/index/main.ts
File was deleted