ItdmWenxiangHistory48List.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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="10" :lg="11" :md="12" :sm="24">
  8. <a-form-item label="创建时间">
  9. <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.createTime_begin"></j-date>
  10. <span class="query-group-split-cust"></span>
  11. <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.createTime_end"></j-date>
  12. </a-form-item>
  13. </a-col>
  14. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  15. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  16. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  17. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  18. <a @click="handleToggleSearch" style="margin-left: 8px">
  19. {{ toggleSearchStatus ? '收起' : '展开' }}
  20. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  21. </a>
  22. </span>
  23. </a-col>
  24. </a-row>
  25. </a-form>
  26. </div>
  27. <!-- 查询区域-END -->
  28. <!-- 操作按钮区域 -->
  29. <div class="table-operator">
  30. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  31. <a-button type="primary" icon="download" @click="handleExportXls('48立方温箱数据')">导出</a-button>
  32. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  33. <a-button type="primary" icon="import">导入</a-button>
  34. </a-upload>
  35. <!-- 高级查询区域 -->
  36. <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  37. <a-dropdown v-if="selectedRowKeys.length > 0">
  38. <a-menu slot="overlay">
  39. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  40. </a-menu>
  41. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  42. </a-dropdown>
  43. </div>
  44. <!-- table区域-begin -->
  45. <div>
  46. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  47. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  48. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  49. </div>
  50. <a-table
  51. ref="table"
  52. size="middle"
  53. :scroll="{x:true}"
  54. bordered
  55. rowKey="id"
  56. :columns="columns"
  57. :dataSource="dataSource"
  58. :pagination="ipagination"
  59. :loading="loading"
  60. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  61. class="j-table-force-nowrap"
  62. @change="handleTableChange">
  63. <template slot="htmlSlot" slot-scope="text">
  64. <div v-html="text"></div>
  65. </template>
  66. <template slot="imgSlot" slot-scope="text,record">
  67. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  68. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  69. </template>
  70. <template slot="fileSlot" slot-scope="text">
  71. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  72. <a-button
  73. v-else
  74. :ghost="true"
  75. type="primary"
  76. icon="download"
  77. size="small"
  78. @click="downloadFile(text)">
  79. 下载
  80. </a-button>
  81. </template>
  82. <span slot="action" slot-scope="text, record">
  83. <a @click="handleEdit(record)">编辑</a>
  84. <a-divider type="vertical" />
  85. <a-dropdown>
  86. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  87. <a-menu slot="overlay">
  88. <a-menu-item>
  89. <a @click="handleDetail(record)">详情</a>
  90. </a-menu-item>
  91. <a-menu-item>
  92. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  93. <a>删除</a>
  94. </a-popconfirm>
  95. </a-menu-item>
  96. </a-menu>
  97. </a-dropdown>
  98. </span>
  99. </a-table>
  100. </div>
  101. <itdm-wenxiang-history48-modal ref="modalForm" @ok="modalFormOk"></itdm-wenxiang-history48-modal>
  102. </a-card>
  103. </template>
  104. <script>
  105. import '@/assets/less/TableExpand.less'
  106. import { mixinDevice } from '@/utils/mixin'
  107. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  108. import ItdmWenxiangHistory48Modal from './modules/ItdmWenxiangHistory48Modal'
  109. export default {
  110. name: 'ItdmWenxiangHistory48List',
  111. mixins:[JeecgListMixin, mixinDevice],
  112. components: {
  113. ItdmWenxiangHistory48Modal
  114. },
  115. data () {
  116. return {
  117. description: '48立方温箱数据管理页面',
  118. // 表头
  119. columns: [
  120. {
  121. title: '#',
  122. dataIndex: '',
  123. key:'rowIndex',
  124. width:60,
  125. align:"center",
  126. customRender:function (t,r,index) {
  127. return parseInt(index)+1;
  128. }
  129. },
  130. {
  131. title:'设备名称',
  132. align:"center",
  133. dataIndex: 'deviceName'
  134. },
  135. {
  136. title:'设备编号',
  137. align:"center",
  138. dataIndex: 'deviceNo'
  139. },
  140. {
  141. title:'温度',
  142. align:"center",
  143. dataIndex: 'temperature'
  144. },
  145. {
  146. title:'温度上限',
  147. align:"center",
  148. dataIndex: 'temperatureMax'
  149. },
  150. {
  151. title:'温度下限',
  152. align:"center",
  153. dataIndex: 'temperatureMin'
  154. },
  155. {
  156. title:'温度报警(0正常1报警)',
  157. align:"center",
  158. dataIndex: 'temperatureAlarm'
  159. },
  160. {
  161. title:'湿度',
  162. align:"center",
  163. dataIndex: 'humidity'
  164. },
  165. {
  166. title:'湿度上限',
  167. align:"center",
  168. dataIndex: 'humidityMax'
  169. },
  170. {
  171. title:'湿度下限',
  172. align:"center",
  173. dataIndex: 'humidityMin'
  174. },
  175. {
  176. title:'湿度报警(0正常1报警)',
  177. align:"center",
  178. dataIndex: 'humidityAlarm'
  179. },
  180. {
  181. title:'A相电流',
  182. align:"center",
  183. dataIndex: 'currentA'
  184. },
  185. {
  186. title:'A相电流上限',
  187. align:"center",
  188. dataIndex: 'currentAMax'
  189. },
  190. {
  191. title:'A相电流下限',
  192. align:"center",
  193. dataIndex: 'currentAMin'
  194. },
  195. {
  196. title:'A相电流报警(0正常1报警)',
  197. align:"center",
  198. dataIndex: 'currentAAlarm'
  199. },
  200. {
  201. title:'B相电流',
  202. align:"center",
  203. dataIndex: 'currentB'
  204. },
  205. {
  206. title:'B相电流上限',
  207. align:"center",
  208. dataIndex: 'currentBMax'
  209. },
  210. {
  211. title:'B相电流下限',
  212. align:"center",
  213. dataIndex: 'currentBMin'
  214. },
  215. {
  216. title:'B相电流报警(0正常1报警)',
  217. align:"center",
  218. dataIndex: 'currentBAlarm'
  219. },
  220. {
  221. title:'C相电流',
  222. align:"center",
  223. dataIndex: 'currentC'
  224. },
  225. {
  226. title:'C相电流上限',
  227. align:"center",
  228. dataIndex: 'currentCMax'
  229. },
  230. {
  231. title:'C相电流下限',
  232. align:"center",
  233. dataIndex: 'currentCMin'
  234. },
  235. {
  236. title:'C相电流报警(0正常1报警)',
  237. align:"center",
  238. dataIndex: 'currentCAlarm'
  239. },
  240. {
  241. title:'创建时间',
  242. align:"center",
  243. dataIndex: 'createTime'
  244. },
  245. {
  246. title: '操作',
  247. dataIndex: 'action',
  248. align:"center",
  249. fixed:"right",
  250. width:147,
  251. scopedSlots: { customRender: 'action' }
  252. }
  253. ],
  254. url: {
  255. list: "/itdmWenxiangHistory/itdmWenxiangHistory48/list",
  256. delete: "/itdmWenxiangHistory/itdmWenxiangHistory48/delete",
  257. deleteBatch: "/itdmWenxiangHistory/itdmWenxiangHistory48/deleteBatch",
  258. exportXlsUrl: "/itdmWenxiangHistory/itdmWenxiangHistory48/exportXls",
  259. importExcelUrl: "itdmWenxiangHistory/itdmWenxiangHistory48/importExcel",
  260. },
  261. dictOptions:{},
  262. superFieldList:[],
  263. }
  264. },
  265. created() {
  266. this.getSuperFieldList();
  267. },
  268. computed: {
  269. importExcelUrl: function(){
  270. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  271. },
  272. },
  273. methods: {
  274. initDictConfig(){
  275. },
  276. getSuperFieldList(){
  277. let fieldList=[];
  278. fieldList.push({type:'string',value:'deviceName',text:'设备名称',dictCode:''})
  279. fieldList.push({type:'string',value:'deviceNo',text:'设备编号',dictCode:''})
  280. fieldList.push({type:'BigDecimal',value:'temperature',text:'温度',dictCode:''})
  281. fieldList.push({type:'BigDecimal',value:'temperatureMax',text:'温度上限',dictCode:''})
  282. fieldList.push({type:'BigDecimal',value:'temperatureMin',text:'温度下限',dictCode:''})
  283. fieldList.push({type:'int',value:'temperatureAlarm',text:'温度报警(0正常1报警)',dictCode:''})
  284. fieldList.push({type:'BigDecimal',value:'humidity',text:'湿度',dictCode:''})
  285. fieldList.push({type:'BigDecimal',value:'humidityMax',text:'湿度上限',dictCode:''})
  286. fieldList.push({type:'BigDecimal',value:'humidityMin',text:'湿度下限',dictCode:''})
  287. fieldList.push({type:'int',value:'humidityAlarm',text:'湿度报警(0正常1报警)',dictCode:''})
  288. fieldList.push({type:'BigDecimal',value:'currentA',text:'A相电流',dictCode:''})
  289. fieldList.push({type:'BigDecimal',value:'currentAMax',text:'A相电流上限',dictCode:''})
  290. fieldList.push({type:'BigDecimal',value:'currentAMin',text:'A相电流下限',dictCode:''})
  291. fieldList.push({type:'int',value:'currentAAlarm',text:'A相电流报警(0正常1报警)',dictCode:''})
  292. fieldList.push({type:'BigDecimal',value:'currentB',text:'B相电流',dictCode:''})
  293. fieldList.push({type:'BigDecimal',value:'currentBMax',text:'B相电流上限',dictCode:''})
  294. fieldList.push({type:'BigDecimal',value:'currentBMin',text:'B相电流下限',dictCode:''})
  295. fieldList.push({type:'int',value:'currentBAlarm',text:'B相电流报警(0正常1报警)',dictCode:''})
  296. fieldList.push({type:'BigDecimal',value:'currentC',text:'C相电流',dictCode:''})
  297. fieldList.push({type:'BigDecimal',value:'currentCMax',text:'C相电流上限',dictCode:''})
  298. fieldList.push({type:'BigDecimal',value:'currentCMin',text:'C相电流下限',dictCode:''})
  299. fieldList.push({type:'int',value:'currentCAlarm',text:'C相电流报警(0正常1报警)',dictCode:''})
  300. fieldList.push({type:'datetime',value:'createTime',text:'创建时间'})
  301. this.superFieldList = fieldList
  302. }
  303. }
  304. }
  305. </script>
  306. <style scoped>
  307. @import '~@assets/less/common.less';
  308. </style>