<script setup lang="ts">
// import { getProList } from '../api'
import ReplyDialog from '../components/ReplyDialog.vue'
const appList = ref()
const isShowReplyDialog = ref(false)
const listOptions = computed(() => {
  return {
    // remote: { httpRequest: getProList, params: { name: '' } },
    filters: [
      { type: 'select', prop: 'name', label: '所属课程：', placeholder: '所属课程' },
      { type: 'select', prop: 'name', label: '所属班级：', placeholder: '所属班级' },
      { type: 'select', prop: 'name', label: '所属学生：', placeholder: '所属学生' },
      { type: 'input', prop: 'name', label: '问题内容：', placeholder: '问题内容' }
    ],
    columns: [
      { label: '序号', type: 'index', align: 'center', width: '100px' },
      { label: '所属课程', prop: 'course_name', align: 'center' },
      { label: '提问人', prop: 'name', align: 'center' },
      { label: '所属班级', prop: 'class_name', align: 'center' },
      { label: '问题类型', prop: 'type', align: 'center' },
      { label: '问题标题', prop: 'title', align: 'center' },
      { label: '是否回复', prop: 'reply_status', align: 'center' },
      { label: '更新时间', prop: 'updated_time', align: 'center' },
      { label: '操作', slots: 'table-operate', align: 'center', fixed: 'right' }
    ]
    // data: [
    //   {
    //     name: '111'
    //   }
    // ]
  }
})
const handleReply = () => {
  isShowReplyDialog.value = true
}
</script>

<template>
  <AppCard title="问答管理">
    <AppList v-bind="listOptions" ref="appList" border stripe>
      <template #table-operate>
        <el-space>
          <el-link type="primary" plain @click="handleReply">添加回复</el-link>
        </el-space>
      </template>
    </AppList>
  </AppCard>
  <ReplyDialog v-model:isShowReplyDialog="isShowReplyDialog" v-if="isShowReplyDialog" />
</template>
