diff --git a/config/dev.env.js b/config/dev.env.js
index d5b822a..7d35e26 100644
--- a/config/dev.env.js
+++ b/config/dev.env.js
@@ -7,6 +7,8 @@
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://139.198.18.188:8083"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
// BASE_API: '"http://192.168.43.84:8083"'
-
+ // BASE_API: '"https://38ka911915.picp.vip"' // 柴壮本地
+ // BASE_API: '"http://111.198.10.15:21405"'
})
diff --git a/config/dev.env.js b/config/dev.env.js
index d5b822a..7d35e26 100644
--- a/config/dev.env.js
+++ b/config/dev.env.js
@@ -7,6 +7,8 @@
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://139.198.18.188:8083"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
// BASE_API: '"http://192.168.43.84:8083"'
-
+ // BASE_API: '"https://38ka911915.picp.vip"' // 柴壮本地
+ // BASE_API: '"http://111.198.10.15:21405"'
})
diff --git a/config/prod.env.js b/config/prod.env.js
index fc8406e..825966d 100644
--- a/config/prod.env.js
+++ b/config/prod.env.js
@@ -9,4 +9,6 @@
// BASE_API: '"http://111.198.10.15:11604"'
// BASE_API: '"http://192.168.8.108:8083"'
// BASE_API: '"https://smartlog.work/prodapi4test"'
+ // BASE_API: '"http://111.198.10.15:21405"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
}
diff --git a/config/dev.env.js b/config/dev.env.js
index d5b822a..7d35e26 100644
--- a/config/dev.env.js
+++ b/config/dev.env.js
@@ -7,6 +7,8 @@
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://139.198.18.188:8083"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
// BASE_API: '"http://192.168.43.84:8083"'
-
+ // BASE_API: '"https://38ka911915.picp.vip"' // 柴壮本地
+ // BASE_API: '"http://111.198.10.15:21405"'
})
diff --git a/config/prod.env.js b/config/prod.env.js
index fc8406e..825966d 100644
--- a/config/prod.env.js
+++ b/config/prod.env.js
@@ -9,4 +9,6 @@
// BASE_API: '"http://111.198.10.15:11604"'
// BASE_API: '"http://192.168.8.108:8083"'
// BASE_API: '"https://smartlog.work/prodapi4test"'
+ // BASE_API: '"http://111.198.10.15:21405"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
}
diff --git a/package.json b/package.json
index 5ad20d8..a143abb 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"echarts": "^4.2.1",
"element-ui": "2.13.0",
"event-source-polyfill": "^1.0.5",
+ "file-saver": "^2.0.5",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"mockjs": "1.0.1-beta3",
diff --git a/config/dev.env.js b/config/dev.env.js
index d5b822a..7d35e26 100644
--- a/config/dev.env.js
+++ b/config/dev.env.js
@@ -7,6 +7,8 @@
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://139.198.18.188:8083"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
// BASE_API: '"http://192.168.43.84:8083"'
-
+ // BASE_API: '"https://38ka911915.picp.vip"' // 柴壮本地
+ // BASE_API: '"http://111.198.10.15:21405"'
})
diff --git a/config/prod.env.js b/config/prod.env.js
index fc8406e..825966d 100644
--- a/config/prod.env.js
+++ b/config/prod.env.js
@@ -9,4 +9,6 @@
// BASE_API: '"http://111.198.10.15:11604"'
// BASE_API: '"http://192.168.8.108:8083"'
// BASE_API: '"https://smartlog.work/prodapi4test"'
+ // BASE_API: '"http://111.198.10.15:21405"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
}
diff --git a/package.json b/package.json
index 5ad20d8..a143abb 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"echarts": "^4.2.1",
"element-ui": "2.13.0",
"event-source-polyfill": "^1.0.5",
+ "file-saver": "^2.0.5",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"mockjs": "1.0.1-beta3",
diff --git a/src/api/factory.js b/src/api/factory.js
index d922a9b..7351508 100644
--- a/src/api/factory.js
+++ b/src/api/factory.js
@@ -23,17 +23,28 @@
})
}
-// 设备安装基础信息列表导出
+// 设备安装基础信息列表导出(不包含图片)
export function batchExportDeviceAdd(params) {
return request({
url: 'appDeviceAdd/listExp',
method: 'post',
- timeout: 120000,
+ timeout: 120000000,
params,
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 设备安装基础信息列表导出(包含图片)
+export function batchExportDeviceImage(params) {
+ return request({
+ url: 'appDeviceAdd//image/listExp',
+ method: 'post',
+ // timeout: 120000,
+ params
+ // responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
+ })
+}
+
// 厂家查询
export function getFactoryList(params) {
return request({
@@ -142,3 +153,26 @@
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 上次导出的列表
+export function getLastExportList(data) {
+ return request({
+ url: `/appDeviceAdd/batch/logs?offset=${data.offset}&limit=${data.limit}`,
+ method: 'get'
+ })
+}
+
+// 下载压缩包
+export function downloadZip(recentDir) {
+ return request({
+ url: '/appDeviceAdd/batchzip',
+ // withCredentials: false,
+ method: 'get',
+ headers: { 'Content-Type': 'application/json; application/octet-stream' },
+ timeout: 120000,
+ responseType: 'blob', // 这一步也很关键,一定要加上 responseType 值为 blob
+ params: {
+ recentDir: recentDir
+ }
+ })
+}
+
diff --git a/config/dev.env.js b/config/dev.env.js
index d5b822a..7d35e26 100644
--- a/config/dev.env.js
+++ b/config/dev.env.js
@@ -7,6 +7,8 @@
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://139.198.18.188:8083"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
// BASE_API: '"http://192.168.43.84:8083"'
-
+ // BASE_API: '"https://38ka911915.picp.vip"' // 柴壮本地
+ // BASE_API: '"http://111.198.10.15:21405"'
})
diff --git a/config/prod.env.js b/config/prod.env.js
index fc8406e..825966d 100644
--- a/config/prod.env.js
+++ b/config/prod.env.js
@@ -9,4 +9,6 @@
// BASE_API: '"http://111.198.10.15:11604"'
// BASE_API: '"http://192.168.8.108:8083"'
// BASE_API: '"https://smartlog.work/prodapi4test"'
+ // BASE_API: '"http://111.198.10.15:21405"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
}
diff --git a/package.json b/package.json
index 5ad20d8..a143abb 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"echarts": "^4.2.1",
"element-ui": "2.13.0",
"event-source-polyfill": "^1.0.5",
+ "file-saver": "^2.0.5",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"mockjs": "1.0.1-beta3",
diff --git a/src/api/factory.js b/src/api/factory.js
index d922a9b..7351508 100644
--- a/src/api/factory.js
+++ b/src/api/factory.js
@@ -23,17 +23,28 @@
})
}
-// 设备安装基础信息列表导出
+// 设备安装基础信息列表导出(不包含图片)
export function batchExportDeviceAdd(params) {
return request({
url: 'appDeviceAdd/listExp',
method: 'post',
- timeout: 120000,
+ timeout: 120000000,
params,
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 设备安装基础信息列表导出(包含图片)
+export function batchExportDeviceImage(params) {
+ return request({
+ url: 'appDeviceAdd//image/listExp',
+ method: 'post',
+ // timeout: 120000,
+ params
+ // responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
+ })
+}
+
// 厂家查询
export function getFactoryList(params) {
return request({
@@ -142,3 +153,26 @@
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 上次导出的列表
+export function getLastExportList(data) {
+ return request({
+ url: `/appDeviceAdd/batch/logs?offset=${data.offset}&limit=${data.limit}`,
+ method: 'get'
+ })
+}
+
+// 下载压缩包
+export function downloadZip(recentDir) {
+ return request({
+ url: '/appDeviceAdd/batchzip',
+ // withCredentials: false,
+ method: 'get',
+ headers: { 'Content-Type': 'application/json; application/octet-stream' },
+ timeout: 120000,
+ responseType: 'blob', // 这一步也很关键,一定要加上 responseType 值为 blob
+ params: {
+ recentDir: recentDir
+ }
+ })
+}
+
diff --git a/src/icons/svg/icon-projectManagement.svg b/src/icons/svg/icon-projectManagement.svg
new file mode 100644
index 0000000..5483193
--- /dev/null
+++ b/src/icons/svg/icon-projectManagement.svg
@@ -0,0 +1 @@
+
diff --git a/config/dev.env.js b/config/dev.env.js
index d5b822a..7d35e26 100644
--- a/config/dev.env.js
+++ b/config/dev.env.js
@@ -7,6 +7,8 @@
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://139.198.18.188:8083"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
// BASE_API: '"http://192.168.43.84:8083"'
-
+ // BASE_API: '"https://38ka911915.picp.vip"' // 柴壮本地
+ // BASE_API: '"http://111.198.10.15:21405"'
})
diff --git a/config/prod.env.js b/config/prod.env.js
index fc8406e..825966d 100644
--- a/config/prod.env.js
+++ b/config/prod.env.js
@@ -9,4 +9,6 @@
// BASE_API: '"http://111.198.10.15:11604"'
// BASE_API: '"http://192.168.8.108:8083"'
// BASE_API: '"https://smartlog.work/prodapi4test"'
+ // BASE_API: '"http://111.198.10.15:21405"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
}
diff --git a/package.json b/package.json
index 5ad20d8..a143abb 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"echarts": "^4.2.1",
"element-ui": "2.13.0",
"event-source-polyfill": "^1.0.5",
+ "file-saver": "^2.0.5",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"mockjs": "1.0.1-beta3",
diff --git a/src/api/factory.js b/src/api/factory.js
index d922a9b..7351508 100644
--- a/src/api/factory.js
+++ b/src/api/factory.js
@@ -23,17 +23,28 @@
})
}
-// 设备安装基础信息列表导出
+// 设备安装基础信息列表导出(不包含图片)
export function batchExportDeviceAdd(params) {
return request({
url: 'appDeviceAdd/listExp',
method: 'post',
- timeout: 120000,
+ timeout: 120000000,
params,
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 设备安装基础信息列表导出(包含图片)
+export function batchExportDeviceImage(params) {
+ return request({
+ url: 'appDeviceAdd//image/listExp',
+ method: 'post',
+ // timeout: 120000,
+ params
+ // responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
+ })
+}
+
// 厂家查询
export function getFactoryList(params) {
return request({
@@ -142,3 +153,26 @@
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 上次导出的列表
+export function getLastExportList(data) {
+ return request({
+ url: `/appDeviceAdd/batch/logs?offset=${data.offset}&limit=${data.limit}`,
+ method: 'get'
+ })
+}
+
+// 下载压缩包
+export function downloadZip(recentDir) {
+ return request({
+ url: '/appDeviceAdd/batchzip',
+ // withCredentials: false,
+ method: 'get',
+ headers: { 'Content-Type': 'application/json; application/octet-stream' },
+ timeout: 120000,
+ responseType: 'blob', // 这一步也很关键,一定要加上 responseType 值为 blob
+ params: {
+ recentDir: recentDir
+ }
+ })
+}
+
diff --git a/src/icons/svg/icon-projectManagement.svg b/src/icons/svg/icon-projectManagement.svg
new file mode 100644
index 0000000..5483193
--- /dev/null
+++ b/src/icons/svg/icon-projectManagement.svg
@@ -0,0 +1 @@
+
diff --git a/src/router/modules/system.js b/src/router/modules/system.js
index 876fe61..7ce21dd 100644
--- a/src/router/modules/system.js
+++ b/src/router/modules/system.js
@@ -130,7 +130,14 @@
component: () => import('@/views/factoryManager/listConstruction'), // Parent router-view
name: 'ConstructionList',
meta: { title: '日志列表', permission: ['/construction/list'] }
- }]
+ },
+ {
+ path: '/projectManagementList',
+ component: () => import('@/views/factoryManager/projectManagement/list.vue'), // Parent router-view
+ name: 'ProjectManagementList',
+ meta: { title: '项目管理', permission: ['/projectManagement/list'] }
+ }
+ ]
},
{
path: 'system',
diff --git a/config/dev.env.js b/config/dev.env.js
index d5b822a..7d35e26 100644
--- a/config/dev.env.js
+++ b/config/dev.env.js
@@ -7,6 +7,8 @@
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://139.198.18.188:8083"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
// BASE_API: '"http://192.168.43.84:8083"'
-
+ // BASE_API: '"https://38ka911915.picp.vip"' // 柴壮本地
+ // BASE_API: '"http://111.198.10.15:21405"'
})
diff --git a/config/prod.env.js b/config/prod.env.js
index fc8406e..825966d 100644
--- a/config/prod.env.js
+++ b/config/prod.env.js
@@ -9,4 +9,6 @@
// BASE_API: '"http://111.198.10.15:11604"'
// BASE_API: '"http://192.168.8.108:8083"'
// BASE_API: '"https://smartlog.work/prodapi4test"'
+ // BASE_API: '"http://111.198.10.15:21405"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
}
diff --git a/package.json b/package.json
index 5ad20d8..a143abb 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"echarts": "^4.2.1",
"element-ui": "2.13.0",
"event-source-polyfill": "^1.0.5",
+ "file-saver": "^2.0.5",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"mockjs": "1.0.1-beta3",
diff --git a/src/api/factory.js b/src/api/factory.js
index d922a9b..7351508 100644
--- a/src/api/factory.js
+++ b/src/api/factory.js
@@ -23,17 +23,28 @@
})
}
-// 设备安装基础信息列表导出
+// 设备安装基础信息列表导出(不包含图片)
export function batchExportDeviceAdd(params) {
return request({
url: 'appDeviceAdd/listExp',
method: 'post',
- timeout: 120000,
+ timeout: 120000000,
params,
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 设备安装基础信息列表导出(包含图片)
+export function batchExportDeviceImage(params) {
+ return request({
+ url: 'appDeviceAdd//image/listExp',
+ method: 'post',
+ // timeout: 120000,
+ params
+ // responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
+ })
+}
+
// 厂家查询
export function getFactoryList(params) {
return request({
@@ -142,3 +153,26 @@
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 上次导出的列表
+export function getLastExportList(data) {
+ return request({
+ url: `/appDeviceAdd/batch/logs?offset=${data.offset}&limit=${data.limit}`,
+ method: 'get'
+ })
+}
+
+// 下载压缩包
+export function downloadZip(recentDir) {
+ return request({
+ url: '/appDeviceAdd/batchzip',
+ // withCredentials: false,
+ method: 'get',
+ headers: { 'Content-Type': 'application/json; application/octet-stream' },
+ timeout: 120000,
+ responseType: 'blob', // 这一步也很关键,一定要加上 responseType 值为 blob
+ params: {
+ recentDir: recentDir
+ }
+ })
+}
+
diff --git a/src/icons/svg/icon-projectManagement.svg b/src/icons/svg/icon-projectManagement.svg
new file mode 100644
index 0000000..5483193
--- /dev/null
+++ b/src/icons/svg/icon-projectManagement.svg
@@ -0,0 +1 @@
+
diff --git a/src/router/modules/system.js b/src/router/modules/system.js
index 876fe61..7ce21dd 100644
--- a/src/router/modules/system.js
+++ b/src/router/modules/system.js
@@ -130,7 +130,14 @@
component: () => import('@/views/factoryManager/listConstruction'), // Parent router-view
name: 'ConstructionList',
meta: { title: '日志列表', permission: ['/construction/list'] }
- }]
+ },
+ {
+ path: '/projectManagementList',
+ component: () => import('@/views/factoryManager/projectManagement/list.vue'), // Parent router-view
+ name: 'ProjectManagementList',
+ meta: { title: '项目管理', permission: ['/projectManagement/list'] }
+ }
+ ]
},
{
path: 'system',
diff --git a/src/store/index.js b/src/store/index.js
index c7e23ff..64b95fd 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -5,7 +5,7 @@
import permission from './modules/permission'
import tagsView from './modules/tagsView'
import getters from './getters'
-
+import websocket from './modules/websocket'
Vue.use(Vuex)
const store = new Vuex.Store({
@@ -13,7 +13,8 @@
app,
user,
permission,
- tagsView
+ tagsView,
+ websocket
},
getters
})
diff --git a/config/dev.env.js b/config/dev.env.js
index d5b822a..7d35e26 100644
--- a/config/dev.env.js
+++ b/config/dev.env.js
@@ -7,6 +7,8 @@
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://139.198.18.188:8083"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
// BASE_API: '"http://192.168.43.84:8083"'
-
+ // BASE_API: '"https://38ka911915.picp.vip"' // 柴壮本地
+ // BASE_API: '"http://111.198.10.15:21405"'
})
diff --git a/config/prod.env.js b/config/prod.env.js
index fc8406e..825966d 100644
--- a/config/prod.env.js
+++ b/config/prod.env.js
@@ -9,4 +9,6 @@
// BASE_API: '"http://111.198.10.15:11604"'
// BASE_API: '"http://192.168.8.108:8083"'
// BASE_API: '"https://smartlog.work/prodapi4test"'
+ // BASE_API: '"http://111.198.10.15:21405"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
}
diff --git a/package.json b/package.json
index 5ad20d8..a143abb 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"echarts": "^4.2.1",
"element-ui": "2.13.0",
"event-source-polyfill": "^1.0.5",
+ "file-saver": "^2.0.5",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"mockjs": "1.0.1-beta3",
diff --git a/src/api/factory.js b/src/api/factory.js
index d922a9b..7351508 100644
--- a/src/api/factory.js
+++ b/src/api/factory.js
@@ -23,17 +23,28 @@
})
}
-// 设备安装基础信息列表导出
+// 设备安装基础信息列表导出(不包含图片)
export function batchExportDeviceAdd(params) {
return request({
url: 'appDeviceAdd/listExp',
method: 'post',
- timeout: 120000,
+ timeout: 120000000,
params,
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 设备安装基础信息列表导出(包含图片)
+export function batchExportDeviceImage(params) {
+ return request({
+ url: 'appDeviceAdd//image/listExp',
+ method: 'post',
+ // timeout: 120000,
+ params
+ // responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
+ })
+}
+
// 厂家查询
export function getFactoryList(params) {
return request({
@@ -142,3 +153,26 @@
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 上次导出的列表
+export function getLastExportList(data) {
+ return request({
+ url: `/appDeviceAdd/batch/logs?offset=${data.offset}&limit=${data.limit}`,
+ method: 'get'
+ })
+}
+
+// 下载压缩包
+export function downloadZip(recentDir) {
+ return request({
+ url: '/appDeviceAdd/batchzip',
+ // withCredentials: false,
+ method: 'get',
+ headers: { 'Content-Type': 'application/json; application/octet-stream' },
+ timeout: 120000,
+ responseType: 'blob', // 这一步也很关键,一定要加上 responseType 值为 blob
+ params: {
+ recentDir: recentDir
+ }
+ })
+}
+
diff --git a/src/icons/svg/icon-projectManagement.svg b/src/icons/svg/icon-projectManagement.svg
new file mode 100644
index 0000000..5483193
--- /dev/null
+++ b/src/icons/svg/icon-projectManagement.svg
@@ -0,0 +1 @@
+
diff --git a/src/router/modules/system.js b/src/router/modules/system.js
index 876fe61..7ce21dd 100644
--- a/src/router/modules/system.js
+++ b/src/router/modules/system.js
@@ -130,7 +130,14 @@
component: () => import('@/views/factoryManager/listConstruction'), // Parent router-view
name: 'ConstructionList',
meta: { title: '日志列表', permission: ['/construction/list'] }
- }]
+ },
+ {
+ path: '/projectManagementList',
+ component: () => import('@/views/factoryManager/projectManagement/list.vue'), // Parent router-view
+ name: 'ProjectManagementList',
+ meta: { title: '项目管理', permission: ['/projectManagement/list'] }
+ }
+ ]
},
{
path: 'system',
diff --git a/src/store/index.js b/src/store/index.js
index c7e23ff..64b95fd 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -5,7 +5,7 @@
import permission from './modules/permission'
import tagsView from './modules/tagsView'
import getters from './getters'
-
+import websocket from './modules/websocket'
Vue.use(Vuex)
const store = new Vuex.Store({
@@ -13,7 +13,8 @@
app,
user,
permission,
- tagsView
+ tagsView,
+ websocket
},
getters
})
diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js
new file mode 100644
index 0000000..db4b1a7
--- /dev/null
+++ b/src/store/modules/websocket.js
@@ -0,0 +1,80 @@
+import { logAxis } from 'echarts/lib/theme/dark'
+import { Notification } from 'element-ui'
+import router from '../../router'
+import user from './user'
+const websocket = {
+ state: {
+ // wsUrl: 'ws://198.168.1.113:11307/websocket/',
+ // wsUrl: 'ws://127.0.0.1:8095/websocket/',
+ // wsUrl: 'ws://111.198.10.15:21405/websocket/',
+ wsUrl: 'ws://139.198.18.188:8083/websocket/',
+ websocket: null,
+ wsStatus: false, // websocket连接状态
+ needRefresh: false // 是否需要刷新数据
+ },
+ mutations: {
+ SET_WEBSOCKET: (state, websocket) => {
+ state.websocket = websocket
+ },
+ SET_WS_STATUS: (state, wsStatus) => {
+ state.wsStatus = wsStatus
+ },
+ SET_NEED_REFRESH: (state, needRefresh) => {
+ state.needRefresh = needRefresh
+ }
+ },
+
+ actions: {
+ // 连接websocket
+ initWebSocket({ commit }) {
+ if (typeof (WebSocket) === 'undefined') {
+ Notification({
+ title: '提示',
+ message: '当前浏览器无法接收实时信息,请使用谷歌浏览器或360浏览器极速模式!',
+ type: 'warning',
+ duration: 0
+ })
+ } else {
+ // 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改
+ // 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送
+ // const socketUrl = websocket.state.wsUrl + user.state.token
+ const socketUrl = websocket.state.wsUrl + user.state.id
+ const socket = new WebSocket(socketUrl)
+ commit('SET_WEBSOCKET', socket)
+ commit('SET_WS_STATUS', true)
+ // 监听socket打开
+ socket.onopen = function() {
+ console.log('浏览器WebSocket已打开')
+ }
+ // 监听socket消息接收
+ socket.onmessage = function(msg) {
+ // 设备更新数据结果
+ const data = JSON.parse(msg.data)
+ console.log('socket返回数据', data)
+ Notification({
+ title: '导出图片结果',
+ message: data.message,
+ type: 'success',
+ duration: 0
+ })
+ }
+ // 监听socket错误
+ socket.onerror = function() {
+ Notification({
+ title: '服务器错误',
+ message: '无法接收实时信息,请检查服务器后重新刷新页面',
+ type: 'error',
+ duration: 0
+ })
+ }
+ // 监听socket关闭
+ socket.onclose = function() {
+ console.log('WebSocket已关闭')
+ commit('SET_WS_STATUS', false)
+ }
+ }
+ }
+ }
+}
+
+export default websocket
diff --git a/config/dev.env.js b/config/dev.env.js
index d5b822a..7d35e26 100644
--- a/config/dev.env.js
+++ b/config/dev.env.js
@@ -7,6 +7,8 @@
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
BASE_API: '"http://139.198.18.188:8083"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
// BASE_API: '"http://192.168.43.84:8083"'
-
+ // BASE_API: '"https://38ka911915.picp.vip"' // 柴壮本地
+ // BASE_API: '"http://111.198.10.15:21405"'
})
diff --git a/config/prod.env.js b/config/prod.env.js
index fc8406e..825966d 100644
--- a/config/prod.env.js
+++ b/config/prod.env.js
@@ -9,4 +9,6 @@
// BASE_API: '"http://111.198.10.15:11604"'
// BASE_API: '"http://192.168.8.108:8083"'
// BASE_API: '"https://smartlog.work/prodapi4test"'
+ // BASE_API: '"http://111.198.10.15:21405"'
+ // BASE_API: '"https://logapi.smartlog.work/"' // 小程序
}
diff --git a/package.json b/package.json
index 5ad20d8..a143abb 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"echarts": "^4.2.1",
"element-ui": "2.13.0",
"event-source-polyfill": "^1.0.5",
+ "file-saver": "^2.0.5",
"js-cookie": "2.2.0",
"jsencrypt": "^3.0.0-rc.1",
"mockjs": "1.0.1-beta3",
diff --git a/src/api/factory.js b/src/api/factory.js
index d922a9b..7351508 100644
--- a/src/api/factory.js
+++ b/src/api/factory.js
@@ -23,17 +23,28 @@
})
}
-// 设备安装基础信息列表导出
+// 设备安装基础信息列表导出(不包含图片)
export function batchExportDeviceAdd(params) {
return request({
url: 'appDeviceAdd/listExp',
method: 'post',
- timeout: 120000,
+ timeout: 120000000,
params,
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 设备安装基础信息列表导出(包含图片)
+export function batchExportDeviceImage(params) {
+ return request({
+ url: 'appDeviceAdd//image/listExp',
+ method: 'post',
+ // timeout: 120000,
+ params
+ // responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
+ })
+}
+
// 厂家查询
export function getFactoryList(params) {
return request({
@@ -142,3 +153,26 @@
responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob
})
}
+// 上次导出的列表
+export function getLastExportList(data) {
+ return request({
+ url: `/appDeviceAdd/batch/logs?offset=${data.offset}&limit=${data.limit}`,
+ method: 'get'
+ })
+}
+
+// 下载压缩包
+export function downloadZip(recentDir) {
+ return request({
+ url: '/appDeviceAdd/batchzip',
+ // withCredentials: false,
+ method: 'get',
+ headers: { 'Content-Type': 'application/json; application/octet-stream' },
+ timeout: 120000,
+ responseType: 'blob', // 这一步也很关键,一定要加上 responseType 值为 blob
+ params: {
+ recentDir: recentDir
+ }
+ })
+}
+
diff --git a/src/icons/svg/icon-projectManagement.svg b/src/icons/svg/icon-projectManagement.svg
new file mode 100644
index 0000000..5483193
--- /dev/null
+++ b/src/icons/svg/icon-projectManagement.svg
@@ -0,0 +1 @@
+
diff --git a/src/router/modules/system.js b/src/router/modules/system.js
index 876fe61..7ce21dd 100644
--- a/src/router/modules/system.js
+++ b/src/router/modules/system.js
@@ -130,7 +130,14 @@
component: () => import('@/views/factoryManager/listConstruction'), // Parent router-view
name: 'ConstructionList',
meta: { title: '日志列表', permission: ['/construction/list'] }
- }]
+ },
+ {
+ path: '/projectManagementList',
+ component: () => import('@/views/factoryManager/projectManagement/list.vue'), // Parent router-view
+ name: 'ProjectManagementList',
+ meta: { title: '项目管理', permission: ['/projectManagement/list'] }
+ }
+ ]
},
{
path: 'system',
diff --git a/src/store/index.js b/src/store/index.js
index c7e23ff..64b95fd 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -5,7 +5,7 @@
import permission from './modules/permission'
import tagsView from './modules/tagsView'
import getters from './getters'
-
+import websocket from './modules/websocket'
Vue.use(Vuex)
const store = new Vuex.Store({
@@ -13,7 +13,8 @@
app,
user,
permission,
- tagsView
+ tagsView,
+ websocket
},
getters
})
diff --git a/src/store/modules/websocket.js b/src/store/modules/websocket.js
new file mode 100644
index 0000000..db4b1a7
--- /dev/null
+++ b/src/store/modules/websocket.js
@@ -0,0 +1,80 @@
+import { logAxis } from 'echarts/lib/theme/dark'
+import { Notification } from 'element-ui'
+import router from '../../router'
+import user from './user'
+const websocket = {
+ state: {
+ // wsUrl: 'ws://198.168.1.113:11307/websocket/',
+ // wsUrl: 'ws://127.0.0.1:8095/websocket/',
+ // wsUrl: 'ws://111.198.10.15:21405/websocket/',
+ wsUrl: 'ws://139.198.18.188:8083/websocket/',
+ websocket: null,
+ wsStatus: false, // websocket连接状态
+ needRefresh: false // 是否需要刷新数据
+ },
+ mutations: {
+ SET_WEBSOCKET: (state, websocket) => {
+ state.websocket = websocket
+ },
+ SET_WS_STATUS: (state, wsStatus) => {
+ state.wsStatus = wsStatus
+ },
+ SET_NEED_REFRESH: (state, needRefresh) => {
+ state.needRefresh = needRefresh
+ }
+ },
+
+ actions: {
+ // 连接websocket
+ initWebSocket({ commit }) {
+ if (typeof (WebSocket) === 'undefined') {
+ Notification({
+ title: '提示',
+ message: '当前浏览器无法接收实时信息,请使用谷歌浏览器或360浏览器极速模式!',
+ type: 'warning',
+ duration: 0
+ })
+ } else {
+ // 获取token保存到vuex中的用户信息,此处仅适用于本项目,注意删除或修改
+ // 实例化socket,这里我把用户名传给了后台,使后台能判断要把消息发给哪个用户,其实也可以后台直接获取用户IP来判断并推送
+ // const socketUrl = websocket.state.wsUrl + user.state.token
+ const socketUrl = websocket.state.wsUrl + user.state.id
+ const socket = new WebSocket(socketUrl)
+ commit('SET_WEBSOCKET', socket)
+ commit('SET_WS_STATUS', true)
+ // 监听socket打开
+ socket.onopen = function() {
+ console.log('浏览器WebSocket已打开')
+ }
+ // 监听socket消息接收
+ socket.onmessage = function(msg) {
+ // 设备更新数据结果
+ const data = JSON.parse(msg.data)
+ console.log('socket返回数据', data)
+ Notification({
+ title: '导出图片结果',
+ message: data.message,
+ type: 'success',
+ duration: 0
+ })
+ }
+ // 监听socket错误
+ socket.onerror = function() {
+ Notification({
+ title: '服务器错误',
+ message: '无法接收实时信息,请检查服务器后重新刷新页面',
+ type: 'error',
+ duration: 0
+ })
+ }
+ // 监听socket关闭
+ socket.onclose = function() {
+ console.log('WebSocket已关闭')
+ commit('SET_WS_STATUS', false)
+ }
+ }
+ }
+ }
+}
+
+export default websocket
diff --git a/src/views/factoryManager/components/editProject.vue b/src/views/factoryManager/components/editProject.vue
new file mode 100644
index 0000000..d61c2e8
--- /dev/null
+++ b/src/views/factoryManager/components/editProject.vue
@@ -0,0 +1,173 @@
+
+