123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <div id="activitiDeployment" class="plg-tab-container">
- <div id="activitiDeployment-grid-1" class="grid-container-full"></div>
- </div>
- <script type="text/javascript">
- var $ = layui.jquery,
- upload = layui.upload;
- var opts = {
- skin: "terrace",
- columns: [
- {
- id: "id",
- name: "id",
- type: 'txt',
- hidden: true
- },
- {
- id: "name",
- name: "部署名称",
- type: 'ro',
- width: 200
- },
- {
- id: "category",
- name: "部署类目",
- type: 'ro',
- width: 200
- },
- {
- id: "deploymentTime",
- name: "部署时间",
- type: 'ro',
- width: '*'
- }
- ],
- imagePath: "/prologui/assets/PlgGrid",
- url: "/api/service-activiti/model/deployment", //数据接口
- type: "get", //数据提交方式,默认为get
- params: {
- pageNum: 1,
- pageSize: 10,
- deployName: null
- }, //查询提交参数,分页参数默认为pageNum,pageSize
- multiselect: false, //是否支持多选
- page: true, //是否启用分页
- toolbar:[
- {type:"button", name:"deleteBtn", className: "danger", value:"<i class='layui-icon layui-icon-delete'></i>删除"},{type: "newcolumn"},
- {type: "input", name: 'deployName', label: '部署名称:', placeholder: '请输入部署名称', offsetLeft:20},{type: "newcolumn"}
- ,{type:"button", name:"searchBtn", value:"查询"},{type: "newcolumn"}
- ],
- totalCount: "totalCount" //总记录数字段,默认totalCount
-
- };
- var activitiDeployment = new PlgGrid(opts);
- activitiDeployment.renderTo("activitiDeployment-grid-1");
- activitiDeployment.loadData();
- activitiDeployment.attachToolBarEvent("onButtonClick", function(name){
- if(name == "deleteBtn"){
- delactivitiDeployment();
- }else if(name == "searchBtn"){
- search();
- }
- });
- function search(){
- var deployName = $("input[name='deployName']").val();
- var am = activitiDeployment.getParams();
- am.deployName = deployName;
- activitiDeployment.reload();
- }
- function delactivitiDeployment() {
- var deploymentId = activitiDeployment.getSelectedRowId();
- if(!deploymentId){
- layer.msg("请选择一条数据");
- return;
- }
- layer.confirm('确定删除?', {
- btn: ['确定', '取消'],
- }, function(index, layero) {
- //按钮【按钮一】的回调
- $.ajax({
- type: 'GET',
- url: "/api/service-activiti/activiti/deldeploy",
- data: {
- deploymentId : deploymentId
- },
- async: false,
- success: function(data) {
- activitiDeployment.reload();
- alert(data.message);
- }
- });
- layer.close(index)
- });
- };
- </script>
|