create-weapp-vite 2.3.14 → 2.3.16
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/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-JolaD7Ia.js → src-C8kzMXK7.js} +11 -7
- package/package.json +1 -1
- package/templates/default/.vscode/extensions.json +2 -1
- package/templates/default/package.json +3 -0
- package/templates/lib/.vscode/extensions.json +2 -1
- package/templates/lib/package.json +4 -1
- package/templates/plugin/.vscode/extensions.json +7 -0
- package/templates/plugin/package.json +3 -0
- package/templates/tailwindcss/.vscode/extensions.json +2 -1
- package/templates/tailwindcss/package.json +3 -0
- package/templates/tdesign/.vscode/extensions.json +2 -1
- package/templates/tdesign/package.json +3 -0
- package/templates/vant/.vscode/extensions.json +2 -1
- package/templates/vant/package.json +3 -0
- package/templates/wevu/.vscode/extensions.json +2 -1
- package/templates/wevu/README.md +3 -3
- package/templates/wevu/package.json +4 -1
- package/templates/wevu/src/app.vue +1 -60
- package/templates/wevu/src/pages/index/index.vue +26 -194
- package/templates/wevu/src/pages/layouts/index.vue +0 -18
- package/templates/wevu/weapp-vite.config.ts +0 -7
- package/templates/wevu-tdesign/.vscode/extensions.json +2 -1
- package/templates/wevu-tdesign/README.md +3 -6
- package/templates/wevu-tdesign/package.json +4 -1
- package/templates/wevu-tdesign/project.private.config.json +0 -66
- package/templates/wevu-tdesign/src/app.vue +1 -73
- package/templates/wevu-tdesign/src/pages/index/index.vue +19 -362
- package/templates/wevu/src/components/InfoPanel/index.vue +0 -52
- package/templates/wevu/src/components/StatusPill/index.vue +0 -42
- package/templates/wevu/src/packageA/pages/workspace/index.vue +0 -137
- package/templates/wevu/src/packageB/pages/settings/index.vue +0 -131
- package/templates/wevu/src/pages/overview/index.vue +0 -149
- package/templates/wevu-tdesign/public/tabbar/ability-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/ability.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/data-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/data.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/form-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/form.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/home-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/home.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/list-active.png +0 -0
- package/templates/wevu-tdesign/public/tabbar/list.png +0 -0
- package/templates/wevu-tdesign/src/components/EmptyState/index.vue +0 -36
- package/templates/wevu-tdesign/src/components/FilterBar/index.vue +0 -64
- package/templates/wevu-tdesign/src/components/FormRow/index.vue +0 -43
- package/templates/wevu-tdesign/src/components/FormStep/index.vue +0 -48
- package/templates/wevu-tdesign/src/components/KpiBoard/index.vue +0 -145
- package/templates/wevu-tdesign/src/components/QuickActionGrid/index.vue +0 -79
- package/templates/wevu-tdesign/src/components/ResultCard/index.vue +0 -51
- package/templates/wevu-tdesign/src/components/SectionTitle/index.vue +0 -34
- package/templates/wevu-tdesign/src/components/TrendCard/index.vue +0 -101
- package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/BrokenCard.vue +0 -46
- package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/FixedExternalClassCard.vue +0 -50
- package/templates/wevu-tdesign/src/components/VirtualHostClassDemo/RecommendedCard.vue +0 -53
- package/templates/wevu-tdesign/src/hooks/useDialog.ts +0 -205
- package/templates/wevu-tdesign/src/hooks/useFormBinder.ts +0 -17
- package/templates/wevu-tdesign/src/hooks/useLayoutFeedbackBridge.ts +0 -17
- package/templates/wevu-tdesign/src/hooks/usePullDownRefresh.ts +0 -12
- package/templates/wevu-tdesign/src/hooks/useToast.ts +0 -100
- package/templates/wevu-tdesign/src/layouts/admin.vue +0 -41
- package/templates/wevu-tdesign/src/layouts/default.vue +0 -23
- package/templates/wevu-tdesign/src/pages/ability/index.vue +0 -164
- package/templates/wevu-tdesign/src/pages/data/index.vue +0 -189
- package/templates/wevu-tdesign/src/pages/form/index.vue +0 -271
- package/templates/wevu-tdesign/src/pages/layout-feedback/components/FeedbackCallerCard.vue +0 -79
- package/templates/wevu-tdesign/src/pages/layout-feedback/index.vue +0 -211
- package/templates/wevu-tdesign/src/pages/layout-store/index.vue +0 -127
- package/templates/wevu-tdesign/src/pages/layouts/index.vue +0 -120
- package/templates/wevu-tdesign/src/pages/list/index.vue +0 -146
- package/templates/wevu-tdesign/src/stores/layoutInteractionDemo.ts +0 -129
- package/templates/wevu-tdesign/src/subpackages/ability/index.vue +0 -103
- package/templates/wevu-tdesign/src/subpackages/lab/class-binding/index.vue +0 -440
- package/templates/wevu-tdesign/src/subpackages/lab/index.vue +0 -169
- package/templates/wevu-tdesign/src/subpackages/lab/virtual-host-class/index.vue +0 -94
- package/templates/wevu-tdesign/src/types/action.ts +0 -14
- package/templates/wevu-tdesign/src/types/list.ts +0 -17
- package/templates/wevu-tdesign/src/utils/changeEvent.ts +0 -53
- package/templates/wevu-tdesign/src/utils/listFilters.ts +0 -34
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, watch } from 'wevu'
|
|
3
|
-
|
|
4
|
-
import KpiBoard from '@/components/KpiBoard/index.vue'
|
|
5
|
-
import SectionTitle from '@/components/SectionTitle/index.vue'
|
|
6
|
-
import TrendCard from '@/components/TrendCard/index.vue'
|
|
7
|
-
import { resolveStringChangeValue } from '@/utils/changeEvent'
|
|
8
|
-
|
|
9
|
-
definePageJson({
|
|
10
|
-
navigationBarTitleText: '数据',
|
|
11
|
-
backgroundColor: '#f6f7fb',
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
const ranges = [
|
|
15
|
-
{ value: 'today', label: '今日' },
|
|
16
|
-
{ value: 'week', label: '本周' },
|
|
17
|
-
{ value: 'month', label: '本月' },
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
const activeRange = ref('week')
|
|
21
|
-
const refreshTick = ref(0)
|
|
22
|
-
|
|
23
|
-
const kpiItems = computed(() => {
|
|
24
|
-
const scale = activeRange.value === 'today' ? 1 : activeRange.value === 'month' ? 4 : 2
|
|
25
|
-
const drift = refreshTick.value
|
|
26
|
-
return [
|
|
27
|
-
{
|
|
28
|
-
key: 'orders',
|
|
29
|
-
label: '订单量',
|
|
30
|
-
value: 268 * scale + drift,
|
|
31
|
-
unit: '单',
|
|
32
|
-
delta: 12 + drift,
|
|
33
|
-
footnote: '核心目标',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
key: 'gmv',
|
|
37
|
-
label: '成交额',
|
|
38
|
-
value: 42 * scale + drift,
|
|
39
|
-
unit: '万',
|
|
40
|
-
delta: 3 + drift,
|
|
41
|
-
footnote: 'GMV',
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
key: 'retention',
|
|
45
|
-
label: '留存',
|
|
46
|
-
value: 62 + drift,
|
|
47
|
-
unit: '%',
|
|
48
|
-
delta: 4,
|
|
49
|
-
footnote: '用户粘性',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
key: 'nps',
|
|
53
|
-
label: 'NPS',
|
|
54
|
-
value: 48 + drift,
|
|
55
|
-
unit: '分',
|
|
56
|
-
delta: 2,
|
|
57
|
-
footnote: '满意度',
|
|
58
|
-
},
|
|
59
|
-
]
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
const trends = computed(() => [
|
|
63
|
-
{
|
|
64
|
-
key: 'active',
|
|
65
|
-
title: '活跃用户',
|
|
66
|
-
value: activeRange.value === 'today' ? 980 : activeRange.value === 'month' ? 8820 : 3560,
|
|
67
|
-
unit: '人',
|
|
68
|
-
delta: 12 + refreshTick.value,
|
|
69
|
-
progress: 78,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
key: 'conversion',
|
|
73
|
-
title: '转化漏斗',
|
|
74
|
-
value: activeRange.value === 'today' ? 21 : activeRange.value === 'month' ? 25 : 23,
|
|
75
|
-
unit: '%',
|
|
76
|
-
delta: 1,
|
|
77
|
-
progress: 56,
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
key: 'response',
|
|
81
|
-
title: '响应时长',
|
|
82
|
-
value: activeRange.value === 'today' ? 1.6 : 1.8,
|
|
83
|
-
unit: 's',
|
|
84
|
-
delta: -0.2,
|
|
85
|
-
progress: 68,
|
|
86
|
-
},
|
|
87
|
-
])
|
|
88
|
-
|
|
89
|
-
const reportLines = computed(() => [
|
|
90
|
-
`分组:${ranges.find(range => range.value === activeRange.value)?.label ?? '本周'}`,
|
|
91
|
-
'渠道贡献 Top3:直播、社群、搜索',
|
|
92
|
-
'重点事项:提升转化 > 优化留存',
|
|
93
|
-
])
|
|
94
|
-
|
|
95
|
-
function onRangeChange(event: unknown) {
|
|
96
|
-
activeRange.value = resolveStringChangeValue(event, activeRange.value)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
watch(activeRange, () => {
|
|
100
|
-
refreshTick.value = Math.floor(Math.random() * 6)
|
|
101
|
-
})
|
|
102
|
-
</script>
|
|
103
|
-
|
|
104
|
-
<template>
|
|
105
|
-
<view class="min-h-screen bg-[#f6f7fb] px-[28rpx] pb-[88rpx] pt-[24rpx] text-[#1c1c3c]">
|
|
106
|
-
<view class="rounded-[28rpx] bg-linear-to-br from-[#f1f5ff] via-[#eef2ff] to-[#ffffff] p-[20rpx]">
|
|
107
|
-
<SectionTitle title="经营仪表盘" subtitle="聚焦关键指标与趋势" />
|
|
108
|
-
<view class="mt-[12rpx]">
|
|
109
|
-
<t-tabs :value="activeRange" @change="onRangeChange">
|
|
110
|
-
<t-tab-panel v-for="range in ranges" :key="range.value" :value="range.value" :label="range.label" />
|
|
111
|
-
</t-tabs>
|
|
112
|
-
</view>
|
|
113
|
-
</view>
|
|
114
|
-
|
|
115
|
-
<view class="mt-[18rpx]">
|
|
116
|
-
<KpiBoard title="核心 KPI" subtitle="趋势随区间自动刷新" :items="kpiItems">
|
|
117
|
-
<template #action />
|
|
118
|
-
<template #items="{ items }">
|
|
119
|
-
<view v-for="card in items" :key="card.key">
|
|
120
|
-
<view class="rounded-[18rpx] bg-[#f7f7fb] p-[16rpx]">
|
|
121
|
-
<view class="flex items-center justify-between">
|
|
122
|
-
<view class="flex items-center gap-[8rpx]">
|
|
123
|
-
<view class="h-[8rpx] w-[8rpx] rounded-full" :class="card.tone === 'positive' ? 'bg-[#22c55e]' : card.tone === 'negative' ? 'bg-[#ef4444]' : 'bg-[#94a3b8]'" />
|
|
124
|
-
<text class="text-[22rpx] text-[#61618a]">
|
|
125
|
-
{{ card.item.label }}
|
|
126
|
-
</text>
|
|
127
|
-
</view>
|
|
128
|
-
<view v-if="card.isLeading" class="rounded-full bg-[#fff3c2] px-[10rpx] py-[4rpx]">
|
|
129
|
-
<text class="text-[18rpx] font-semibold text-[#8a5200]">
|
|
130
|
-
HOT
|
|
131
|
-
</text>
|
|
132
|
-
</view>
|
|
133
|
-
</view>
|
|
134
|
-
<view class="mt-[10rpx] flex items-end justify-between">
|
|
135
|
-
<view class="flex items-baseline gap-[6rpx]">
|
|
136
|
-
<text class="text-[32rpx] font-bold text-[#1c1c3c]">
|
|
137
|
-
{{ card.item.value }}
|
|
138
|
-
</text>
|
|
139
|
-
<text v-if="card.item.unit" class="text-[20rpx] text-[#7a7aa0]">
|
|
140
|
-
{{ card.item.unit }}
|
|
141
|
-
</text>
|
|
142
|
-
</view>
|
|
143
|
-
<view
|
|
144
|
-
class="rounded-full px-[10rpx] py-[4rpx]"
|
|
145
|
-
:class="card.tone === 'positive' ? 'bg-[#e7f7ee] text-[#1b7a3a]' : card.tone === 'negative' ? 'bg-[#ffe9e9] text-[#b42318]' : 'bg-[#edf1f7] text-[#64748b]'"
|
|
146
|
-
>
|
|
147
|
-
<text class="text-[20rpx] font-semibold">
|
|
148
|
-
{{ card.tone === 'positive' ? '↑' : card.tone === 'negative' ? '↓' : '→' }}
|
|
149
|
-
{{ card.item.delta == null ? '--' : card.item.delta + (card.item.unit ? card.item.unit : '') }}
|
|
150
|
-
</text>
|
|
151
|
-
</view>
|
|
152
|
-
</view>
|
|
153
|
-
<text v-if="card.item.footnote" class="mt-[6rpx] block text-[20rpx] text-[#8a8aa5]">
|
|
154
|
-
{{ card.item.footnote }}
|
|
155
|
-
</text>
|
|
156
|
-
</view>
|
|
157
|
-
</view>
|
|
158
|
-
</template>
|
|
159
|
-
</KpiBoard>
|
|
160
|
-
</view>
|
|
161
|
-
|
|
162
|
-
<view class="mt-[18rpx]">
|
|
163
|
-
<SectionTitle title="趋势追踪" subtitle="转化与体验指标" />
|
|
164
|
-
<view class="mt-[12rpx] grid gap-[12rpx]">
|
|
165
|
-
<TrendCard
|
|
166
|
-
v-for="card in trends"
|
|
167
|
-
:key="card.key"
|
|
168
|
-
:title="card.title"
|
|
169
|
-
:value="card.value"
|
|
170
|
-
:unit="card.unit"
|
|
171
|
-
:delta="card.delta"
|
|
172
|
-
:progress="card.progress"
|
|
173
|
-
/>
|
|
174
|
-
</view>
|
|
175
|
-
</view>
|
|
176
|
-
|
|
177
|
-
<view class="mt-[18rpx] rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
|
|
178
|
-
<SectionTitle title="经营洞察" subtitle="跟进重点事项" />
|
|
179
|
-
<view class="mt-[12rpx] space-y-[10rpx]">
|
|
180
|
-
<view v-for="line in reportLines" :key="line" class="flex items-center gap-[8rpx]">
|
|
181
|
-
<view class="h-[8rpx] w-[8rpx] rounded-full bg-[#5a48c5]" />
|
|
182
|
-
<text class="text-[22rpx] text-[#4c4b68]">
|
|
183
|
-
{{ line }}
|
|
184
|
-
</text>
|
|
185
|
-
</view>
|
|
186
|
-
</view>
|
|
187
|
-
</view>
|
|
188
|
-
</view>
|
|
189
|
-
</template>
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { UploadFile } from 'tdesign-miniprogram/upload/type'
|
|
3
|
-
|
|
4
|
-
import { computed, reactive, ref, watch } from 'wevu'
|
|
5
|
-
|
|
6
|
-
import FormRow from '@/components/FormRow/index.vue'
|
|
7
|
-
import FormStep from '@/components/FormStep/index.vue'
|
|
8
|
-
import ResultCard from '@/components/ResultCard/index.vue'
|
|
9
|
-
import SectionTitle from '@/components/SectionTitle/index.vue'
|
|
10
|
-
import { useFormBinder } from '@/hooks/useFormBinder'
|
|
11
|
-
import { useToast } from '@/hooks/useToast'
|
|
12
|
-
import { resolveBooleanChangeValue } from '@/utils/changeEvent'
|
|
13
|
-
|
|
14
|
-
definePageJson({
|
|
15
|
-
navigationBarTitleText: '表单',
|
|
16
|
-
backgroundColor: '#f6f7fb',
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const { changeModel } = useFormBinder()
|
|
20
|
-
const { showToast } = useToast()
|
|
21
|
-
|
|
22
|
-
const steps = [
|
|
23
|
-
{ key: 'basic', title: '基础信息', subtitle: '业务基本配置' },
|
|
24
|
-
{ key: 'strategy', title: '执行策略', subtitle: '预算与节奏' },
|
|
25
|
-
{ key: 'confirm', title: '确认提交', subtitle: '核对并提交' },
|
|
26
|
-
]
|
|
27
|
-
|
|
28
|
-
const currentStep = ref(0)
|
|
29
|
-
const submitted = ref(false)
|
|
30
|
-
|
|
31
|
-
const formState = reactive({
|
|
32
|
-
name: '',
|
|
33
|
-
owner: '',
|
|
34
|
-
category: 'growth',
|
|
35
|
-
urgent: false,
|
|
36
|
-
budget: 30,
|
|
37
|
-
pace: 'balanced',
|
|
38
|
-
description: '',
|
|
39
|
-
attachments: [] as UploadFile[],
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
const categories = [
|
|
43
|
-
{ value: 'growth', label: '增长' },
|
|
44
|
-
{ value: 'retention', label: '留存' },
|
|
45
|
-
{ value: 'brand', label: '品牌' },
|
|
46
|
-
]
|
|
47
|
-
|
|
48
|
-
const paceOptions = [
|
|
49
|
-
{ value: 'fast', label: '快速推进' },
|
|
50
|
-
{ value: 'balanced', label: '平衡' },
|
|
51
|
-
{ value: 'steady', label: '稳健' },
|
|
52
|
-
]
|
|
53
|
-
|
|
54
|
-
const riskLevel = computed(() => {
|
|
55
|
-
if (formState.urgent && formState.budget > 60) {
|
|
56
|
-
return '高风险'
|
|
57
|
-
}
|
|
58
|
-
if (formState.budget > 40) {
|
|
59
|
-
return '中风险'
|
|
60
|
-
}
|
|
61
|
-
return '可控'
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
const canGoNext = computed(() => {
|
|
65
|
-
if (currentStep.value === 0) {
|
|
66
|
-
return !!formState.name && !!formState.owner
|
|
67
|
-
}
|
|
68
|
-
if (currentStep.value === 1) {
|
|
69
|
-
return !!formState.description
|
|
70
|
-
}
|
|
71
|
-
return true
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
const summaryRows = computed(() => [
|
|
75
|
-
{ label: '项目名称', value: formState.name || '--' },
|
|
76
|
-
{ label: '负责人', value: formState.owner || '--' },
|
|
77
|
-
{ label: '类型', value: categories.find(item => item.value === formState.category)?.label ?? '--' },
|
|
78
|
-
{ label: '预算', value: `${formState.budget} 万` },
|
|
79
|
-
{ label: '节奏', value: paceOptions.find(item => item.value === formState.pace)?.label ?? '--' },
|
|
80
|
-
{ label: '风险级别', value: riskLevel.value },
|
|
81
|
-
])
|
|
82
|
-
|
|
83
|
-
watch(
|
|
84
|
-
() => formState.urgent,
|
|
85
|
-
(value) => {
|
|
86
|
-
if (value) {
|
|
87
|
-
formState.pace = 'fast'
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
const nameModel = changeModel<string>('formState.name')
|
|
93
|
-
const ownerModel = changeModel<string>('formState.owner')
|
|
94
|
-
const categoryModel = changeModel<string>('formState.category')
|
|
95
|
-
const budgetModel = changeModel<number>('formState.budget')
|
|
96
|
-
const paceModel = changeModel<string>('formState.pace')
|
|
97
|
-
const descriptionModel = changeModel<string>('formState.description')
|
|
98
|
-
const attachmentsModel = changeModel<UploadFile[], 'files'>('formState.attachments', {
|
|
99
|
-
valueProp: 'files',
|
|
100
|
-
parser: event => event?.detail?.files ?? [],
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
function setUrgent(value: boolean) {
|
|
104
|
-
formState.urgent = value
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function toggleUrgent() {
|
|
108
|
-
setUrgent(!formState.urgent)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function handleUrgentChange(event: unknown) {
|
|
112
|
-
setUrgent(resolveBooleanChangeValue(event, !formState.urgent))
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function stopUrgentTap() {
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function goNext() {
|
|
119
|
-
if (!canGoNext.value) {
|
|
120
|
-
showToast('请先完善当前步骤信息', 'warning')
|
|
121
|
-
return
|
|
122
|
-
}
|
|
123
|
-
if (currentStep.value < steps.length - 1) {
|
|
124
|
-
currentStep.value += 1
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function goPrev() {
|
|
129
|
-
if (currentStep.value > 0) {
|
|
130
|
-
currentStep.value -= 1
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function submit() {
|
|
135
|
-
submitted.value = true
|
|
136
|
-
showToast('提交成功')
|
|
137
|
-
}
|
|
138
|
-
</script>
|
|
139
|
-
|
|
140
|
-
<template>
|
|
141
|
-
<view class="min-h-screen bg-[#f6f7fb] px-[28rpx] pb-[88rpx] pt-[24rpx] text-[#1c1c3c]">
|
|
142
|
-
<view class="rounded-[28rpx] bg-linear-to-br from-[#fff7ed] via-[#ffffff] to-[#fef3c7] p-[20rpx]">
|
|
143
|
-
<SectionTitle title="项目提报" subtitle="示例多步表单与联动校验" />
|
|
144
|
-
<view class="mt-[12rpx]">
|
|
145
|
-
<t-steps :current="currentStep" layout="horizontal">
|
|
146
|
-
<t-step-item v-for="item in steps" :key="item.key" :title="item.title" />
|
|
147
|
-
</t-steps>
|
|
148
|
-
</view>
|
|
149
|
-
</view>
|
|
150
|
-
|
|
151
|
-
<view class="mt-[18rpx] space-y-[14rpx]">
|
|
152
|
-
<FormStep
|
|
153
|
-
v-if="currentStep === 0"
|
|
154
|
-
:step="1"
|
|
155
|
-
title="基础信息"
|
|
156
|
-
subtitle="填写核心字段"
|
|
157
|
-
:active="currentStep === 0"
|
|
158
|
-
>
|
|
159
|
-
<view class="flex flex-col gap-[14rpx]">
|
|
160
|
-
<FormRow label="项目名称">
|
|
161
|
-
<t-input
|
|
162
|
-
placeholder="例如:新客增长计划"
|
|
163
|
-
:value="nameModel.value"
|
|
164
|
-
@change="nameModel.onChange"
|
|
165
|
-
/>
|
|
166
|
-
</FormRow>
|
|
167
|
-
<FormRow label="负责人">
|
|
168
|
-
<t-input
|
|
169
|
-
placeholder="例如:王凯"
|
|
170
|
-
:value="ownerModel.value"
|
|
171
|
-
@change="ownerModel.onChange"
|
|
172
|
-
/>
|
|
173
|
-
</FormRow>
|
|
174
|
-
<FormRow label="类型">
|
|
175
|
-
<t-radio-group :value="categoryModel.value" @change="categoryModel.onChange">
|
|
176
|
-
<t-radio v-for="item in categories" :key="item.value" :value="item.value" :label="item.label" />
|
|
177
|
-
</t-radio-group>
|
|
178
|
-
</FormRow>
|
|
179
|
-
<view
|
|
180
|
-
class="urgent-row-toggle flex items-center justify-between rounded-[18rpx] bg-[#f8fafc] px-[18rpx] py-[16rpx]"
|
|
181
|
-
@tap="toggleUrgent"
|
|
182
|
-
>
|
|
183
|
-
<view>
|
|
184
|
-
<text class="text-[22rpx] font-semibold text-[#1f1a3f]">
|
|
185
|
-
加急
|
|
186
|
-
</text>
|
|
187
|
-
<text class="mt-[4rpx] block text-[20rpx] text-[#8a8aa5]">
|
|
188
|
-
整行可点击切换,开启后默认切到快速推进
|
|
189
|
-
</text>
|
|
190
|
-
</view>
|
|
191
|
-
<t-switch :value="formState.urgent" @tap.stop="stopUrgentTap" @change="handleUrgentChange" />
|
|
192
|
-
</view>
|
|
193
|
-
</view>
|
|
194
|
-
</FormStep>
|
|
195
|
-
|
|
196
|
-
<FormStep
|
|
197
|
-
v-if="currentStep === 1"
|
|
198
|
-
:step="2"
|
|
199
|
-
title="执行策略"
|
|
200
|
-
subtitle="预算与节奏"
|
|
201
|
-
:active="currentStep === 1"
|
|
202
|
-
>
|
|
203
|
-
<view class="flex flex-col gap-[14rpx]">
|
|
204
|
-
<FormRow label="预算规模" description="10-100 万">
|
|
205
|
-
<view class="flex items-center gap-[12rpx]">
|
|
206
|
-
<t-slider
|
|
207
|
-
:value="budgetModel.value"
|
|
208
|
-
:min="10"
|
|
209
|
-
:max="100"
|
|
210
|
-
@change="budgetModel.onChange"
|
|
211
|
-
/>
|
|
212
|
-
<text class="text-[22rpx] text-[#5c5b7a]">
|
|
213
|
-
{{ formState.budget }} 万
|
|
214
|
-
</text>
|
|
215
|
-
</view>
|
|
216
|
-
</FormRow>
|
|
217
|
-
<FormRow label="推进节奏">
|
|
218
|
-
<t-radio-group :value="paceModel.value" @change="paceModel.onChange">
|
|
219
|
-
<t-radio v-for="item in paceOptions" :key="item.value" :value="item.value" :label="item.label" />
|
|
220
|
-
</t-radio-group>
|
|
221
|
-
</FormRow>
|
|
222
|
-
<FormRow label="补充说明">
|
|
223
|
-
<t-textarea
|
|
224
|
-
placeholder="描述目标与资源安排"
|
|
225
|
-
:value="descriptionModel.value"
|
|
226
|
-
:maxlength="140"
|
|
227
|
-
@change="descriptionModel.onChange"
|
|
228
|
-
/>
|
|
229
|
-
</FormRow>
|
|
230
|
-
<FormRow label="附件">
|
|
231
|
-
<t-upload
|
|
232
|
-
:files="attachmentsModel.files"
|
|
233
|
-
:max="3"
|
|
234
|
-
@change="attachmentsModel.onChange"
|
|
235
|
-
/>
|
|
236
|
-
</FormRow>
|
|
237
|
-
</view>
|
|
238
|
-
</FormStep>
|
|
239
|
-
|
|
240
|
-
<FormStep
|
|
241
|
-
v-if="currentStep === 2"
|
|
242
|
-
:step="3"
|
|
243
|
-
title="确认提交"
|
|
244
|
-
subtitle="预览关键信息"
|
|
245
|
-
:active="currentStep === 2"
|
|
246
|
-
>
|
|
247
|
-
<ResultCard title="提交摘要" :items="summaryRows">
|
|
248
|
-
<template #action>
|
|
249
|
-
<t-tag size="small" theme="primary" variant="light">
|
|
250
|
-
{{ riskLevel }}
|
|
251
|
-
</t-tag>
|
|
252
|
-
</template>
|
|
253
|
-
</ResultCard>
|
|
254
|
-
</FormStep>
|
|
255
|
-
</view>
|
|
256
|
-
|
|
257
|
-
<view class="mt-[18rpx] flex gap-[12rpx]">
|
|
258
|
-
<t-button block variant="outline" theme="default" :disabled="currentStep === 0" @tap="goPrev">
|
|
259
|
-
上一步
|
|
260
|
-
</t-button>
|
|
261
|
-
<t-button
|
|
262
|
-
block
|
|
263
|
-
theme="primary"
|
|
264
|
-
:disabled="currentStep === steps.length - 1 && submitted"
|
|
265
|
-
@tap="currentStep === steps.length - 1 ? submit() : goNext()"
|
|
266
|
-
>
|
|
267
|
-
{{ currentStep === steps.length - 1 ? (submitted ? '已提交' : '提交') : '下一步' }}
|
|
268
|
-
</t-button>
|
|
269
|
-
</view>
|
|
270
|
-
</view>
|
|
271
|
-
</template>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'wevu'
|
|
3
|
-
import { useDialog } from '@/hooks/useDialog'
|
|
4
|
-
import { useToast } from '@/hooks/useToast'
|
|
5
|
-
|
|
6
|
-
const props = defineProps<{
|
|
7
|
-
onReport?: (payload: string) => void
|
|
8
|
-
}>()
|
|
9
|
-
|
|
10
|
-
const actionSeed = ref(0)
|
|
11
|
-
const { showToast } = useToast({ duration: 1400 })
|
|
12
|
-
const { alert, confirm } = useDialog()
|
|
13
|
-
|
|
14
|
-
function nextLabel(prefix: string) {
|
|
15
|
-
actionSeed.value += 1
|
|
16
|
-
return `${prefix} #${actionSeed.value}`
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function triggerChildToast() {
|
|
20
|
-
const label = nextLabel('子组件 Toast')
|
|
21
|
-
showToast(`${label} 已通过 layout 宿主触发`)
|
|
22
|
-
props.onReport?.(`${label} 已触发`)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function triggerChildAlert() {
|
|
26
|
-
const label = nextLabel('子组件 Alert')
|
|
27
|
-
void alert({
|
|
28
|
-
title: label,
|
|
29
|
-
content: '当前弹窗由子组件直接调用 useDialog(),但实际宿主仍在 layout 内。',
|
|
30
|
-
confirmBtn: '知道了',
|
|
31
|
-
}).then(() => {
|
|
32
|
-
props.onReport?.(`${label} 已确认`)
|
|
33
|
-
})
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function triggerChildConfirm() {
|
|
37
|
-
const label = nextLabel('子组件 Confirm')
|
|
38
|
-
void confirm({
|
|
39
|
-
title: label,
|
|
40
|
-
content: '点击确认后会回传一条日志,证明子组件与页面都能经由同一 layout 宿主通信。',
|
|
41
|
-
confirmBtn: '确认',
|
|
42
|
-
cancelBtn: '取消',
|
|
43
|
-
}).then(() => {
|
|
44
|
-
props.onReport?.(`${label} 点击确认`)
|
|
45
|
-
}).catch(() => {
|
|
46
|
-
props.onReport?.(`${label} 点击取消`)
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
</script>
|
|
50
|
-
|
|
51
|
-
<template>
|
|
52
|
-
<view class="rounded-[24rpx] bg-white p-[20rpx] shadow-[0_18rpx_40rpx_rgba(17,24,39,0.08)]">
|
|
53
|
-
<view class="flex items-center justify-between">
|
|
54
|
-
<view>
|
|
55
|
-
<text class="text-[28rpx] font-semibold text-[#1f1a3f]">
|
|
56
|
-
子组件直连 layout 宿主
|
|
57
|
-
</text>
|
|
58
|
-
<text class="mt-[6rpx] block text-[22rpx] leading-[1.7] text-[#6f6b8a]">
|
|
59
|
-
这个组件不接收 toast/dialog 实例,也不手动 selectComponent,只直接调用 useToast() / useDialog()。
|
|
60
|
-
</text>
|
|
61
|
-
</view>
|
|
62
|
-
<t-tag size="small" theme="primary" variant="light">
|
|
63
|
-
Child
|
|
64
|
-
</t-tag>
|
|
65
|
-
</view>
|
|
66
|
-
|
|
67
|
-
<view class="mt-[18rpx] flex flex-col gap-[12rpx]">
|
|
68
|
-
<t-button block theme="primary" variant="outline" @tap="triggerChildToast">
|
|
69
|
-
子组件触发 Toast
|
|
70
|
-
</t-button>
|
|
71
|
-
<t-button block theme="primary" variant="outline" @tap="triggerChildAlert">
|
|
72
|
-
子组件触发 Alert
|
|
73
|
-
</t-button>
|
|
74
|
-
<t-button block theme="danger" variant="outline" @tap="triggerChildConfirm">
|
|
75
|
-
子组件触发 Confirm
|
|
76
|
-
</t-button>
|
|
77
|
-
</view>
|
|
78
|
-
</view>
|
|
79
|
-
</template>
|