6a5aa71b88831a0a9b1392089ffb98b043facc01.svn-base 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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 v-model="queryParam.templetName" placeholder="请输入图表名称"/>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  14. <a-button type="primary" icon="search" @click="searchQuery">查询</a-button>
  15. <a-button type="primary" icon="reload" style="margin-left: 8px" @click="searchReset">重置</a-button>
  16. </span>
  17. </a-col>
  18. </a-row>
  19. </a-form>
  20. </div>
  21. <!-- 操作按钮区域 -->
  22. <div class="table-operator">
  23. <a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
  24. <a-button type="primary" icon="download" @click="handleExportXls('在线图表')">导出</a-button>
  25. <a-upload name="file" :show-upload-list="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  26. <a-button type="primary" icon="import" >导入</a-button>
  27. </a-upload>
  28. <a-dropdown v-if="selectedRowKeys.length > 0">
  29. <a-menu slot="overlay">
  30. <a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
  31. </a-menu>
  32. <a-button>批量操作<a-icon type="down" /></a-button>
  33. </a-dropdown>
  34. </div>
  35. <!-- table区域-begin -->
  36. <div>
  37. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  38. <i class="anticon anticon-info-circle ant-alert-icon" />
  39. 已选择
  40. <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
  41. 项
  42. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  43. </div>
  44. <a-table
  45. size="middle"
  46. bordered
  47. row-key="id"
  48. :columns="columns"
  49. :data-source="dataSource"
  50. :pagination="ipagination"
  51. :loading="loading"
  52. :row-selection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  53. @change="handleTableChange"
  54. >
  55. <template slot="action" slot-scope="text, record">
  56. <a @click="handleEdit(record)">编辑</a>
  57. <a-divider type="vertical" />
  58. <a-dropdown>
  59. <a class="ant-dropdown-link">更多<a-icon type="down" /></a>
  60. <a-menu slot="overlay">
  61. <a-menu-item>
  62. <a @click="goPageOnline(record.templetCode)">功能测试</a>
  63. </a-menu-item>
  64. <a-menu-item>
  65. <a @click="handleOnlineUrlShow(record)">配置地址</a>
  66. </a-menu-item>
  67. <a-menu-item>
  68. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  69. <a>删除</a>
  70. </a-popconfirm>
  71. </a-menu-item>
  72. </a-menu>
  73. </a-dropdown>
  74. </template>
  75. </a-table>
  76. </div>
  77. <!-- 提示online报表链接 -->
  78. <config-url-modal :url="onlineUrl" ref="onlineUrlModal"></config-url-modal>
  79. <!-- 编辑弹窗区域 -->
  80. <onl-graphreport-templet-modal ref="modalForm" @modalFormOk="modalFormOk"></onl-graphreport-templet-modal>
  81. </a-card>
  82. </template>
  83. <script>
  84. import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'
  85. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  86. import JEllipsis from '@/components/jeecg/JEllipsis'
  87. import onlGraphreportTempletModal from './modal/OnlGraphreportTempletModal'
  88. import ConfigUrlModal from '@/components/custom/ConfigUrlModal'
  89. export default {
  90. name: 'OnlGraphreportTempletList',
  91. components: {
  92. JEllipsis,
  93. onlGraphreportTempletModal,
  94. ConfigUrlModal
  95. },
  96. mixins: [JeecgListMixin],
  97. data() {
  98. // const ellipsis = (v, l = 40) => (`<j-ellipsis value={v} length={l}/>`)
  99. return {
  100. // 表头
  101. columns: [
  102. {
  103. title: '#',
  104. dataIndex: '',
  105. key: 'rowIndex',
  106. width: 60,
  107. align: 'center',
  108. customRender: function(t, r, index) {
  109. return parseInt(index) + 1
  110. }
  111. },
  112. {
  113. title: '组合报表名称',
  114. align: 'center',
  115. dataIndex: 'templetName'
  116. },
  117. {
  118. title: '组合报表编码',
  119. align: 'center',
  120. dataIndex: 'templetCode'
  121. },
  122. {
  123. title: '组合报表风格',
  124. align: 'center',
  125. dataIndex: 'templetStyle',
  126. customRender: (text, record) => {
  127. const tbTypeText = filterDictText(this.graphDisplayTemplate, `${text}`)
  128. return tbTypeText
  129. }
  130. },
  131. {
  132. title: '操作',
  133. dataIndex: 'action',
  134. align: 'center',
  135. scopedSlots: { customRender: 'action' }
  136. }
  137. ],
  138. url: {
  139. list: '/diagram/diagramCombination/list',
  140. deleteBatch: '/diagram/diagramCombination/deleteBatch',
  141. delete: '/diagram/diagramCombination/delete',
  142. importExcelUrl: '/sys/fillRule/importExcel',
  143. exportXlsUrl: '/sys/fillRule/exportXls'
  144. },
  145. onlineUrl: '',
  146. graphDisplayTemplate: []
  147. }
  148. },
  149. created() {
  150. // 初始化字典 - 图表类型
  151. initDictOptions('online_graph_display_template').then((res) => {
  152. if (res.success) {
  153. this.graphDisplayTemplate = res.result
  154. }
  155. })
  156. },
  157. methods: {
  158. goPageOnline(code) {
  159. this.$router.push({ path: '/online/cggraphreport/templet/' + code })
  160. },
  161. handleOnlineUrlShow(record) {
  162. this.onlineUrl = `/online/cggraphreport/templet/${record.templetCode}`
  163. this.$refs.onlineUrlModal.onlineUrlVisible = true
  164. // this.onlineUrlVisible = true
  165. },
  166. importExcelUrl() {
  167. return `${window._CONFIG['domianURL']}${this.url.importExcelUrl}`
  168. }
  169. }
  170. }
  171. </script>
  172. <style scoped>
  173. @import '~@assets/less/common.less';
  174. </style>
  175. <style lang="less">
  176. </style>