diff --git a/cellsysIcon.js b/cellsysIcon.js index e7372e8..48289a9 100644 --- a/cellsysIcon.js +++ b/cellsysIcon.js @@ -1,5 +1,5 @@ import Canvg from 'canvg' -import { CellsysType } from './cellsysUtil.js' +import {CellsysType, EditTask, EditType} from './cellsysUtil.js' 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' } +/** + * 创建图标 + * @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 { diff --git a/cellsysIconType.js b/cellsysIconType.js index b7350f4..989faef 100644 --- a/cellsysIconType.js +++ b/cellsysIconType.js @@ -1,4 +1,4 @@ -import { CellsysType } from './cellsysUtil.js'; +import {CellsysType, EditTask, EditType, Query, QueryTask, QueryType} from './cellsysUtil.js'; class CellsysIconType { 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 diff --git a/cellsysOrg.js b/cellsysOrg.js index 18194e3..7584593 100644 --- a/cellsysOrg.js +++ b/cellsysOrg.js @@ -805,7 +805,7 @@ class CellsysOrg { * @param feedback 审核意见 * @returns {function(): Promise} */ - auditJoinOrgMember(params) { + auditJoinOrgMember(params = {}) { let { userId, audit, feedback, memberTypeId, groudIds } = params; let editTask = new EditTask(EditType.OrgMember_Update); let status = audit ? 2 : 3; diff --git a/cellsysUtil.js b/cellsysUtil.js index 06dae6a..3589942 100644 --- a/cellsysUtil.js +++ b/cellsysUtil.js @@ -143,6 +143,7 @@ const QueryType = { StatsEventCount: '/rpc/view_stats_event_type_count', Icon: '/rpc/view_icon', IconType: '/rpc/view_icon_type', + QRCodeList: '/rpc/view_qr_code', //查询二维码列表 BannerType: '/rpc/view_banner_type', BannerList: '/rpc/view_banner', @@ -377,6 +378,16 @@ const EditType = { EdgeNameUpdate: '/rpc/UpdateEdgeName', //更改用户聊天记录已读状态 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', }; // 提交类接口 diff --git a/package.json b/package.json index 738e88d..61f475a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@airkoon/cellsys", - "version": "1.16.1", + "version": "1.16.3", "description": "边缘服务器和cloud的公共库", "scripts": { "test": "echo \"Error: no test specified\" && exit 1"