sceneList.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <PageWrapper contentBackground>
  3. <template #footer>
  4. <a-tabs v-model:activeKey="state" @change="changeTable">
  5. <a-tab-pane :key="0" tab="待处理" />
  6. <a-tab-pane :key="1" tab="已处理" />
  7. </a-tabs>
  8. </template>
  9. <div class="pt-4 m-4 desc-wrap">
  10. <BasicTable @register="registerTimeTable" >
  11. <template #action="{ record }">
  12. <TableAction
  13. stopButtonPropagation
  14. :actions="[
  15. {
  16. label: '发送',
  17. icon: 'icon-park-outline:door-handle',
  18. ifShow:record.state == 0,
  19. onClick: handleWithdraw.bind(null, record),
  20. },
  21. ]"
  22. />
  23. </template>
  24. </BasicTable>
  25. </div>
  26. <addMessgeModal @register="register" @update="reload" />
  27. </PageWrapper>
  28. </template>
  29. <script lang="ts">
  30. import { defineComponent, ref } from 'vue';
  31. import { BasicTable, useTable, TableAction, FormProps } from '/@/components/Table';
  32. import { PageWrapper } from '/@/components/Page';
  33. import { Divider, Card, Empty, Descriptions, Steps, Tabs } from 'ant-design-vue';
  34. import { intercomMessageList, intercomMessageHandle } from '/@/api/operate'
  35. import { sceneApplyList } from '/@/api/operate'
  36. import { useI18n } from '/@/hooks/web/useI18n';
  37. import addMessgeModal from './components/message/addModal.vue'
  38. import { useModal } from '/@/components/Modal';
  39. import { DMegaSchema, refundTimeTableData } from './data';
  40. import { useMessage } from '/@/hooks/web/useMessage';
  41. export default defineComponent({
  42. components: {
  43. BasicTable,
  44. PageWrapper,
  45. TableAction,
  46. addMessgeModal,
  47. [Divider.name]: Divider,
  48. [Card.name]: Card,
  49. Empty,
  50. [Descriptions.name]: Descriptions,
  51. [Descriptions.Item.name]: Descriptions.Item,
  52. [Steps.name]: Steps,
  53. [Steps.Step.name]: Steps.Step,
  54. [Tabs.name]: Tabs,
  55. [Tabs.TabPane.name]: Tabs.TabPane,
  56. },
  57. setup() {
  58. const { t } = useI18n();
  59. const { createConfirm, createMessage } = useMessage();
  60. const [register, { openModal }] = useModal();
  61. const state = ref<number>(0); //未处理,0已处理(默认1)
  62. const searchForm: Partial<FormProps> = {
  63. labelWidth: 100,
  64. schemas: [
  65. {
  66. field: 'payTime',
  67. label: '提交时间',
  68. component: 'RangePicker',
  69. componentProps: {
  70. maxLength: 100,
  71. format: 'YYYY-MM-DD HH:mm',
  72. showTime: true,
  73. },
  74. colProps: {
  75. xl: 11,
  76. xxl: 11,
  77. },
  78. },
  79. {
  80. field: 'companyName',
  81. label: '公司名称',
  82. component: 'Input',
  83. colProps: {
  84. xl: 6,
  85. xxl: 6,
  86. },
  87. },
  88. ],
  89. };
  90. const [registerTimeTable,{reload}] = useTable({
  91. api: sceneApplyList,
  92. // title: '',
  93. rowKey: 'id',
  94. fetchSetting: {
  95. pageField: 'pageNum',
  96. sizeField: 'pageSize',
  97. listField: 'list',
  98. totalField: 'total',
  99. },
  100. searchInfo: { handleState:state },
  101. columns: DMegaSchema,
  102. formConfig: searchForm,
  103. useSearchForm: true,
  104. dataSource: refundTimeTableData,
  105. showTableSetting: true,
  106. showIndexColumn: false,
  107. // pagination: { pageSize: 20 },
  108. // scroll: { y: 300 },
  109. beforeFetch:(params)=>{
  110. return {
  111. ...params,
  112. startTime: params.payTime && params.payTime[0],
  113. endTime: params.payTime && params.payTime[1],
  114. }
  115. },
  116. actionColumn: {
  117. width: 100,
  118. title: '操作',
  119. ifShow:state.value == 1,
  120. dataIndex: 'action',
  121. slots: { customRender: 'action' },
  122. },
  123. });
  124. function changeTable(val: string) {
  125. state.value = val;
  126. reload();
  127. }
  128. async function handleWithdraw(record: Recordable) {
  129. createConfirm({
  130. iconType: 'info',
  131. title: '发送邮件',
  132. content: `此操作将对${record.applicationName}进行删除, 是否继续?`,
  133. onOk: async () => {
  134. await buryPointDlt({ id: record.id });
  135. reload();
  136. createMessage.success(t('common.optSuccess'));
  137. },
  138. });
  139. // openModal(true,record)
  140. }
  141. return {
  142. registerTimeTable,
  143. handleWithdraw,
  144. changeTable,
  145. state,
  146. reload,
  147. register,
  148. openModal,
  149. };
  150. },
  151. });
  152. </script>