questionnaireList.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <div class="page">
  3. <div class="top adfacjb">
  4. <div class="t_l">
  5. <p>问卷管理</p>
  6. <p class="tip">创建和管理PERILL评估问卷</p>
  7. </div>
  8. <div class="t_r">
  9. <el-button type="primary" icon="el-icon-plus">新增问卷</el-button>
  10. </div>
  11. </div>
  12. <div class="query adfacjb">
  13. <el-input placeholder="搜索问卷" prefix-icon="el-icon-search" v-model="queryParams.name" style="width: calc(100% - 448px);"></el-input>
  14. <el-select v-model="queryParams.type" placeholder="全部类型" style="width: 200px;"></el-select>
  15. <el-select v-model="queryParams.sort" placeholder="排序方式" style="width: 200px;"></el-select>
  16. </div>
  17. <div class="list">
  18. <el-table :data="dataList" border cell-class-name="vertical-top-cell" v-loading="loading" empty-text="暂无问卷" max-height="578px">
  19. <el-table-column label="序号" width="50">
  20. <template #default="scope">
  21. {{ scope.$index + 1 }}
  22. </template>
  23. </el-table-column>
  24. <el-table-column label="问卷标题" prop="aaa"></el-table-column>
  25. <el-table-column label="创建人" prop="aaa"></el-table-column>
  26. <el-table-column label="创建时间" prop="aaa"></el-table-column>
  27. <el-table-column label="问卷类型" prop="aaa"></el-table-column>
  28. <el-table-column label="操作" width="200">
  29. <template #default="scope">
  30. <el-button link type="text" size="mini" @click="handleRelease(scope.row)">发布问卷</el-button>
  31. <el-button link type="text" size="mini" @click="handleDetail(scope.row)">详情</el-button>
  32. <el-button link type="text" size="mini" @click="handleDelete(scope.row)">删除</el-button>
  33. </template>
  34. </el-table-column>
  35. </el-table>
  36. <el-row style="display: flex;justify-content: center;">
  37. <el-pagination
  38. @size-change="handleSizeChange"
  39. @current-change="handleCurrentChange"
  40. :current-page="queryParams.page"
  41. :page-sizes="[5, 10, 20, 50]"
  42. :page-size="10"
  43. layout="total, sizes, prev, pager, next, jumper"
  44. :total="total"
  45. v-show="total > 0">
  46. </el-pagination>
  47. </el-row>
  48. </div>
  49. </div>
  50. </template>
  51. <script setup name="">
  52. import { ref, getCurrentInstance } from 'vue'
  53. const { proxy } = getCurrentInstance();
  54. const queryParams = ref({
  55. page:1,
  56. limit:10,
  57. name: '',
  58. type: '',
  59. sort: ''
  60. })
  61. const dataList = ref([1,2,3])
  62. const total = ref(0)
  63. const loading = ref(false)
  64. const getList = async () => {
  65. let query = {...queryParams.value};
  66. loading.value = true;
  67. // const res = await listOrder(query);
  68. // userList.value = res.data.list;
  69. // total.value = res.data.total;
  70. loading.value = false;
  71. }
  72. const handleSizeChange = (e)=>{
  73. queryParams.value.limit = e;
  74. getList();
  75. }
  76. const handleCurrentChange = (e)=>{
  77. queryParams.value.page = e;
  78. getList();
  79. }
  80. const handleRelease = row => {
  81. proxy.$router.push({path:'/agentQuestionnairePublish'});
  82. }
  83. const handleDetail = row => {
  84. proxy.$router.push({path:'/agentQuestionnaireDetail'});
  85. }
  86. const handleDelete = row => {
  87. proxy.$confirm('确定删除该问卷吗?', '提示', {
  88. confirmButtonText: '确定',
  89. confirmButtonColor:'#761E6A',
  90. cancelButtonText: '取消',
  91. type: 'warning'
  92. }).then(() => {
  93. })
  94. }
  95. </script>
  96. <style scoped lang="scss">
  97. .page{
  98. padding: 28px 20px;
  99. background: #FAFAFA;
  100. .top{
  101. .t_l{
  102. p{
  103. font-family: PingFang-SC, PingFang-SC;
  104. font-weight: bold;
  105. font-size: 16px;
  106. color: #252525;
  107. line-height: 16px;
  108. &.tip{
  109. font-family: PingFangSC, PingFang SC;
  110. font-weight: 400;
  111. font-size: 14px;
  112. color: #6B7280;
  113. line-height: 14px;
  114. margin-top: 16px;
  115. }
  116. }
  117. }
  118. }
  119. .query{
  120. width: 100%;
  121. padding: 16px 20px;
  122. box-sizing: border-box;
  123. background: #FFFFFF;
  124. border-radius: 6px;
  125. border: 1px solid #F3F4F6;
  126. margin-top: 16px;
  127. }
  128. .list{
  129. width: 100%;
  130. height: calc(100vh - 204px);
  131. background: #FFFFFF;
  132. overflow-y: auto;
  133. margin-top: 12px;
  134. }
  135. }
  136. </style>