bht-app/src/pages/knowledgeBase/knowledgeBase.vue

199 lines
5.6 KiB
Vue
Raw Normal View History

2025-05-22 15:05:43 +08:00
<!--
* @Author: XHC
* @Date: 2025-05-19 15:18:26
* @LastEditors: XHC
2025-06-06 17:50:10 +08:00
* @LastEditTime: 2025-06-05 17:18:03
2025-05-23 16:31:00 +08:00
* @Description: 知识库
2025-05-22 15:05:43 +08:00
-->
2025-05-22 09:59:54 +08:00
<template>
2025-05-22 15:05:43 +08:00
<view class="knowledgeBase">
<view class="search-box">
<uni-search-bar class="search" radius="15" bgColor="#EDF4FD" placeholder="搜索线路名称" clearButton="auto" cancelButton="none" @confirm="search" />
<view class="search-title">
<view
v-for="(item, index) in titleList"
:key="index"
:class="titleCurIndex == index ? 'active' : ''"
class="title-item grey"
@click="changeTitle(index)"
>
{{ item.name }}
</view>
2025-06-06 17:50:10 +08:00
<uni-icons fontFamily="iconfont" color="#fff" :size="24" @click="screening">{{'&#xe621;'}}</uni-icons>
2025-05-22 15:05:43 +08:00
</view>
</view>
<view class="list-box" v-if="titleCurIndex == 0">
<uni-card class="list-card" v-for="(item, index) in listData" :key="index">
<view class="head"><text class="title">{{ item.title }}</text></view>
<view class="num grey">{{ item.num }}</view>
<view class="info-box grey">
2025-05-22 17:25:45 +08:00
<uni-row :gutter="30">
2025-05-22 15:05:43 +08:00
<uni-col :span="16">
2025-06-06 17:50:10 +08:00
<view class="info"><uni-icons fontFamily="iconfont" color="#1469BC">{{'&#xe753;'}}</uni-icons> <text class="info-text">{{ item.departments }}</text></view>
2025-05-22 15:05:43 +08:00
</uni-col>
<uni-col :span="8">
2025-05-23 14:57:57 +08:00
<view class="info"><uni-icons fontFamily="iconfont" color="#808185">{{'&#xe74e;'}}</uni-icons> {{ item.time }}</view>
2025-05-22 15:05:43 +08:00
</uni-col>
</uni-row>
</view>
</uni-card>
</view>
2025-06-06 17:50:10 +08:00
<DaDropdown
ref="daDropdownRef"
v-model:dropdownMenu="dropdownMenuList"
@confirm="handleConfirm"
@close="handleClose"
@open="handleOpen">
</DaDropdown>
2025-05-22 15:05:43 +08:00
</view>
2025-05-22 09:59:54 +08:00
</template>
<script setup>
2025-05-23 14:57:57 +08:00
import { reactive, ref } from 'vue';
2025-06-06 17:50:10 +08:00
import DaDropdown from '@/components/da-dropdown/index.vue'
2025-05-22 15:05:43 +08:00
// 标题
let titleCurIndex = ref(0)
let titleList = reactive([
{ id: 1, name: "全部" },
{ id: 2, name: "发电机" },
{ id: 3, name: "发电机" },
{ id: 4, name: "发电机" },
{ id: 5, name: "发电机" },
])
2025-06-06 17:50:10 +08:00
const daDropdownRef = ref(null)
const menuVal = ref(null)
const dropdownMenuList = ref([
{
// title: '筛选',
type: 'filter',
prop: 'god5',
// 默认选中单选2、多选2、3、滑动30
// value: { ft1: '2', ft2: ['2', '3'], ft3: 30 },
options: [
{
title: '单选',
type: 'radio',
prop: 'ft1',
options: [
{ label: '单选1', value: '1' },
{ label: '单选2', value: '2' },
{ label: '单选3', value: '3' },
{ label: '单选4', value: '4' },
],
},
{
title: '多选',
type: 'checkbox',
prop: 'ft2',
options: [
{ label: '多选1', value: '1' },
{ label: '多选2', value: '2' },
{ label: '多选3', value: '3' },
{ label: '多选4', value: '4' },
{ label: '多选5', value: '5' },
],
},
// {
// title: '滑块',
// type: 'slider',
// prop: 'ft3',
// componentProps: {
// min: 0,
// max: 100,
// step: 1,
// showValue: true,
// },
// },
],
},
])
function handleConfirm(v, selectedValue) {
console.log('handleConfirm ==>', v, selectedValue)
}
function handleClose(v, callbackMenuList) {
console.log('handleClose ==>', v, callbackMenuList)
}
function handleOpen(v) {
console.log('handleOpen ==>', v)
}
function handleMenuVal() {
menuVal.value = daDropdownRef.value?.getMenuValue()
console.log('已选数据', menuVal.value)
}
2025-05-22 15:05:43 +08:00
// 列表数据
const listData = reactive([
2025-05-30 17:02:59 +08:00
{ title: '电站运行巡检作业指导书', num: 'Q/BHTHP.ZDS 7008-2024', departments: '水力发电厂运行部', time: '2025-02-20' },
{ title: '电站运行巡检作业指导书', num: 'Q/BHTHP.ZDS 7008-2024', departments: '水力发电厂运行部', time: '2025-02-20' },
{ title: '电站运行巡检作业指导书', num: 'Q/BHTHP.ZDS 7008-2024', departments: '水力发电厂运行部', time: '2025-02-20' },
{ title: '电站运行巡检作业指导书', num: 'Q/BHTHP.ZDS 7008-2024', departments: '水力发电厂运行部', time: '2025-02-20' },
{ title: '电站运行巡检作业指导书', num: 'Q/BHTHP.ZDS 7008-2024', departments: '水力发电厂运行部', time: '2025-02-20' },
{ title: '电站运行巡检作业指导书', num: 'Q/BHTHP.ZDS 7008-2024', departments: '水力发电厂运行部', time: '2025-02-20' },
{ title: '电站运行巡检作业指导书', num: 'Q/BHTHP.ZDS 7008-2024', departments: '水力发电厂运行部', time: '2025-02-20' },
{ title: '电站运行巡检作业指导书', num: 'Q/BHTHP.ZDS 7008-2024', departments: '水力发电厂运行部', time: '2025-02-20' },
{ title: '电站运行巡检作业指导书', num: 'Q/BHTHP.ZDS 7008-2024', departments: '水力发电厂运行部', time: '2025-02-20' },
{ title: '电站运行巡检作业指导书', num: 'Q/BHTHP.ZDS 7008-2024', departments: '水力发电厂运行部', time: '2025-02-20' },
2025-05-22 15:05:43 +08:00
])
// 搜索
const search = () => {
}
// 切换标题
const changeTitle = (index) => {
titleCurIndex.value = index
}
2025-06-06 17:50:10 +08:00
const screening = () => {
// picker.value.show()
console.log(daDropdownRef.value);
daDropdownRef.value?.handleMenuClick()
}
2025-05-22 09:59:54 +08:00
</script>
2025-05-22 15:05:43 +08:00
<style lang="scss" scoped>
.knowledgeBase {
2025-06-06 17:50:10 +08:00
// position: relative;
2025-05-22 15:05:43 +08:00
.search-title {
width: 100%;
display: flex;
justify-content: space-around;
.title-item {
color: #ffffffb8;
padding-bottom: 10rpx;
}
.active {
color: #fff;
font-weight: bold;
border-bottom: 6rpx solid #fff;
}
}
.list-box {
2025-06-06 17:50:10 +08:00
.title {
width: 100%;
}
2025-05-22 15:05:43 +08:00
.info {
margin-right: 0;
2025-05-22 17:25:45 +08:00
width: 100%;
2025-05-22 15:05:43 +08:00
}
}
2025-06-06 17:50:10 +08:00
:deep(.da-dropdown-menu) {
position: absolute!important;
width: 50rpx;
height: 60rpx;
top: 100rpx!important;
right: 40rpx!important;
opacity: 0;
}
:deep(.da-dropdown-content) {
top: 170rpx!important;
}
2025-05-22 15:05:43 +08:00
}
</style>