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',
hidden: true
}
},
}
]
}

View File

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