fix some error and warning

This commit is contained in:
zhl 2021-05-07 11:43:12 +08:00
parent 8db8241295
commit e90e1fb8c3
2 changed files with 14 additions and 12 deletions

View File

@ -60,7 +60,7 @@ const shopRoutes: RouteConfig = {
elicon: 'el-icon-arrow-right', elicon: 'el-icon-arrow-right',
hidden: true hidden: true
} }
}, }
] ]
} }

View File

@ -90,7 +90,6 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
width="180" width="180"
@ -134,7 +133,6 @@ import { Component, Vue } from 'vue-property-decorator'
import Pagination from '@/components/Pagination/index.vue' import Pagination from '@/components/Pagination/index.vue'
import { getShops } from '@/api/shop' import { getShops } from '@/api/shop'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { Form } from 'element-ui'
import { import {
deleteQuestion, deleteQuestion,
getAllCategory, getAllCategory,
@ -180,6 +178,7 @@ export default class extends Vue {
sub_tag: '', sub_tag: '',
groups: '' groups: ''
} }
private typeOptions: any[] = [] private typeOptions: any[] = []
private tagSet: Set<string> = new Set() private tagSet: Set<string> = new Set()
private tagOptions: string[] = [] private tagOptions: string[] = []
@ -188,13 +187,16 @@ export default class extends Vue {
typeSelect: [] typeSelect: []
} }
$refs!: {
filterForm: HTMLFormElement
}
created() { created() {
this.getList() this.getList()
this.getRemoteTags() this.getRemoteTags()
this.getRemoteCategory() this.getRemoteCategory()
} }
private async getList() { private async getList() {
this.listLoading = true this.listLoading = true
const { data } = await getQuestions(this.listQuery) const { data } = await getQuestions(this.listQuery)
@ -235,26 +237,27 @@ export default class extends Vue {
} }
private resetFilterForm() { private resetFilterForm() {
const ref = <Form>this.$refs.filterForm this.$refs.filterForm.resetFields()
ref.resetFields()
} }
private async getRemoteDeptList(name: string) { private async getRemoteDeptList(name: string) {
const { data } = await getShops({ key: name }) const { data } = await getShops({ key: name })
if (!data.records) return if (!data.records) return
this.allDepts = data.records this.allDepts = data.records
} }
private async getRemoteTags() { private async getRemoteTags() {
let { data } = await getAllTags() const { data } = await getAllTags()
console.log(data) console.log(data)
this.tagSet = new Set(data) this.tagSet = new Set(data)
this.tagOptions = data this.tagOptions = data
} }
private async getRemoteCategory() { private async getRemoteCategory() {
let {data} = await getAllCategory() const { data } = await getAllCategory()
for (let cat of data) { for (const cat of data) {
let subArr = [] const subArr = []
for (let s of cat.children) { for (const s of cat.children) {
subArr.push({ subArr.push({
value: s._id, value: s._id,
label: s.name label: s.name
@ -267,7 +270,6 @@ export default class extends Vue {
}) })
} }
} }
} }
</script> </script>