ItdmDeviceRunList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="设备">
  9. <j-dict-select-tag placeholder="请选择设备" v-model="queryParam.deviceId" dictCode="itdm_device,device_name,id"/>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="设备类型">
  14. <a-input placeholder="请输入设备类型" v-model="queryParam.deviceType"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <template v-if="toggleSearchStatus">
  18. <a-col :xl="10" :lg="11" :md="12" :sm="24">
  19. <a-form-item label="设备开始运行时间">
  20. <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.timeBegin_begin"></j-date>
  21. <span class="query-group-split-cust"></span>
  22. <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.timeBegin_end"></j-date>
  23. </a-form-item>
  24. </a-col>
  25. <a-col :xl="10" :lg="11" :md="12" :sm="24">
  26. <a-form-item label="设备结束运行时间">
  27. <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.timeEnd_begin"></j-date>
  28. <span class="query-group-split-cust"></span>
  29. <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.timeEnd_end"></j-date>
  30. </a-form-item>
  31. </a-col>
  32. </template>
  33. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  34. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  35. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  36. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  37. <a @click="handleToggleSearch" style="margin-left: 8px">
  38. {{ toggleSearchStatus ? '收起' : '展开' }}
  39. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  40. </a>
  41. </span>
  42. </a-col>
  43. </a-row>
  44. </a-form>
  45. </div>
  46. <!-- 查询区域-END -->
  47. <!-- 操作按钮区域 -->
  48. <div class="table-operator">
  49. <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
  50. <a-button type="primary" icon="download" @click="handleExportXls('设备运行时间表')">导出</a-button>
  51. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
  52. <!-- <a-button type="primary" icon="import">导入</a-button>-->
  53. <!-- </a-upload>-->
  54. <!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
  55. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
  56. <a-dropdown v-if="selectedRowKeys.length > 0">
  57. <a-menu slot="overlay">
  58. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  59. </a-menu>
  60. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  61. </a-dropdown>
  62. </div>
  63. <!-- table区域-begin -->
  64. <div>
  65. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  66. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  67. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  68. </div>
  69. <a-table
  70. ref="table"
  71. size="middle"
  72. :scroll="{x:true}"
  73. bordered
  74. rowKey="id"
  75. :columns="columns"
  76. :dataSource="dataSource"
  77. :pagination="ipagination"
  78. :loading="loading"
  79. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  80. class="j-table-force-nowrap"
  81. @change="handleTableChange">
  82. <template slot="htmlSlot" slot-scope="text">
  83. <div v-html="text"></div>
  84. </template>
  85. <template slot="imgSlot" slot-scope="text,record">
  86. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  87. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  88. </template>
  89. <template slot="fileSlot" slot-scope="text">
  90. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  91. <a-button
  92. v-else
  93. :ghost="true"
  94. type="primary"
  95. icon="download"
  96. size="small"
  97. @click="downloadFile(text)">
  98. 下载
  99. </a-button>
  100. </template>
  101. <span slot="action" slot-scope="text, record">
  102. <a-menu-item>
  103. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  104. <a>删除</a>
  105. </a-popconfirm>
  106. </a-menu-item>
  107. <!-- <a @click="handleEdit(record)">编辑</a>-->
  108. <!-- <a-divider type="vertical" />-->
  109. <!-- <a-dropdown>-->
  110. <!-- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->
  111. <!-- <a-menu slot="overlay">-->
  112. <!-- <a-menu-item>-->
  113. <!-- <a @click="handleDetail(record)">详情</a>-->
  114. <!-- </a-menu-item>-->
  115. <!-- <a-menu-item>-->
  116. <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
  117. <!-- <a>删除</a>-->
  118. <!-- </a-popconfirm>-->
  119. <!-- </a-menu-item>-->
  120. <!-- </a-menu>-->
  121. <!-- </a-dropdown>-->
  122. </span>
  123. </a-table>
  124. </div>
  125. <itdm-device-run-modal ref="modalForm" @ok="modalFormOk"></itdm-device-run-modal>
  126. </a-card>
  127. </template>
  128. <script>
  129. import '@/assets/less/TableExpand.less'
  130. import { mixinDevice } from '@/utils/mixin'
  131. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  132. import ItdmDeviceRunModal from './modules/ItdmDeviceRunModal'
  133. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  134. export default {
  135. name: 'ItdmDeviceRunList',
  136. mixins:[JeecgListMixin, mixinDevice],
  137. components: {
  138. ItdmDeviceRunModal
  139. },
  140. data () {
  141. return {
  142. description: '设备运行时间表管理页面',
  143. // 表头
  144. columns: [
  145. {
  146. title: '#',
  147. dataIndex: '',
  148. key:'rowIndex',
  149. width:60,
  150. align:"center",
  151. customRender:function (t,r,index) {
  152. return parseInt(index)+1;
  153. }
  154. },
  155. // {
  156. // title:'设备id',
  157. // align:"center",
  158. // dataIndex: 'deviceId_dictText'
  159. // },
  160. {
  161. title:'设备名称',
  162. align:"center",
  163. dataIndex: 'deviceName'
  164. },
  165. {
  166. title:'设备类型',
  167. align:"center",
  168. dataIndex: 'deviceType'
  169. },
  170. {
  171. title:'设备开始运行时间',
  172. align:"center",
  173. dataIndex: 'timeBegin'
  174. },
  175. {
  176. title:'设备结束运行时间',
  177. align:"center",
  178. dataIndex: 'timeEnd'
  179. },
  180. {
  181. title:'设备本次运行时间',
  182. align:"center",
  183. dataIndex: 'timeRun'
  184. },
  185. // {
  186. // title:'天',
  187. // align:"center",
  188. // dataIndex: 'timeDay'
  189. // },
  190. // {
  191. // title:'小时',
  192. // align:"center",
  193. // dataIndex: 'timeHour'
  194. // },
  195. // {
  196. // title:'分钟',
  197. // align:"center",
  198. // dataIndex: 'timeMinute'
  199. // },
  200. // {
  201. // title:'秒',
  202. // align:"center",
  203. // dataIndex: 'timeSecond'
  204. // },
  205. {
  206. title:'创建日期',
  207. align:"center",
  208. dataIndex: 'createTime'
  209. },
  210. {
  211. title: '操作',
  212. dataIndex: 'action',
  213. align:"center",
  214. fixed:"right",
  215. width:147,
  216. scopedSlots: { customRender: 'action' }
  217. }
  218. ],
  219. url: {
  220. list: "/itdmDeviceRun/itdmDeviceRun/list",
  221. delete: "/itdmDeviceRun/itdmDeviceRun/delete",
  222. deleteBatch: "/itdmDeviceRun/itdmDeviceRun/deleteBatch",
  223. exportXlsUrl: "/itdmDeviceRun/itdmDeviceRun/exportXls",
  224. importExcelUrl: "itdmDeviceRun/itdmDeviceRun/importExcel",
  225. },
  226. dictOptions:{},
  227. superFieldList:[],
  228. }
  229. },
  230. created() {
  231. this.getSuperFieldList();
  232. },
  233. computed: {
  234. importExcelUrl: function(){
  235. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  236. },
  237. },
  238. methods: {
  239. initDictConfig(){
  240. },
  241. getSuperFieldList(){
  242. let fieldList=[];
  243. fieldList.push({type:'int',value:'deviceId',text:'设备id',dictCode:"itdm_device,device_name,id"})
  244. fieldList.push({type:'string',value:'deviceName',text:'设备名称',dictCode:''})
  245. fieldList.push({type:'string',value:'deviceType',text:'设备类型',dictCode:''})
  246. fieldList.push({type:'datetime',value:'timeBegin',text:'设备开始运行时间'})
  247. fieldList.push({type:'datetime',value:'timeEnd',text:'设备结束运行时间'})
  248. fieldList.push({type:'string',value:'timeRun',text:'设备本次运行时间',dictCode:''})
  249. fieldList.push({type:'int',value:'timeDay',text:'天',dictCode:''})
  250. fieldList.push({type:'int',value:'timeHour',text:'小时',dictCode:''})
  251. fieldList.push({type:'int',value:'timeMinute',text:'分钟',dictCode:''})
  252. fieldList.push({type:'int',value:'timeSecond',text:'秒',dictCode:''})
  253. fieldList.push({type:'datetime',value:'createTime',text:'创建日期'})
  254. this.superFieldList = fieldList
  255. }
  256. }
  257. }
  258. </script>
  259. <style scoped>
  260. @import '~@assets/less/common.less';
  261. </style>