You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
167 lines
5.8 KiB
Plaintext
167 lines
5.8 KiB
Plaintext
11 months ago
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta charset="utf-8" />
|
||
|
<title></title>
|
||
|
<!--通用js-->
|
||
|
<script src="/WF/Scripts/jquery-1.11.0.min.js" type="text/javascript"></script>
|
||
|
<script src="/WF/Scripts/QueryString.js" type="text/javascript"></script>
|
||
|
<script src="/WF/Scripts/config.js" type="text/javascript"></script>
|
||
|
<script src="/WF/Comm/Gener.js" type="text/javascript"></script>
|
||
|
<link href="css/icons.css" rel="stylesheet" />
|
||
|
<style type="text/css">
|
||
|
.classB {
|
||
|
width: 28px;
|
||
|
height: 25px;
|
||
|
background: #0079E2;
|
||
|
margin-bottom: 3px;
|
||
|
border-radius: 5px
|
||
|
}
|
||
|
.classR {
|
||
|
width: 28px;
|
||
|
height: 25px;
|
||
|
background: #FF0000;
|
||
|
margin-left: 5px;
|
||
|
margin-bottom: 3px;
|
||
|
border-radius: 5px
|
||
|
}
|
||
|
.classO {
|
||
|
width: 28px;
|
||
|
height: 25px;
|
||
|
background: #F200F1;
|
||
|
margin-left: 5px;
|
||
|
margin-bottom: 3px;
|
||
|
border-radius: 5px
|
||
|
}
|
||
|
.classP {
|
||
|
width: 28px;
|
||
|
height: 25px;
|
||
|
background: #FF9900;
|
||
|
margin-left: 5px;
|
||
|
margin-bottom: 3px;
|
||
|
border-radius: 5px
|
||
|
}
|
||
|
.classG {
|
||
|
width: 28px;
|
||
|
height: 25px;
|
||
|
background: #00C800;
|
||
|
margin-left: 5px;
|
||
|
margin-bottom: 3px;
|
||
|
border-radius: 5px
|
||
|
}
|
||
|
|
||
|
</style>
|
||
|
<script type="text/javascript">
|
||
|
var selectedeleid = new Object();
|
||
|
var selectStyle = new Object();
|
||
|
|
||
|
var data = null;
|
||
|
$(function () {
|
||
|
|
||
|
var flow = new Entity("BP.Cloud.Template.Flow", GetQueryString("flowNo"));
|
||
|
if (flow.ICON.indexOf('@') >= 0) { //包含@符号,是按照规则组装的数据
|
||
|
selectedeleid = flow.ICON.split("@")[0];
|
||
|
selectStyle = flow.ICON.split("@")[1];
|
||
|
}
|
||
|
|
||
|
//获得数.
|
||
|
var cols = 5; //列数.
|
||
|
var colIdx = -1;
|
||
|
var iconNum = 100;
|
||
|
|
||
|
var html = "<table style='height:100%;'>";
|
||
|
html += "<tr>";
|
||
|
html += "<th ><a class='seticoncss' id='color_blue' href=\"javascript:SetStyle('color_blue')\"><div class='classB'></div></a></th>";
|
||
|
html += "<th><a class='seticoncss' id='color_red' href=\"javascript:SetStyle('.color_blue_b')\"><div class='classR'></div></a></th>";
|
||
|
html += "<th><a class='seticoncss' id='color_yellow' href=\"javascript:SetStyle('color_purple')\"><div class='classO'></div></a></th>";
|
||
|
html += "<th><a class='seticoncss' id='color_purple' href=\"javascript:SetStyle('color_orange')\"><div class='classP'></div></a></th>";
|
||
|
html += "<th><a class='seticoncss' id='color_green' href=\"javascript:SetStyle('color_green')\"><div class='classG'></div></a></th>";
|
||
|
html += "</tr>";
|
||
|
|
||
|
for (var i = 0; i < 26; i++) {
|
||
|
colIdx++;
|
||
|
if (colIdx == 0)
|
||
|
html += "<tr>";
|
||
|
|
||
|
html += "<td >";
|
||
|
|
||
|
// html += ":::" + en.Name;
|
||
|
html += "<img class='icons' onclick=\"SelectIt('icon_" + i + "');\" src='FlowIcon/icon_" + i + ".png' id ='icon_" + i + "' />";
|
||
|
// html += " <img onclick=\"SelectIt(" + en.Name + ");\ src='/App/FlowDesigner/FlowIcon/" + en.Name + "' id = '" + en.Name + "' />";
|
||
|
|
||
|
html += "</td>";
|
||
|
|
||
|
if (colIdx == cols - 1) {
|
||
|
html += "</tr>";
|
||
|
colIdx = -1;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//处理输出余下的部分.
|
||
|
if (colIdx != -1) {
|
||
|
while (true) {
|
||
|
html += "<td></td>";
|
||
|
colIdx++;
|
||
|
if (colIdx == cols - 1)
|
||
|
html += "</tr>";
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
html += "</table>";
|
||
|
$("#docs").append(html);
|
||
|
|
||
|
//默认一个风格
|
||
|
//$('#' + selectStyle).addClass('select_csstemp');
|
||
|
|
||
|
AddClass();
|
||
|
});
|
||
|
|
||
|
//切换风格
|
||
|
function SetStyle(sty) {
|
||
|
selectStyle = sty;
|
||
|
$('.seticoncss').removeClass('select_csstemp');
|
||
|
$('#' + sty).addClass('select_csstemp');
|
||
|
AddClass();
|
||
|
}
|
||
|
|
||
|
function SelectIt(eleid) {
|
||
|
selectedeleid = eleid;
|
||
|
AddClass();
|
||
|
}
|
||
|
//设置选择的指定图片.
|
||
|
function AddClass() {
|
||
|
var classArr = ['color_blue', 'color_blue_b', 'color_orange', 'color_red', 'color_purple', 'color_purple', 'color_green'];
|
||
|
for (var i = 0; i < classArr.length; i++) {
|
||
|
$('.icons').removeClass(classArr[i]);
|
||
|
}
|
||
|
|
||
|
$('.icons').addClass('color_gray').removeClass("selectedenable");//给所有图标添加灰色
|
||
|
$('#' + selectedeleid).addClass(selectStyle).addClass("selectedenable").removeClass('color_gray');//选中的图标添加选中色并且移除灰色系
|
||
|
}
|
||
|
|
||
|
function Save(flowNo) {
|
||
|
|
||
|
var imgId = $('#iconsIfr').contents().find("#docs").contents().find(".selectedenable").attr("id");
|
||
|
var iconStyle = $('#iconsIfr').contents().find("#docs").contents().find(".select_csstemp").attr("id");
|
||
|
var img = imgId + "@" + iconStylse;
|
||
|
|
||
|
//设置选择的ID.
|
||
|
var flow = new Entity("BP.Cloud.Flow", flowNo);
|
||
|
flow.ICON = selectedeleid + "@" + selectStyle;
|
||
|
flow.Update();
|
||
|
}
|
||
|
function GetSelectedIconStyle() {
|
||
|
|
||
|
return selectedeleid + "@" + selectStyle;
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="docs" style="margin:0px 10px 0px 76px;">
|
||
|
</div>
|
||
|
<!--<button onclick="Save()">保存</button>-->
|
||
|
</body>
|
||
|
</html>
|