loglist.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <PageWrapper contentBackground>
  3. <!-- <template #footer>
  4. <a-tabs v-model:activeKey="language" @change="changeTable">
  5. <a-tab-pane key="cn" tab="Chinese" />
  6. <a-tab-pane key="en" tab="English" />
  7. </a-tabs>
  8. </template> -->
  9. <div class="desc-wrap-BasicTable">
  10. <BasicTable @register="registerTable"></BasicTable>
  11. </div>
  12. </PageWrapper>
  13. </template>
  14. <script lang="ts">
  15. import { defineComponent, h, ref, onMounted } from 'vue';
  16. import {
  17. BasicTable,
  18. useTable,
  19. TableAction,
  20. BasicColumn,
  21. TableImg,
  22. FormProps,
  23. } from '/@/components/Table';
  24. import { PageWrapper } from '/@/components/Page';
  25. import { Time } from '/@/components/Time';
  26. import { AgentLoglist } from '/@/api/dealer';
  27. import { Descriptions, Tabs } from 'ant-design-vue';
  28. import { useModal } from '/@/components/Modal';
  29. import { useI18n } from '/@/hooks/web/useI18n';
  30. import { useMessage } from '/@/hooks/web/useMessage';
  31. import { usePermissionStore } from '/@/store/modules/permission';
  32. import { useUserStore } from '/@/store/modules/user';
  33. import dayjs from 'dayjs';
  34. export default defineComponent({
  35. components: {
  36. BasicTable,
  37. TableAction,
  38. PageWrapper,
  39. TableImg,
  40. [Descriptions.name]: Descriptions,
  41. [Descriptions.Item.name]: Descriptions.Item,
  42. [Tabs.name]: Tabs,
  43. [Tabs.TabPane.name]: Tabs.TabPane,
  44. },
  45. setup() {
  46. const { t } = useI18n();
  47. const userStore = useUserStore();
  48. const iseur = userStore.isEnv;
  49. const { createMessage } = useMessage();
  50. const permissionStore = usePermissionStore();
  51. const { getCheckPerm } = permissionStore;
  52. const [register, { openModal }] = useModal();
  53. const language = ref<string>('cn'); //未处理,0已处理(默认1)
  54. const columns: BasicColumn[] = [
  55. {
  56. title: '经销商名称',
  57. dataIndex: 'agentName',
  58. ellipsis: true,
  59. width: 250,
  60. },
  61. {
  62. title: '账号',
  63. ellipsis: true,
  64. dataIndex: 'agentUserName',
  65. width: 120,
  66. },
  67. {
  68. title: '授权详情',
  69. ellipsis: true,
  70. dataIndex: 'majorAddNum',
  71. customRender: ({ record }) => {
  72. let streur = `专业会员${record.majorAddNum}年、高级会员${record.highAddNum}月、场景下载${record.downAddNum}次`
  73. let str = `专业会员${record.majorAddNum}年、场景下载${record.downAddNum}次`
  74. return iseur ? streur : str;
  75. },
  76. width: 250,
  77. },
  78. {
  79. title: '授权累计',
  80. ellipsis: true,
  81. customRender: ({ record }) => {
  82. let streur = `专业会员${record.majorAddNumTotal}年、高级会员${record.highAddNumTotal}月、场景下载${record.downAddNumTotal}次`
  83. let str = `专业会员${record.majorAddNumTotal}年、场景下载${record.downAddNumTotal}次`
  84. return iseur ? streur : str;
  85. },
  86. dataIndex: 'majorAddNumTotal',
  87. width: 250,
  88. },
  89. {
  90. title: '操作人',
  91. ellipsis: true,
  92. dataIndex: 'sysNickName',
  93. width: 120,
  94. },
  95. {
  96. title: '操作时间',
  97. ellipsis: true,
  98. dataIndex: 'updateTime',
  99. width: 120,
  100. },
  101. ];
  102. const searchForm: Partial<FormProps> = {
  103. labelWidth: 100,
  104. autoSubmitOnEnter: true,
  105. schemas: [
  106. {
  107. field: 'agentName',
  108. label: '经销商名称',
  109. component: 'Input',
  110. colProps: {
  111. xl: 7,
  112. xxl: 7,
  113. },
  114. },
  115. {
  116. field: 'agentUserName',
  117. label: '账户',
  118. component: 'Input',
  119. colProps: {
  120. xl: 7,
  121. xxl: 7,
  122. },
  123. },
  124. {
  125. field: 'sysNickName',
  126. label: '操作人',
  127. component: 'Input',
  128. colProps: {
  129. xl: 7,
  130. xxl: 7,
  131. },
  132. },
  133. ],
  134. };
  135. const [registerTable, { reload }] = useTable({
  136. api: AgentLoglist,
  137. title: '经销商授权记录列表',
  138. columns: columns,
  139. useSearchForm: true,
  140. formConfig: searchForm,
  141. showTableSetting: true,
  142. showIndexColumn: false,
  143. searchInfo: { language },
  144. rowKey: 'id',
  145. fetchSetting: {
  146. pageField: 'pageNum',
  147. sizeField: 'pageSize',
  148. listField: 'list',
  149. totalField: 'total',
  150. },
  151. beforeFetch: (T) => {
  152. if (T.timeList) {
  153. T.timeList[0] = dayjs(T.timeList[0]).format('YYYY-MM-DD');
  154. T.timeList[1] = dayjs(T.timeList[1]).format('YYYY-MM-DD');
  155. }
  156. return T;
  157. },
  158. canResize: true,
  159. });
  160. async function hendleAddNew() {
  161. await DownExport();
  162. console.log('新增新闻');
  163. }
  164. onMounted(() => {
  165. console.log('商家欧酷', dayjs().subtract(6, 'month'), dayjs())
  166. })
  167. return {
  168. registerTable,
  169. hendleAddNew,
  170. reload,
  171. language,
  172. register,
  173. openModal,
  174. getCheckPerm,
  175. };
  176. },
  177. });
  178. </script>