Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
ba9bfcbdcc | |||
c85ee3f425 | |||
c872318147 | |||
![]() |
93f5bd0c58 | ||
![]() |
d991b2a3e0 | ||
![]() |
919709e560 | ||
![]() |
8159f97701 | ||
![]() |
6ed69a4e8e | ||
![]() |
ae6ec1b4eb | ||
![]() |
fee4985d75 | ||
![]() |
6040224f29 | ||
![]() |
e375b43f22 | ||
![]() |
dabd0b840a | ||
![]() |
55f40b09e8 | ||
![]() |
a260b3107b | ||
![]() |
ace4df447a |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
node_modules
|
node_modules
|
||||||
.idea
|
.idea
|
||||||
|
12
.idea/CellsysBase.iml
generated
12
.idea/CellsysBase.iml
generated
@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="WEB_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/CellsysBase.iml" filepath="$PROJECT_DIR$/.idea/CellsysBase.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
8
.idea/workspace.xml
generated
8
.idea/workspace.xml
generated
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="PropertiesComponent">{
|
|
||||||
"keyToString": {
|
|
||||||
"settings.editor.selected.configurable": "preferences.editor"
|
|
||||||
}
|
|
||||||
}</component>
|
|
||||||
</project>
|
|
@ -4,7 +4,7 @@
|
|||||||
* @LastEditors: ag 2663588772@qq.com
|
* @LastEditors: ag 2663588772@qq.com
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
import { thirdpartyGet, thirdpartyPost } from '@/api/axiosExtension.js';
|
import { get, post } from './utils/axios';
|
||||||
|
|
||||||
//第三方数据元数据
|
//第三方数据元数据
|
||||||
class CellsysExtensionMeta {
|
class CellsysExtensionMeta {
|
||||||
@ -89,7 +89,7 @@ class CellsysExtensionRecord {
|
|||||||
queryThirdpartyData() {
|
queryThirdpartyData() {
|
||||||
let apiUrl = this.apiUrl;
|
let apiUrl = this.apiUrl;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
thirdpartyGet(apiUrl)
|
get(apiUrl)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.data = res;
|
this.data = res;
|
||||||
resolve(res);
|
resolve(res);
|
||||||
@ -128,7 +128,7 @@ class CellsysExtensionType {
|
|||||||
//表格头数据
|
//表格头数据
|
||||||
let metadataUrl = this.metadataUrl;
|
let metadataUrl = this.metadataUrl;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
thirdpartyGet(metadataUrl)
|
get(metadataUrl)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// this.data = res;
|
// this.data = res;
|
||||||
resolve(res);
|
resolve(res);
|
||||||
@ -142,7 +142,7 @@ class CellsysExtensionType {
|
|||||||
//表格内容
|
//表格内容
|
||||||
let selectUrl = this.selectUrl;
|
let selectUrl = this.selectUrl;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
thirdpartyPost(selectUrl, pageInfo)
|
post(selectUrl, pageInfo)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// this.data = res;
|
// this.data = res;
|
||||||
resolve(res);
|
resolve(res);
|
||||||
@ -156,7 +156,7 @@ class CellsysExtensionType {
|
|||||||
//插入
|
//插入
|
||||||
let insertUrl = this.insertUrl;
|
let insertUrl = this.insertUrl;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
thirdpartyPost(insertUrl, params)
|
post(insertUrl, params)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// this.data = res;
|
// this.data = res;
|
||||||
resolve(res);
|
resolve(res);
|
||||||
@ -170,7 +170,7 @@ class CellsysExtensionType {
|
|||||||
//更新
|
//更新
|
||||||
let updateUrl = this.updateUrl;
|
let updateUrl = this.updateUrl;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
thirdpartyPost(updateUrl, params)
|
post(updateUrl, params)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// this.data = res;
|
// this.data = res;
|
||||||
resolve(res);
|
resolve(res);
|
||||||
@ -184,7 +184,7 @@ class CellsysExtensionType {
|
|||||||
//删除
|
//删除
|
||||||
let deleteUrl = this.deleteUrl;
|
let deleteUrl = this.deleteUrl;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
thirdpartyPost(deleteUrl, param)
|
post(deleteUrl, param)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
// this.data = res;
|
// this.data = res;
|
||||||
resolve(res);
|
resolve(res);
|
||||||
@ -195,19 +195,24 @@ class CellsysExtensionType {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadImg(param, progressCallBack){
|
uploadImg(param, progressCallBack) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let config = {
|
let config = {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'multipart/form-data'
|
'Content-Type': 'multipart/form-data',
|
||||||
},
|
},
|
||||||
onUploadProgress:(progressEvent)=>{ //用于上传进度
|
onUploadProgress: (progressEvent) => {
|
||||||
|
//用于上传进度
|
||||||
let loaded = progressEvent.loaded,
|
let loaded = progressEvent.loaded,
|
||||||
total = progressEvent.total;
|
total = progressEvent.total;
|
||||||
progressCallBack(loaded/total); //上传进度回调
|
progressCallBack(loaded / total); //上传进度回调
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
thirdpartyPost(`${window.GLOBAL["CORS_API"]}/ThirdpartyApi/artwork/api/picture/upload`, param, config)
|
post(
|
||||||
|
`${window.GLOBAL['CORS_API']}/ThirdpartyApi/artwork/api/picture/upload`,
|
||||||
|
param,
|
||||||
|
config,
|
||||||
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
resolve(res);
|
resolve(res);
|
||||||
})
|
})
|
||||||
|
@ -147,7 +147,7 @@ class CellsysGroup {
|
|||||||
_membersParam.push({
|
_membersParam.push({
|
||||||
_realname: memberObj.realName,
|
_realname: memberObj.realName,
|
||||||
_mobile: memberObj.mobile,
|
_mobile: memberObj.mobile,
|
||||||
_gender: memberObj.gender,
|
_gender: String(memberObj.gender),
|
||||||
_email: memberObj.email,
|
_email: memberObj.email,
|
||||||
_member_type_name: memberObj.typeName
|
_member_type_name: memberObj.typeName
|
||||||
? memberObj.typeName
|
? memberObj.typeName
|
||||||
@ -210,5 +210,4 @@ class CellsysGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default CellsysGroup;
|
||||||
export default CellsysGroup
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import Canvg from 'canvg'
|
import Canvg from 'canvg'
|
||||||
import { CellsysType } from './cellsysUtil.js'
|
import {CellsysType, EditTask, EditType} from './cellsysUtil.js'
|
||||||
|
|
||||||
|
|
||||||
class CellsysIcon {
|
class CellsysIcon {
|
||||||
@ -142,6 +142,82 @@ const personStand = {
|
|||||||
'data': 'M505.394 231.226c49.548 0 92.49-46.245 92.49-102.4s-42.942-105.703-92.49-105.703-92.49 46.245-92.49 102.4 39.638 105.703 92.49 105.703zm75.974 66.064H429.419c-16.516 0-33.032 6.607-46.245 19.82-13.213 13.213-19.82 33.032-19.82 52.851v214.71c0 39.639 26.427 69.368 59.459 72.67l6.606 3.304v336.93h151.949V657.341h6.606c33.032-3.303 56.155-33.032 59.458-72.671v-214.71c0-39.638-29.729-72.67-66.064-72.67z'
|
'data': 'M505.394 231.226c49.548 0 92.49-46.245 92.49-102.4s-42.942-105.703-92.49-105.703-92.49 46.245-92.49 102.4 39.638 105.703 92.49 105.703zm75.974 66.064H429.419c-16.516 0-33.032 6.607-46.245 19.82-13.213 13.213-19.82 33.032-19.82 52.851v214.71c0 39.639 26.427 69.368 59.459 72.67l6.606 3.304v336.93h151.949V657.341h6.606c33.032-3.303 56.155-33.032 59.458-72.671v-214.71c0-39.638-29.729-72.67-66.064-72.67z'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建图标
|
||||||
|
* @param {*} icon
|
||||||
|
*/
|
||||||
|
export function saveIcon(icon) {
|
||||||
|
let editTask = new EditTask(EditType.saveIcon);
|
||||||
|
editTask.addParam("_name", icon.name);
|
||||||
|
editTask.addParam("_fill_color", icon.fillColor);
|
||||||
|
editTask.addParam("_fill_opacity", icon.fillOpacity);
|
||||||
|
editTask.addParam("_type", icon.type);
|
||||||
|
editTask.addParam("_tags", icon.tags);
|
||||||
|
editTask.addParam("_data", icon.data);
|
||||||
|
editTask.addParam("_rotate", icon.rotate);
|
||||||
|
return editTask.execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入图标
|
||||||
|
* @param {*} cellsysObject
|
||||||
|
*/
|
||||||
|
export function importIcons(cellsysObject) {
|
||||||
|
let editTask = new EditTask(EditType.importIcons),
|
||||||
|
paramList = []
|
||||||
|
if (cellsysObject.length > 0) {
|
||||||
|
cellsysObject.forEach(icon => {
|
||||||
|
paramList.push({
|
||||||
|
'_name': icon.name,
|
||||||
|
'_fill_color': icon.fillColor,
|
||||||
|
'_fill_opacity': icon.fillOpacity,
|
||||||
|
'_type': icon.type,
|
||||||
|
'_tags': icon.tags,
|
||||||
|
'_data': icon.data,
|
||||||
|
'_rotate': icon.rotate
|
||||||
|
})
|
||||||
|
})
|
||||||
|
editTask.addParam('_icons', paramList)
|
||||||
|
}
|
||||||
|
return editTask.execute()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新图标
|
||||||
|
* @param {*} cellsysObject
|
||||||
|
*/
|
||||||
|
export function updateIcon(cellsysObject) {
|
||||||
|
let editTask = new EditTask(EditType.updateIcon);
|
||||||
|
editTask.addParam("_icon_id", cellsysObject.id);
|
||||||
|
editTask.addParam("_id", cellsysObject.id);
|
||||||
|
editTask.addParam("_name", cellsysObject.name);
|
||||||
|
editTask.addParam("_fill_color", cellsysObject.fillColor);
|
||||||
|
editTask.addParam("_fill_opacity", cellsysObject.fillOpacity);
|
||||||
|
editTask.addParam("_type", cellsysObject.type);
|
||||||
|
editTask.addParam("_tags", cellsysObject.tags);
|
||||||
|
editTask.addParam("_data", cellsysObject.data);
|
||||||
|
return editTask.execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除图标
|
||||||
|
* @param {*} cellsysObject
|
||||||
|
*/
|
||||||
|
export function deleteIcon(cellsysObject) {
|
||||||
|
let editTask = new EditTask(EditType.deleteIcon);
|
||||||
|
editTask.addParam("_id", cellsysObject.id);
|
||||||
|
return editTask.execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序图标
|
||||||
|
* @param {*} data
|
||||||
|
*/
|
||||||
|
export function sortIcons(data) {
|
||||||
|
let editTask = new EditTask(EditType.sortIcon)
|
||||||
|
editTask.addParam('_icons', data)
|
||||||
|
return editTask.execute()
|
||||||
|
}
|
||||||
|
|
||||||
export default CellsysIcon
|
export default CellsysIcon
|
||||||
export {
|
export {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { CellsysType } from './cellsysUtil.js';
|
import {CellsysType, EditTask, EditType, Query, QueryTask, QueryType} from './cellsysUtil.js';
|
||||||
|
|
||||||
class CellsysIconType {
|
class CellsysIconType {
|
||||||
constructor(params) {
|
constructor(params) {
|
||||||
@ -16,4 +16,47 @@ class CellsysIconType {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增图标类型
|
||||||
|
* @param {*} cellsysObject
|
||||||
|
*/
|
||||||
|
export function saveIconType(cellsysObject) {
|
||||||
|
let editTask = new EditTask(EditType.saveIconType)
|
||||||
|
editTask.addParam("_name", cellsysObject.name)
|
||||||
|
editTask.addParam("_sort", cellsysObject.sort)
|
||||||
|
return editTask.execute()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新图标类型
|
||||||
|
* @param {*} cellsysObject
|
||||||
|
*/
|
||||||
|
export function updateIconType(cellsysObject) {
|
||||||
|
let editTask = new EditTask(EditType.updateIconType)
|
||||||
|
editTask.addParam("_id", cellsysObject.id)
|
||||||
|
editTask.addParam("_name", cellsysObject.name)
|
||||||
|
editTask.addParam("_sort", cellsysObject.sort)
|
||||||
|
return editTask.execute()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除图标类型
|
||||||
|
* @param {*} cellsysObject
|
||||||
|
*/
|
||||||
|
export function deleteIconType(cellsysObject) {
|
||||||
|
let editTask = new EditTask(EditType.deleteIconType)
|
||||||
|
editTask.addParam("_id", cellsysObject.id)
|
||||||
|
return editTask.execute()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序图标
|
||||||
|
* @param {*} data
|
||||||
|
*/
|
||||||
|
export function sortIconTypes(data) {
|
||||||
|
let editTask = new EditTask(EditType.sortIconType)
|
||||||
|
editTask.addParam('_icon_types', data)
|
||||||
|
return editTask.execute()
|
||||||
|
}
|
||||||
|
|
||||||
export default CellsysIconType
|
export default CellsysIconType
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Query, QueryTask, QueryType, Operator, CellsysType } from './cellsysUtil.js';
|
import { Query, QueryTask, QueryType, Operator, CellsysType } from './cellsysUtil.js';
|
||||||
import CellsysEquipment from './cellsysEquipment.js';
|
import CellsysEquipment from './cellsysEquipment.js';
|
||||||
|
import { formatterDate } from './utils/date';
|
||||||
|
|
||||||
class CellsysMember {
|
class CellsysMember {
|
||||||
constructor(params) {
|
constructor(params) {
|
||||||
@ -45,10 +46,17 @@ class CellsysMember {
|
|||||||
this.avatar = params.avatar; // 头像
|
this.avatar = params.avatar; // 头像
|
||||||
}
|
}
|
||||||
|
|
||||||
setMemberType(value) {
|
get dateTimeStr() {
|
||||||
this.memberType = value;
|
if (this.dateTime) {
|
||||||
|
return formatterDate(this.dateTime, 'YYYY-MM-DD HH:mm');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get createTimeFormat() {
|
||||||
|
return formatterDate(this.createTime);
|
||||||
|
}
|
||||||
|
get updateTimeFormat() {
|
||||||
|
return formatterDate(this.updateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
setLeader(value) {
|
setLeader(value) {
|
||||||
if (value && value === 1) {
|
if (value && value === 1) {
|
||||||
this.isLeader = 1;
|
this.isLeader = 1;
|
||||||
@ -62,10 +70,14 @@ class CellsysMember {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//查询用户绑定的设备详情,带组织联合逻辑,无分页
|
//查询用户绑定的设备详情,带组织联合逻辑,无分页
|
||||||
queryBindDeviceDeatil() {
|
queryBindDeviceDeatil(params = {}) {
|
||||||
|
let { isUnion } = params;
|
||||||
if (this.macId) {
|
if (this.macId) {
|
||||||
let query = new Query();
|
let query = new Query();
|
||||||
let queryType = QueryType.UnionEquipment;
|
let queryType = QueryType.Equipment;
|
||||||
|
if (isUnion) {
|
||||||
|
queryType = QueryType.UnionEquipment;
|
||||||
|
}
|
||||||
let queryTask = new QueryTask(queryType);
|
let queryTask = new QueryTask(queryType);
|
||||||
query.addFilter('macid', Operator.Equals, this.macId);
|
query.addFilter('macid', Operator.Equals, this.macId);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
@ -1,63 +1,63 @@
|
|||||||
import { CellsysPolygonStyle } from './cellsysStyle'
|
import { CellsysPolygonStyle } from './cellsysStyle';
|
||||||
import CellsysElementType from './cellsysElementType';
|
import CellsysElementType from './cellsysElementType';
|
||||||
import { CellsysType, EditTask, EditType, Query, QueryTask, QueryType } from './cellsysUtil.js';
|
import { CellsysType, EditTask, EditType, Query, QueryTask, QueryType } from './cellsysUtil.js';
|
||||||
import { PublishTarget } from './cellsysEnum';
|
import { PublishTarget } from './cellsysEnum';
|
||||||
import {hexColorToRgba} from "@/utils/utils";
|
import { hexColorToRgba } from './utils/utils';
|
||||||
|
|
||||||
class CellsysOfflinePolygonType extends CellsysElementType {
|
class CellsysOfflinePolygonType extends CellsysElementType {
|
||||||
constructor(params) {
|
constructor(params) {
|
||||||
super(params);
|
super(params);
|
||||||
|
|
||||||
this.cellsysType = CellsysType.OfflinePolygonType
|
this.cellsysType = CellsysType.OfflinePolygonType;
|
||||||
if (!params) {
|
if (!params) {
|
||||||
params = {}
|
params = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
this.id = params.id
|
this.id = params.id;
|
||||||
this.name = params.name
|
this.name = params.name;
|
||||||
this.description = params.description
|
this.description = params.description;
|
||||||
this.orgId = params.org_id
|
this.orgId = params.org_id;
|
||||||
this.orgName = params.org_name
|
this.orgName = params.org_name;
|
||||||
this.style = params.style ? params.style : CellsysPolygonStyle.getDefaultStyle();
|
this.style = params.style ? params.style : CellsysPolygonStyle.getDefaultStyle();
|
||||||
this.action = params.action
|
this.action = params.action;
|
||||||
this.typeCount = params.type_count || 0
|
this.typeCount = params.type_count || 0;
|
||||||
this.isPublish = params.is_publish || 0;
|
this.isPublish = params.is_publish || 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setId(value) {
|
setId(value) {
|
||||||
this.id = value
|
this.id = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
setName(value) {
|
setName(value) {
|
||||||
this.name = value
|
this.name = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
setDescription(value) {
|
setDescription(value) {
|
||||||
this.description = value
|
this.description = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
setStyle(value) {
|
setStyle(value) {
|
||||||
this.style = value
|
this.style = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
getColor() {
|
getColor() {
|
||||||
return this.style ? this.style.color : '#000000'
|
return this.style ? this.style.color : '#000000';
|
||||||
}
|
}
|
||||||
|
|
||||||
getFillColor() {
|
getFillColor() {
|
||||||
return this.style ? this.style.fillColor : null
|
return this.style ? this.style.fillColor : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFillOpacity() {
|
getFillOpacity() {
|
||||||
return this.style ? this.style.fillOpacity : null
|
return this.style ? this.style.fillOpacity : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
getCssStyle() {
|
getCssStyle() {
|
||||||
// return formatterPolygonStyle(this.style)
|
// return formatterPolygonStyle(this.style)
|
||||||
if (this.style) {
|
if (this.style) {
|
||||||
let strokeOpacity = this.style.strokeOpacity;
|
let strokeOpacity = this.style.strokeOpacity;
|
||||||
strokeOpacity = strokeOpacity === null || strokeOpacity === undefined ? 0 : strokeOpacity;
|
strokeOpacity =
|
||||||
|
strokeOpacity === null || strokeOpacity === undefined ? 0 : strokeOpacity;
|
||||||
let colors = hexColorToRgba(this.style.strokeColor || '#000000');
|
let colors = hexColorToRgba(this.style.strokeColor || '#000000');
|
||||||
colors.push(strokeOpacity);
|
colors.push(strokeOpacity);
|
||||||
let border = this.style.weight + 'px ' + 'solid rgba(' + colors.join(',') + ')';
|
let border = this.style.weight + 'px ' + 'solid rgba(' + colors.join(',') + ')';
|
||||||
@ -76,18 +76,16 @@ class CellsysOfflinePolygonType extends CellsysElementType {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//发布功能
|
//发布功能
|
||||||
setPublish(publishStatus, range, ids, isEditable, remark) {
|
setPublish(publishStatus, range, ids, isEditable, remark) {
|
||||||
|
|
||||||
let editTask = new EditTask(EditType.OfflinePublish);
|
let editTask = new EditTask(EditType.OfflinePublish);
|
||||||
editTask.addParam('_id', this.id);
|
editTask.addParam('_id', this.id);
|
||||||
editTask.addParam("_offline_fence_type_name", this.name);
|
editTask.addParam('_offline_fence_type_name', this.name);
|
||||||
editTask.addParam('_is_publish', PublishTarget[publishStatus]);
|
editTask.addParam('_is_publish', PublishTarget[publishStatus]);
|
||||||
editTask.addParam('_remark', remark);
|
editTask.addParam('_remark', remark);
|
||||||
if (publishStatus !== "noPublish") {
|
if (publishStatus !== 'noPublish') {
|
||||||
if (range === 1) { //发布到组织
|
if (range === 1) {
|
||||||
|
//发布到组织
|
||||||
editTask.addParam('_publish_org', ids);
|
editTask.addParam('_publish_org', ids);
|
||||||
} else {
|
} else {
|
||||||
editTask.addParam('_publish_group', ids);
|
editTask.addParam('_publish_group', ids);
|
||||||
@ -104,14 +102,12 @@ class CellsysOfflinePolygonType extends CellsysElementType {
|
|||||||
|
|
||||||
//查询协同数据发布记录列表
|
//查询协同数据发布记录列表
|
||||||
synergyDataPublishRecord(dataId, type) {
|
synergyDataPublishRecord(dataId, type) {
|
||||||
|
|
||||||
let query = new Query();
|
let query = new Query();
|
||||||
query.setOrder({ create_time: 'desc' });
|
query.setOrder({ create_time: 'desc' });
|
||||||
query.addFilter('data_type', '=', 4);
|
query.addFilter('data_type', '=', 4);
|
||||||
query.setCurrPage(1);
|
query.setCurrPage(1);
|
||||||
query.setPageSize(1);
|
query.setPageSize(1);
|
||||||
|
|
||||||
|
|
||||||
if (dataId) {
|
if (dataId) {
|
||||||
query.addFilter('data_id', '=', dataId);
|
query.addFilter('data_id', '=', dataId);
|
||||||
}
|
}
|
||||||
@ -123,9 +119,7 @@ class CellsysOfflinePolygonType extends CellsysElementType {
|
|||||||
queryTask
|
queryTask
|
||||||
.execute(query)
|
.execute(query)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
||||||
resolve(res);
|
resolve(res);
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
reject(err);
|
reject(err);
|
||||||
@ -141,5 +135,4 @@ class CellsysOfflinePolygonType extends CellsysElementType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default CellsysOfflinePolygonType;
|
||||||
export default CellsysOfflinePolygonType
|
|
||||||
|
@ -126,6 +126,14 @@ class CellsysOrg {
|
|||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get mapOptions() {
|
||||||
|
if (this.options && this.options['mapOptions']) {
|
||||||
|
return this.options['mapOptions'];
|
||||||
|
} else {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新组织信息
|
* 更新组织信息
|
||||||
*/
|
*/
|
||||||
@ -233,7 +241,7 @@ class CellsysOrg {
|
|||||||
editTask.addParam('_username', params.userName);
|
editTask.addParam('_username', params.userName);
|
||||||
editTask.addParam('_realname', params.realName);
|
editTask.addParam('_realname', params.realName);
|
||||||
editTask.addParam('_email', params.email);
|
editTask.addParam('_email', params.email);
|
||||||
editTask.addParam('_gender', params.gender);
|
editTask.addParam('_gender', String(params.gender));
|
||||||
editTask.addParam('_birthday', params.birthday);
|
editTask.addParam('_birthday', params.birthday);
|
||||||
editTask.addParam('_avatar', params.avatar);
|
editTask.addParam('_avatar', params.avatar);
|
||||||
editTask.addParam('_is_username', 0);
|
editTask.addParam('_is_username', 0);
|
||||||
@ -288,9 +296,9 @@ class CellsysOrg {
|
|||||||
/**
|
/**
|
||||||
* 查询组织内的所有App
|
* 查询组织内的所有App
|
||||||
*/
|
*/
|
||||||
queryApps(pageInfo, order, filters) {
|
queryApps(pageInfo, order, filters,getUnion) {
|
||||||
let query = new Query();
|
let query = new Query();
|
||||||
query.addFilter('org_id', Operator.Equals, this.id);
|
// query.addFilter('org_id', Operator.Equals, this.id);
|
||||||
if (pageInfo) {
|
if (pageInfo) {
|
||||||
query.setCurrPage(pageInfo.currPage);
|
query.setCurrPage(pageInfo.currPage);
|
||||||
query.setPageSize(pageInfo.pageSize);
|
query.setPageSize(pageInfo.pageSize);
|
||||||
@ -305,7 +313,14 @@ class CellsysOrg {
|
|||||||
query.addFilter(item['name'], item['operator'], item['value']);
|
query.addFilter(item['name'], item['operator'], item['value']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let queryTask = new QueryTask(QueryType.App, pageInfo ? true : false);
|
let queryType=QueryType.App
|
||||||
|
if (this.unionStatus === 1 && getUnion === true) {
|
||||||
|
//联合状态为父级组织,并且需要获取联合信息
|
||||||
|
queryType = QueryType.UnionApp;
|
||||||
|
} else {
|
||||||
|
query.setOrder({ org_id: 'asc', id: 'desc' });
|
||||||
|
}
|
||||||
|
let queryTask = new QueryTask(queryType, pageInfo ? true : false);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
queryTask
|
queryTask
|
||||||
.execute(query)
|
.execute(query)
|
||||||
@ -338,9 +353,9 @@ class CellsysOrg {
|
|||||||
* @param order
|
* @param order
|
||||||
* @returns {Promise<unknown>}
|
* @returns {Promise<unknown>}
|
||||||
*/
|
*/
|
||||||
queryAppListByPublish(pageInfo, filters, order) {
|
queryAppListByPublish(pageInfo, filters, order,getUnion) {
|
||||||
let query = new Query();
|
let query = new Query();
|
||||||
query.addFilter('org_id', Operator.Equals, this.id);
|
// query.addFilter('org_id', Operator.Equals, this.id);
|
||||||
query.addFilter('is_publish', Operator.Equals, 1);
|
query.addFilter('is_publish', Operator.Equals, 1);
|
||||||
if (pageInfo) {
|
if (pageInfo) {
|
||||||
query.setCurrPage(pageInfo.currPage);
|
query.setCurrPage(pageInfo.currPage);
|
||||||
@ -356,7 +371,14 @@ class CellsysOrg {
|
|||||||
query.addFilter(item['name'], item['operator'], item['value']);
|
query.addFilter(item['name'], item['operator'], item['value']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let queryTask = new QueryTask(QueryType.App, pageInfo ? true : false);
|
let queryType=QueryType.App
|
||||||
|
if (this.unionStatus === 1 && getUnion === true) {
|
||||||
|
//联合状态为父级组织,并且需要获取联合信息
|
||||||
|
queryType = QueryType.UnionApp;
|
||||||
|
} else {
|
||||||
|
query.setOrder({ org_id: 'asc', id: 'desc' });
|
||||||
|
}
|
||||||
|
let queryTask = new QueryTask(queryType, pageInfo ? true : false);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
queryTask
|
queryTask
|
||||||
.execute(query)
|
.execute(query)
|
||||||
@ -797,7 +819,7 @@ class CellsysOrg {
|
|||||||
* @param feedback 审核意见
|
* @param feedback 审核意见
|
||||||
* @returns {function(): Promise<unknown>}
|
* @returns {function(): Promise<unknown>}
|
||||||
*/
|
*/
|
||||||
auditJoinOrgMember(params) {
|
auditJoinOrgMember(params = {}) {
|
||||||
let { userId, audit, feedback, memberTypeId, groudIds } = params;
|
let { userId, audit, feedback, memberTypeId, groudIds } = params;
|
||||||
let editTask = new EditTask(EditType.OrgMember_Update);
|
let editTask = new EditTask(EditType.OrgMember_Update);
|
||||||
let status = audit ? 2 : 3;
|
let status = audit ? 2 : 3;
|
||||||
@ -3578,7 +3600,7 @@ class CellsysOrg {
|
|||||||
/**
|
/**
|
||||||
* 查询组织下所有离线区域信息
|
* 查询组织下所有离线区域信息
|
||||||
*/
|
*/
|
||||||
queryOfflinePolygons(pageInfo, filters, order) {
|
queryOfflinePolygons(pageInfo, filters, order, httpConfig) {
|
||||||
let query = new Query();
|
let query = new Query();
|
||||||
query.addFilter('org_id', Operator.Equals, this.id);
|
query.addFilter('org_id', Operator.Equals, this.id);
|
||||||
if (pageInfo) {
|
if (pageInfo) {
|
||||||
@ -3595,7 +3617,9 @@ class CellsysOrg {
|
|||||||
} else {
|
} else {
|
||||||
query.setOrder({ id: 'desc' });
|
query.setOrder({ id: 'desc' });
|
||||||
}
|
}
|
||||||
|
if (httpConfig) {
|
||||||
|
query.setHttpConfig(httpConfig);
|
||||||
|
}
|
||||||
let queryTask = new QueryTask(QueryType.OfflinePolygon, pageInfo ? true : false);
|
let queryTask = new QueryTask(QueryType.OfflinePolygon, pageInfo ? true : false);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
queryTask
|
queryTask
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Query, QueryTask, QueryType } from './cellsysUtil.js';
|
import { Query, QueryTask, QueryType } from './cellsysUtil.js';
|
||||||
import './utils/paho-mqtt.js';
|
import './utils/paho-mqtt.js';
|
||||||
import { getToken } from '@/utils/auth';
|
import cellsysSystem from './cellsysSystem';
|
||||||
|
|
||||||
let clientManager = {
|
let clientManager = {
|
||||||
//全局clinet管理
|
//全局clinet管理
|
||||||
@ -37,7 +37,7 @@ const TopicType = {
|
|||||||
|
|
||||||
const createMqttClient = (cellsysPush, cellsysTopic) => {
|
const createMqttClient = (cellsysPush, cellsysTopic) => {
|
||||||
// let clientId = 'cellsys' + (new Date().getTime()) + Math.floor(Math.random() * 100)
|
// let clientId = 'cellsys' + (new Date().getTime()) + Math.floor(Math.random() * 100)
|
||||||
let clientId = getToken() + '.timestamp.' + new Date().getTime();
|
let clientId = cellsysSystem.token + cellsysTopic.topicType + new Date().getTime();
|
||||||
let { ip, port, aliasPath, isSSL, username, password } = cellsysPush;
|
let { ip, port, aliasPath, isSSL, username, password } = cellsysPush;
|
||||||
|
|
||||||
let client;
|
let client;
|
||||||
@ -60,17 +60,19 @@ const createMqttClient = (cellsysPush, cellsysTopic) => {
|
|||||||
};
|
};
|
||||||
client.connect(options);
|
client.connect(options);
|
||||||
client.onConnected = (reconnect) => {
|
client.onConnected = (reconnect) => {
|
||||||
|
console.log(clientId, '连接建立的clientId');
|
||||||
if (reconnect) {
|
if (reconnect) {
|
||||||
isLost = false;
|
isLost = false;
|
||||||
clearTimeout(lostTimeCount);
|
clearTimeout(lostTimeCount);
|
||||||
lostTimeCount = null;
|
lostTimeCount = null;
|
||||||
console.log(cellsysTopic, 'mq重连topic');
|
/* console.log(cellsysTopic, 'mq重连topic');*/
|
||||||
}
|
}
|
||||||
resolve(client);
|
resolve(client);
|
||||||
};
|
};
|
||||||
client.onConnectionLost = (responseObject) => {
|
client.onConnectionLost = (responseObject) => {
|
||||||
console.log(responseObject, '中断对象');
|
console.log(responseObject, '中断对象');
|
||||||
console.log(cellsysTopic, '中断的topic');
|
console.log(cellsysTopic, '中断的topic');
|
||||||
|
console.log(clientId, '中断的clientId');
|
||||||
//连接中断时开始倒计时,2分钟后没有重连成功则执行错误回调;
|
//连接中断时开始倒计时,2分钟后没有重连成功则执行错误回调;
|
||||||
isLost = true;
|
isLost = true;
|
||||||
lostTimeCount = setTimeout(() => {
|
lostTimeCount = setTimeout(() => {
|
||||||
@ -228,7 +230,7 @@ class pushTask {
|
|||||||
isSSL: isSSL,
|
isSSL: isSSL,
|
||||||
};
|
};
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
params['ip'] = 'localhost';
|
params['ip'] = '192.168.2.10';
|
||||||
}
|
}
|
||||||
|
|
||||||
let cloudOptions = this.cellsysOrg ? this.cellsysOrg.cloudOptions : {};
|
let cloudOptions = this.cellsysOrg ? this.cellsysOrg.cloudOptions : {};
|
||||||
|
@ -13,6 +13,10 @@ import CellsysMemberType from './cellsysMemberType';
|
|||||||
class CellsysSystem {
|
class CellsysSystem {
|
||||||
constructor(params) {}
|
constructor(params) {}
|
||||||
|
|
||||||
|
static token = null; //当前token
|
||||||
|
static adminToken = null; //管理员token
|
||||||
|
static hostname = null;
|
||||||
|
|
||||||
//在边缘工作站上查询设备列表
|
//在边缘工作站上查询设备列表
|
||||||
static querEdgeOrgList() {
|
static querEdgeOrgList() {
|
||||||
let query = new Query();
|
let query = new Query();
|
||||||
@ -23,6 +27,7 @@ class CellsysSystem {
|
|||||||
queryTask
|
queryTask
|
||||||
.execute(query)
|
.execute(query)
|
||||||
.then((orgList) => {
|
.then((orgList) => {
|
||||||
|
debugger;
|
||||||
resolve(orgList);
|
resolve(orgList);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as http from '@/api/axios.js';
|
import * as http from './utils/axios.js';
|
||||||
|
|
||||||
const BASE_URL = location.origin;
|
const BASE_URL = location.origin;
|
||||||
const IMAGE_URL = '/resources/basePic/cellsysApp';
|
const IMAGE_URL = '/resources/basePic/cellsysApp';
|
||||||
@ -54,6 +54,8 @@ const QueryType = {
|
|||||||
UnionMemberTypeUser: '/rpc/view_org_union_member_type_user',
|
UnionMemberTypeUser: '/rpc/view_org_union_member_type_user',
|
||||||
// 门户中App的列表
|
// 门户中App的列表
|
||||||
App: '/rpc/view_org_app_basic', //查询应用基础列表2(含原始应用id)view_app_basic不含
|
App: '/rpc/view_org_app_basic', //查询应用基础列表2(含原始应用id)view_app_basic不含
|
||||||
|
//查询组织联合的u应用列表
|
||||||
|
UnionApp: '/rpc/view_org_union_app',
|
||||||
// 应用模板
|
// 应用模板
|
||||||
AppModel: '/rpc/view_app_model',
|
AppModel: '/rpc/view_app_model',
|
||||||
AppModelType: '/rpc/view_app_model_type',
|
AppModelType: '/rpc/view_app_model_type',
|
||||||
@ -143,6 +145,7 @@ const QueryType = {
|
|||||||
StatsEventCount: '/rpc/view_stats_event_type_count',
|
StatsEventCount: '/rpc/view_stats_event_type_count',
|
||||||
Icon: '/rpc/view_icon',
|
Icon: '/rpc/view_icon',
|
||||||
IconType: '/rpc/view_icon_type',
|
IconType: '/rpc/view_icon_type',
|
||||||
|
|
||||||
QRCodeList: '/rpc/view_qr_code', //查询二维码列表
|
QRCodeList: '/rpc/view_qr_code', //查询二维码列表
|
||||||
BannerType: '/rpc/view_banner_type',
|
BannerType: '/rpc/view_banner_type',
|
||||||
BannerList: '/rpc/view_banner',
|
BannerList: '/rpc/view_banner',
|
||||||
@ -377,6 +380,16 @@ const EditType = {
|
|||||||
EdgeNameUpdate: '/rpc/UpdateEdgeName',
|
EdgeNameUpdate: '/rpc/UpdateEdgeName',
|
||||||
//更改用户聊天记录已读状态
|
//更改用户聊天记录已读状态
|
||||||
ChatPrivateRead: '/rpc/cellsysChatPrivateRead',
|
ChatPrivateRead: '/rpc/cellsysChatPrivateRead',
|
||||||
|
//图标
|
||||||
|
importIcons: '/rpc/cellsysIconsInsert',
|
||||||
|
saveIcon: '/rpc/cellsysIconInsert',
|
||||||
|
updateIcon: '/rpc/cellsysIconUpdate',
|
||||||
|
deleteIcon: '/rpc/cellsysIconDelete',
|
||||||
|
sortIcon: '/rpc/cellsysIconSortUpdate',
|
||||||
|
saveIconType: '/rpc/cellsysIconTypeInsert',
|
||||||
|
updateIconType: '/rpc/cellsysIconTypeUpdate',
|
||||||
|
deleteIconType: '/rpc/cellsysIconTypeDelete',
|
||||||
|
sortIconType: '/rpc/cellsysIconTypeSortUpdate',
|
||||||
};
|
};
|
||||||
|
|
||||||
// 提交类接口
|
// 提交类接口
|
||||||
@ -429,6 +442,8 @@ const AdminQueryType = [
|
|||||||
'/v2' + EditType.Group_Update,
|
'/v2' + EditType.Group_Update,
|
||||||
'/v2' + EditType.Group_Delete,
|
'/v2' + EditType.Group_Delete,
|
||||||
'/v2' + EditType.Member_Create,
|
'/v2' + EditType.Member_Create,
|
||||||
|
'/v2' + EditType.EquipmentUser_Create,
|
||||||
|
'/v2' + EditType.EquipmentUser_Delete,
|
||||||
SubmitType.edgeEquipmentConnect,
|
SubmitType.edgeEquipmentConnect,
|
||||||
QueryType.WifiHotspot,
|
QueryType.WifiHotspot,
|
||||||
SubmitType.switchHotspotStatus,
|
SubmitType.switchHotspotStatus,
|
||||||
@ -518,6 +533,7 @@ const ThirdpartyObjectType = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class Query {
|
class Query {
|
||||||
|
static bodyParams = true; //设置请求体里需不需要传body
|
||||||
constructor(params) {
|
constructor(params) {
|
||||||
if (!params) {
|
if (!params) {
|
||||||
params = {};
|
params = {};
|
||||||
@ -575,10 +591,14 @@ class Query {
|
|||||||
getQuery() {
|
getQuery() {
|
||||||
let param = this._getParam();
|
let param = this._getParam();
|
||||||
let content = null;
|
let content = null;
|
||||||
|
let cellsysContent = param;
|
||||||
|
if (Query.bodyParams) {
|
||||||
|
cellsysContent = { body: param };
|
||||||
|
}
|
||||||
switch (this._type.toLocaleLowerCase()) {
|
switch (this._type.toLocaleLowerCase()) {
|
||||||
default:
|
default:
|
||||||
case 'cellsys':
|
case 'cellsys':
|
||||||
content = { body: param };
|
content = cellsysContent;
|
||||||
break;
|
break;
|
||||||
case 'mongodb':
|
case 'mongodb':
|
||||||
content = param;
|
content = param;
|
||||||
@ -614,6 +634,7 @@ class Query {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class QueryTask {
|
class QueryTask {
|
||||||
|
static hostName = '';
|
||||||
constructor(url, getPageInfo) {
|
constructor(url, getPageInfo) {
|
||||||
//过滤java接口
|
//过滤java接口
|
||||||
if (url.indexOf('cellsys/api') !== -1) {
|
if (url.indexOf('cellsys/api') !== -1) {
|
||||||
@ -625,6 +646,7 @@ class QueryTask {
|
|||||||
//接口版本改为V2版本
|
//接口版本改为V2版本
|
||||||
this.url = '/v2' + url;
|
this.url = '/v2' + url;
|
||||||
}
|
}
|
||||||
|
this.url = QueryTask.hostName + this.url;
|
||||||
this.getPageInfo = getPageInfo; //是否返回分页信息
|
this.getPageInfo = getPageInfo; //是否返回分页信息
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -635,6 +657,8 @@ class QueryTask {
|
|||||||
} else {
|
} else {
|
||||||
query = new Query();
|
query = new Query();
|
||||||
}
|
}
|
||||||
|
// this.getPageInfo = query.pageSize !== 0;
|
||||||
|
|
||||||
let type = query.getType();
|
let type = query.getType();
|
||||||
let httpConfig = query.httpConfig;
|
let httpConfig = query.httpConfig;
|
||||||
switch (type.toLocaleLowerCase()) {
|
switch (type.toLocaleLowerCase()) {
|
||||||
|
169
package-lock.json
generated
169
package-lock.json
generated
@ -1,15 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "@airkoon/cellsys",
|
"name": "@airkoon/cellsys",
|
||||||
"version": "1.15.1",
|
"version": "1.15.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@airkoon/cellsys",
|
"name": "@airkoon/cellsys",
|
||||||
"version": "1.15.1",
|
"version": "1.15.3",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"canvg": "~3.0.7"
|
"axios": "~1.4.0",
|
||||||
|
"canvg": "~3.0.7",
|
||||||
|
"dayjs": "~1.10.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/runtime": {
|
"node_modules/@babel/runtime": {
|
||||||
@ -33,6 +35,21 @@
|
|||||||
"resolved": "https://registry.npmmirror.com/@types/raf/-/raf-3.4.3.tgz",
|
"resolved": "https://registry.npmmirror.com/@types/raf/-/raf-3.4.3.tgz",
|
||||||
"integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw=="
|
"integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw=="
|
||||||
},
|
},
|
||||||
|
"node_modules/asynckit": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||||
|
},
|
||||||
|
"node_modules/axios": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==",
|
||||||
|
"dependencies": {
|
||||||
|
"follow-redirects": "^1.15.0",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
|
"proxy-from-env": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/canvg": {
|
"node_modules/canvg": {
|
||||||
"version": "3.0.10",
|
"version": "3.0.10",
|
||||||
"resolved": "https://registry.npmmirror.com/canvg/-/canvg-3.0.10.tgz",
|
"resolved": "https://registry.npmmirror.com/canvg/-/canvg-3.0.10.tgz",
|
||||||
@ -51,6 +68,17 @@
|
|||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/combined-stream": {
|
||||||
|
"version": "1.0.8",
|
||||||
|
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
|
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||||
|
"dependencies": {
|
||||||
|
"delayed-stream": "~1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/core-js": {
|
"node_modules/core-js": {
|
||||||
"version": "3.38.0",
|
"version": "3.38.0",
|
||||||
"resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.38.0.tgz",
|
"resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.38.0.tgz",
|
||||||
@ -61,11 +89,80 @@
|
|||||||
"url": "https://opencollective.com/core-js"
|
"url": "https://opencollective.com/core-js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dayjs": {
|
||||||
|
"version": "1.10.8",
|
||||||
|
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.10.8.tgz",
|
||||||
|
"integrity": "sha512-wbNwDfBHHur9UOzNUjeKUOJ0fCb0a52Wx0xInmQ7Y8FstyajiV1NmK1e00cxsr9YrE9r7yAChE0VvpuY5Rnlow=="
|
||||||
|
},
|
||||||
|
"node_modules/delayed-stream": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/follow-redirects": {
|
||||||
|
"version": "1.15.9",
|
||||||
|
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||||
|
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"debug": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/form-data": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
|
||||||
|
"dependencies": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-db": {
|
||||||
|
"version": "1.52.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
|
||||||
|
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-types": {
|
||||||
|
"version": "2.1.35",
|
||||||
|
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
|
||||||
|
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||||
|
"dependencies": {
|
||||||
|
"mime-db": "1.52.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/performance-now": {
|
"node_modules/performance-now": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmmirror.com/performance-now/-/performance-now-2.1.0.tgz",
|
"resolved": "https://registry.npmmirror.com/performance-now/-/performance-now-2.1.0.tgz",
|
||||||
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow=="
|
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow=="
|
||||||
},
|
},
|
||||||
|
"node_modules/proxy-from-env": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||||
|
},
|
||||||
"node_modules/raf": {
|
"node_modules/raf": {
|
||||||
"version": "3.4.1",
|
"version": "3.4.1",
|
||||||
"resolved": "https://registry.npmmirror.com/raf/-/raf-3.4.1.tgz",
|
"resolved": "https://registry.npmmirror.com/raf/-/raf-3.4.1.tgz",
|
||||||
@ -125,6 +222,21 @@
|
|||||||
"resolved": "https://registry.npmmirror.com/@types/raf/-/raf-3.4.3.tgz",
|
"resolved": "https://registry.npmmirror.com/@types/raf/-/raf-3.4.3.tgz",
|
||||||
"integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw=="
|
"integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw=="
|
||||||
},
|
},
|
||||||
|
"asynckit": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||||
|
},
|
||||||
|
"axios": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==",
|
||||||
|
"requires": {
|
||||||
|
"follow-redirects": "^1.15.0",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
|
"proxy-from-env": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"canvg": {
|
"canvg": {
|
||||||
"version": "3.0.10",
|
"version": "3.0.10",
|
||||||
"resolved": "https://registry.npmmirror.com/canvg/-/canvg-3.0.10.tgz",
|
"resolved": "https://registry.npmmirror.com/canvg/-/canvg-3.0.10.tgz",
|
||||||
@ -140,16 +252,67 @@
|
|||||||
"svg-pathdata": "^6.0.3"
|
"svg-pathdata": "^6.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"combined-stream": {
|
||||||
|
"version": "1.0.8",
|
||||||
|
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
|
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||||
|
"requires": {
|
||||||
|
"delayed-stream": "~1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"core-js": {
|
"core-js": {
|
||||||
"version": "3.38.0",
|
"version": "3.38.0",
|
||||||
"resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.38.0.tgz",
|
"resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.38.0.tgz",
|
||||||
"integrity": "sha512-XPpwqEodRljce9KswjZShh95qJ1URisBeKCjUdq27YdenkslVe7OO0ZJhlYXAChW7OhXaRLl8AAba7IBfoIHug=="
|
"integrity": "sha512-XPpwqEodRljce9KswjZShh95qJ1URisBeKCjUdq27YdenkslVe7OO0ZJhlYXAChW7OhXaRLl8AAba7IBfoIHug=="
|
||||||
},
|
},
|
||||||
|
"dayjs": {
|
||||||
|
"version": "1.10.8",
|
||||||
|
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.10.8.tgz",
|
||||||
|
"integrity": "sha512-wbNwDfBHHur9UOzNUjeKUOJ0fCb0a52Wx0xInmQ7Y8FstyajiV1NmK1e00cxsr9YrE9r7yAChE0VvpuY5Rnlow=="
|
||||||
|
},
|
||||||
|
"delayed-stream": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
|
||||||
|
},
|
||||||
|
"follow-redirects": {
|
||||||
|
"version": "1.15.9",
|
||||||
|
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||||
|
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ=="
|
||||||
|
},
|
||||||
|
"form-data": {
|
||||||
|
"version": "4.0.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.1.tgz",
|
||||||
|
"integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
|
||||||
|
"requires": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mime-db": {
|
||||||
|
"version": "1.52.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
|
||||||
|
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
|
||||||
|
},
|
||||||
|
"mime-types": {
|
||||||
|
"version": "2.1.35",
|
||||||
|
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
|
||||||
|
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||||
|
"requires": {
|
||||||
|
"mime-db": "1.52.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"performance-now": {
|
"performance-now": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmmirror.com/performance-now/-/performance-now-2.1.0.tgz",
|
"resolved": "https://registry.npmmirror.com/performance-now/-/performance-now-2.1.0.tgz",
|
||||||
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow=="
|
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow=="
|
||||||
},
|
},
|
||||||
|
"proxy-from-env": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||||
|
},
|
||||||
"raf": {
|
"raf": {
|
||||||
"version": "3.4.1",
|
"version": "3.4.1",
|
||||||
"resolved": "https://registry.npmmirror.com/raf/-/raf-3.4.1.tgz",
|
"resolved": "https://registry.npmmirror.com/raf/-/raf-3.4.1.tgz",
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "@airkoon/cellsys",
|
"name": "@airkoon/cellsys",
|
||||||
"version": "1.15.1",
|
"version": "1.16.4",
|
||||||
"description": "边缘服务器相关",
|
"description": "边缘服务器和cloud的公共库",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"author": "gui",
|
"author": "gui",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"canvg": "~3.0.7"
|
"canvg": "~3.0.7",
|
||||||
|
"axios": "~1.4.0",
|
||||||
|
"dayjs": "~1.10.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
67
utils/axios.js
Normal file
67
utils/axios.js
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
import { AdminQueryType } from '../cellsysUtil';
|
||||||
|
import cellsysSystem from '../cellsysSystem';
|
||||||
|
|
||||||
|
const service = axios.create({
|
||||||
|
baseURL: '/api', //api 的 base_url,根据开发生产环境配置文件配置
|
||||||
|
withCredentials: true, // 跨域请求时发送 cookies
|
||||||
|
timeout: 0,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=UTF-8',
|
||||||
|
},
|
||||||
|
responseType: 'json',
|
||||||
|
});
|
||||||
|
|
||||||
|
service.interceptors.request.use(
|
||||||
|
(config) => {
|
||||||
|
let url = config.url;
|
||||||
|
let token = cellsysSystem.token;
|
||||||
|
if (AdminQueryType.indexOf(url) !== -1) {
|
||||||
|
//这里应该再加一层用户身份判断才是正确的写法
|
||||||
|
token = cellsysSystem.adminToken;
|
||||||
|
}
|
||||||
|
if (token && !config.headers['Authorization']) {
|
||||||
|
config.headers['Authorization'] = 'Bearer ' + token;
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
console.error(error);
|
||||||
|
return Promise.reject(error);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
//这里需要注意的是,由于历史原因,axios的response的成功回调格式是在本文件中封装,而失败回调的格式是在引用CellsysBase的项目中按需进行封装。
|
||||||
|
service.interceptors.response.use(
|
||||||
|
(response) => {
|
||||||
|
let data;
|
||||||
|
if (response.data === undefined || response.data == null) {
|
||||||
|
switch (response.status) {
|
||||||
|
case 201:
|
||||||
|
data = { code: 201 };
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
data = { code: 200 };
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
data = response.data;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
return Promise.reject(err);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const post = (url, data, config) => {
|
||||||
|
return service.post(url, data, config);
|
||||||
|
};
|
||||||
|
|
||||||
|
const get = (url, data) => {
|
||||||
|
return service.get(url, {
|
||||||
|
params: data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
export { post, get, service };
|
18984
utils/mqtt@4.3.7.js
Normal file
18984
utils/mqtt@4.3.7.js
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user