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.

118 lines
5.2 KiB
Plaintext

11 months ago
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>按照sql计算</title>
<!--SQL编辑器-->
<link href="../../../Scripts/CodeMirror/lib/codemirror.css" rel="stylesheet" />
<link href="../../../Scripts/CodeMirror/addon/hint/show-hint.css" rel="stylesheet" />
<script src="../../../Scripts/CodeMirror/lib/codemirror.js"></script>
<script src="../../../Scripts/CodeMirror/addon/edit/matchbrackets.js"></script>
<script src="../../../Scripts/CodeMirror/mode/sql/sql.js"></script>
<script src="../../../Scripts/CodeMirror/addon/hint/show-hint.js"></script>
<script src="../../../Scripts/CodeMirror/addon/hint/sql-hint.js"></script>
<script src="../../../Scripts/LoadSql.js"></script>
<link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
<link href="../../../Scripts/easyUI145/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="../../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<script src="../../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="../../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
<script type="text/javascript" src="../../../Scripts/config.js"></script>
<script type="text/javascript" src="../../../Comm/Gener.js"></script>
<script src="DDLBar.js" type="text/javascript"></script>
<script src="../../CCFlowEnum.js" type="text/javascript"></script>
<script src="../../../Scripts/EasyUIUtility.js" type="text/javascript"></script>
<script src="../../../Scripts/vue.js" type="text/javascript"></script>
<!-- 自己的系统风格统一. -->
<link href="../../../Style/skin/adminfont/iconfont.css" rel="stylesheet" />
<link href="../../../Style/skin/css/Default.css" rel="stylesheet" />
<!-- 自己的系统风格统一end -->
</head>
<body>
<div id="App">
<div id="bar">
</div>
<fieldset>
<legend>请在文本框里输入SQL.</legend>
<br />
<textarea id="TB_SQL" class="SQL" style="width: 95%; height: 50px" v-model="sql"></textarea>
</fieldset>
<fieldset>
<legend id="help"></legend>
<ul>
<li>该SQL是需要返回No,Name两个列分别是人员编号,人员名称,返回的数据必须按照顺序来。</li>
<li>
SQL语句支持ccbpm表达式, 比如SELECT No,Name FROM Port_Emp WHERE FK_Dept='@WebUser.FK_Dept'
</li>
<li>
比如SELECT No,Name FROM Port_Emp WHERE FK_Dept='@MyFieldName' MyFieldName 必须是节点表单字段.
</li>
<li>什么是ccbpm表达式请百度ccbpm 表达式</li>
<li>
<a href="javascript:LoadTemplate();">我要从模版里选择一个设置.</a>
<div><select id="SQLTemplate" name="SQLTemplate" style="display:none" @change="ChangeData()"></select></div>
</li>
<li>注意1. 区分大小写。2. 顺序不能变化, No,Name </li>
</ul>
</fieldset>
</div>
<script type="text/javascript">
var Baseinfo = new Vue({
el: '#App',
data: {
deliverWay: DeliveryWay.BySQL,
sql: '',
nodeId:GetQueryString("FK_Node")
},
created() {
InitBar(this.deliverWay);
var node = new Entity("BP.WF.Node", this.nodeId);
if (node.DeliveryWay == DeliveryWay.BySQL) {
this.sql = node.DeliveryParas;
}
},
methods: {
ChangeData() {
var no = $("#SQLTemplate").val();
if (templates != null) {
var items = $.grep(templates, function (template) {
return template.No == no;
});
if (items.length > 0) {
this.sql = items[0].Docs;
editor.setValue(this.sql);
}
}
}
}
});
function Save() {
var node = new Entity("BP.WF.Template.NodeExt", Baseinfo.nodeId);
node.DeliveryWay =Baseinfo.deliverWay;
if (CheckIsSQL(editor.getValue()) == false) {
alert("请输入合法的SQL.");
return;
}
node.DeliveryParas = editor.getValue();
node.Update();
}
var templates = null;
function LoadTemplate() {
$("#SQLTemplate").show();
templates = new Entities("BP.WF.Template.SQLTemplates");
templates.RetrieveAll();
$("#SQLTemplate").empty();
GenerBindDDL("SQLTemplate", templates,"No","Name");
}
function ChangeData() {
}
</script>
</body>
</html>