vue_zhongyou 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js ADDED
@@ -0,0 +1 @@
1
+ console.log('小鱼的npm,上传一些资源')
package/package.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "vue_zhongyou",
3
+ "version": "1.0.1",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "keywords": [],
7
+ "author": "yg",
8
+ "license": "MIT"
9
+ }
@@ -0,0 +1,10 @@
1
+ body,html{
2
+ width: 100%;
3
+ height: 100%;
4
+ margin: 0;
5
+ padding: 0;
6
+ }
7
+ #app{
8
+ width: 100%;
9
+ height: 100%;
10
+ }
@@ -0,0 +1,183 @@
1
+ <template>
2
+ <div class="filter-sort-panel">
3
+ <div class="toolbar" ref="toolbarRef">
4
+ <button
5
+ type="button"
6
+ class="toolbar-btn"
7
+ :class="{ active: activePanel === 'filter' }"
8
+ @click="togglePanel('filter')"
9
+ >
10
+ <van-icon name="filter-o" class="btn-icon" />
11
+ <span>筛选</span>
12
+ <van-icon
13
+ name="arrow-down"
14
+ class="arrow"
15
+ :class="{ open: activePanel === 'filter' }"
16
+ />
17
+ </button>
18
+ <button
19
+ type="button"
20
+ class="toolbar-btn"
21
+ :class="{ active: activePanel === 'sort' }"
22
+ @click="togglePanel('sort')"
23
+ >
24
+ <van-icon name="descending" class="btn-icon" />
25
+ <span>排序</span>
26
+ <van-icon
27
+ name="arrow-down"
28
+ class="arrow"
29
+ :class="{ open: activePanel === 'sort' }"
30
+ />
31
+ </button>
32
+ </div>
33
+
34
+ <transition name="dropdown-fade">
35
+ <div
36
+ v-if="activePanel"
37
+ class="panel"
38
+ :class="`panel-${activePanel}`"
39
+ >
40
+ <slot v-if="activePanel === 'filter'" name="filter" />
41
+ <slot v-else name="sort" />
42
+ </div>
43
+ </transition>
44
+
45
+ <transition name="fade">
46
+ <div
47
+ v-if="activePanel"
48
+ class="overlay"
49
+ :style="{ top: `${overlayTop}px` }"
50
+ @click="closePanel"
51
+ />
52
+ </transition>
53
+ </div>
54
+ </template>
55
+
56
+ <script setup>
57
+ import { nextTick, ref } from 'vue'
58
+
59
+ const activePanel = ref('')
60
+ const overlayTop = ref(0)
61
+ const toolbarRef = ref(null)
62
+
63
+ const togglePanel = (panel) => {
64
+ if (activePanel.value === panel) {
65
+ activePanel.value = ''
66
+ overlayTop.value = 0
67
+ return
68
+ }
69
+
70
+ activePanel.value = panel
71
+
72
+ nextTick(() => {
73
+ if (toolbarRef.value) {
74
+ const { bottom } = toolbarRef.value.getBoundingClientRect()
75
+ overlayTop.value = bottom
76
+ }
77
+ })
78
+ }
79
+
80
+ const closePanel = () => {
81
+ activePanel.value = ''
82
+ overlayTop.value = 0
83
+ }
84
+ </script>
85
+
86
+ <style scoped lang="scss">
87
+ .filter-sort-panel {
88
+ position: relative;
89
+ background-color: #fff;
90
+ border-radius: 10px;
91
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
92
+
93
+ .toolbar {
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: space-between;
97
+ padding: 12px 16px;
98
+ gap: 12px;
99
+ background-color: #fff;
100
+ z-index: 2;
101
+
102
+ .toolbar-btn {
103
+ flex: 1;
104
+ display: flex;
105
+ align-items: center;
106
+ justify-content: center;
107
+ gap: 6px;
108
+ padding: 8px 12px;
109
+ border-radius: 999px;
110
+ border: 1px solid #ebedf0;
111
+ background: #fff;
112
+ color: #323233;
113
+ font-size: 14px;
114
+ transition: all 0.2s ease;
115
+
116
+ &:active {
117
+ background-color: #f2f3f5;
118
+ }
119
+
120
+ &.active {
121
+ color: #1989fa;
122
+ border-color: #1989fa;
123
+ background-color: rgba(25, 137, 250, 0.08);
124
+ }
125
+
126
+ .btn-icon {
127
+ font-size: 18px;
128
+ }
129
+
130
+ .arrow {
131
+ font-size: 12px;
132
+ transform: rotate(0deg);
133
+ transition: transform 0.2s ease;
134
+
135
+ &.open {
136
+ transform: rotate(180deg);
137
+ }
138
+ }
139
+ }
140
+ }
141
+
142
+ .panel {
143
+ position: absolute;
144
+ left: 0;
145
+ right: 0;
146
+ top: 100%;
147
+ background-color: #fff;
148
+ padding: 16px;
149
+ box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
150
+ border-radius: 0 0 12px 12px;
151
+ z-index: 3;
152
+ }
153
+
154
+ .overlay {
155
+ position: fixed;
156
+ inset: 0;
157
+ background-color: rgba(0, 0, 0, 0.4);
158
+ z-index: 1;
159
+ }
160
+ }
161
+
162
+ .dropdown-fade-enter-active,
163
+ .dropdown-fade-leave-active {
164
+ transition: opacity 0.2s ease, transform 0.2s ease;
165
+ }
166
+
167
+ .dropdown-fade-enter-from,
168
+ .dropdown-fade-leave-to {
169
+ opacity: 0;
170
+ transform: translateY(-6px);
171
+ }
172
+
173
+ .fade-enter-active,
174
+ .fade-leave-active {
175
+ transition: opacity 0.2s ease;
176
+ }
177
+
178
+ .fade-enter-from,
179
+ .fade-leave-to {
180
+ opacity: 0;
181
+ }
182
+ </style>
183
+
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <div class="card">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script setup>
8
+ import { ref } from 'vue'
9
+ </script>
10
+
11
+ <style lang='scss' scoped>
12
+ .card{
13
+ padding: 12px;
14
+ border-radius: 8px;
15
+ background-color: #f5f5f5;
16
+ }
17
+ </style>
@@ -0,0 +1,199 @@
1
+ <template>
2
+ <!-- 首页头部 -->
3
+ <van-sticky>
4
+ <div class="header">
5
+ <div class="user-info">
6
+ <img src="https://img.yzcdn.cn/vant/cat.jpeg" alt="用户头像" class="avatar" />
7
+ <div class="user-details">
8
+ <div class="username" >张明</div>
9
+ </div>
10
+ </div>
11
+ <div class="header-actions">
12
+ <div class="search-icon">
13
+ <van-search v-model="searchText" placeholder="搜索..." show-action shape="round" bg-color="#c59b70"
14
+ @search="onSearch">
15
+ <template #action>
16
+ <div class="search-action">
17
+ <van-icon name="bell-o" size="20" color="#666" />
18
+ </div>
19
+ </template>
20
+ </van-search>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </van-sticky>
25
+
26
+ <!-- 首页轮播图 -->
27
+ <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
28
+ <van-swipe-item>1</van-swipe-item>
29
+ <van-swipe-item>2</van-swipe-item>
30
+ <van-swipe-item>3</van-swipe-item>
31
+ <van-swipe-item>4</van-swipe-item>
32
+ </van-swipe>
33
+ <!-- 首页导航 -->
34
+ <div class="quick-nav">
35
+ <van-grid :column-num="4" :border="false">
36
+ <van-grid-item
37
+ v-for="item in quickNavList"
38
+ :key="item.id"
39
+ @click="goToModule(item.path)"
40
+ >
41
+ <div class="grid-item-content">
42
+ <div class="icon-container"><van-icon :name="item.icon" size="24" color="#816e6e" /></div>
43
+ <div class="text-container">{{ item.text }}</div>
44
+ </div>
45
+ </van-grid-item>
46
+ </van-grid>
47
+ </div>
48
+ <!-- 通知公告 -->
49
+ <div class="notice-section">
50
+ <div class="notice-header">
51
+ <span class="notice-title">通知公告</span>
52
+ <span class="more-link" @click="goToMoreNotice">更多 ></span>
53
+ </div>
54
+ <Card
55
+ v-for="(notice, index) in noticeList.slice(0, 5)"
56
+ :key="index"
57
+ >
58
+ <template>
59
+ <div>
60
+
61
+ </div>
62
+ </template>
63
+ </Card>
64
+ <!-- <van-card
65
+ v-for="(notice, index) in noticeList.slice(0, 5)"
66
+ :key="index"
67
+ :desc="notice.content"
68
+ :title="notice.title"
69
+ :thumb="notice.thumb || 'https://img.yzcdn.cn/vant/notice.png'"
70
+ @click="goToNoticeDetail(notice.id)"
71
+ /> -->
72
+ </div>
73
+ <!-- 公司新闻 -->
74
+ <div class="notice-section">
75
+ <div class="notice-header">
76
+ <span class="notice-title">公司新闻</span>
77
+ <span class="more-link" @click="goToMoreNotice">更多 ></span>
78
+ </div>
79
+ <van-card
80
+ v-for="(notice, index) in noticeList.slice(0, 5)"
81
+ :key="index"
82
+ :desc="notice.content"
83
+ :title="notice.title"
84
+ :thumb="notice.thumb || 'https://img.yzcdn.cn/vant/notice.png'"
85
+ @click="goToNoticeDetail(notice.id)"
86
+ />
87
+ </div>
88
+ </template>
89
+
90
+ <script setup>
91
+ import Card from '@/components/card.vue'
92
+ import { ref } from 'vue'
93
+ import {useRouter} from 'vue-router'
94
+ const router = useRouter()
95
+ const quickNavList = ref([
96
+ { id: 1, icon: 'newspaper', text: '新闻', path: '/' },
97
+ { id: 2, icon: 'notes', text: '公文', path: '/official' },
98
+ { id: 3, icon: 'label', text: '行政', path: '/list' },
99
+ { id: 4, icon: 'more', text: '更多', path: '/' },
100
+ ])
101
+ const noticeList = ref([
102
+ { id: 1, title: '通知公告1', content: '这是通知公告1的内容', thumb: 'https://img.yzcdn.cn/vant/notice.png' },
103
+ { id: 2, title: '通知公告2', content: '这是通知公告2的内容' },
104
+ { id: 3, title: '通知公告3', content: '这是通知公告3的内容' },
105
+ { id: 4, title: '通知公告4', content: '这是通知公告4的内容' },
106
+ { id: 5, title: '通知公告5', content: '这是通知公告5的内容' },
107
+ ])
108
+ // 点击导航项跳转到对应的模块
109
+ const goToModule = (path) => {
110
+ router.push(path)
111
+ }
112
+ </script>
113
+ <style scoped lang="scss">
114
+ $primary-color:#C59B70;
115
+ .header {
116
+
117
+ background-color: $primary-color;
118
+ padding: 6px 10px;
119
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
120
+ display: flex;
121
+ justify-content: space-between;
122
+ align-items: center;
123
+ .header-actions {
124
+ display: flex;
125
+ align-items: center;
126
+ }
127
+
128
+ .user-info {
129
+ display: flex;
130
+ align-items: center;
131
+ .username {
132
+ font-size: 16px;
133
+ font-weight: bold;
134
+ color: white;
135
+ }
136
+ .avatar {
137
+ width: 40px;
138
+ height: 40px;
139
+ border-radius: 50%;
140
+ margin-right: 12px;
141
+ border: 2px solid white;
142
+ }
143
+ }
144
+
145
+ }
146
+
147
+ .my-swipe .van-swipe-item {
148
+ color: #fff;
149
+ font-size: 20px;
150
+ line-height: 150px;
151
+ text-align: center;
152
+ background-color: #39a9ed;
153
+ }
154
+
155
+
156
+ .quick-nav {
157
+ padding: 16px;
158
+ }
159
+ .grid-item-content {
160
+ display: flex;
161
+ flex-direction: column;
162
+ align-items: center;
163
+ justify-content: center;
164
+ }
165
+ .icon-container{
166
+ height: 50px;
167
+ width: 50px;
168
+ border-radius: 50%;
169
+ background-color: #c59b70c2;
170
+ display: flex;
171
+ align-items: center;
172
+ justify-content: center;
173
+ }
174
+ .text-container{
175
+ font-size: 14px;
176
+ color: #816e6e;
177
+ margin-top: 4px;
178
+ }
179
+
180
+ .notice-section {
181
+ padding: 0px 16px 16px 16px;
182
+ }
183
+ .notice-header {
184
+ display: flex;
185
+ justify-content: space-between;
186
+ align-items: center;
187
+ .more-link {
188
+ font-size: 14px;
189
+ color: $primary-color;
190
+ }
191
+ }
192
+ .notice-title {
193
+ font-size: 16px;
194
+ font-weight: bold;
195
+ }
196
+ .van-search {
197
+ background-color: $primary-color;
198
+ }
199
+ </style>
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <FilterSortPanel class="filter-sort-toolbar">
3
+ <template #filter>
4
+ <div class="panel-section">
5
+ <div class="panel-title">筛选方式</div>
6
+ <van-radio-group v-model="filterValue" direction="vertical">
7
+ <van-radio
8
+ v-for="item in filterOptions"
9
+ :key="item.value"
10
+ :name="item.value"
11
+ >
12
+ {{ item.label }}
13
+ </van-radio>
14
+ </van-radio-group>
15
+ <div class="panel-actions">
16
+ <van-button size="small" type="default" round plain @click="resetFilters">
17
+ 重置
18
+ </van-button>
19
+ <van-button size="small" type="primary" round @click="applyFilters">
20
+ 完成
21
+ </van-button>
22
+ </div>
23
+ </div>
24
+ </template>
25
+ <template #sort>
26
+ <div class="panel-section">
27
+ <div class="panel-title">排序方式</div>
28
+ <van-radio-group v-model="sortValue" direction="vertical">
29
+ <van-radio
30
+ v-for="item in sortOptions"
31
+ :key="item.value"
32
+ :name="item.value"
33
+ >
34
+ {{ item.label }}
35
+ </van-radio>
36
+ </van-radio-group>
37
+ </div>
38
+ </template>
39
+ </FilterSortPanel>
40
+
41
+ </template>
42
+ <script setup>
43
+ import { ref } from 'vue'
44
+ import FilterSortPanel from '@/components/FilterSortPanel.vue'
45
+
46
+ const sortValue = ref('latestCreated')
47
+ const filterValue = ref('all')
48
+
49
+ const sortOptions = [
50
+ { label: '最新创建', value: 'latestCreated' },
51
+ { label: '最早创建', value: 'earliestCreated' },
52
+ { label: '最近更新', value: 'latestUpdated' },
53
+ { label: '最早更新', value: 'earliestUpdated' }
54
+ ]
55
+
56
+ const filterOptions = [
57
+ { label: '全部公文', value: 'all' },
58
+ { label: '待审公文', value: 'pending' },
59
+ { label: '已审公文', value: 'approved' },
60
+ { label: '签报公文', value: 'sign' }
61
+ ]
62
+
63
+ const resetFilters = () => {
64
+ filterValue.value = 'all'
65
+ }
66
+
67
+ const applyFilters = () => {
68
+ // 在此处触发实际的筛选逻辑
69
+ // 例如:emit('filter-change', { filter: filterValue.value, sort: sortValue.value })
70
+ }
71
+ </script>
72
+ <style lang='scss' scoped>
73
+ .filter-sort-toolbar {
74
+ margin-bottom: 10px;
75
+ }
76
+
77
+ .panel-section {
78
+ display: flex;
79
+ flex-direction: column;
80
+ gap: 12px;
81
+ }
82
+
83
+ .panel-title {
84
+ font-size: 16px;
85
+ font-weight: 600;
86
+ color: #333;
87
+ }
88
+
89
+ .panel-actions {
90
+ display: flex;
91
+ justify-content: flex-end;
92
+ gap: 10px;
93
+ }
94
+
95
+ </style>