ItdmDeviceList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  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. <a-input placeholder="请输入设备名称" v-model="queryParam.deviceName"></a-input>
  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="6" :lg="7" :md="8" :sm="24">
  19. <a-form-item label="设备状态">
  20. <j-dict-select-tag placeholder="请选择设备状态" v-model="queryParam.deviceStatus" dictCode="device_status"/>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  24. <a-form-item label="是否已维护">
  25. <j-dict-select-tag placeholder="请选择是否已维护" v-model="queryParam.isRepair" dictCode="is_repair"/>
  26. </a-form-item>
  27. </a-col>
  28. </template>
  29. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  30. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  31. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  32. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  33. <a @click="handleToggleSearch" style="margin-left: 8px">
  34. {{ toggleSearchStatus ? '收起' : '展开' }}
  35. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  36. </a>
  37. </span>
  38. </a-col>
  39. </a-row>
  40. </a-form>
  41. </div>
  42. <!-- 查询区域-END -->
  43. <!-- 操作按钮区域 -->
  44. <div class="table-operator">
  45. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  46. <a-button type="primary" icon="download" @click="handleExportXls('设备表')">导出</a-button>
  47. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  48. <a-button type="primary" icon="import">导入</a-button>
  49. </a-upload>
  50. <!-- 高级查询区域 -->
  51. <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  52. <a-dropdown v-if="selectedRowKeys.length > 0">
  53. <a-menu slot="overlay">
  54. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  55. </a-menu>
  56. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  57. </a-dropdown>
  58. </div>
  59. <!-- table区域-begin -->
  60. <div>
  61. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  62. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  63. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  64. </div>
  65. <a-table
  66. ref="table"
  67. size="middle"
  68. :scroll="{x:true}"
  69. bordered
  70. rowKey="id"
  71. :columns="columns"
  72. :dataSource="dataSource"
  73. :pagination="ipagination"
  74. :loading="loading"
  75. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  76. class="j-table-force-nowrap"
  77. @change="handleTableChange">
  78. <template slot="htmlSlot" slot-scope="text">
  79. <div v-html="text"></div>
  80. </template>
  81. <template slot="imgSlot" slot-scope="text,record">
  82. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  83. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  84. </template>
  85. <template slot="fileSlot" slot-scope="text">
  86. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  87. <a-button
  88. v-else
  89. :ghost="true"
  90. type="primary"
  91. icon="download"
  92. size="small"
  93. @click="downloadFile(text)">
  94. 下载
  95. </a-button>
  96. </template>
  97. <span slot="action" slot-scope="text, record">
  98. <a @click="handleEdit(record)">编辑</a>
  99. <a-divider type="vertical" />
  100. <a-dropdown>
  101. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  102. <a-menu slot="overlay">
  103. <a-menu-item>
  104. <a @click="handleDetail(record)">详情</a>
  105. </a-menu-item>
  106. <a-menu-item>
  107. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  108. <a>删除</a>
  109. </a-popconfirm>
  110. </a-menu-item>
  111. </a-menu>
  112. </a-dropdown>
  113. </span>
  114. <span slot="action2" slot-scope="text, item">
  115. <a-popconfirm :title="item.deviceStatus == 3 ? '确定取消设备故障吗': '确定设备出现故障吗'" @confirm="() => handleGuzhang(item)">
  116. <a>{{item.deviceStatus == 3 ? '取消故障': '故障'}}</a>
  117. </a-popconfirm>
  118. </span>
  119. </a-table>
  120. </div>
  121. <itdm-device-modal ref="modalForm" @ok="modalFormOk"></itdm-device-modal>
  122. </a-card>
  123. </template>
  124. <script>
  125. import '@/assets/less/TableExpand.less'
  126. import { mixinDevice } from '@/utils/mixin'
  127. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  128. import ItdmDeviceModal from './modules/ItdmDeviceModal'
  129. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  130. export default {
  131. name: 'ItdmDeviceList',
  132. mixins:[JeecgListMixin, mixinDevice],
  133. components: {
  134. ItdmDeviceModal
  135. },
  136. data () {
  137. return {
  138. description: '设备表管理页面',
  139. // 表头
  140. columns: [
  141. {
  142. title: '#',
  143. dataIndex: '',
  144. key:'rowIndex',
  145. width:60,
  146. align:"center",
  147. customRender:function (t,r,index) {
  148. return parseInt(index)+1;
  149. }
  150. },
  151. {
  152. title:'更新人',
  153. align:"center",
  154. dataIndex: 'updateBy'
  155. },
  156. {
  157. title:'更新日期',
  158. align:"center",
  159. dataIndex: 'updateTime'
  160. },
  161. {
  162. title:'设备名称',
  163. align:"center",
  164. dataIndex: 'deviceName'
  165. },
  166. {
  167. title:'设备类型',
  168. align:"center",
  169. dataIndex: 'deviceType'
  170. },
  171. {
  172. title:'设备编号',
  173. align:"center",
  174. dataIndex: 'deviceNo'
  175. },
  176. {
  177. title:'设备状态',
  178. align:"center",
  179. dataIndex: 'deviceStatus_dictText'
  180. },
  181. {
  182. title:'维护时间',
  183. align:"center",
  184. dataIndex: 'repairTime'
  185. },
  186. {
  187. title:'维护人',
  188. align:"center",
  189. dataIndex: 'repairer'
  190. },
  191. {
  192. title:'维护记录',
  193. align:"center",
  194. dataIndex: 'record'
  195. },
  196. {
  197. title:'设备型号',
  198. align:"center",
  199. dataIndex: 'deviceModel'
  200. },
  201. {
  202. title:'本次运行开始时间',
  203. align:"center",
  204. dataIndex: 'runStartTime'
  205. },
  206. {
  207. title:'设备运行标识',
  208. align:"center",
  209. dataIndex: 'biaoshi_dictText'
  210. },
  211. {
  212. title:'是否已维护',
  213. align:"center",
  214. dataIndex: 'isRepair_dictText'
  215. },
  216. {
  217. title: '故障判断',
  218. dataIndex: 'action2',
  219. align:"center",
  220. fixed:"right",
  221. scopedSlots: { customRender: 'action2' }
  222. },
  223. {
  224. title: '操作',
  225. dataIndex: 'action',
  226. align:"center",
  227. fixed:"right",
  228. width:147,
  229. scopedSlots: { customRender: 'action' }
  230. }
  231. ],
  232. url: {
  233. list: "/itdmDevice/itdmDevice/list",
  234. delete: "/itdmDevice/itdmDevice/delete",
  235. deleteBatch: "/itdmDevice/itdmDevice/deleteBatch",
  236. exportXlsUrl: "/itdmDevice/itdmDevice/exportXls",
  237. importExcelUrl: "itdmDevice/itdmDevice/importExcel",
  238. },
  239. dictOptions:{},
  240. superFieldList:[],
  241. }
  242. },
  243. created() {
  244. this.getSuperFieldList();
  245. },
  246. computed: {
  247. importExcelUrl: function(){
  248. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  249. },
  250. },
  251. methods: {
  252. initDictConfig(){
  253. },
  254. getSuperFieldList(){
  255. let fieldList=[];
  256. fieldList.push({type:'string',value:'updateBy',text:'更新人',dictCode:''})
  257. fieldList.push({type:'datetime',value:'updateTime',text:'更新日期'})
  258. fieldList.push({type:'string',value:'deviceName',text:'设备名称',dictCode:''})
  259. fieldList.push({type:'string',value:'deviceType',text:'设备类型',dictCode:''})
  260. fieldList.push({type:'string',value:'deviceNo',text:'设备编号',dictCode:''})
  261. fieldList.push({type:'int',value:'deviceStatus',text:'设备状态',dictCode:'device_status'})
  262. fieldList.push({type:'datetime',value:'repairTime',text:'维护时间'})
  263. fieldList.push({type:'string',value:'repairer',text:'维护人',dictCode:''})
  264. fieldList.push({type:'string',value:'record',text:'维护记录',dictCode:''})
  265. fieldList.push({type:'string',value:'deviceSpecification',text:'设备规格',dictCode:''})
  266. fieldList.push({type:'string',value:'deviceModel',text:'设备型号',dictCode:''})
  267. fieldList.push({type:'string',value:'deviceLife',text:'计量有效期',dictCode:''})
  268. fieldList.push({type:'datetime',value:'runStartTime',text:'本次运行开始时间'})
  269. fieldList.push({type:'int',value:'biaoshi',text:'设备运行标识',dictCode:'biaoshi'})
  270. fieldList.push({type:'int',value:'isRepair',text:'是否已维护',dictCode:'is_repair'})
  271. fieldList.push({type:'int',value:'equipmenttreeid',text:'设备树id',dictCode:''})
  272. fieldList.push({type:'string',value:'address',text:'安装地点',dictCode:''})
  273. fieldList.push({type:'int',value:'specid',text:'区域',dictCode:''})
  274. fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
  275. this.superFieldList = fieldList
  276. },
  277. handleGuzhang(item){
  278. console.log(item)
  279. }
  280. }
  281. }
  282. </script>
  283. <style scoped>
  284. @import '~@assets/less/common.less';
  285. </style>