HwVersionList.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div class="page-header-index-wide">
  3. <a-card :bordered="false">
  4. <!-- 查询区域 -->
  5. <div class="table-page-search-wrapper">
  6. <a-form layout="inline" @keyup.enter.native="searchQuery">
  7. <a-row :gutter="24">
  8. </a-row>
  9. </a-form>
  10. </div>
  11. <!-- 查询区域-END -->
  12. <!-- 操作按钮区域 -->
  13. <div class="table-operator">
  14. <a-button @click="handleAdd" type="primary" icon="plus">新增版本</a-button>
  15. <!--<a-button type="primary" icon="download" @click="handleExportXls('版本')">导出</a-button>-->
  16. <!--<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
  17. <!--<a-button type="primary" icon="import">导入</a-button>-->
  18. <!--</a-upload>-->
  19. <!--<a-dropdown v-if="selectedRowKeys.length > 0">-->
  20. <!--<a-menu slot="overlay">-->
  21. <!--<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
  22. <!--</a-menu>-->
  23. <!--<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
  24. <!--</a-dropdown>-->
  25. </div>
  26. <!-- table区域-begin -->
  27. <div>
  28. <!--<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
  29. <!--<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项-->
  30. <!--<a style="margin-left: 24px" @click="onClearSelected">清空</a>-->
  31. <!--</div>-->
  32. <a-table
  33. ref="table"
  34. size="middle"
  35. bordered
  36. rowKey="id"
  37. :columns="columns"
  38. :dataSource="dataSource"
  39. :pagination="ipagination"
  40. :loading="loading"
  41. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  42. @change="handleTableChange">
  43. <template slot="imgSlot" slot-scope="text">
  44. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
  45. <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  46. </template>
  47. <template slot="fileSlot" slot-scope="text">
  48. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此文件</span>
  49. <a-button
  50. v-else
  51. :ghost="true"
  52. type="primary"
  53. icon="download"
  54. size="small"
  55. @click="uploadFile(text)">
  56. 下载
  57. </a-button>
  58. </template>
  59. <span slot="action" slot-scope="text, record">
  60. <a @click="handleEdit(record)">编辑</a>
  61. <a-divider type="vertical" />
  62. <a @click="detailVersion(record)">删除</a>
  63. </span>
  64. </a-table>
  65. </div>
  66. <hwVersion-modal ref="modalForm" @ok="modalFormOk"></hwVersion-modal>
  67. </a-card>
  68. </div>
  69. </template>
  70. <script>
  71. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  72. import HwVersionModal from './modules/HwVersionModal'
  73. import { getAction, deleteAction, putAction, postAction } from '@/api/manage'
  74. const detailVersion = (params) => putAction('/hwversion/hwVersion/detailVersion', params)
  75. export default {
  76. name: "HwVersionList",
  77. mixins:[JeecgListMixin],
  78. components: {
  79. HwVersionModal
  80. },
  81. data () {
  82. return {
  83. description: '版本管理页面',
  84. // 表头
  85. columns: [
  86. {
  87. title: '#',
  88. dataIndex: '',
  89. key:'rowIndex',
  90. width:60,
  91. align:"center",
  92. customRender:function (t,r,index) {
  93. return parseInt(index)+1;
  94. }
  95. },
  96. {
  97. title:'标识',
  98. align:"center",
  99. dataIndex: 'title'
  100. },
  101. {
  102. title:'版本号',
  103. align:"center",
  104. dataIndex: 'version'
  105. },
  106. {
  107. title:'是否强制更新',
  108. align:"center",
  109. dataIndex: 'isForceUpdate_dictText'
  110. },
  111. {
  112. title:'app系统',
  113. align:"center",
  114. dataIndex: 'appSystem_dictText'
  115. },
  116. {
  117. title: '操作',
  118. dataIndex: 'action',
  119. align:"center",
  120. scopedSlots: { customRender: 'action' },
  121. }
  122. ],
  123. url: {
  124. list: "/hwversion/hwVersion/list",
  125. delete: "/hwversion/hwVersion/delete",
  126. deleteBatch: "/hwversion/hwVersion/deleteBatch",
  127. exportXlsUrl: "/hwversion/hwVersion/exportXls",
  128. importExcelUrl: "hwversion/hwVersion/importExcel",
  129. },
  130. dictOptions:{
  131. }
  132. }
  133. },
  134. computed: {
  135. importExcelUrl: function(){
  136. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  137. }
  138. },
  139. methods: {
  140. initDictConfig(){
  141. },
  142. detailVersion(record){
  143. let that = this
  144. const modal =that.$confirm({
  145. title: '删除',
  146. closable:true,
  147. keyboard: false,
  148. maskClosable: true,
  149. content: '确定删除吗',
  150. okText: '确定',
  151. cancelText: '取消',
  152. onOk: function() {
  153. detailVersion({ id: record.id}).then((res) => {
  154. if (res.success) {
  155. that.$message.success(res.message)
  156. that.loadData()
  157. } else {
  158. that.$message.warning(res.message)
  159. }
  160. })
  161. },
  162. onCancel() {
  163. modal.destroy()
  164. }
  165. })
  166. }
  167. }
  168. }
  169. </script>
  170. <style scoped>
  171. @import '~@assets/less/common.less'
  172. </style>