TestDemo1List.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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('测试')">导出</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. <a-dropdown v-if="selectedRowKeys.length > 0">
  19. <a-menu slot="overlay">
  20. <!-- <a-menu-item key="1" ><a-icon @click="tijiao()" type="delete"/>提交流程</a-menu-item> -->
  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="{fixed:true,selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  42. @change="handleTableChange">
  43. <template slot="htmlSlot" slot-scope="text">
  44. <div v-html="text"></div>
  45. </template>
  46. <template slot="imgSlot" slot-scope="text">
  47. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
  48. <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  49. </template>
  50. <template slot="fileSlot" slot-scope="text">
  51. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此文件</span>
  52. <a-button
  53. v-else
  54. :ghost="true"
  55. type="primary"
  56. icon="download"
  57. size="small"
  58. @click="uploadFile(text)">
  59. 下载
  60. </a-button>
  61. </template>
  62. <span slot="action" slot-scope="text, record">
  63. <a @click="handleEdit(record)">编辑</a>
  64. <a-divider type="vertical" />
  65. <a-dropdown>
  66. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  67. <a-menu slot="overlay">
  68. <a-menu-item>
  69. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  70. <a>删除</a>
  71. </a-popconfirm>
  72. </a-menu-item>
  73. <a-menu-item>
  74. <a-popconfirm title="确定提交流程吗?" @confirm="() => tijiao(record.id)">
  75. <a>提交流程</a>
  76. </a-popconfirm>
  77. </a-menu-item>
  78. </a-menu>
  79. </a-dropdown>
  80. </span>
  81. </a-table>
  82. </div>
  83. <testDemo1-modal ref="modalForm" @ok="modalFormOk"></testDemo1-modal>
  84. </a-card>
  85. </template>
  86. <script>
  87. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  88. import TestDemo1Modal from './modules/TestDemo1Modal'
  89. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  90. export default {
  91. name: "TestDemo1List",
  92. mixins:[JeecgListMixin],
  93. components: {
  94. TestDemo1Modal
  95. },
  96. created(){
  97. // console.log(this.$route.query)
  98. // let str=this.$route.path
  99. // let index = str .lastIndexOf("?")
  100. // let id =str .substring(index+1,str.length);
  101. // console.log(id)
  102. // this.$router.push({ path: '/online/cgformList/' + id })
  103. },
  104. data () {
  105. return {
  106. description: '测试管理页面',
  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: 'bpmStatus'
  123. },
  124. {
  125. title:'名称',
  126. align:"center",
  127. dataIndex: 'name'
  128. },
  129. {
  130. title:'姓名',
  131. align:"center",
  132. dataIndex: 'sax'
  133. },
  134. {
  135. title: '操作',
  136. dataIndex: 'action',
  137. align:"center",
  138. scopedSlots: { customRender: 'action' }
  139. }
  140. ],
  141. url: {
  142. list: "/ceshi/testDemo1/list",
  143. delete: "/ceshi/testDemo1/delete",
  144. deleteBatch: "/ceshi/testDemo1/deleteBatch",
  145. exportXlsUrl: "/ceshi/testDemo1/exportXls",
  146. importExcelUrl: "ceshi/testDemo1/importExcel",
  147. },
  148. dictOptions:{},
  149. }
  150. },
  151. computed: {
  152. importExcelUrl: function(){
  153. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  154. }
  155. },
  156. methods: {
  157. initDictConfig(){
  158. },
  159. tijiao(id){
  160. let formData ={}
  161. formData.procDefId = "测试22:1:60007";
  162. formData.procDeTitle ="测试22";
  163. formData.tableName = "test_demo1";
  164. formData.tableId=id;
  165. this.postFormAction("/actBusiness/add",formData).then((res)=>{
  166. if (res.success){
  167. this.$message.success("保存成功!")
  168. // this.$emit('afterSubmit',formData)
  169. }else {
  170. this.$message.error(res.message)
  171. }
  172. }).finally(()=>{
  173. this.btndisabled = false;
  174. })
  175. }
  176. }
  177. }
  178. </script>
  179. <style scoped>
  180. @import '~@assets/less/common.less';
  181. </style>