|
@@ -12,24 +12,41 @@
|
|
|
:page-size="pageSize"
|
|
|
:total-records="totalRecords"
|
|
|
@currentChange="pageHandle"
|
|
|
+ :isAdd="true"
|
|
|
+ @add="openQPopup"
|
|
|
+ :operationsDefaultLength="6"
|
|
|
/>
|
|
|
<popup-edit
|
|
|
:isShow="isDtlShow"
|
|
|
:curObj="curObj"
|
|
|
@close="closePopup"
|
|
|
/>
|
|
|
+ <q-edit
|
|
|
+ :isShow="isQShow"
|
|
|
+ :curObj="curObj"
|
|
|
+ @close="closeQPopup"
|
|
|
+ />
|
|
|
+ <a-edit
|
|
|
+ :isShow="isAShow"
|
|
|
+ :curObj="curObj"
|
|
|
+ @close="closeAPopup"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import { arrToObj } from '@/utils'
|
|
|
import SearchForm from './components/searchForm/Index'
|
|
|
import PopupEdit from './components/popup/answer'
|
|
|
+import QEdit from './components/popup/QEdit'
|
|
|
+import AEdit from './components/popup/AEdit'
|
|
|
import baseTable from '_m/baseTable.js'
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
components: {
|
|
|
SearchForm,
|
|
|
PopupEdit,
|
|
|
+ QEdit,
|
|
|
+ AEdit,
|
|
|
},
|
|
|
provide() {
|
|
|
return {
|
|
@@ -43,6 +60,8 @@ export default {
|
|
|
searchForm: null,
|
|
|
isDtlShow: false,
|
|
|
curObj: {},
|
|
|
+ isQShow: false,
|
|
|
+ isAShow: false,
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -64,12 +83,13 @@ export default {
|
|
|
rows: [
|
|
|
{ label: '问题内容', prop: 'question_cont', fullShow: true, minWidth: 200, align: 'left' },
|
|
|
{ label: '标签', prop: 'qtName' },
|
|
|
- { label: '昵称', prop: 'nickname' },
|
|
|
- { label: '头像', prop: 'avatar', type: 'img' },
|
|
|
+ // { label: '昵称', prop: 'nickname' },
|
|
|
+ // { label: '头像', prop: 'avatar', type: 'img' },
|
|
|
{ label: '提问时间', prop: 'create_at' },
|
|
|
- { label: '操作', width: 200, type: 'handle2', operations:
|
|
|
+ { label: '操作', width: 240, type: 'handle2', operations:
|
|
|
[
|
|
|
- { label: '查看回答', func: this.openPopup, btnType: 'primary' },
|
|
|
+ { label: '我来回答', func: this.openAPopup, btnType: 'primary' },
|
|
|
+ { label: '查看回答', func: this.openPopup, btnType: 'success' },
|
|
|
{ label: '删除', func: this.delHandle, btnType: 'danger' },
|
|
|
]
|
|
|
}
|
|
@@ -77,6 +97,29 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ openQPopup () {
|
|
|
+ this.isQShow = true
|
|
|
+ },
|
|
|
+ closeQPopup (obj) {
|
|
|
+ this.isQShow = false
|
|
|
+ if (obj) {
|
|
|
+ this.fetchData()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ openAPopup (row) {
|
|
|
+ if (row && row.id) {
|
|
|
+ this.curObj = row
|
|
|
+ } else {
|
|
|
+ this.curObj = {}
|
|
|
+ }
|
|
|
+ this.isAShow = true
|
|
|
+ },
|
|
|
+ closeAPopup (obj) {
|
|
|
+ this.isAShow = false
|
|
|
+ if (obj) {
|
|
|
+ this.fetchData()
|
|
|
+ }
|
|
|
+ },
|
|
|
delHandle(row) {
|
|
|
this.$msg(`您确定要删除该问题吗?`, 'confirm', () => {
|
|
|
this.$api.user.admquestiondel({
|