XpRecycleBinModal.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <a-modal
  3. :width="1200"
  4. :title="title"
  5. v-model:open="visible"
  6. :destroyOnClose="true"
  7. @cancel="handleCancel"
  8. cancelText="关闭"
  9. :okButtonProps="{ style: { display: 'none' } }"
  10. >
  11. <a-form layout="inline" @keyup.enter.native="searchQuery" style="margin-bottom: 15px">
  12. <a-form-item>
  13. <a-input placeholder="邮箱/姓名" v-model="queryParam.searchText" />
  14. </a-form-item>
  15. <a-form-item>
  16. <a-button type="primary" @click="searchQuery">查询</a-button>
  17. <a-button @click="searchReset" style="margin-left: 8px">重置</a-button>
  18. </a-form-item>
  19. </a-form>
  20. <a-table ref="table" size="middle" :columns="columns" :loading="loading" :dataSource="dataSource">
  21. <!-- 显示头像 -->
  22. <template #avatarslot="text, record, index">
  23. <div class="anty-img-wrap">
  24. <a-avatar shape="square" :src="url.getAvatar(record.avatar)" icon="user" />
  25. </div>
  26. </template>
  27. <template #contactSlot="text, record">
  28. <div>
  29. <a-popover>
  30. <template #content>
  31. {{ text }}
  32. </template>
  33. <div style="width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ text }}</div>
  34. </a-popover>
  35. </div>
  36. </template>
  37. <template #action="text, record">
  38. <span>
  39. <a @click="enquiryDetail(record)"> 详情</a>
  40. </span>
  41. </template>
  42. </a-table>
  43. <!--询盘详情-->
  44. <enquiry-detail ref="enquiryDetail" />
  45. </a-modal>
  46. </template>
  47. <script lang="js">
  48. import { getAction } from '/@/api/manage/manage';
  49. import { JeecgListMixin } from '/@/hooks/component/JeecgListMixin';
  50. import enquiryDetail from '/@/views/adweb/enquiry/modules/enquiryDetail.vue';
  51. import { useMessage } from '@/hooks/web/useMessage';
  52. const { createMessage } = useMessage();
  53. export default {
  54. name: 'XpRecycleBinModal',
  55. components: { enquiryDetail },
  56. mixins: [JeecgListMixin],
  57. data() {
  58. return {
  59. title: '',
  60. loading: false,
  61. innerVisible: false,
  62. dataSource: [],
  63. visible: false,
  64. columns: [],
  65. url: {
  66. list: '/adweb/adwebEnquiry/getWastedEnquiry',
  67. },
  68. disableMixinCreated: true,
  69. ip: '',
  70. };
  71. },
  72. methods: {
  73. init(ip) {
  74. let that = this;
  75. that.columns = [
  76. { title: '站点名称', align: 'left', dataIndex: 'siteName', scopedSlots: { customRender: 'contactSlot' } },
  77. { title: '姓名', align: 'left', dataIndex: 'contact', scopedSlots: { customRender: 'contactSlot' } },
  78. { title: '邮箱', align: 'left', dataIndex: 'fromEmail', scopedSlots: { customRender: 'contactSlot' } },
  79. { title: '电话', align: 'left', dataIndex: 'phone' },
  80. { title: '询盘时间', align: 'left', dataIndex: 'recordCtime' },
  81. { title: '操作', align: 'center', dataIndex: 'action', scopedSlots: { customRender: 'action' } },
  82. ];
  83. that.ip = ip;
  84. that.loadData(ip);
  85. console.log(ip);
  86. that.visible = true;
  87. },
  88. //询盘详情
  89. enquiryDetail(record) {
  90. this.$nextTick(() => {
  91. this.$refs.enquiryDetail.init(record);
  92. });
  93. },
  94. searchQuery() {
  95. this.loadData(this.ip);
  96. },
  97. searchReset() {
  98. this.queryParam = {};
  99. this.loadData(this.ip);
  100. },
  101. handleCancel() {
  102. this.queryParam = {};
  103. this.visible = false;
  104. },
  105. loadData(ip) {
  106. if (!this.url.list) {
  107. createMessage.error('请设置url.list属性!');
  108. return;
  109. }
  110. var params = this.getQueryParams(); //查询条件
  111. this.loading = true;
  112. params.ip = ip;
  113. params.wasteEnquiryType = 'ip';
  114. getAction(this.url.list, params).then((res) => {
  115. if (res.success) {
  116. this.dataSource = res.result;
  117. }
  118. if (res.code === 510) {
  119. createMessage.warning(res.message);
  120. }
  121. this.loading = false;
  122. });
  123. },
  124. },
  125. };
  126. </script>
  127. <style lang="less" scoped></style>