weaver_trunk_cli/pc4mobx/prj/components/portal/edit/configUtil.js

104 lines
3.8 KiB
JavaScript

/*
* @Author: lusx
* @Date: 2020-03-12 16:47:08
* @Last Modified by: lusx
* @Last Modified time: 2020-04-21 10:45:05
*/
import { WeaLocaleProvider } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
const toolbarfun = (visibleDialog) => (
[
// { name: 'document', items: ['Source'], type: 'simple' },
{ name: 'document', items: ['Source'] ,type: 'fuza'},
{ name: 'paragraph', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', '-', 'NumberedList', 'BulletedList'] ,type: 'fuza'},
{ name: 'styles', items: ['Format', 'Font', 'FontSize'], type: 'fuza'},
{ name: 'styles', items: ['FontSize'], type: 'simple' },
{ name: 'colors', items: ['TextColor'] ,type: 'fuza'},
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike',], type: 'simple'},
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike',], type: 'fuza'},
{ name: 'basicstyles', items: ['Bold', 'Italic'] ,type: 'fuza'}
].filter(i => {
if (visibleDialog === true) {
return i.type === 'fuza'
} else {
return i.type === 'simple'
}
})
)
const mirror = {
Document: { type: 37, name: getLabel(126529, "文档"), icon: 'icon-blog-Document' },
Flow: { type: 152, name: getLabel(131692, "流程"), icon: 'icon-blog-Process' },
Customer: { type: 18, name: getLabel(30043, "客户"), icon: 'icon-blog-Personnel' },
Project: { type: 135, name: getLabel(30046, "项目"), icon: 'icon-blog-Project' },
Task: { type: 'prjtsk', name: getLabel(383349, "任务"), icon: 'icon-blog-Task' },
}
const objDocument = {
name: 'Browser',
show: <div className="wea-cb-item">
<span className={`wea-cbi-icon ${mirror['Document'].icon}`} />
<span className="wea-cbi-text">{mirror['Document'].name}</span>
</div>,
type: mirror['Document'].type,
title: mirror['Document'].name,
};
const objFlow = {
name: 'Browser',
show: <div className="wea-cb-item">
<span className={`wea-cbi-icon ${mirror['Flow'].icon}`} />
<span className="wea-cbi-text">{mirror['Flow'].name}</span>
</div>,
type: mirror['Flow'].type,
title: mirror['Flow'].name,
};
const objCustomer = {
name: 'Browser',
show: <div className="wea-cb-item">
<span className={`wea-cbi-icon ${mirror['Customer'].icon}`} />
<span className="wea-cbi-text">{mirror['Customer'].name}</span>
</div>,
type: mirror['Customer'].type,
title: mirror['Customer'].name,
};
const objProject = {
name: 'Browser',
show: <div className="wea-cb-item">
<span className={`wea-cbi-icon ${mirror['Project'].icon}`} />
<span className="wea-cbi-text">{mirror['Project'].name}</span>
</div>,
type: mirror['Project'].type,
title: mirror['Project'].name,
};
const objTask = {
name: 'Browser',
show: <div className="wea-cb-item">
<span className={`wea-cbi-icon ${mirror['Task'].icon}`} />
<span className="wea-cbi-text">{mirror['Task'].name}</span>
</div>,
type: mirror['Task'].type,
title: mirror['Task'].name,
};
const upload = (params) => {
const { exchangeList } = params;
return {
name: 'Upload',
show: <div className="wea-cb-item">
<span className='wea-cbi-icon icon-blog-Enclosure' />
<span className="wea-cbi-text">{getLabel(128158, "附件")}</span>
</div>,
uploadId: 'project_edit',
uploadUrl: `${exchangeList.relateddoc.uploadUrl}?category=${exchangeList.relateddoc.category}`,
category: exchangeList.relateddoc.category,
maxUploadSize: exchangeList.relateddoc.maxSize,
style: { display: "inline-block", padding: 0 }
}
}
export {
objDocument,
objFlow,
objCustomer,
objProject,
objTask,
upload,
toolbarfun
}