From ee792d5205b848320029c7f45274dc39688bf9dd Mon Sep 17 00:00:00 2001 From: 刘淇 <290219706@qq.com> Date: Sat, 10 Oct 2026 14:53:15 +0800 Subject: [PATCH] 动态表单 --- api/common.js | 5 ++++- common/utils/request.js | 5 ++++- pages-sub/daily/maintain-manage/add-record.vue | 1425 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ pages/index/index.vue | 128 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------- pages/login/index.vue | 5 +++++ uni_modules/neo-datetime-pro/components/neo-datetime-pro/neo-datetime-pro.vue | 4 ++-- 6 files changed, 861 insertions(+), 711 deletions(-) diff --git a/api/common.js b/api/common.js index 2eaa6f4..00ad1a9 100644 --- a/api/common.js +++ b/api/common.js @@ -71,7 +71,7 @@ export const getOptionsByCode = (params) => { * @param {Object} params {} * @returns {Promise} */ -export const getMaterialsByCode = (params) => { +export const getMaterialByCode = (params) => { return get('/app-api/app/garden/work-field-config/materials', params); }; @@ -93,3 +93,6 @@ export const workRecordSubmit = (data) => { + + + diff --git a/common/utils/request.js b/common/utils/request.js index 6918e8f..7ddaa5e 100644 --- a/common/utils/request.js +++ b/common/utils/request.js @@ -7,7 +7,10 @@ const request = (options) => { url: '', method: 'GET', data: {}, - header: { 'Content-Type': 'application/json' }, + header: { + 'Content-Type': 'application/json', + 'tenant-id':'1' + }, timeout: globalConfig.api.timeout }; diff --git a/pages-sub/daily/maintain-manage/add-record.vue b/pages-sub/daily/maintain-manage/add-record.vue index 56fade7..c122a0b 100644 --- a/pages-sub/daily/maintain-manage/add-record.vue +++ b/pages-sub/daily/maintain-manage/add-record.vue @@ -4,233 +4,541 @@ - - - + + + + - - - + + + + + - - + + - - + + + + - - - + + + + + + {{ popupType6.fieldItem?.fieldName || '选择项目' }} + + + + + + + + {{ subItem.label }} + + + + + + + + + + + {{ row.label }} + + + + + + + 已选:{{ (inspectForm[popupType6.fieldCode] || []).length }} / {{ popupType6.extConfig.maxCount }} + + + + + + + + + + + + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue index 6034a70..670d017 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -24,20 +24,51 @@ - - 单位: 个 - - - - + + 数字指标 + + + {{ sortLabel }} + + + + + + + + + - + + + + + + {{baseListItem.num}} + {{baseListItem.title}} + + @@ -131,6 +162,46 @@ type GroupItem = { showTipHeader: boolean; // 是否展示顶部进度条 useWalkText: boolean; // 是否展示步行距离文案 }; + +// 创建响应式数据 +const baseList = ref([ + { + num:'123', + name: 'photo', + title: '应办任务数' + }, + { + num:'32', + name: 'photo', + title: '已办任务数' + }, + { + num:'456', + name: 'lock', + title: '待办任务数' + }, + { + num:'0', + name: 'star', + title: '超时未完成' + }, +]); + +const options1 = ref([ + { + label: '默认排序', + value: 1, + }, + { + label: '距离优先', + value: 2, + }, + { + label: '价格优先', + value: 3, + } +]); + const groupConfig: GroupItem[] = [ // 组2 A1B2 纯效率·有提醒 { @@ -263,6 +334,35 @@ const klineOption = ref({ } }); +const value1 = ref(1) +const showActionSheet = ref(false) + +// actionSheet选项映射 +const actionSheetOptions = computed(()=>{ + return options1.value.map(opt => ({ + name: opt.label, + value: opt.value + })) +}) +// 显示当前选中的文字 +const sortLabel = computed(()=>{ + const cur = options1.value.find(i=>i.value === value1.value) + return cur?.label ?? "默认排序" +}) + +// 打开菜单 +const openActionSheet = ()=>{ + showActionSheet.value = true +} +// 选中回调 +const handleSheetSelect = (item: {name:string, value:number})=>{ + value1.value = item.value + showActionSheet.value = false + // ========== 在这里添加排序业务逻辑 ========== + console.log('选中排序类型:', item.value) +} + + const userName = computed(() => userStore.userInfo?.user?.nickname || '用户'); const rpx2px = (rpx: number) => { @@ -621,7 +721,6 @@ $border-color: #e5e5e5; color: $text-color-placeholder; margin-bottom: $spacing-md; .date-picker-wrap { - padding: 2px 4px; border-radius: 3px; transition: background-color 0.2s; position: relative; @@ -708,6 +807,13 @@ $border-color: #e5e5e5; .empty-box { padding: 60rpx 0; } +.sort-trigger { + display: flex; + align-items: center; + font-size: 12px; + color: $text-color-placeholder; +} + .task-item { padding: $spacing-md; diff --git a/pages/login/index.vue b/pages/login/index.vue index 814d32a..954281b 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -406,10 +406,15 @@ const handleLogin = async () => { loginParams.mobile = form.mobile; loginParams.code = form.code; loginParams.type = 'sms'; + loginParams.tenantName='蓟城山水集团' + + loginParams.rememberMe= true } else { loginParams.username = form.account; loginParams.password = form.password; loginParams.type = 'password'; + loginParams.tenantName='蓟城山水集团' + loginParams.rememberMe= true } // 执行登录 diff --git a/uni_modules/neo-datetime-pro/components/neo-datetime-pro/neo-datetime-pro.vue b/uni_modules/neo-datetime-pro/components/neo-datetime-pro/neo-datetime-pro.vue index 359e1f6..7666ada 100644 --- a/uni_modules/neo-datetime-pro/components/neo-datetime-pro/neo-datetime-pro.vue +++ b/uni_modules/neo-datetime-pro/components/neo-datetime-pro/neo-datetime-pro.vue @@ -867,7 +867,7 @@ export default { display: flex; align-items: center; justify-content: space-between; - padding: 4rpx 32rpx; + padding: 4rpx 12rpx; background: var(--neo-color-bg-elevated, #fff); border: 2rpx solid var(--neo-color-border, rgba(0, 0, 0, 0.08)); border-radius: 12rpx; @@ -894,7 +894,7 @@ export default { } .trigger-value { - font-size: 28rpx; + font-size: 24rpx; } -- libgit2 0.21.4