Skip to content

Commit

Permalink
add easyui
Browse files Browse the repository at this point in the history
  • Loading branch information
leelance committed Jan 3, 2017
1 parent cefbc5d commit dba2645
Show file tree
Hide file tree
Showing 9 changed files with 17,748 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lance.activiti.mapper.system.UserMapper">

<!-- findAll -->
<select id="findAll" resultType="UserInfo">
select *from t_user
</select>

<!-- findByAccount -->
<select id="findByAccount" resultType="UserInfo">
select *from t_user where account=#{value}
</select>

<!-- findOne -->
<select id="findOne" resultType="UserInfo">
select *from t_user where id=#{value}
</select>

<!-- save -->
<insert id="save" parameterType="UserInfo">
insert into t_user(account,password,name,phone,email,create_time)values(
#{account},#{password},#{name},#{phone},#{email},now()
)
</insert>

<!-- update -->
<update id="update" parameterType="UserInfo">
update t_user SET
account=#{account},
password=#{password},
name=#{name},
phone=#{phone},
email=#{email}
where id=#{id}
</update>

<!-- delete -->
<delete id="delete">
delete from t_user where id=#{value}
</delete>
</mapper>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://activiti.org/bpmn20" id="adhoc-definitions">
<process id="activitiAdhoc" name="Adhoc Activiti Process" isExecutable="true">
<startEvent id="start" activiti:formKey="wf:submitAdhocTask"></startEvent>
<sequenceFlow id="flow1" sourceRef="start" targetRef="adhocTask"></sequenceFlow>
<userTask id="adhocTask" name="Adhoc Task" activiti:assignee="admin1" activiti:formKey="wf:adhocTask">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;]]></activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow id="flow2" sourceRef="adhocTask" targetRef="verifyTaskDone"></sequenceFlow>
<userTask id="verifyTaskDone" name="Verify Adhoc Task Completed." activiti:assignee="admin2" activiti:formKey="wf:completedAdhocTask">
<documentation>Verify the arbitrary task was completed.</documentation>
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
if (wf_notifyMe)
{
var mail = actions.create("mail");
mail.parameters.to = initiator.properties.email;
mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
mail.parameters.from = bpm_assignee.properties.email;
mail.parameters.text = "It's done";
mail.execute(bpm_package);
}]]></activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow id="flow3" sourceRef="verifyTaskDone" targetRef="theEnd"></sequenceFlow>
<endEvent id="theEnd"></endEvent>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_activitiAdhoc">
<bpmndi:BPMNPlane bpmnElement="activitiAdhoc" id="BPMNPlane_activitiAdhoc">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
<omgdc:Bounds height="35.0" width="35.0" x="32.0" y="200.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="adhocTask" id="BPMNShape_adhocTask">
<omgdc:Bounds height="55.0" width="105.0" x="140.0" y="190.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="verifyTaskDone" id="BPMNShape_verifyTaskDone">
<omgdc:Bounds height="55.0" width="105.0" x="310.0" y="190.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="theEnd" id="BPMNShape_theEnd">
<omgdc:Bounds height="35.0" width="35.0" x="490.0" y="200.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="67.0" y="217.0"></omgdi:waypoint>
<omgdi:waypoint x="140.0" y="217.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="245.0" y="217.0"></omgdi:waypoint>
<omgdi:waypoint x="310.0" y="217.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="415.0" y="217.0"></omgdi:waypoint>
<omgdi:waypoint x="490.0" y="217.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
131 changes: 131 additions & 0 deletions spring-boot-activiti/src/main/resources/static/js/Index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
var Index = {
grid: '#taskinfo-grid',
form: '#taskinfoForm',

init: function(){
//初始化Grid列表数据
this.initGrid();
},

//添加模块
addTaskInfo: function(){
var d = this.createTaskInfoDialog();
d.dialog({title: "Add City"}).dialog('open');
},

//修改模块弹出修改框
updateTaskInfo: function() {
var message = Ext.getSingleSelected(this.grid);
if(message){
return Ext.alert(message);
}

this.update();
},

//执行更新操作
update: function() {
var record = Ext.getRecord(Index.grid);
var d = this.createTaskInfoDialog();
d.dialog({title: "Update"}).dialog('open');

//加载form表单
$(this.form).form('load', record);
},

//删除模块
deleteTaskInfo: function(){
var message = Ext.getSingleSelected(this.grid);
if(message){
return Ext.alert(message);
}

Ext.confirm('您确认要删除这条记录吗?', function(){
Ext.progress('Loading...');
var record = Ext.getRecord(Index.grid);
$.get("/delete/"+record.id, function(result){
if(result.errorCode==0){
$(Index.grid).datagrid("reload")
}else{
Ext.alert(result.errorText);
}
Ext.progressClose();
});
});
},

searchHotelName: function() {
$(this.grid).datagrid("load", {hotelName: $('#hotelNameSearch').val()})
},

//保存模块
saveTaskInfo: function(){
$(Index.form).form('submit',{
url: '/save',
onSubmit: function(){
var flag = $(this).form('enableValidation').form('validate');
if(flag) {
Ext.progress('Loading...');
}
return flag;
},
success: function(result){
result = $.parseJSON(result);
if(result.errorCode ==0){
var d = Index.createTaskInfoDialog();
d.dialog('close');
$(Index.grid).datagrid("reload");
}else{
Ext.alert(result.errorText);
}

Ext.progressClose();
}
});
},

//初始化表单
initGrid: function(){
$(this.grid).datagrid({
toolbar: '#taskinfo-tbar',
url:'/list',
method: 'post',
fitColumns: true,
striped: true,
fit: true,
pagination:false,
rownumbers:true,
ctrlSelect: false,
singleSelect: true,
border: false,
columns:[[
{field:'id',title:'',checkbox:'true', width:20},
{field:'name',title:'Name',width:80},
{field:'country',title:'country',width:80},
{field:'state',title:'state',width:80},
{field:'map',title:'map',width:80}
]]
});
},

//模块框
createTaskInfoDialog: function() {
$(this.form).form('clear');
$('#taskinfoForm input[name=id]').val(0);

var d = $('#taskinfoDialog').dialog({
width:320,
minimizable: false,
maximizable: false,
collapsible: false,
resizable: false,
modal: true,
iconCls: 'icon-win',
buttons: [
{text: 'Save', handler: this.saveTaskInfo},
{text: 'Close', handler: function(){d.dialog('close');}}
]
});
return d;
}
}
Loading

0 comments on commit dba2645

Please sign in to comment.