63 lines
1.6 KiB
JavaScript
63 lines
1.6 KiB
JavaScript
import {CellsysType, EditTask, EditType, Query, QueryTask, QueryType} from './cellsysUtil.js';
|
|
|
|
class CellsysIconType {
|
|
constructor(params) {
|
|
this.cellsysType = CellsysType.CellsysIcon;
|
|
if (!params) { params = {} };
|
|
this.id = params.id;
|
|
this.name = params.name;
|
|
}
|
|
|
|
queryIconTypeList() {
|
|
let query = new Query();
|
|
let queryTask = new QueryTask(QueryType.IconType);
|
|
return queryTask.execute(query);
|
|
}
|
|
|
|
}
|
|
|
|
/**
|
|
* 新增图标类型
|
|
* @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
|