InspectItemList.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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.itemname"></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="设备类型ID(设备定义)">
  14. <a-input placeholder="请输入设备类型ID(设备定义)" v-model="queryParam.equipdefid"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  19. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21. <a @click="handleToggleSearch" style="margin-left: 8px">
  22. {{ toggleSearchStatus ? '收起' : '展开' }}
  23. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  24. </a>
  25. </span>
  26. </a-col>
  27. </a-row>
  28. </a-form>
  29. </div>
  30. <!-- 查询区域-END -->
  31. <!-- 操作按钮区域 -->
  32. <div class="table-operator">
  33. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  34. <a-button type="primary" icon="download" @click="handleExportXls('巡检项')">导出</a-button>
  35. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  36. <a-button type="primary" icon="import">导入</a-button>
  37. </a-upload>
  38. <!-- 高级查询区域 -->
  39. <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  40. <a-dropdown v-if="selectedRowKeys.length > 0">
  41. <a-menu slot="overlay">
  42. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  43. </a-menu>
  44. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  45. </a-dropdown>
  46. </div>
  47. <!-- table区域-begin -->
  48. <div>
  49. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  50. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  51. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  52. </div>
  53. <a-table
  54. ref="table"
  55. size="middle"
  56. :scroll="{x:true}"
  57. bordered
  58. rowKey="id"
  59. :columns="columns"
  60. :dataSource="dataSource"
  61. :pagination="ipagination"
  62. :loading="loading"
  63. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  64. class="j-table-force-nowrap"
  65. @change="handleTableChange">
  66. <template slot="htmlSlot" slot-scope="text">
  67. <div v-html="text"></div>
  68. </template>
  69. <template slot="imgSlot" slot-scope="text,record">
  70. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  71. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  72. </template>
  73. <template slot="fileSlot" slot-scope="text">
  74. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  75. <a-button
  76. v-else
  77. :ghost="true"
  78. type="primary"
  79. icon="download"
  80. size="small"
  81. @click="downloadFile(text)">
  82. 下载
  83. </a-button>
  84. </template>
  85. <template slot="tooltip" slot-scope="text" >
  86. <a-tooltip placement="top" :title="text" trigger="hover">
  87. <div style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 80px;">
  88. {{ text }}
  89. </div>
  90. </a-tooltip>
  91. </template>
  92. <span slot="action" slot-scope="text, record">
  93. <a @click="handleEdit(record)">编辑</a>
  94. <a-divider type="vertical" />
  95. <a-dropdown>
  96. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  97. <a-menu slot="overlay">
  98. <a-menu-item>
  99. <a @click="handleDetail(record)">详情</a>
  100. </a-menu-item>
  101. <a-menu-item>
  102. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  103. <a>删除</a>
  104. </a-popconfirm>
  105. </a-menu-item>
  106. </a-menu>
  107. </a-dropdown>
  108. </span>
  109. </a-table>
  110. </div>
  111. <inspect-item-modal ref="modalForm" @ok="modalFormOk"></inspect-item-modal>
  112. </a-card>
  113. </template>
  114. <script>
  115. import '@/assets/less/TableExpand.less'
  116. import { mixinDevice } from '@/utils/mixin'
  117. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  118. import InspectItemModal from './modules/InspectItemModal'
  119. export default {
  120. name: 'InspectItemList',
  121. mixins:[JeecgListMixin, mixinDevice],
  122. components: {
  123. InspectItemModal
  124. },
  125. data () {
  126. return {
  127. description: '巡检项管理页面',
  128. // 表头
  129. columns: [
  130. {
  131. title: '序号',
  132. dataIndex: '',
  133. key:'rowIndex',
  134. width:60,
  135. align:"center",
  136. customRender:function (t,r,index) {
  137. return parseInt(index)+1;
  138. }
  139. },
  140. {
  141. title:'巡检项编号',
  142. align:"center",
  143. dataIndex: 'itemcode'
  144. },
  145. {
  146. title:'名称',
  147. align:"center",
  148. dataIndex: 'itemname'
  149. },
  150. {
  151. title:'设备类型',
  152. align:"center",
  153. dataIndex: 'equipdefname'
  154. },
  155. // {
  156. // title:'条件(字典中定义)',
  157. // align:"center",
  158. // dataIndex: 'conditions'
  159. // },
  160. // {
  161. // title:'参考值',
  162. // align:"center",
  163. // dataIndex: 'refervalue'
  164. // },
  165. // {
  166. // title:'标签(多个用逗号隔开)',
  167. // align:"center",
  168. // dataIndex: 'tag'
  169. // },
  170. {
  171. title:'巡检标准',
  172. align:"center",
  173. dataIndex: 'inspectionstandards'
  174. },
  175. {
  176. title:'巡检项类型',
  177. align:"center",
  178. dataIndex: 'classification_dictText'
  179. },
  180. {
  181. title:'备注',
  182. align:"center",
  183. width: 80,
  184. dataIndex: 'remark',
  185. scopedSlots: { customRender: 'tooltip' }
  186. },
  187. {
  188. title: '操作',
  189. dataIndex: 'action',
  190. align:"center",
  191. fixed:"right",
  192. width:147,
  193. scopedSlots: { customRender: 'action' }
  194. },
  195. ],
  196. url: {
  197. list: "/cmmsInspectItem/cmmsInspectItem/list",
  198. delete: "/cmmsInspectItem/cmmsInspectItem/delete",
  199. deleteBatch: "/cmmsInspectItem/cmmsInspectItem/deleteBatch",
  200. exportXlsUrl: "/cmmsInspectItem/cmmsInspectItem/exportXls",
  201. importExcelUrl: "cmmsInspectItem/cmmsInspectItem/importExcel",
  202. },
  203. dictOptions:{},
  204. superFieldList:[],
  205. }
  206. },
  207. created() {
  208. this.getSuperFieldList();
  209. },
  210. computed: {
  211. importExcelUrl: function(){
  212. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  213. },
  214. },
  215. methods: {
  216. initDictConfig(){
  217. },
  218. getSuperFieldList(){
  219. let fieldList=[];
  220. fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
  221. fieldList.push({type:'string',value:'itemcode',text:'巡检项编号',dictCode:''})
  222. fieldList.push({type:'string',value:'itemname',text:'名称',dictCode:''})
  223. fieldList.push({type:'string',value:'equipdefid',text:'设备类型ID(设备定义)',dictCode:''})
  224. fieldList.push({type:'string',value:'conditions',text:'条件(字典中定义)',dictCode:''})
  225. fieldList.push({type:'string',value:'refervalue',text:'参考值',dictCode:''})
  226. fieldList.push({type:'string',value:'tag',text:'标签(多个用逗号隔开)',dictCode:''})
  227. fieldList.push({type:'string',value:'inspectionstandards',text:'巡检标准',dictCode:''})
  228. fieldList.push({type:'string',value:'classification',text:'分类:0环境1设备2其他',dictCode:''})
  229. this.superFieldList = fieldList
  230. }
  231. }
  232. }
  233. </script>
  234. <style scoped>
  235. @import '~@assets/less/common.less';
  236. </style>