|
@@ -29,20 +29,77 @@
|
|
|
</el-input>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row class="one_2" v-for="(val, indexs) in searchList" :key="indexs">
|
|
|
- <el-col :span="1" class="left">{{ val.title }}:</el-col>
|
|
|
+ <el-row class="one_2">
|
|
|
+ <el-col :span="1" class="left">状态:</el-col>
|
|
|
<el-col :span="23" class="right">
|
|
|
<a-button
|
|
|
class="title"
|
|
|
- v-for="(item, index) in val.list"
|
|
|
+ v-for="(item, index) in statusList"
|
|
|
:key="index"
|
|
|
type="link"
|
|
|
size="samll"
|
|
|
+ @click="toSelect(item, 'one')"
|
|
|
+ :class="[item.is_active ? 'show' : '']"
|
|
|
>
|
|
|
{{ item.label }}
|
|
|
</a-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row class="one_2">
|
|
|
+ <el-col :span="1" class="left">技术:</el-col>
|
|
|
+ <el-col :span="23" class="right">
|
|
|
+ <a-button
|
|
|
+ class="title"
|
|
|
+ v-for="(item, index) in typeList"
|
|
|
+ :key="index"
|
|
|
+ type="link"
|
|
|
+ size="samll"
|
|
|
+ @click="toSelect(item, 'two')"
|
|
|
+ :class="[item.is_active ? 'show' : '']"
|
|
|
+ >
|
|
|
+ {{ item.label }}
|
|
|
+ </a-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="one_2">
|
|
|
+ <el-col :span="1" class="left">行业:</el-col>
|
|
|
+ <el-col :span="22" class="right" v-if="oneShow">
|
|
|
+ <a-button
|
|
|
+ class="title"
|
|
|
+ v-for="(item, index) in industryList"
|
|
|
+ :key="index"
|
|
|
+ type="link"
|
|
|
+ size="samll"
|
|
|
+ @click="toSelect(item, 'thr')"
|
|
|
+ :class="[item.is_active ? 'show' : '']"
|
|
|
+ >
|
|
|
+ {{ item.label }}
|
|
|
+ </a-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="22" class="right" v-else>
|
|
|
+ <a-button
|
|
|
+ class="title"
|
|
|
+ v-for="(item, index) in industryList.slice(0, 12)"
|
|
|
+ :key="index"
|
|
|
+ type="link"
|
|
|
+ size="samll"
|
|
|
+ @click="toSelect(item, 'thr')"
|
|
|
+ :class="[item.is_active ? 'show' : '']"
|
|
|
+ >
|
|
|
+ {{ item.label }}
|
|
|
+ </a-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1" class="button">
|
|
|
+ <span v-if="!oneShow" @click="oneShow = true">
|
|
|
+ 更多
|
|
|
+ <el-icon><ArrowDown /></el-icon>
|
|
|
+ </span>
|
|
|
+ <span v-else @click="oneShow = false">
|
|
|
+ 收起
|
|
|
+ <el-icon><ArrowUp /></el-icon>
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="two">
|
|
|
<el-row
|
|
@@ -122,34 +179,6 @@ const router = useRouter()
|
|
|
// 加载中
|
|
|
const loading = ref(false)
|
|
|
const searchForm = ref({})
|
|
|
-const searchList = ref([
|
|
|
- {
|
|
|
- title: '状态',
|
|
|
- list: [
|
|
|
- { value: '0', label: '全部' },
|
|
|
- { value: '1', label: '可报名' },
|
|
|
- { value: '2', label: '已报名' },
|
|
|
- { value: '3', label: '不可报名' }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '类别',
|
|
|
- list: [
|
|
|
- { value: '0', label: '全部' },
|
|
|
- { value: '1', label: '智能算法' },
|
|
|
- { value: '2', label: '方案应用' }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- title: '技术',
|
|
|
- list: [
|
|
|
- { value: '0', label: '数据挖掘' },
|
|
|
- { value: '1', label: '自然语言处理' },
|
|
|
- { value: '2', label: '计算机视觉' },
|
|
|
- { value: '3', label: 'AI其他' }
|
|
|
- ]
|
|
|
- }
|
|
|
-])
|
|
|
// 搜索
|
|
|
const input = ref('')
|
|
|
// 列表
|
|
@@ -160,6 +189,9 @@ const total = ref(0)
|
|
|
const typeList = ref([])
|
|
|
const formList = ref([])
|
|
|
const statusList = ref([])
|
|
|
+const industryList = ref([])
|
|
|
+// 是否展开
|
|
|
+const oneShow = ref(false)
|
|
|
// 请求
|
|
|
onMounted(async () => {
|
|
|
loading.value = true
|
|
@@ -175,9 +207,15 @@ const searchOther = async () => {
|
|
|
// 类别
|
|
|
result = await dictDataStore.query({ code: 'matchForm', is_use: '0' })
|
|
|
if ($checkRes(result)) formList.value = result.data
|
|
|
+ // 赛事行业
|
|
|
+ result = await dictDataStore.query({ code: 'matchIndustry', is_use: '0' })
|
|
|
+ if ($checkRes(result)) industryList.value = result.data
|
|
|
// 赛事状态
|
|
|
result = await dictDataStore.query({ code: 'matchStatus', is_use: '0' })
|
|
|
if ($checkRes(result)) statusList.value = result.data
|
|
|
+ statusList.value.unshift({ value: '-1', label: '全部' })
|
|
|
+ industryList.value.unshift({ value: '-1', label: '全部' })
|
|
|
+ typeList.value.unshift({ value: '-1', label: '全部' })
|
|
|
}
|
|
|
const search = async (query = { skip: 0, limit }) => {
|
|
|
const info = {
|
|
@@ -220,6 +258,37 @@ const onSearch = () => {
|
|
|
else searchForm.value = {}
|
|
|
search({ skip, limit })
|
|
|
}
|
|
|
+// 选择查询
|
|
|
+const toSelect = (item, num) => {
|
|
|
+ if (num == 'one') {
|
|
|
+ for (const val of statusList.value) {
|
|
|
+ if (val.value == item.value) val.is_active = true
|
|
|
+ else val.is_active = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (num == 'two') {
|
|
|
+ for (const val of typeList.value) {
|
|
|
+ if (val.value == item.value) val.is_active = true
|
|
|
+ else val.is_active = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (num == 'thr') {
|
|
|
+ for (const val of industryList.value) {
|
|
|
+ if (val.value == item.value) val.is_active = true
|
|
|
+ else val.is_active = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+const currentPage = ref(1)
|
|
|
+// 分页
|
|
|
+const changePage = (page = currentPage.value) => {
|
|
|
+ search({ skip: (page - 1) * limit, limit: limit })
|
|
|
+}
|
|
|
+const sizeChange = (limits) => {
|
|
|
+ limit = limits
|
|
|
+ currentPage.value = 1
|
|
|
+ search({ skip: 0, limit: limit })
|
|
|
+}
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
.main {
|
|
@@ -256,10 +325,14 @@ const onSearch = () => {
|
|
|
}
|
|
|
|
|
|
.right {
|
|
|
+ .show {
|
|
|
+ color: #2374ff !important;
|
|
|
+ }
|
|
|
.title {
|
|
|
color: #666;
|
|
|
font-size: 14px;
|
|
|
line-height: 15px;
|
|
|
+ margin: 0 10px;
|
|
|
display: inline-block;
|
|
|
overflow: hidden;
|
|
|
text-decoration: none;
|
|
@@ -269,6 +342,10 @@ const onSearch = () => {
|
|
|
color: #2374ff;
|
|
|
}
|
|
|
}
|
|
|
+ .button {
|
|
|
+ color: #2374ff;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.two {
|