projectDeviceList.jsp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
  2. <%@include file="/context/mytags.jsp" %>
  3. <%--非当前角色的用户列表--%>
  4. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  5. <div id="main_device_list" class="easyui-layout" fit="true">
  6. <div region="center" style="padding:0px;border:0px">
  7. <t:datagrid name="projectDeviceList" title="common.operation"
  8. actionUrl="projectServiceDeviceController.do?datagridProjectDevice&projectid=${projectid}" fit="true" fitColumns="true"
  9. idField="id" checkbox="true" queryMode="group">
  10. <t:dgCol title="编号" field="id" hidden="true"></t:dgCol>
  11. <t:dgCol title="设备编号" sortable="false" field="code" query="true" width="120"></t:dgCol>
  12. <t:dgCol title="设备名称" field="name" query="true" width="120"></t:dgCol>
  13. <t:dgCol title="设备类型" field="typeId" query="true" queryMode="single" dictionary="P_device_type,id,type_name" width="120"></t:dgCol>
  14. <t:dgCol title="当前位置" field="location" hidden="true" queryMode="single" width="120"></t:dgCol>
  15. <%-- <t:dgCol title="common.status" sortable="true" field="status" replace="common.active_1,common.inactive_0,super.admin_-1"></t:dgCol> --%>
  16. </t:datagrid>
  17. </div>
  18. </div>
  19. <div style="display: none">
  20. <t:formvalid formid="formobj" layout="div" dialog="true" action="projectServiceDeviceController.do?doAddProjectDevice&projectid=${projectid}&serviceid=${serviceid}" beforeSubmit="setDeviceIds">
  21. <input id="deviceIds" name="deviceIds">
  22. </t:formvalid>
  23. </div>
  24. <script>
  25. function setDeviceIds() {
  26. $("#deviceIds").val(getDeviceListSelections('id'));
  27. return true;
  28. }
  29. function getDeviceListSelections(field) {
  30. var ids = [];
  31. var rows = $('#projectDeviceList').datagrid('getSelections');
  32. for (var i = 0; i < rows.length; i++) {
  33. ids.push(rows[i][field]);
  34. }
  35. ids.join(',');
  36. return ids
  37. }
  38. </script>