Bläddra i källkod

feat():意见列表

geek 4 år sedan
förälder
incheckning
82913b91b2

+ 40 - 0
src/api/advice.js

@@ -0,0 +1,40 @@
+import request from '@/utils/request'
+
+export function fetchList(query) {
+  return request({
+    url: '/advice/index',
+    method: 'get',
+    params: query
+  })
+}
+
+export function fetchAdvice(id) {
+  return request({
+    url: '/advice/read',
+    method: 'get',
+    params: { id }
+  })
+}
+
+export function createAdvice(data) {
+  return request({
+    url: '/advice/save',
+    method: 'post',
+    data
+  })
+}
+
+export function updateAdvice(data) {
+  return request({
+    url: '/advice/update?id=' + data.id,
+    method: 'post',
+    data
+  })
+}
+
+export function deleteAdvice(id) {
+  return request({
+    url: '/advice/delete?id=' + id,
+    method: 'get'
+  })
+}

+ 40 - 0
src/api/question.js

@@ -0,0 +1,40 @@
+import request from '@/utils/request'
+
+export function fetchList(query) {
+  return request({
+    url: '/advice/index',
+    method: 'get',
+    params: query
+  })
+}
+
+export function fetchQuestion(id) {
+  return request({
+    url: '/advice/read',
+    method: 'get',
+    params: { id }
+  })
+}
+
+export function createQuestion(data) {
+  return request({
+    url: '/advice/save',
+    method: 'post',
+    data
+  })
+}
+
+export function updateQuestion(data) {
+  return request({
+    url: '/advice/update?id=' + data.id,
+    method: 'post',
+    data
+  })
+}
+
+export function deleteQuestion(id) {
+  return request({
+    url: '/advice/delete?id=' + id,
+    method: 'get'
+  })
+}

+ 50 - 0
src/router/index.js

@@ -109,6 +109,25 @@ export const constantRoutes = [
     ]
   },
   {
+    path: '/advice',
+    component: Layout,
+    children: [
+      {
+        path: 'list',
+        name: 'advice',
+        component: () => import('@/views/advice/list'),
+        meta: { title: '意见列表', icon: 'el-icon-s-help' }
+      },
+      {
+        path: 'edit/:id(\\d+)',
+        name: 'editAdvice',
+        component: () => import('@/views/advice/edit'),
+        meta: { title: '查看意见', icon: 'el-icon-s-help' },
+        hidden: true
+      }
+    ]
+  },
+  {
     path: '/banner',
     component: Layout,
     redirect: '/banner/list',
@@ -140,6 +159,37 @@ export const constantRoutes = [
     ]
   },
   {
+    path: '/question',
+    component: Layout,
+    redirect: '/banner/list',
+    name: 'question',
+    meta: {
+      title: '常见疑问设置',
+      icon: 'el-icon-s-help'
+    },
+    children: [
+      {
+        path: 'create',
+        component: () => import('@/views/question/create'),
+        name: 'CreateQuestion',
+        meta: { title: '创建疑问', icon: 'el-icon-edit' }
+      },
+      {
+        path: 'edit/:id(\\d+)',
+        component: () => import('@/views/question/edit'),
+        name: 'EditBanner',
+        meta: { title: '修改疑问', noCache: true, activeMenu: '/question/list' },
+        hidden: true
+      },
+      {
+        path: 'list',
+        component: () => import('@/views/question/list'),
+        name: 'BannerList',
+        meta: { title: '常见疑问列表', icon: 'el-icon-s-order' }
+      }
+    ]
+  },
+  {
     path: '/user',
     component: Layout,
     redirect: '/user/list',

+ 200 - 0
src/views/advice/components/ArticleDetail.vue

@@ -0,0 +1,200 @@
+<template>
+  <div class="createPost-container">
+    <el-form ref="postForm" :label-position="labelPosition" :model="postForm" :rules="rules" class="form-container">
+      <div class="createPost-main-container">
+        <el-form-item prop="advice" style="" label="建议">
+          <el-input v-model="postForm.advice" placeholder="" style="width: 600px;" type="textarea" :rows="2" />
+        </el-form-item>
+        <el-form-item prop="mobile" style="" label="手机号">
+          <el-input v-model="postForm.mobile" placeholder="" style="width: 300px;" />
+        </el-form-item>
+        <el-form-item prop="user_id" style="" label="用户id">
+          <el-input v-model="postForm.user_id" placeholder="" style="width: 100px;" />
+        </el-form-item>
+        <el-row>
+          <el-button v-if="!isEdit" v-loading="loading" type="success" @click="submitForm">
+            提交
+          </el-button>
+          <el-button v-if="isEdit" v-loading="loading" type="success" @click="updateArticle">
+            修改
+          </el-button>
+        </el-row>
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+// import Sticky from '@/components/Sticky' // 粘性header组件
+// import { validURL } from '@/utils/validate'
+import { fetchAdvice, createAdvice, updateAdvice } from '@/api/advice'
+import { searchUser } from '@/api/remote-search'
+// import { CommentDropdown, PlatformDropdown, SourceUrlDropdown } from './Dropdown'
+
+const defaultForm = {
+  status: 'draft',
+  title: '', // 文章题目
+  content: '', // 文章内容
+  content_short: '', // 文章摘要
+  video_url: '', // 文章外链
+  cover_img: '', // 文章图片
+  display_time: undefined, // 前台展示时间
+  id: undefined,
+  platforms: ['a-platform'],
+  comment_disabled: false,
+  importance: 0
+}
+
+export default {
+  name: 'ArticleDetail',
+  components: { },
+  props: {
+    isEdit: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      postForm: Object.assign({}, defaultForm),
+      loading: false,
+      userListOptions: [],
+      rules: {
+      },
+      tempRoute: {},
+      labelPosition: 'top'
+    }
+  },
+  computed: {
+    contentShortLength() {
+      return this.postForm.content_short.length
+    },
+    displayTime: {
+      // set and get is useful when the data
+      // returned by the back end api is different from the front end
+      // back end return => "2013-06-25 06:59:25"
+      // front end need timestamp => 1372114765000
+      get() {
+        return (+new Date(this.postForm.display_time))
+      },
+      set(val) {
+        this.postForm.display_time = new Date(val)
+      }
+    }
+  },
+  created() {
+    if (this.isEdit) {
+      const id = this.$route.params && this.$route.params.id
+      this.fetchData(id)
+    }
+    // Why need to make a copy of this.$route here?
+    // Because if you enter this page and quickly switch tag, may be in the execution of the setTagsViewTitle function, this.$route is no longer pointing to the current page
+    // https://github.com/PanJiaChen/vue-element-admin/issues/1221
+    this.tempRoute = Object.assign({}, this.$route)
+  },
+  methods: {
+    fetchData(id) {
+      fetchAdvice(id).then(response => {
+        this.postForm = response.data.info
+        // set tags view title
+        // this.setTagsViewTitle()
+        // set page title
+        // this.setPageTitle()
+      }).catch(err => {
+        console.log(err)
+      })
+    },
+    setPageTitle() {
+      const title = 'Edit Article'
+      document.title = `${title} - ${this.postForm.id}`
+    },
+    submitForm() {
+      this.$refs.postForm.validate(valid => {
+        if (valid) {
+          this.$router.push(`/advice/list`)
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    updateArticle() {
+      console.log(this.postForm)
+      // updateAdvice(this.postForm).then(response => {
+      //   this.$notify({
+      //     title: '修改',
+      //     message: '修改成功',
+      //     type: 'success',
+      //     duration: 2000
+      //   })
+      //   this.postForm.status = 'published'
+      //   this.loading = false
+      //   this.listLoading = false
+      //   this.$router.push(`/advice/list`)
+      // })
+      this.$router.push(`/advice/list`)
+    },
+    draftForm() {
+      if (this.postForm.content.length === 0 || this.postForm.title.length === 0) {
+        this.$message({
+          message: '请填写必要的标题和内容',
+          type: 'warning'
+        })
+        return
+      }
+      this.$message({
+        message: '保存成功',
+        type: 'success',
+        showClose: true,
+        duration: 1000
+      })
+      this.postForm.status = 'draft'
+    },
+    getRemoteUserList(query) {
+      searchUser(query).then(response => {
+        if (!response.data.items) return
+        this.userListOptions = response.data.items.map(v => v.name)
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import "~@/styles/mixin.scss";
+
+.createPost-container {
+  position: relative;
+
+  .createPost-main-container {
+    padding: 40px 45px 20px 50px;
+
+    .postInfo-container {
+      position: relative;
+      @include clearfix;
+      margin-bottom: 10px;
+
+      .postInfo-container-item {
+        float: left;
+      }
+    }
+  }
+
+  .word-counter {
+    width: 40px;
+    position: absolute;
+    right: 10px;
+    top: 0px;
+  }
+}
+
+.article-textarea ::v-deep {
+  textarea {
+    padding-right: 40px;
+    resize: none;
+    border: none;
+    border-radius: 0px;
+    border-bottom: 1px solid #bfcbd9;
+  }
+}
+</style>

+ 41 - 0
src/views/advice/components/Dropdown/Comment.vue

@@ -0,0 +1,41 @@
+<template>
+  <el-dropdown :show-timeout="100" trigger="click">
+    <el-button plain>
+      {{ !comment_disabled?'Comment: opened':'Comment: closed' }}
+      <i class="el-icon-caret-bottom el-icon--right" />
+    </el-button>
+    <el-dropdown-menu slot="dropdown" class="no-padding">
+      <el-dropdown-item>
+        <el-radio-group v-model="comment_disabled" style="padding: 10px;">
+          <el-radio :label="true">
+            Close comment
+          </el-radio>
+          <el-radio :label="false">
+            Open comment
+          </el-radio>
+        </el-radio-group>
+      </el-dropdown-item>
+    </el-dropdown-menu>
+  </el-dropdown>
+</template>
+
+<script>
+export default {
+  props: {
+    value: {
+      type: Boolean,
+      default: false
+    }
+  },
+  computed: {
+    comment_disabled: {
+      get() {
+        return this.value
+      },
+      set(val) {
+        this.$emit('input', val)
+      }
+    }
+  }
+}
+</script>

+ 46 - 0
src/views/advice/components/Dropdown/Platform.vue

@@ -0,0 +1,46 @@
+<template>
+  <el-dropdown :hide-on-click="false" :show-timeout="100" trigger="click">
+    <el-button plain>
+      Platfroms({{ platforms.length }})
+      <i class="el-icon-caret-bottom el-icon--right" />
+    </el-button>
+    <el-dropdown-menu slot="dropdown" class="no-border">
+      <el-checkbox-group v-model="platforms" style="padding: 5px 15px;">
+        <el-checkbox v-for="item in platformsOptions" :key="item.key" :label="item.key">
+          {{ item.name }}
+        </el-checkbox>
+      </el-checkbox-group>
+    </el-dropdown-menu>
+  </el-dropdown>
+</template>
+
+<script>
+export default {
+  props: {
+    value: {
+      required: true,
+      default: () => [],
+      type: Array
+    }
+  },
+  data() {
+    return {
+      platformsOptions: [
+        { key: 'a-platform', name: 'a-platform' },
+        { key: 'b-platform', name: 'b-platform' },
+        { key: 'c-platform', name: 'c-platform' }
+      ]
+    }
+  },
+  computed: {
+    platforms: {
+      get() {
+        return this.value
+      },
+      set(val) {
+        this.$emit('input', val)
+      }
+    }
+  }
+}
+</script>

+ 38 - 0
src/views/advice/components/Dropdown/SourceUrl.vue

@@ -0,0 +1,38 @@
+<template>
+  <el-dropdown :show-timeout="100" trigger="click">
+    <el-button plain>
+      Link
+      <i class="el-icon-caret-bottom el-icon--right" />
+    </el-button>
+    <el-dropdown-menu slot="dropdown" class="no-padding no-border" style="width:400px">
+      <el-form-item label-width="0px" style="margin-bottom: 0px" prop="source_uri">
+        <el-input v-model="source_uri" placeholder="Please enter the content">
+          <template slot="prepend">
+            URL
+          </template>
+        </el-input>
+      </el-form-item>
+    </el-dropdown-menu>
+  </el-dropdown>
+</template>
+
+<script>
+export default {
+  props: {
+    value: {
+      type: String,
+      default: ''
+    }
+  },
+  computed: {
+    source_uri: {
+      get() {
+        return this.value
+      },
+      set(val) {
+        this.$emit('input', val)
+      }
+    }
+  }
+}
+</script>

+ 3 - 0
src/views/advice/components/Dropdown/index.js

@@ -0,0 +1,3 @@
+export { default as CommentDropdown } from './Comment'
+export { default as PlatformDropdown } from './Platform'
+export { default as SourceUrlDropdown } from './SourceUrl'

+ 9 - 0
src/views/advice/components/Warning.vue

@@ -0,0 +1,9 @@
+<template>
+  <aside>
+    <!--<a
+      href="https://panjiachen.github.io/vue-element-admin-site/guide/essentials/tags-view.html"
+      target="_blank"
+    >Document</a>-->
+  </aside>
+</template>
+

+ 13 - 0
src/views/advice/create.vue

@@ -0,0 +1,13 @@
+<template>
+  <article-detail :is-edit="false" />
+</template>
+
+<script>
+import ArticleDetail from './components/ArticleDetail'
+
+export default {
+  name: 'CreateArticle',
+  components: { ArticleDetail }
+}
+</script>
+

+ 13 - 0
src/views/advice/edit.vue

@@ -0,0 +1,13 @@
+<template>
+  <article-detail :is-edit="true" />
+</template>
+
+<script>
+import ArticleDetail from './components/ArticleDetail'
+
+export default {
+  name: 'EditForm',
+  components: { ArticleDetail }
+}
+</script>
+

+ 139 - 0
src/views/advice/list.vue

@@ -0,0 +1,139 @@
+<template>
+  <div class="app-container">
+    <div class="filter-container">
+<!--      <el-input v-model="listQuery.question" placeholder="问题" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />-->
+<!--      <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">-->
+<!--        Search-->
+<!--      </el-button>-->
+    </div>
+    <el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
+      <el-table-column align="center" label="ID" width="80">
+        <template slot-scope="scope">
+          <span>{{ scope.row.id }}</span>
+        </template>
+      </el-table-column>
+
+      <el-table-column width="180px" align="center" label="日期">
+        <template slot-scope="scope">
+          <span>{{ scope.row.create_time }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column class-name="status-col" label="状态" width="80ß">
+        <template slot-scope="{row}">
+          <el-tag :type="row.status | statusFilter">
+            {{ row.status == '1' ? "正常" : "删除" }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column min-width="300px" label="问题">
+        <template slot-scope="{row}">
+          <router-link :to="'/advice/edit/'+row.id" class="link-type">
+            <span>{{ row.advice }}</span>
+          </router-link>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="Actions" width="190" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <router-link :to="'/advice/edit/'+scope.row.id">
+            <el-button type="primary" size="mini" icon="el-icon-edit">
+              修改
+            </el-button>
+          </router-link>
+          <el-button type="danger" size="mini" icon="el-icon-delete" style="margin-left: 10px;" @click="handleDelete(scope)">
+            删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.pageSize" @pagination="getList" />
+  </div>
+</template>
+
+<script>
+import { fetchList, deleteAdvice } from '@/api/advice'
+import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
+import waves from '@/directive/waves'
+
+export default {
+  name: 'ArticleList',
+  components: { Pagination },
+  directives: { waves },
+  filters: {
+    statusFilter(status) {
+      const statusMap = {
+        normal: 'success',
+        draft: 'info',
+        deleted: 'danger'
+      }
+      return statusMap[status]
+    }
+  },
+  data() {
+    return {
+      list: null,
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        pageSize: 10
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    getList() {
+      this.listLoading = true
+      fetchList(this.listQuery).then(response => {
+        this.list = response.data.list
+        this.total = response.data.count
+        this.listLoading = false
+      })
+    },
+    handleFilter() {
+      this.listLoading = true
+      fetchList(this.listQuery).then(response => {
+        this.list = response.data.list
+        this.total = response.data.count
+        this.listLoading = false
+      })
+    },
+    handleDelete({ $index, row }) {
+      console.log(row.id)
+      this.$confirm('您确定要删除吗', '警告', {
+        confirmButtonText: '是的',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(async() => {
+          await deleteAdvice(row.id)
+          this.list.splice($index, 1)
+          this.$message({
+            type: 'success',
+            message: '删除成功'
+          })
+        })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.edit-input {
+  padding-right: 100px;
+}
+.cancel-btn {
+  position: absolute;
+  right: 15px;
+  top: 10px;
+}
+.filter-container{
+  margin-bottom: 20px;
+}
+.filter-item {
+  margin-right: 10px;
+}
+
+</style>

+ 24 - 36
src/views/question/components/ArticleDetail.vue

@@ -1,26 +1,15 @@
 <template>
   <div class="createPost-container">
-    <el-form ref="postForm" :model="postForm" :rules="rules" class="form-container">
+    <el-form ref="postForm" :label-position="labelPosition" :model="postForm" :rules="rules" class="form-container">
       <div class="createPost-main-container">
-        <el-row>
-          <Warning />
-
-          <el-col :span="24">
-            <el-form-item style="margin-bottom: 40px;" prop="title">
-              <MDinput v-model="postForm.title" :maxlength="50" name="name" required>
-                文章标题
-              </MDinput>
-            </el-form-item>
-            <div class="postInfo-container">
-              <div style="margin-bottom: 10px;">封面图</div>
-              <el-form-item prop="cover_img" style="margin-bottom: 30px;" label="">
-                <Upload v-model="postForm.cover_img" />
-              </el-form-item>
-            </div>
-          </el-col>
-        </el-row>
-        <el-form-item prop="content" style="margin-bottom: 30px;">
-          <Tinymce ref="editor" v-model="postForm.content" :height="400" />
+        <el-form-item prop="question" style="" label="问题">
+          <el-input v-model="postForm.question" placeholder="" style="width: 300px;" />
+        </el-form-item>
+        <el-form-item prop="content" style="" label="回答">
+          <Tinymce ref="editor" v-model="postForm.answer" :height="400" />
+        </el-form-item>
+        <el-form-item prop="sort" style="" label="排序">
+          <el-input v-model="postForm.sort" placeholder="" style="width: 100px;" />
         </el-form-item>
         <el-row>
           <el-button v-if="!isEdit" v-loading="loading" type="success" @click="submitForm">
@@ -37,13 +26,11 @@
 
 <script>
 import Tinymce from '@/components/Tinymce'
-import Upload from '@/components/Upload/SingleImage3'
-import MDinput from '@/components/MDinput'
+
 // import Sticky from '@/components/Sticky' // 粘性header组件
 // import { validURL } from '@/utils/validate'
-import { fetchArticle, createArticle, updateArticle } from '@/api/article'
+import { fetchQuestion, createQuestion, updateQuestion } from '@/api/question'
 import { searchUser } from '@/api/remote-search'
-import Warning from './Warning'
 // import { CommentDropdown, PlatformDropdown, SourceUrlDropdown } from './Dropdown'
 
 const defaultForm = {
@@ -62,7 +49,7 @@ const defaultForm = {
 
 export default {
   name: 'ArticleDetail',
-  components: { Tinymce, MDinput, Warning, Upload },
+  components: { Tinymce },
   props: {
     isEdit: {
       type: Boolean,
@@ -86,11 +73,12 @@ export default {
       loading: false,
       userListOptions: [],
       rules: {
-        cover_img: [{ message: '封面图不为空', validator: validateRequire }],
-        title: [{ message: '标题不为空', validator: validateRequire }],
-        content: [{ message: '内容不为空', validator: validateRequire }]
+        sort: [{ message: '排序不为空', validator: validateRequire }],
+        question: [{ message: '问题不为空', validator: validateRequire }],
+        answer: [{ message: '回答不为空', validator: validateRequire }]
       },
-      tempRoute: {}
+      tempRoute: {},
+      labelPosition: 'top'
     }
   },
   computed: {
@@ -122,7 +110,7 @@ export default {
   },
   methods: {
     fetchData(id) {
-      fetchArticle(id).then(response => {
+      fetchQuestion(id).then(response => {
         this.postForm = response.data.info
         // set tags view title
         // this.setTagsViewTitle()
@@ -141,17 +129,17 @@ export default {
         if (valid) {
           this.loading = true
           console.log(this.postForm)
-          createArticle(this.postForm).then(response => {
+          createQuestion(this.postForm).then(response => {
             this.$notify({
               title: '成功',
-              message: '发布文章成功',
+              message: '发布成功',
               type: 'success',
               duration: 2000
             })
             this.postForm.status = 'published'
             this.loading = false
             this.listLoading = false
-            this.$router.push(`/article/list`)
+            this.$router.push(`/question/list`)
           })
         } else {
           console.log('error submit!!')
@@ -161,17 +149,17 @@ export default {
     },
     updateArticle() {
       console.log(this.postForm)
-      updateArticle(this.postForm).then(response => {
+      updateQuestion(this.postForm).then(response => {
         this.$notify({
           title: '修改',
-          message: '修改文章成功',
+          message: '修改成功',
           type: 'success',
           duration: 2000
         })
         this.postForm.status = 'published'
         this.loading = false
         this.listLoading = false
-        this.$router.push(`/article/list`)
+        this.$router.push(`/question/list`)
       })
     },
     draftForm() {

+ 12 - 20
src/views/question/list.vue

@@ -1,21 +1,15 @@
 <template>
   <div class="app-container">
     <div class="filter-container">
-      <el-input v-model="listQuery.title" placeholder="Title" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
-      <!--<el-select v-model="listQuery.importance" placeholder="Imp" clearable style="width: 90px" class="filter-item">
-        <el-option v-for="item in importanceOptions" :key="item" :label="item" :value="item" />
-      </el-select>-->
+      <el-input v-model="listQuery.question" placeholder="问题" style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter" />
       <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">
         Search
       </el-button>
-      <router-link :to="{ path: '/article/create' }">
+      <router-link :to="{ path: '/question/create' }">
         <el-button v-waves class="filter-item" type="primary" icon="el-icon-edit">
-          新建文章
+          新建
         </el-button>
       </router-link>
-      <!--<el-checkbox v-model="showReviewer" class="filter-item" style="margin-left:15px;" @change="tableKey=tableKey+1">
-        reviewer
-      </el-checkbox>-->
     </div>
     <el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
       <el-table-column align="center" label="ID" width="80">
@@ -24,30 +18,28 @@
         </template>
       </el-table-column>
 
-      <el-table-column width="180px" align="center" label="Date">
+      <el-table-column width="180px" align="center" label="日期">
         <template slot-scope="scope">
           <span>{{ scope.row.create_time }}</span>
         </template>
       </el-table-column>
-      <el-table-column class-name="status-col" label="Status" width="80ß">
+      <el-table-column class-name="status-col" label="状态" width="80ß">
         <template slot-scope="{row}">
           <el-tag :type="row.status | statusFilter">
-            {{ row.status == 'normal' ? "正常" : "删除" }}
+            {{ row.status == '1' ? "正常" : "删除" }}
           </el-tag>
         </template>
       </el-table-column>
-
-      <el-table-column min-width="300px" label="Title">
+      <el-table-column min-width="300px" label="问题">
         <template slot-scope="{row}">
-          <router-link :to="'/article/edit/'+row.id" class="link-type">
-            <span>{{ row.title }}</span>
+          <router-link :to="'/question/edit/'+row.id" class="link-type">
+            <span>{{ row.question }}</span>
           </router-link>
         </template>
       </el-table-column>
-
       <el-table-column align="center" label="Actions" width="190" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <router-link :to="'/article/edit/'+scope.row.id">
+          <router-link :to="'/question/edit/'+scope.row.id">
             <el-button type="primary" size="mini" icon="el-icon-edit">
               修改
             </el-button>
@@ -64,7 +56,7 @@
 </template>
 
 <script>
-import { fetchList, deleteArticle } from '@/api/article'
+import { fetchList, deleteQuestion } from '@/api/question'
 import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
 import waves from '@/directive/waves'
 
@@ -121,7 +113,7 @@ export default {
         type: 'warning'
       })
         .then(async() => {
-          await deleteArticle(row.id)
+          await deleteQuestion(row.id)
           this.list.splice($index, 1)
           this.$message({
             type: 'success',