提交 6ecf04fc 编写于 作者: A atongge123

试卷列表

上级 683e1853
<template>
<a-dropdown v-if="dataList.length > 0" style="width: 120px">
<template #overlay>
<a-menu @click="clickMenuItem">
<a-menu-item v-for="(item, index ) in dataList" :key="item[fieldNames.value]">
{{item[fieldNames.label]}}
</a-menu-item>
</a-menu>
</template>
<a class="more-item-title hover-title">
{{ label }}
<DownOutlined v-if="currentSelectKey == null" class="icon" />
<CloseCircleOutlined v-else :style="{fontSize:'12px', color:'#999'}" @click="clickClose" />
</a>
</a-dropdown>
</template>
<script>
export default {
name: "xqh-filter-dropdown",
emits: ['click'],
props: {
dataList: {
type: Array,
default () {
return []
}
},
defaultLabel: "",
fieldNames: {
type: Object,
default () {
return {
label: "label",
value: "value",
children: 'children'
}
}
},
},
data() {
return {
currentSelectKey: null,
};
},
computed: {
label() {
let selectItem = this.dataList.find(item =>item[this.fieldNames.value] == this.currentSelectKey)
console.log("selectItem:", selectItem);
let text = selectItem && selectItem[this.fieldNames.label] || this.defaultLabel
console.log("text:", text);
console.log("this.currentSelectKey:", this.currentSelectKey);
return text
}
},
methods: {
clickMenuItem({ item, key, keyPath }) {
this.currentSelectKey = key
console.log("key",key);
this.$emit("click", {item, key, keyPath })
},
clickClose(){
this.currentSelectKey = null;
this.$emit("click", { item:{} ,key:"", keyPath:"" })
}
}
}
</script>
<style lang="scss">
.more-item-title {
color: #474e5d;
font-size: 16px;
.icon {
color: #a4a4a4;
font-size: 14px;
transition: all .3s;
}
}
.hover-title2:hover {
color: #0080FF;
}
.hover-title:hover {
color: #0080FF;
}
.hover-title:hover .icon {
transform: rotate(-180deg);
}
</style>
\ No newline at end of file
......@@ -63,9 +63,9 @@
<template #icon>
</template>
</a-tree>
<a-tree v-if="currentKonwledgePointsList.length > 0" :fieldNames="treeProps" show-line
:tree-line="true &&{ showLeafIcon:true }" show-icon
:tree-data="currentKonwledgePointsList" @select="onSelectKonwledge">
<a-tree v-if="currentKonwledgePointsTreeData.length > 0" :fieldNames="treeProps"
show-line :tree-line="true &&{ showLeafIcon:true }" show-icon
:tree-data="currentKonwledgePointsTreeData" @select="onSelectKonwledge">
<template #icon>
</template>
</a-tree>
......@@ -81,53 +81,37 @@
<search-type-item title="更 多:">
<a-space size="middle" style="margin-left: 15px;">
<a-cascader v-model:value="currentSchool" placeholder="请选择学校" :options="citys"
<!-- <a-cascader v-model:value="currentSchool" placeholder="请选择学校" :options="citys"
@change="onChangeSchool" expand-trigger="hover" :load-data="loadSchoolData"
@dropdownVisibleChange="schoolDropdownVisibleChange">
<a class="more-item-title hover-title2" href="#">
地区/学校
<DownOutlined class="icon" />
</a>
</a-cascader>
<a-dropdown>
<template #overlay>
<a-menu @click="clickYear">
<a-menu-item v-for="{label,value} in years" :key="value">
{{label}}
</a-menu-item>
</a-menu>
</template>
<a class="more-item-title hover-title">
{{ currentYear || "年份" }}
<DownOutlined class="icon" />
</a>
</a-dropdown>
<a-dropdown v-if="currentKonwledgePointsList.length > 0">
<template #overlay>
<a-menu @click="clickKnowledge">
<a-menu-item v-for="(knowledge, index ) in currentKonwledgePointsList" :key="knowledge._id">
{{knowledge.name}}
</a-menu-item>
</a-menu>
</template>
<a class="more-item-title hover-title">
{{ currentKonwledgePoint.name || "知识点" }}
<DownOutlined class="icon" />
</a>
</a-dropdown>
<a-dropdown style="width: 120px">
<template #overlay>
<a-menu @click="clickGrade">
<a-menu-item v-for="{label, value} in grades" :key="value">
{{label}}
</a-menu-item>
</a-menu>
</template>
<a class="more-item-title hover-title">
{{ currentGrade || "年级" }}
<DownOutlined class="icon" />
</a>
</a-dropdown>
</a-cascader> -->
<a-space>
<span>地区</span>
<uni-data-picker style="width: 180px;" placeholder="请选择地区" popup-title="请选择地区"
collection="opendb-city-china" field="code as value, name as text"
orderby="value asc" :step-searh="true" self-field="code"
parent-field="parent_code" @change="onchangeArea" v-model="selectAreaValue"
@nodeclick="onnodeclickArea">
</uni-data-picker>
</a-space>
<a-space>
<span>学校</span>
<uni-data-select style="width: 100px;" collection="xqh-school"
field="_id as value, name as text" lv-model="currentSchool" :clear="true"
:where="schoolWhere" />
</a-space>
<xqh-filter-dropdown default-label="年份" :data-list="years"
@click="clickYear"></xqh-filter-dropdown>
<xqh-filter-dropdown default-label="知识点" :field-names="{label:'name', value:'_id'}"
:data-list="currentKonwledgePointsList"
@click="clickKnowledge"></xqh-filter-dropdown>
<xqh-filter-dropdown default-label="年级" :data-list="grades"
@click="clickGrade"></xqh-filter-dropdown>
</a-space>
</search-type-item>
</view>
......@@ -154,8 +138,8 @@
<text class="fr"><text class="total">{{total}}</text>套专辑</text>
</view>
</view>
<view class="list-contnet">
<a-list item-layout="horizontal" size="large" :pagination="pagination"
<view class="list-content">
<a-list item-layout="horizontal" size="large"
:data-source="examListData">
<template #renderItem="{ item }">
<a-list-item key="item.title" class="list-item">
......@@ -207,7 +191,8 @@
</a-list-item>
</template>
</a-list>
</view>
</view>
<a-pagination class="bottom-pagination" :pageSize="pagination.pageSize" v-model:current="pagination.current" :total="pagination.total" show-less-items />
</view>
</view>
</view>
......@@ -268,6 +253,9 @@
currentSceneCategeroiesList: [],
//知识点数据树
currentKonwledgePointsList: [],
currentKonwledgePointsTreeData: [],
selectAreaValue: "",
schoolWhere: "",
treeProps: {
children: 'children',
title: 'name',
......@@ -487,10 +475,10 @@
}]
//知识点
// _this.currentKonwledgePointsList = dataList[1].data
// //不限
// if(dataList[1].data.length > 0){
// _this.currentKonwledgePointsList = dataList[1].data
// //不限
// if(dataList[1].data.length > 0){
// }
//场景
......@@ -661,12 +649,12 @@
}]
//知识点
_this.currentKonwledgePointsList = [{
_this.currentKonwledgePointsTreeData = [{
"name": "知识点",
_id: "1",
children: dataList[1].data
}]
_this.currentKonwledgePointsList = dataList[1].data
//场景
_this.currentSceneCategeroiesList = [{
"name": "小升初",
......@@ -886,11 +874,35 @@
}
return {}
}
this.currentKonwledgePoint = getKnowledge(this.currentCourseQualityLevel, key)
this.currentKonwledgePoint = getKnowledge(this.currentCourseQualityLevel, key)
this.loadExamList()
},
schoolDropdownVisibleChange(visible) {
this.schoolDropdownVisible = visible
},
onnodeclickArea(item) {
console.log("onnodeclickArea", item);
if(!item.parent_value){
this.currentProvinceCode = item.value
// this.
}
else if(item.parent_value && !item.isleaf){
this.currentCityCode = item.value
}else if(item.parent_value && !item.isleaf){
this.currentAreaCode = item.value
}else{
//清空数据
this.schoolWhere = ""
this.currentProvinceCode = ""
this.currentCityCode = ""
this.currentAreaCode = ""
}
this.loadExamList()
},
onchangeArea(e) {
console.log("onnodeclickArea", e);
}
}
......@@ -1238,7 +1250,7 @@
}
}
.list-contnet {
.list-content {
background: #fff;
border-radius: 0 0 6px 6px;
......@@ -1274,6 +1286,10 @@
text-overflow: ellipsis;
}
}
}
.bottom-pagination{
margin: 10px auto;
}
}
......
......@@ -12,14 +12,7 @@
<xqh-search></xqh-search>
</view>
<view class="right">
<navigator url="/pages/vip/vip" class="operate-btn" type="primary">
<CrownOutlined style="font-size: 24px;color: #0069ff;line-height: 24px;" class="icon" />
<text class="name">会员</text>
</navigator>
<navigator url="/pages/member/index?path=/user/download" class="operate-btn" type="primary">
<UploadOutlined style="font-size: 24px;color: #0069ff;line-height: 24px;" class="icon" />
<text class="name">上传</text>
</navigator>
<right-quick-entrance></right-quick-entrance>
</view>
</view>
<view class="nav">
......@@ -323,7 +316,7 @@
.logo {
background: url(https://zxxkstatic.zxxk.com/skins/common/images/xkw-logo.png) no-repeat 0 0;
background: url(/static/xqh-logo.png) no-repeat 0 0;
background-size: 100% auto;
font-size: 0;
height: 38px;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册