ElecfeeRatioList.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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-row>
  8. </a-form>
  9. </div>
  10. <!-- 查询区域-END -->
  11. <!-- 操作按钮区域 -->
  12. <div class="table-operator">
  13. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  14. <!-- <a-button type="primary" icon="download" @click="handleExportXls('base_elecfee_ratio')">导出</a-button>
  15. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  16. <a-button type="primary" icon="import">导入</a-button>
  17. </a-upload> -->
  18. <!-- 高级查询区域 -->
  19. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
  20. <a-dropdown v-if="selectedRowKeys.length > 0">
  21. <a-menu slot="overlay">
  22. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  23. </a-menu>
  24. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  25. </a-dropdown>
  26. </div>
  27. <!-- table区域-begin -->
  28. <div>
  29. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  30. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  31. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  32. </div>
  33. <a-table
  34. ref="table"
  35. size="middle"
  36. :scroll="{x:true}"
  37. bordered
  38. rowKey="id"
  39. :columns="columns"
  40. :dataSource="dataSource"
  41. :pagination="ipagination"
  42. :loading="loading"
  43. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  44. class="j-table-force-nowrap"
  45. @change="handleTableChange">
  46. <template slot="htmlSlot" slot-scope="text">
  47. <div v-html="text"></div>
  48. </template>
  49. <template slot="imgSlot" slot-scope="text,record">
  50. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  51. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  52. </template>
  53. <template slot="fileSlot" slot-scope="text">
  54. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  55. <a-button
  56. v-else
  57. :ghost="true"
  58. type="primary"
  59. icon="download"
  60. size="small"
  61. @click="downloadFile(text)">
  62. 下载
  63. </a-button>
  64. </template>
  65. <span slot="action" slot-scope="text, record">
  66. <a @click="handleEdit(record)">编辑</a>
  67. <a-divider type="vertical" />
  68. <a @click="handleDetail(record)">详情</a>
  69. <a-divider type="vertical" />
  70. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  71. <a>删除</a>
  72. </a-popconfirm>
  73. <!-- <a-divider type="vertical" />
  74. <a-dropdown>
  75. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  76. <a-menu slot="overlay">
  77. <a-menu-item>
  78. <a @click="handleDetail(record)">详情</a>
  79. </a-menu-item>
  80. <a-menu-item>
  81. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  82. <a>删除</a>
  83. </a-popconfirm>
  84. </a-menu-item>
  85. </a-menu>
  86. </a-dropdown> -->
  87. </span>
  88. </a-table>
  89. </div>
  90. <elecfee-ratio-modal ref="modalForm" @ok="modalFormOk"></elecfee-ratio-modal>
  91. </a-card>
  92. </template>
  93. <script>
  94. import '@/assets/less/TableExpand.less'
  95. import { mixinDevice } from '@/utils/mixin'
  96. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  97. import ElecfeeRatioModal from './modules/ElecfeeRatioModal'
  98. export default {
  99. name: 'ElecfeeRatioList',
  100. mixins:[JeecgListMixin, mixinDevice],
  101. components: {
  102. ElecfeeRatioModal
  103. },
  104. data () {
  105. return {
  106. description: 'base_elecfee_ratio管理页面',
  107. // 表头
  108. columns: [
  109. {
  110. title: '序号',
  111. dataIndex: '',
  112. key:'rowIndex',
  113. width:60,
  114. align:"center",
  115. customRender:function (t,r,index) {
  116. return parseInt(index)+1;
  117. }
  118. },
  119. {
  120. title:'部门',
  121. align:"center",
  122. dataIndex: 'deptid_dictText',
  123. width: 200,
  124. },
  125. {
  126. title:'功率因数',
  127. align:"center",
  128. sorter: true,
  129. dataIndex: 'powerfactor',
  130. width: 150,
  131. },
  132. {
  133. title:'考核因数',
  134. align:"center",
  135. sorter: true,
  136. dataIndex: 'assessfactor',
  137. width: 150,
  138. },
  139. {
  140. title:'力调系数',
  141. align:"center",
  142. sorter: true,
  143. dataIndex: 'ratio',
  144. width: 150,
  145. },
  146. {
  147. title:'开始时间',
  148. align:"center",
  149. sorter: true,
  150. dataIndex: 'begintime',
  151. // customRender:function (text) {
  152. // return !text?"":(text.length>10?text.substr(0,10):text)
  153. // },
  154. width: 200,
  155. },
  156. {
  157. title:'结束时间',
  158. align:"center",
  159. sorter: true,
  160. dataIndex: 'endtime',
  161. // customRender:function (text) {
  162. // return !text?"":(text.length>10?text.substr(0,10):text)
  163. // },
  164. width: 200,
  165. },
  166. {
  167. title:'录入人',
  168. align:"center",
  169. dataIndex: 'createBy_dictText',
  170. },
  171. {
  172. title:'录入日期',
  173. align:"center",
  174. sorter: true,
  175. dataIndex: 'createTime',
  176. },
  177. {
  178. title:'备注',
  179. align:"center",
  180. dataIndex: 'remark'
  181. },
  182. {
  183. title: '操作',
  184. dataIndex: 'action',
  185. align:"center",
  186. fixed:"right",
  187. width:147,
  188. scopedSlots: { customRender: 'action' }
  189. }
  190. ],
  191. url: {
  192. list: "/elecfeeRatio/elecfeeRatio/list",
  193. delete: "/elecfeeRatio/elecfeeRatio/delete",
  194. deleteBatch: "/elecfeeRatio/elecfeeRatio/deleteBatch",
  195. exportXlsUrl: "/elecfeeRatio/elecfeeRatio/exportXls",
  196. importExcelUrl: "elecfeeRatio/elecfeeRatio/importExcel",
  197. },
  198. dictOptions:{},
  199. superFieldList:[],
  200. }
  201. },
  202. created() {
  203. this.getSuperFieldList();
  204. },
  205. computed: {
  206. importExcelUrl: function(){
  207. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  208. },
  209. },
  210. methods: {
  211. initDictConfig(){
  212. },
  213. getSuperFieldList(){
  214. let fieldList=[];
  215. fieldList.push({type:'int',value:'elecfeeratioid',text:'力调系数ID'})
  216. fieldList.push({type:'string',value:'remark',text:'备注'})
  217. fieldList.push({type:'int',value:'deptid',text:'部门ID'})
  218. fieldList.push({type:'number',value:'powerfactor',text:'功率因数'})
  219. fieldList.push({type:'number',value:'assessfactor',text:'考核因数'})
  220. fieldList.push({type:'number',value:'ratio',text:'力调系数'})
  221. fieldList.push({type:'date',value:'begintime',text:'开始时间'})
  222. fieldList.push({type:'date',value:'endtime',text:'结束时间'})
  223. this.superFieldList = fieldList
  224. }
  225. }
  226. }
  227. </script>
  228. <style scoped>
  229. @import '~@assets/less/common.less';
  230. </style>