questionnaireManager.vue 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <div class="page">
  3. <el-table :data="dataList" border cell-class-name="vertical-top-cell" v-loading="loading" empty-text="暂无问卷管理" max-height="578px" style="margin-top: 18px;">
  4. <el-table-column label="序号" width="50">
  5. <template #default="scope">
  6. {{ scope.$index + 1 }}
  7. </template>
  8. </el-table-column>
  9. <el-table-column label="问卷名称" prop="title"></el-table-column>
  10. <el-table-column label="问卷类型" prop="">
  11. <template #default="scope">{{ typeCfg[scope.row.type]||'' }}</template>
  12. </el-table-column>
  13. <el-table-column label="团队名称" prop="teamName"></el-table-column>
  14. <el-table-column label="问卷状态" prop="">
  15. <template #default="scope">{{ statusCfg[scope.row.status]||'' }}</template>
  16. </el-table-column>
  17. <el-table-column label="创建时间" prop="createDate"></el-table-column>
  18. </el-table>
  19. <el-row style="display: flex;justify-content: center;">
  20. <el-pagination
  21. @size-change="handleSizeChange"
  22. @current-change="handleCurrentChange"
  23. :current-page="queryParams.page"
  24. :page-sizes="[5, 10, 20, 50]"
  25. :page-size="10"
  26. layout="total, sizes, prev, pager, next, jumper"
  27. :total="total"
  28. v-show="total > 0">
  29. </el-pagination>
  30. </el-row>
  31. </div>
  32. </template>
  33. <script setup name="">
  34. const props = defineProps({
  35. userId:{
  36. typeof:'String',
  37. default:''
  38. }
  39. });
  40. import { ref, getCurrentInstance, onMounted } from 'vue'
  41. const { proxy } = getCurrentInstance();
  42. import {
  43. getQuestionniareManagerList
  44. } from '@/api/agent/indexTwo.js'
  45. const queryParams = ref({
  46. page: 1,
  47. limit: 10,
  48. userId:''
  49. })
  50. const typeCfg = ref({
  51. 0: '我发布的',
  52. 1: '我收到的'
  53. })
  54. const statusCfg = ref({
  55. '-1': '已失效',
  56. 0: '待完成',
  57. 1: '已完成'
  58. })
  59. const dataList = ref([])
  60. const total = ref(0)
  61. const loading = ref(false)
  62. const handleSizeChange = (val) => {
  63. queryParams.value.limit = val;
  64. getList();
  65. }
  66. const handleCurrentChange = (val) => {
  67. queryParams.value.page = val;
  68. getList();
  69. }
  70. const getList = async () => {
  71. let query = JSON.parse(JSON.stringify(queryParams.value));
  72. loading.value = true;
  73. const res = await getQuestionniareManagerList(query);
  74. dataList.value = res.data.list;
  75. total.value = res.data.total;
  76. loading.value = false;
  77. }
  78. onMounted(() => {
  79. queryParams.value.userId = props.userId;
  80. getList();
  81. })
  82. </script>
  83. <style scoped lang="scss">
  84. </style>