otherPlatform.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div class="dataShare-other-platform-container layout-padding">
  3. <div class="layout-padding-auto layout-padding-view pd20">
  4. <ProTable
  5. ref="proTableRef"
  6. :columns="columns"
  7. :data="state.tableData"
  8. @updateTable="queryList"
  9. :loading="state.loading"
  10. :total="state.total"
  11. v-model:page-index="state.queryParams.PageIndex"
  12. v-model:page-size="state.queryParams.PageSize"
  13. >
  14. <template #table-search>
  15. <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
  16. <el-form-item label="时间段" prop="crTime">
  17. <el-date-picker
  18. v-model="state.queryParams.crTime"
  19. type="datetimerange"
  20. unlink-panels
  21. range-separator="至"
  22. start-placeholder="开始时间"
  23. end-placeholder="结束时间"
  24. :shortcuts="shortcuts"
  25. @change="handleQuery"
  26. value-format="YYYY-MM-DD[T]HH:mm:ss"
  27. :default-time="defaultTimeStartEnd"
  28. :clearable="false"
  29. />
  30. </el-form-item>
  31. <el-form-item label-width="0">
  32. <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
  33. <el-button @click="resetQuery(ruleFormRef)" class="default-button" :loading="state.loading">
  34. <SvgIcon name="ele-Refresh" class="mr5" />重置
  35. </el-button>
  36. </el-form-item>
  37. </el-form>
  38. </template>
  39. </ProTable>
  40. </div>
  41. </div>
  42. </template>
  43. <script setup lang="tsx" name="dataShareOtherPlatform">
  44. import { onMounted, reactive, ref } from 'vue';
  45. import { FormInstance } from 'element-plus';
  46. import { defaultDateTime, defaultTimeStartEnd, shortcuts } from "@/utils/constants";
  47. import { formatDate } from '@/utils/formatTime';
  48. import { getReceiveData } from '@/api/dataShare';
  49. import Other from "@/utils/other";
  50. const proTableRef = ref<RefType>(); // 表格ref
  51. // 表格配置项
  52. const columns = ref<any[]>([
  53. { prop: 'orderNo', label: '工单编码', align: 'center', width: 140 },
  54. { prop: 'source', label: '业务平台', align: 'center',width: 120 },
  55. { prop: 'platformsName', label: '平台名称', align: 'center',width: 120 },
  56. { prop: 'receiveData ', label: '原始数据', minWidth: 200, align: 'center' },
  57. { prop: 'operationType', label: '操作', align: 'center' },
  58. { prop: 'opinion', label: '办理意见', align: 'center' }
  59. ]);
  60. // 定义变量内容
  61. const ruleFormRef = ref<RefType>(); // 表单ref
  62. const state = reactive<any>({
  63. queryParams: {
  64. PageIndex: 1,
  65. PageSize: 20,
  66. // 查询条件
  67. crTime: defaultDateTime,
  68. StartTime:null,
  69. EndTime:null,
  70. CaseSerial:null
  71. },
  72. tableData: [], //表单
  73. loading: false, // 加载
  74. total: 0, // 总数
  75. });
  76. /** 搜索按钮操作 */
  77. const handleQuery = () => {
  78. // state.queryParams.PageIndex = 1;
  79. queryList();
  80. };
  81. /** 获取列表 */
  82. const queryList = () => {
  83. state.loading = true;
  84. let request = Other.deepClone(state.queryParams);
  85. request.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
  86. request.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
  87. Reflect.deleteProperty(request, 'crTime');
  88. getReceiveData(request)
  89. .then((res: any) => {
  90. state.tableData = res.result?.items ?? [];
  91. state.total = res.result?.total ?? 0;
  92. state.loading = false;
  93. })
  94. .catch(() => {
  95. state.loading = false;
  96. });
  97. };
  98. /** 重置按钮操作 */
  99. const resetQuery = (formEl: FormInstance | undefined) => {
  100. if (!formEl) return;
  101. formEl.resetFields();
  102. queryList();
  103. };
  104. onMounted(() => {
  105. queryList();
  106. });
  107. </script>