UNPKG

qm-bus

Version:

千米公有云业务组件库

149 lines (129 loc) 3.01 kB
import { QL } from 'iflux2' export const limitQL = QL('limitQL', [ //查询展开的类目key 'limit', limit => limit, ]) export const scopeQL = QL('scopeQL', [ //查询展开的类目key 'scope', scope => scope, ]) export const uploadQL = QL('uploadQL', [ //查询展开的类目key 'upload', upload => upload, ]) export const expandedQL = QL('expandedQL', [ //查询展开的类目key 'expanded', expanded => expanded, ]) export const searchQL = QL('searchQL', [ //查询搜索框的值 'searchKey', searchKey => searchKey, ]) export const expandParentQL = QL('expandParentQL', [ //查询是否自动展开父节点 'expandParent', expandParent => expandParent, ]) export const selectedQL = QL('selectedQL', [ //查询选中的类目 'formSource', formSource => formSource.get('cateId') && formSource.get('cateId').get('value') != undefined ? [formSource.get('cateId').get('value')] : [], ]) /** * 查询todo的数量 */ export const cateQL = QL('cateQL', [ //查询类目列表 'categories', categories => categories, ]) /** * 查询todo的数量 */ export const cellSelectQL = QL('cellSelectQL', [ //查询选中图片 'cellSelected', cellSelected => { return cellSelected }, ]) /** * 查询todo的数量 */ export const allCheckedQL = QL('allCheckedQL', [ //查询是否全选 'cellSelected', 'dataSource', (cellSelected, dataSource) => { let images = dataSource.filter(i => i.get('isCate') != 1).map(i => i.get('id')) if (cellSelected.count() >= images.count()) { if (cellSelected.keySeq().isSuperset(images)) { return true } } return false }, ]) export const notCheckedQL = QL('notCheckedQL', [ //查询是否无选中元素 'cellSelected', 'dataSource', (cellSelected, dataSource) => { let images = dataSource.filter(i => i.get('isCate') != 1).map(i => i.get('id')) if ( images.filter(i => { return cellSelected.has(i) }).size > 0 ) { return false } return true }, ]) /** * 查询todo的数量 */ export const currentDataQL = QL('currentDataQL', [ //查询当前数据 'dataSource', dataSource => dataSource, ]) /** * 查询todo的数量 */ export const netImagesQL = QL('netImagesQL', [ //查询当前数据 'netImages', netImages => netImages, ]) export const imagesQL = QL('imagesQL', [ //查询当前数据 'images', images => images, ]) export const videosQL = QL('videosQL', [ //查询当前数据 'videos', videos => videos, ]) export const selectValueQL = QL('selectValueQL', [ 'formSource', formSource => formSource.get('fileType') && formSource.get('fileType').get('value') != undefined ? formSource.get('fileType').get('value') : 'all', ]) export const linkAddressQL = QL('linkAddressQL', [ //查询当前数据 'linkAddress', linkAddress => linkAddress, ]) export const fileTypeQL = QL('fileTypeQL', ['fileType', fileType => fileType])