165 lines
5.5 KiB
Smarty
165 lines
5.5 KiB
Smarty
/**
|
|
* Organization shapes
|
|
*/
|
|
|
|
Schema.addCategory({
|
|
name: "org_normal",
|
|
text: "ORG 组织结构图",
|
|
dataAttributes: [
|
|
{name: "No.", type:"number", value:"", category: "default"},
|
|
{name: "Name", type:"string", value:"", category: "default"},
|
|
{name: "Owner", type:"string", value:"", category: "default"},
|
|
{name: "Link", type:"link", value:"", category: "default"},
|
|
{name: "Memo", type:"string", value:"", category: "default"},
|
|
{name: "Cost", type:"number", value:"", category: "default"},
|
|
{name: "Time", type:"number", value:"", category: "default"},
|
|
{name: "Manner", type:"list", value:"", category: "default"},
|
|
{name: "Department", type:"string", value:"", category: "default"},
|
|
{name: "Input", type:"string", value:"", category: "default"},
|
|
{name: "Output", type:"string", value:"", category: "default"},
|
|
{name: "Risk", type:"string", value:"", category: "default"},
|
|
{name: "Remarks", type:"string", value:"", category: "default"}
|
|
]
|
|
});
|
|
|
|
/**
|
|
* Organization
|
|
*/
|
|
/**Schema.addShape({
|
|
name:"organization",
|
|
title:"组织",
|
|
text:"组织",
|
|
category:"org_normal",
|
|
props:{w: 120,h: 70},
|
|
lineStyle:{lineWidth: 2, lineColor: "220,87,18"},
|
|
fillStyle:{
|
|
type: "gradient",
|
|
gradientType: "linear",
|
|
beginColor: "245,236,186",
|
|
endColor: "244,208,0",
|
|
angle: Math.PI*0.5
|
|
},
|
|
textBlock:{x: "w*0.15", y: "h*0.19", w: "w*0.8", h: "h*0.62"},textBlockFinal:{x:"w/2-60", y:"h", w:"120", h:"30"},
|
|
path:[
|
|
{
|
|
actions: [
|
|
{action: "move", x: "0", y: "h*0.5"},
|
|
{action: "curve", x1: "0", y1: "-h/6", x2: "w", y2: "-h/6", x: "w", y: "h*0.5"},
|
|
{action: "curve", x1: "w", y1: "h+h/6", x2: "0", y2: "h+h/6", x: "0", y: "h*0.5"},
|
|
{action: "move", x: "w*0.15", y: "h*0.13"},
|
|
{action: "line", x: "w*0.15", y: "h*0.87"}
|
|
]
|
|
}
|
|
]
|
|
});*/
|
|
|
|
/**
|
|
* Position
|
|
*/
|
|
Schema.addShape({
|
|
name:"position",
|
|
title:"岗位",
|
|
text:"岗位",
|
|
category:"org_normal",
|
|
props:{w: 110,h: 50},
|
|
lineStyle:{lineWidth: 2, lineColor: "255,213,172"},
|
|
fillStyle:{
|
|
type: "gradient",
|
|
gradientType: "linear",
|
|
beginColor: "255,244,233",
|
|
endColor: "255,231,207",
|
|
angle: Math.PI*0.5
|
|
},
|
|
textBlock:{x: "w*0.14", y: "0", w: "w*0.86", h: "h"},textBlockFinal:{x:"w/2-60", y:"h", w:"120", h:"30"},
|
|
path:[
|
|
{actions: {ref: "rectangle"}},
|
|
{actions: [{action: "move", x: "w/6", y: "0"},{action: "line", x: "w/6", y: "h"}]},
|
|
{
|
|
lineStyle: {lineWidth: 0},
|
|
fillStyle: {type: "none"},
|
|
actions: {ref: "rectangle"}
|
|
}
|
|
]
|
|
});
|
|
|
|
/**
|
|
* Role
|
|
*/
|
|
Schema.addShape({
|
|
name:"role",
|
|
title:"角色",
|
|
text:"角色",
|
|
category:"org_normal",
|
|
props:{w: 110,h: 50},
|
|
lineStyle:{lineWidth: 2, lineColor: "255,213,172"},
|
|
fillStyle:{
|
|
type: "gradient",
|
|
gradientType: "linear",
|
|
beginColor: "255,244,233",
|
|
endColor: "255,231,207",
|
|
angle: Math.PI*0.5
|
|
},
|
|
textBlock:{x: "w*0.14", y: "0", w: "w*0.86", h: "h"},textBlockFinal:{x:"w/2-60", y:"h", w:"120", h:"30"},
|
|
path:[
|
|
{actions: {ref: "rectangle"}},
|
|
{lineStyle:{lineStyle:"dashed"},actions: [{action: "move", x: "w/6", y: "0"},{action: "line", x: "w/6", y: "h"}]},
|
|
{lineStyle: {lineWidth: 0},fillStyle: {type: "none"},actions: {ref: "rectangle"}
|
|
}
|
|
],drawIcon:function(w, h){
|
|
if (w < 36) {
|
|
return [
|
|
{lineStyle:{lineStyle:"solid", lineWidth:2}, actions:[
|
|
{action:"move", x:0, y:0},
|
|
{action:"line", x:w, y:0},
|
|
{action:"line", x:w, y:h},
|
|
{action:"line", x:0, y:h},
|
|
{action:"close"}
|
|
]},
|
|
{actions:[
|
|
{action:"move", x:w / 6, y:"0"},
|
|
{action:"line", x:w / 6, y:"4"},
|
|
{action:"move", x:w / 6, y:"6"},
|
|
{action:"line", x:w / 6, y:"10"},
|
|
{action:"move", x:w / 6, y:"12"},
|
|
{action:"line", x:w / 6, y:"16"}
|
|
]},
|
|
{lineStyle:{lineWidth:0}, fillStyle:{type:"none"}, actions:{ref:"rectangle"}
|
|
}
|
|
]
|
|
} else {
|
|
return [
|
|
{lineStyle:{lineStyle:"solid", lineWidth:2}, actions:[
|
|
{action:"move", x:0, y:0},
|
|
{action:"line", x:w, y:0},
|
|
{action:"line", x:w, y:h},
|
|
{action:"line", x:0, y:h},
|
|
{action:"close"}
|
|
]},
|
|
{lineStyle:{lineStyle:"dashed"},actions: [{action: "move", x: w/6, y: "0"},{action: "line", x: w/6, y: h}]},
|
|
{lineStyle:{lineWidth:0}, fillStyle:{type:"none"}, actions:{ref:"rectangle"}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Employee
|
|
*/
|
|
Schema.addShape({
|
|
name:"employee",
|
|
title:"组织",
|
|
text:"组织",
|
|
category:"org_normal",
|
|
props:{w: 110,h: 50},
|
|
lineStyle:{lineWidth: 2, lineColor: "255,213,172"},
|
|
fillStyle:{
|
|
type: "gradient",
|
|
gradientType: "linear",
|
|
beginColor: "255,244,233",
|
|
endColor: "255,231,207",
|
|
angle: Math.PI*0.5
|
|
},
|
|
textBlock:{x: "0", y: "0", w: "w", h: "h"},textBlockFinal:{x:"w/2-60", y:"h", w:"120", h:"30"},
|
|
path:[{actions: {ref: "rectangle"}}]
|
|
}); |