From 3efae02a275998bc3f8d8ed780fcf884da72683e Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期四, 03 九月 2020 18:15:09 +0800
Subject: [PATCH] desktop: 应用修改为接口获取
---
/dev/null | 11 --
src/pages/desktop/index/App.vue | 34 +++++---
public/apps.json | 160 ++++++++++++++++++++++++++++++++++++++++
src/api/app.ts | 9 ++
src/Pool/BaseManageData.ts | 2
5 files changed, 191 insertions(+), 25 deletions(-)
diff --git a/public/apps.json b/public/apps.json
new file mode 100644
index 0000000..82069db
--- /dev/null
+++ b/public/apps.json
@@ -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
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/Pool/BaseManageData.ts b/src/Pool/BaseManageData.ts
index 74731c3..0a99a6a 100644
--- a/src/Pool/BaseManageData.ts
+++ b/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;
diff --git a/src/api/app.ts b/src/api/app.ts
new file mode 100644
index 0000000..ddefa18
--- /dev/null
+++ b/src/api/app.ts
@@ -0,0 +1,9 @@
+import request from "@/scripts/httpRequest";
+
+export const getApps = (query: any) => {
+ return request({
+ url: "/apps.json",
+ method: "get",
+ params: query
+ });
+};
diff --git a/src/pages/desktop/index/App.vue b/src/pages/desktop/index/App.vue
index a89ad1d..fc70133 100644
--- a/src/pages/desktop/index/App.vue
+++ b/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) {
//鎵惧埌褰撳墠鐨刬frame
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: '' });
});
}
}
diff --git a/src/pages/desktop/index/mock/userData-copy.json b/src/pages/desktop/index/mock/userData-copy.json
deleted file mode 100644
index 10df66e..0000000
--- a/src/pages/desktop/index/mock/userData-copy.json
+++ /dev/null
@@ -1,112 +0,0 @@
-{
- "code": "0000",
- "success": true,
- "data": {
- "docks": [
- {
- "id": "1",
- "src": "../../images/finder.png",
- "alt": "finder",
- "type": "0"
- },
- {
- "id": "2",
- "src": "../../images/launchpad.png",
- "alt": "launchpad",
- "type": "0"
- },
- {
- "id": "3",
- "src": "../../images/gitee.png",
- "alt": "gitee",
- "type": "1",
- "url": "https://gitee.com/justlive1"
- },
- {
- "id": "4",
- "src": "../../images/github.png",
- "alt": "github",
- "type": "1",
- "url": "https://github.com/justlive1"
- },
- {
- "id": "5",
- "src": "../../images/maps.png",
- "alt": "maps",
- "type": "2",
- "url": "https://map.baidu.com"
- },
- {
- "id": "6",
- "src": "../../images/blog.png",
- "alt": "blog",
- "type": "2",
- "url": "http://www.justlive.vip/blog"
- },
- {
- "id": "7",
- "src": "../../images/iBooks.png",
- "alt": "GB28181",
- "type": "2",
- "url": "/view/gb28181"
- },
- {
- "id": "8",
- "src": "../../images/frost.png",
- "alt": "鍒嗗竷寮忚皟搴�",
- "type": "2",
- "url": "http://www.justlive.vip/center/"
- },
- {
- "code": "0000",
- "success": true,
- "data": {
- "city": "骞垮窞甯�",
- "type": "澶氫簯",
- "icon": "http://yun.rili.cn/wnl/img/cloud.png",
- "temperature": "17"
- }
- },
- {
- "id": "3",
- "src": "../../images/app-mid/DVR-access.png",
- "alt": "DVR",
- "type": "2",
- "url": "/view/DVR",
- "name": "纭洏褰曞儚鏈烘帴鍏�"
- },
- {
- "id": "14",
- "src": "../../images/app-mid/360.png",
- "alt": "鍏ㄦ櫙瑙嗛",
- "type": "2",
- "url": "/view/panoramicVideo",
- "name": "鍏ㄦ櫙瑙嗛"
- },
- {
- "id": "16",
- "src": "../../images/app-mid/device.png",
- "alt": "璁惧绠$悊",
- "type": "2",
- "url": "/view/device",
- "name": "璁惧绠$悊"
- },
- {
- "id": "8",
- "src": "../../images/app-mid/poll.png",
- "alt": "杞绠$悊",
- "type": "2",
- "url": "/view/poll",
- "name": "杞绠$悊"
- },
- {
- "id": "10",
- "src": "../../images/app-mid/algorithm-store.png",
- "alt": "绠楁硶鍟嗗煄",
- "type": "2",
- "url": "/view/algorithmStore",
- "name": "搴旂敤涓績"
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/src/pages/desktop/index/mock/userData.json b/src/pages/desktop/index/mock/userData.json
deleted file mode 100644
index 3a1cc99..0000000
--- a/src/pages/desktop/index/mock/userData.json
+++ /dev/null
@@ -1,173 +0,0 @@
-{
- "code": "0000",
- "success": true,
- "data": {
- "docks": [
- {
- "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
- },
- {
- "id": "21",
- "name": "faceCapture",
- "src": "../../images/app-mid/device.png",
- "alt": "浜鸿劯鎶撴媿娴嬭瘯",
- "type": "2",
- "url": "/view/faceCapture",
- "title": "浜鸿劯鎶撴媿娴嬭瘯",
- "width": 1200,
- "height": 600
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/src/pages/faceCapture/index/App.vue b/src/pages/faceCapture/index/App.vue
deleted file mode 100644
index 128b581..0000000
--- a/src/pages/faceCapture/index/App.vue
+++ /dev/null
@@ -1,59 +0,0 @@
-<template>
- <div class="container">
- <span>ip:</span>
- <el-input v-model="ip" style="width:200px"></el-input>
- <el-table :data="response" border>
- <el-table-column label="鎶撴媿鍥�" width="160" align="center">
- <template slot-scope="scope">
- <div>
- <img
- v-if="scope.row.faceImg"
- :src="`data:image/png;base64,`+scope.row.faceImg"
- style="max-height:84px;width:84px;object-fit:contain;background:rgba(0,0,0,0.35);"
- class="avatar"
- />
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="faceId" label="faceId" align="center"></el-table-column>
- </el-table>
- </div>
-</template>
-
-<script>
-import { capture } from './api'
-export default {
- data() {
- return {
- ip: "",
- response: []
- }
- },
- mounted() {
- this.getData()
- },
- methods: {
- getData() {
- if (this.ip.length) {
- capture({ ip: this.ip }).then(rsp => {
- if (rsp && rsp.rtnCode === '1') {
- this.response.push(rsp.rtnData)
- }
- })
- }
-
- setTimeout(() => {
- this.getData()
- }, 1000)
- }
-
- }
-}
-</script>
-<style lang="scss">
-.container {
- width: 100%;
- height: 100%;
- background: #e9ebf2;
-}
-</style>
diff --git a/src/pages/faceCapture/index/api.ts b/src/pages/faceCapture/index/api.ts
deleted file mode 100644
index 94462f5..0000000
--- a/src/pages/faceCapture/index/api.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import request from "@/scripts/httpRequest";
-
-export const capture = (data: any) => {
- return request({
- url: '/data/api-v/face/capture',
- method: "post",
- data
- })
-}
diff --git a/src/pages/faceCapture/index/main.ts b/src/pages/faceCapture/index/main.ts
deleted file mode 100644
index 6bd5dc0..0000000
--- a/src/pages/faceCapture/index/main.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import Vue from 'vue';
-import ElementUI from 'element-ui';
-import 'element-ui/lib/theme-chalk/index.css';
-import "@/assets/css/element-variables.scss";
-
-import App from './App.vue';
-Vue.use(ElementUI)
-new Vue({
- el: '#app',
- render: h => h(App)
-})
\ No newline at end of file
--
Gitblit v1.8.0