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. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  42. </div>
  43. <a-table
  44. size="middle"
  45. bordered
  46. row-key="id"
  47. :columns="columns"
  48. :data-source="dataSource"
  49. :pagination="ipagination"
  50. :loading="loading"
  51. :row-selection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  52. @change="handleTableChange"
  53. >
  54. <template slot="action" slot-scope="text, record">
  55. <a @click="handleEdit(record)">编辑</a>
  56. <a-divider type="vertical" />
  57. <a-dropdown>
  58. <a class="ant-dropdown-link">更多<a-icon type="down" /></a>
  59. <a-menu slot="overlay">
  60. <a-menu-item>
  61. <a @click="goPageOnline(record.templetCode)">功能测试</a>
  62. </a-menu-item>
  63. <a-menu-item>
  64. <a @click="handleOnlineUrlShow(record)">配置地址</a>
  65. </a-menu-item>
  66. <a-menu-item>
  67. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  68. <a>删除</a>
  69. </a-popconfirm>
  70. </a-menu-item>
  71. </a-menu>
  72. </a-dropdown>
  73. </template>
  74. </a-table>
  75. </div>
  76. <!-- 提示online报表链接 -->
  77. <config-url-modal :url="onlineUrl" ref="onlineUrlModal"></config-url-modal>
  78. <!-- 编辑弹窗区域 -->
  79. <onl-graphreport-templet-modal ref="modalForm" @modalFormOk="modalFormOk"></onl-graphreport-templet-modal>
  80. </a-card>
  81. </template>
  82. <script>
  83. import { initDictOptions, filterDictText } from '@/components/dict/JDictSelectUtil'
  84. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  85. import JEllipsis from '@/components/jeecg/JEllipsis'
  86. import onlGraphreportTempletModal from './modal/OnlGraphreportTempletModal'
  87. import ConfigUrlModal from '@/components/custom/ConfigUrlModal'
  88. export default {
  89. name: 'OnlGraphreportTempletList',
  90. components: {
  91. JEllipsis,
  92. onlGraphreportTempletModal,
  93. ConfigUrlModal
  94. },
  95. mixins: [JeecgListMixin],
  96. data() {
  97. // const ellipsis = (v, l = 40) => (`<j-ellipsis value={v} length={l}/>`)
  98. return {
  99. // 表头
  100. columns: [
  101. {
  102. title: '#',
  103. dataIndex: '',
  104. key: 'rowIndex',
  105. width: 60,
  106. align: 'center',
  107. customRender: function(t, r, index) {
  108. return parseInt(index) + 1
  109. }
  110. },
  111. {
  112. title: '组合报表名称',
  113. align: 'center',
  114. dataIndex: 'templetName'
  115. },
  116. {
  117. title: '组合报表编码',
  118. align: 'center',
  119. dataIndex: 'templetCode'
  120. },
  121. {
  122. title: '组合报表风格',
  123. align: 'center',
  124. dataIndex: 'templetStyle',
  125. customRender: (text, record) => {
  126. const tbTypeText = filterDictText(this.graphDisplayTemplate, `${text}`)
  127. return tbTypeText
  128. }
  129. },
  130. {
  131. title: '操作',
  132. dataIndex: 'action',
  133. align: 'center',
  134. scopedSlots: { customRender: 'action' }
  135. }
  136. ],
  137. url: {
  138. list: '/diagram/diagramCombination/list',
  139. deleteBatch: '/diagram/diagramCombination/deleteBatch',
  140. delete: '/diagram/diagramCombination/delete',
  141. importExcelUrl: '/sys/fillRule/importExcel',
  142. exportXlsUrl: '/sys/fillRule/exportXls'
  143. },
  144. onlineUrl: '',
  145. graphDisplayTemplate: []
  146. }
  147. },
  148. created() {
  149. // 初始化字典 - 图表类型
  150. initDictOptions('online_graph_display_template').then((res) => {
  151. if (res.success) {
  152. this.graphDisplayTemplate = res.result
  153. }
  154. })
  155. },
  156. methods: {
  157. goPageOnline(code) {
  158. this.$router.push({ path: '/online/cggraphreport/templet/' + code })
  159. },
  160. handleOnlineUrlShow(record) {
  161. this.onlineUrl = `/online/cggraphreport/templet/${record.templetCode}`
  162. this.$refs.onlineUrlModal.onlineUrlVisible = true
  163. // this.onlineUrlVisible = true
  164. },
  165. importExcelUrl() {
  166. return `${window._CONFIG['domianURL']}${this.url.importExcelUrl}`
  167. }
  168. }
  169. }
  170. </script>
  171. <style scoped>
  172. @import '~@assets/less/common.less';
  173. </style>
  174. <style lang="less">
  175. </style>