-
- bower.json 中添加 "customize-page" : "",并执行 bower update
-
- config.js 中paths添加:
"customizePage": "vendor/components/customize-page/index"
shim中添加:
'customizePage': {
deps: ['jqueryui','$.tree','jscolor']
}
-
- 文件内部使用
this.showLayoutView = new ShowLayoutView(resp);
// 监听保存后的数据
this.listenTo(this.showLayoutView,"saveConfigData",function(data){
console.log(data);
},this);
// 监听是否处于预览状态 data是true则是预览状态
this.listenTo(this.showLayoutView,"preview",function(data){
console.log(data);
},this);
this.showRegion.show(this.showLayoutView);
var resp = {
type : "tita" //类型为tita
,commonData : { //侧边栏和右侧显示所公用的数据
color : [{
id : "1"
,name : "导航栏文字颜色"
,selector : "ul._tt_sidenav span" //颜色控制的右侧导航栏选择器
,textcolor : "#ccc" //默认的导航栏文字颜色
,highlightTrigger : "nav_color" //左侧hover此模块时trigger的名称
,className : "home_ttsn" //默认值
}],
tenantInfo : { //租户信息
tenantLogo : "http://cache.tita.com/Image/110006/f3cfa837b96d40988862a5a207193986.png"//租户logo
,tenantName : "北森" //租户名称
},
nav : [ //左侧侧边栏
{
id : "0"
,name : "动态"
,className : "home_ttsn"
,href : "#active"
,backgroudImage : ""
}
,{
id : "1"
,name : "工作台"
,className : "bench_ttsn"
,href : "#plat"
,backgroudImage : ""
}
],
secondaryNav : [ //隐藏菜单
{
id : "500"
,name : "职业发展"
,className : "app_500"
,href : "#plat"
,backgroudImage : ""
}
,{
id : "400"
,name : "绩效管理"
,className : "app_400"
,href : "#plat"
,backgroudImage : ""
}
,{
id : "100"
,name : "iTalent"
,className : "app_100"
,href : "#plat"
,backgroudImage : ""
}
]
}
//右侧显示的view,用户自定义
,contentViews : [
{
name:"titaHeader" //new之后的对象名称
,path: 'views/home/common/tita-header-item-view' //用户项目中的文件路径,自行开发
,options:{ //new时可以传入参数
}
}
,{
name:"titaLeft"
,path: 'views/home/common/leftnav-list-view'
,options:{
dataType : "nav"
}
}
,{
name:"titaHideList"
,path: 'views/home/common/hidenav-list-view'
,options:{
dataType : "secondaryNav"
}
}
]
//左侧的配置,
,sidebarViews : {
nav : { //需要添加配置的模块名称
popTreeUData : [ //pop弹窗的数据 (可以传数据popTreeData 或者 链接popTreeUrl)
{
"Functions": null,
"Type": 1,
"Category": 1,
"ID": "034722fd-78d2-47e3-ae13-4c6717bdcc00",
"Url": "/Recruiting/Job/List",
"Text": "职位",
"Order": 2
},
{
"Functions": null,
"Type": 1,
"Category": 1,
"ID": "fe438cf9-a5ff-4572-8cc9-ae15ed5af80d",
"Url": "/Recruiting/RecuritProject/List",
"Text": "项目",
"Order": 3
}] //添加一个popTreeUrl 弹出树的url
,inputEdit : false //默认是true可编辑状态
}
,secondaryNav : {
popTreeUrl : "/tms/custom/getfunctions"
,inputEdit : false
}
,tenantInfo : {
inputMaxLength : 5 //默认可编辑状态的最大长度是10
,uploadUrl : "/upload22" //上传接口
,callbackName : "jsCallback" //供给后端callback名称 默认名称为callback
,uploadInfoMap : {// key为input的name
// <input type="hidden" name="jsCallback" value="parent._callback__910">
"jsCallback" : "parent._callback__910"
,"domain" : "document.domain='tita-inc.com'"
}
}
}
,relationMap: {
//key 为左侧hover此模块时trigger的名称
//value 则对应右侧需要调hightLight的view名称
"nav_color" : "titaLeft"
,"nav" : "titaLeft"
,"tenantInfo" : "titaHeader"
,"secondaryNav" : "titaHideList"
,"userSetting" : "titaHeader"
}
};
funMenu: [
{
"children": null, //是否有二级菜单
"type": 1, //后端标示
"category": 1, //后端标示
"id": "034722fd-78d2-47e3-ae13-4c6717bdcc00",
"url": "/Recruiting/Job/List",
"name": "职位",
"order": 2 //排序
},
{
"children": null,
"type": 1,
"category": 1,
"id": "fe438cf9-a5ff-4572-8cc9-ae15ed5af80d",
"url": "/Recruiting/RecuritProject/List",
"name": "项目",
"order": 3
},
{
"children": [
{
"id": "ddec72df-4eaa-414c-8af7-34e321efcd94",
"type": 1,
"order": 0,
"name": "企业人才",
"url": "#pools",
"category": 2
},
{
"id": "d614c38e-05fb-4b6a-ba80-060d23b7f2c8",
"type": 1,
"order": 0,
"name": "录用阶段应聘者",
"url": "#applicants",
"category": 2
}
],
"type": 1,
"category": 1,
"id": "75b64c85-d13a-4dbf-802a-10faba23b47c",
"url": "/Recruiting/ApplicantManage/AllApplicantList",
"name": "应聘者",
"order": 4
}
]
- images添加 vendor/components/customize-page/src/images/customizePage文件夹
- css添加 vendor/components/customize-page/src/css/customizePage.css 和 zTreeStyle.css