yili-apps/com.actionsoft.apps.coe.pal/method/itsystem.normal/diagram.schema.tpl
2022-06-27 22:14:40 +08:00

147 lines
7.3 KiB
Smarty
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* ITSystem shapes
*/
Schema.addCategory({
name: "itsystem_normal",
text: "IT系统图",
dataAttributes: []
});
/* Database Server*/
Schema.addShape({name:"database", title:"数据库服务",text:"数据库服务", category:"itsystem_normal", props:{w:100, h:70},textBlock:{x:"w*0.15", y:"0", w:"w*0.7", h:"h"},textBlockFinal:{x:"w/2-60", y:"h", w:"120", h:"30"},path:[
{actions:[
{action:"move", x:"0", y:"h*0.14"},
{action:"curve", x1:"0", y1:"-h*0.04", x2:"w", y2:"-h*0.04", x:"w", y:"h*0.14"},
{action:"line", x:"w", y:"h*0.86"},
{action:"curve", x1:"w", y1:"h*1.04", x2:"0", y2:"h*1.04", x:"0", y:"h*0.86"},
{action:"line", x:"0", y:"h*0.14"},
{action:"close"}
]},
{actions:[
{action:"move", x:"w", y:"h*0.14"},
{action:"curve", x1:"w", y1:"h*0.3", x2:"0", y2:"h*0.3", x:"0", y:"h*0.14"},
{action:"curve", x1:"0", y1:"-h*0.04", x2:"w", y2:"-h*0.04", x:"w", y:"h*0.14"},
{action:"close"}
]},
{fillStyle:{type:"none"}, lineStyle:{lineWidth:0}, actions:[
{action:"move", x:"0", y:"h*0.1"},
{action:"quadraticCurve", x1:"w*0.5", y1:"-h*0.1", x:"w", y:"h*0.1"},
{action:"line", x:"w", y:"h*0.9"},
{action:"quadraticCurve", x1:"w*0.5", y1:"h*1.1", x:"0", y:"h*0.9"},
{action:"line", x:"0", y:"h*0.1"},
{action:"close"}
]}
]});
/*App System 两个中空矩形*/
Schema.addShape({name:"appSystem", title:"应用系统", text:"应用系统", category:"itsystem_normal", props:{w:100, h:70}, path:[
{lineStyle:{lineStyle:"solid", lineColor:"120,120,120"}, 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"}
]},
{fillStyle:{type:"none"}, actions:[
{action:"move", x:"Math.min(w*(1/20),h*(1/15))", y:"Math.min(w*(1/20),h*(1/15))"},
{action:"line", x:"Math.max(w*(19/20),w-Math.min(w*(1/20),h*(1/15)))", y:"Math.min(h*(1/15),w-w*(19/20))"},
{action:"line", x:"Math.max(w*(19/20),w-Math.min(w*(1/20),h*(1/15)))", y:"Math.max(h*(14/15),h-Math.min(h*(1/15),w*(1/20)))"},
{action:"line", x:"Math.min(w*(1/20),h-h*(14/15))", y:"Math.max(h*(14/15),h-Math.min(h*(1/15),w*(1/20)))"},
{action:"close"}
]},
{lineStyle:{lineWidth:0}, fillStyle:{type:"none"}, 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"}
]}
], drawIcon:function (a, b) {
return[
{lineStyle:{lineStyle:"solid", lineColor:"120,120,120"}, actions:[
{action:"move", x:0, y:0},
{action:"line", x:a, y:0},
{action:"line", x:a, y:b},
{action:"line", x:0, y:b},
{action:"close"}
]},
{actions:[
{action:"move", x:a > 36 ? Math.min(a*(1/20),b*(1/15)) : a * (1 / 9), y:b > 36 ? Math.min(a*(1/20),b*(1/15)) : b * (1 / 7)},
{action:"line", x:a > 36 ? Math.max(a*(19/20),a-Math.min(a*(1/20),b*(1/15))) : a * (8 / 9), y:b > 36 ? Math.min(b*(1/15),a-a*(19/20)) : b * (1 / 7)},
{action:"line", x:a > 36 ? Math.max(a*(19/20),a-Math.min(a*(1/20),b*(1/15))) : a * (8 / 9), y:b > 36 ? Math.max(b*(14/15),b-Math.min(b*(1/15),a*(1/20))) : b * (6 / 7)},
{action:"line", x:a > 36 ? Math.min(a*(1/20),b-b*(14/15)) : a * (1 / 9), y:b > 36 ? Math.max(b*(14/15),b-Math.min(b*(1/15),a*(1/20))) : b * (6 / 7)},
{action:"close"}
]}
]
}});
/*App System 两个矩形内矩形为full*/
Schema.addShape({name:"device", title:"IT设备", text:"IT设备", category:"itsystem_normal", props:{w:100, h:70},path:[
{lineStyle:{lineStyle:"solid", lineColor:"120,120,120"}, 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"}
]},
{fillStyle:{type:"solid", color:"200,200,200"}, actions:[
{action:"move", x:"Math.min(w*(1/20),h*(1/15))", y:"Math.min(w*(1/20),h*(1/15))"},
{action:"line", x:"Math.max(w*(19/20),w-Math.min(w*(1/20),h*(1/15)))", y:"Math.min(h*(1/15),w-w*(19/20))"},
{action:"line", x:"Math.max(w*(19/20),w-Math.min(w*(1/20),h*(1/15)))", y:"Math.max(h*(14/15),h-Math.min(h*(1/15),w*(1/20)))"},
{action:"line", x:"Math.min(w*(1/20),h-h*(14/15))", y:"Math.max(h*(14/15),h-Math.min(h*(1/15),w*(1/20)))"},
{action:"close"}
]},
{lineStyle:{lineWidth:0}, fillStyle:{type:"none"}, 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"}
]}
], drawIcon:function (a, b) {
return[
{lineStyle:{lineStyle:"solid", lineColor:"120,120,120"}, actions:[
{action:"move", x:0, y:0},
{action:"line", x:a, y:0},
{action:"line", x:a, y:b},
{action:"line", x:0, y:b},
{action:"close"}
]},
{fillStyle:{type:"solid", color:"120,120,120"},actions:[
{action:"move", x:a > 36 ? Math.min(a*(1/20),b*(1/15)) : a * (1 / 9), y:b > 36 ? Math.min(a*(1/20),b*(1/15)) : b * (1 / 7)},
{action:"line", x:a > 36 ? Math.max(a*(19/20),a-Math.min(a*(1/20),b*(1/15))) : a * (8 / 9), y:b > 36 ? Math.min(b*(1/15),a-a*(19/20)) : b * (1 / 7)},
{action:"line", x:a > 36 ? Math.max(a*(19/20),a-Math.min(a*(1/20),b*(1/15))) : a * (8 / 9), y:b > 36 ? Math.max(b*(14/15),b-Math.min(b*(1/15),a*(1/20))) : b * (6 / 7)},
{action:"line", x:a > 36 ? Math.min(a*(1/20),b-b*(14/15)) : a * (1 / 9), y:b > 36 ? Math.max(b*(14/15),b-Math.min(b*(1/15),a*(1/20))) : b * (6 / 7)},
{action:"close"}
]}
]
}});
/*云服务*/
Schema.addShape({name:"cloudServer", title:"云服务",text:"云服务", category:"itsystem_normal", props:{w:100, h:60}, textBlock:{x:"w*0.17", y:"h*0.2", w:"w*0.65", h:"h*0.75"},textBlockFinal:{x:"w/2-60", y:"h", w:"120", h:"30"},
anchors:[
{x:"0",y:"0.735*h"},
{x:"0.5*w",y:"0.05*h"},
{x:"w",y:"0.75*h"},
{x:"w*0.5", y:"h"}
], path:[
{lineStyle:{lineStyle:"solid", lineWidth:4},actions:[
{action:"move", x:"0.17*w", y:"h"},
{action:"curve", x1:"-0.05*w", y1:"h", x2:"-0.05*w", y2:"0.47*h", x:"0.17*w", y:"0.47*h"},
{action:"curve", x1:"0.13*w", y1:"0.28*h", x2:"0.29*w", y2:"0.156*h", x:"0.346*w", y:"0.344*h"},
{action:"curve", x1:"0.39*w", y1:"-0.1*h", x2:"0.85*w", y2:"-0.1*h", x:"0.8*w", y:"0.5*h"},
{action:"curve", x1:"1.05*w", y1:"0.5*h", x2:"1.05*w", y2:"h", x:"0.8*w", y:"h"},
{action:"close"}
]}
], drawIcon:function (a, b) {
return[
{lineStyle:{lineStyle:"solid", lineWidth:a > 36 ? 4 : 2.5},actions:[
{action:"move", x:0.17*a, y:b},
{action:"curve", x1:-0.05*a, y1:b, x2:-0.05*a, y2:0.47*b, x:0.17*a, y:0.47*b},
{action:"curve", x1:0.13*a, y1:0.28*b, x2:0.29*a, y2:0.156*b, x:0.346*a, y:0.344*b},
{action:"curve", x1:0.39*a, y1:-0.1*b, x2:0.85*a, y2:-0.1*b, x:0.8*a, y:0.5*b},
{action:"curve", x1:1.05*a, y1:0.5*b, x2:1.05*a, y2:b, x:0.8*a, y:b},
{action:"close"}
]}
]
}});