refactor: 确立独立子工程架构 (backend, admin, mpuniapp) 并同步更新 AGENTS.md 规范

这个提交包含在:
wikiboss
2026-09-20 17:05:22 +08:00
父节点 de3cf8b870
当前提交 9fa1d1fbd0
共有 1679 个文件被更改,包括 204798 次插入 和 16817 次删除

查看文件

@@ -0,0 +1,134 @@
<template>
<native-view @init="onInit"></native-view>
</template>
<script setup>
import {
CalendarPicker
} from '@/uni_modules/CalendarPicker'
const props = defineProps < {
/**
* 设置选中项的日期。选中的日期未设置或日期格式不符合规范则为默认值。
* 默认值:当前系统日期。
*/
selected ? : Date
/**
* 描述日期选中态底板样式。
* 默认值:底板样式为圆形。
* 说明:hintRadius为0,底板样式为直角矩形。hintRadius为0 ~ 16,底板样式为圆角矩形。hintRadius>=16,底板样式为圆形
*/
hintRadius ? : number
/**
* 设置选择器与入口组件的对齐方式。
* 默认end
* start: 左对齐
* center: 居中对齐
* end: 右对齐
*/
alignType ? : 'start' | 'center' | 'end'
/**
* 按照对齐类型对齐后,选择器相对入口组件的水平方向偏移量
* 默认:0
*/
offsetX ? : number | string
/**
* 按照对齐类型对齐后,选择器相对入口组件的竖直方向偏移量
* 默认:0
*/
offsetY ? : number | string
/**
* 文本颜色
*/
color ? : string
/**
* 文本尺寸
*/
fontSize ? : number
/**
* 字体粗细
* Lighter: 100
* Normal: 400
* Regular: 400
* Medium: 500
* Bold: 700
* Bolder: 900
*/
fontWeight ? : 100 | 400 | 500 | 700 | 900
/**
* 字体样式
* normal: 标准的字体样式
* italic: 斜体的字体样式
*/
fontStyle ? : 'normal' | 'italic'
} >
()
const emit = defineEmits < {
change: [date: Date]
} > ()
const picker: CalendarPicker = new CalendarPicker()
picker.onChange((value: Date) => {
emit('change', value)
})
watchEffect(() => {
const selected = props.selected
if (selected != null) {
picker.setSelected(selected)
}
})
watchEffect(() => {
const alignType = props.alignType
if (alignType != null) {
picker.setAlignType(alignType)
}
})
watchEffect(() => {
const offsetX = props.offsetX
if (offsetX != null) {
picker.setOffsetX(offsetX)
}
})
watchEffect(() => {
const offsetY = props.offsetY
if (offsetY != null) {
picker.setOffsetY(offsetY)
}
})
watchEffect(() => {
const hintRadius = props.hintRadius
if (hintRadius != null) {
picker.setHintRadius(hintRadius)
}
})
watchEffect(() => {
const color = props.color
if (color != null) {
picker.setColor(color)
}
})
watchEffect(() => {
const fontSize = props.fontSize
if (fontSize != null) {
picker.setFontSize(fontSize)
}
})
watchEffect(() => {
const fontStyle = props.fontStyle
if (fontStyle != null) {
picker.setFontStyle(fontStyle)
}
})
watchEffect(() => {
const fontWeight = props.fontWeight
if (fontWeight != null) {
picker.setFontWeight(fontWeight)
}
})
function onInit(event: UniNativeViewInitEvent) {
picker.init(event.detail.element)
}
</script>

查看文件

@@ -0,0 +1,83 @@
{
"id": "CalendarPicker",
"displayName": "CalendarPicker",
"version": "1.0.0",
"description": "CalendarPicker",
"keywords": [
"CalendarPicker"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u",
"alipay": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u",
"app-uvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

查看文件

@@ -0,0 +1 @@
# test-native-view

查看文件

@@ -0,0 +1,13 @@
@Builder
export function buildCalendarPicker(params: ESObject) {
CalendarPicker({ hintRadius: params.hintRadius, selected: params.selected })
.edgeAlign(params.alignType, { dx: params.offsetX, dy: params.offsetY })
.textStyle({
color: params.color,
font: { size: params.fontSize, weight: params.fontWeight, style: params.fontStyle }
})
.onChange((value) => {
params.onChange(value)
})
.attributeModifier(params.attributeUpdater)
}

查看文件

@@ -0,0 +1,108 @@
import { BuilderNode } from "@kit.ArkUI"
import { buildCalendarPicker } from "./builder.ets"
interface CalendarPickerOptions {
selected ?: Date
hintRadius ?: number
alignType ?: CalendarAlign
offsetX ?: number | string
offsetY ?: number | string
color ?: string
fontSize ?: number
fontWeight ?: 100 | 400 | 500 | 700 | 900
fontStyle ?: FontStyle
onChange ?: (value : Date) => void
}
export class CalendarPicker {
private onChanges : Array<(value : Date) => void> = []
private params : CalendarPickerOptions = {
onChange: (value : Date) => {
this.onChanges.forEach((onChange) => {
onChange(value)
})
}
}
private builder : BuilderNode<[CalendarPickerOptions]> | null = null
init(element : UniNativeViewElement) {
this.builder =
element.bindHarmonyWrappedBuilder(wrapBuilder<[CalendarPickerOptions]>(buildCalendarPicker), this.params)
}
onChange(callback : (value : Date) => void) : CalendarPicker {
this.onChanges.push(callback)
return this
}
setSelected(date : Date) : CalendarPicker {
this.params.selected = date
this.builder?.update(this.params)
return this
}
setAlignType(alignType : 'start' | 'center' | 'end') : CalendarPicker {
switch (alignType) {
case 'start':
this.params.alignType = CalendarAlign.START
break
case 'center':
this.params.alignType = CalendarAlign.CENTER
break
case 'end':
this.params.alignType = CalendarAlign.END
break
}
this.builder?.update(this.params)
return this
}
setOffsetX(offsetX : number | string) : CalendarPicker {
this.params.offsetX = offsetX
this.builder?.update(this.params)
return this
}
setOffsetY(offsetY : number | string) : CalendarPicker {
this.params.offsetY = offsetY
this.builder?.update(this.params)
return this
}
setHintRadius(hintRadius : number) : CalendarPicker {
this.params.hintRadius = hintRadius
this.builder?.update(this.params)
return this
}
setColor(color : string) : CalendarPicker {
this.params.color = color
this.builder?.update(this.params)
return this
}
setFontSize(fontSize : number) : CalendarPicker {
this.params.fontSize = fontSize
this.builder?.update(this.params)
return this
}
setFontWeight(fontWeight : 100 | 400 | 500 | 700 | 900) : CalendarPicker {
this.params.fontWeight = fontWeight
this.builder?.update(this.params)
return this
}
setFontStyle(fontStyle : 'normal' | 'italic') : CalendarPicker {
switch (fontStyle) {
case 'normal':
this.params.fontStyle = FontStyle.Normal
break
case 'italic':
this.params.fontStyle = FontStyle.Italic
break
}
this.builder?.update(this.params)
return this
}
}