Feedback.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <script setup lang="ts">
  2. import type { BasicForm, ICRUD } from '@/types/form'
  3. const CRUD: ICRUD = {
  4. create(data: any) {
  5. return Promise.resolve(data)
  6. },
  7. update(data: any) {
  8. return Promise.resolve(data)
  9. },
  10. getList() {
  11. return Promise.resolve()
  12. },
  13. delete(data: any) {
  14. return Promise.resolve(data)
  15. }
  16. }
  17. const formConfig = reactive<BasicForm>({
  18. span: 24,
  19. formItems: []
  20. })
  21. const dialogVisible = ref(false)
  22. const replyConfig = reactive<BasicForm>({
  23. span: 24,
  24. formItems: [
  25. {
  26. label: '回复内容',
  27. value: '',
  28. name: 'reply',
  29. type: 'input',
  30. rules: [{ required: true, message: '请输入回复内容', trigger: 'blur' }],
  31. props: {
  32. type: 'textarea'
  33. }
  34. }
  35. ]
  36. })
  37. const curQuestion = ref<any>(null)
  38. const formData = ref<any>({})
  39. const openDiolog = (row: any) => {
  40. dialogVisible.value = true
  41. curQuestion.value = row
  42. }
  43. const handleReply = () => {
  44. // 回复接口
  45. }
  46. </script>
  47. <template>
  48. <pro-table
  49. :formConfig="formConfig"
  50. :crud="CRUD"
  51. :selection="false"
  52. :showToolbar="false"
  53. :tableConfig="{ showOperate: false }"
  54. >
  55. <el-table-column prop="content" label="反馈内容"></el-table-column>
  56. <el-table-column prop="publishDate" label="反馈时间"></el-table-column>
  57. <el-table-column fixed="right" label="操作" width="100">
  58. <template #default="{ row }">
  59. <el-button link type="primary" size="small" @click="openDiolog(row)">回复</el-button>
  60. </template>
  61. </el-table-column>
  62. </pro-table>
  63. <dialog-form
  64. v-model="dialogVisible"
  65. :formConfig="replyConfig"
  66. :create="handleReply"
  67. :update="handleReply"
  68. :formData="formData"
  69. v-if="dialogVisible"
  70. />
  71. </template>
  72. <style lang="scss" scoped></style>