登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
轻量养虾,开箱即用!低 Token + 稳定算力,Gitee & 模力方舟联合出品的 PocketClaw 正式开售!点击了解详情~
代码拉取完成,页面将自动刷新
开源项目
>
WEB应用开发
>
后台管理框架
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
972
Star
5.4K
Fork
1.7K
GVP
smallwei
/
Avue
代码
Issues
5
Pull Requests
0
Wiki
统计
流水线
服务
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
开发画像分析
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
crud 深层数据报错
已完成
#IAX7QK
XuZeKun
创建于
2024-10-15 14:33
需求是:根据选中的月份,动态生成配置项,下拉框数据根据选中的部门进行隔离 配置代码: 计算属性 ```javascript dynamicOption() { let monthDayOpt = []; // 如果初始化了月份 if (this.initData.mouth) { let dateArr = this.initData.mouth.split('-'); // 当月天数 let days = func.getDaysInMonth(dateArr[0], dateArr[1]); for (let i = 1; i <= days; i++) { let date = new Date(dateArr[0] * 1, dateArr[1] * 1 - 1, i); // 0~6 对应周一到周日 let dayIndex = date.getDay(); let week = ['日', '一', '二', '三', '四', '五', '六'][dayIndex]; let item = { label: i + ' ' + week, type: 'cascader', prop: this.initData.mouth + '-' + i, bind:'schedule.'+this.initData.mouth + '-' + i, width: 50, dicData: this.currDeptScheduleCode, change:({column,value})=>{ console.log(column,value); } }; monthDayOpt.push(item); } } return { height: 'auto', calcHeight: 210, searchShow: true, searchMenuSpan: 6, tip: false, border: true, index: true, viewBtn: true, selection: true, size: 'small', column: [ { label: '員工信息', children: [ { label: '姓名', prop: 'employeeName', display: false, search: true, }, { label: '工號', prop: 'employeeNo', display: false, search: true, }, { label: '部門', display: false, type: 'tree', prop: 'deptId', defaultExpandAll: true, dicData: this.deptDic, props: { label: 'title', value: 'id', }, }, ], }, { label: '月份',disabled:true, type: 'month', prop: 'date', valueFormat: 'YYYY-MM', }, { label: '日期', align: 'center',prop:"schedule", children: monthDayOpt, }, ], }; }, ``` 下拉框字典: ``` javascript currDeptScheduleCode: [ {label:"班",value:1,children:[]},// 这里的children 根据选中的部门动态获取 {label:"休",value:2,children:[ {label:"AL",value:"AL"}, {label:"SL",value:"SL"}, {label:"PH",value:"PH"} ]}, ], ``` 示例数据: ```json { "employeeId": 1, "employeeName": "林飞", "employeeNo": "1", "deptId": "1838059619350941697", "date": "2024-10", "schedule": { "2024-10-1": "1,A", "2024-10-2": "1,A", "2024-10-3": "1,A", "2024-10-4": "1,A", "2024-10-5": "1,A", "2024-10-6": "1,A", "2024-10-7": "1,A", "2024-10-8": "1,A", "2024-10-9": "1,A", "2024-10-10": "1,A", "2024-10-11": "1,A", ... } } ``` 表格显示正常,但是打开form表单编辑就会出现以下报错,且报错条数与动态生成的配置项数量相同 ``` SyntaxError: Unexpected number at setAsVal (avue.min.js:7:5806) at Proxy.<anonymous> (avue.min.js:7:181032) at callWithErrorHandling (runtime-core.esm-bundler.js:199:19) at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:206:17) at baseWatchOptions.call (runtime-core.esm-bundler.js:6139:47) at job (reactivity.esm-bundler.js:1854:18) at flushPreFlushCbs (runtime-core.esm-bundler.js:359:7) at updateComponentPreRender (runtime-core.esm-bundler.js:5409:5) at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5328:11) at ReactiveEffect.run (reactivity.esm-bundler.js:222:19) ``` 修改表单数据后,并没有将修改的值绑定到 schedule.xxx 数据上,提交表单数据如下: ```json { "employeeId": 1, "employeeName": "林飞", "employeeNo": "1", "deptId": "1838059619350941697", "date": "2024-10", "2024-10-1": "2,PCL", "schedule": { "2024-10-1": "1,A", "2024-10-2": "1,A", "2024-10-3": "1,A", "2024-10-4": "1,A", "2024-10-5": "1,A", "2024-10-6": "1,A", "2024-10-7": "1,A", "2024-10-8": "1,A", "2024-10-9": "1,A", "2024-10-10": "1,A", ... }, "2024-10-2": "1,A", "2024-10-3": "1,A", "2024-10-4": "1,E", "2024-10-5": "1,A", "2024-10-6": "1,A", "2024-10-7": "2,PCL", "2024-10-8": "1,A", "2024-10-9": "1,A", "2024-10-10": "1,A", ... } ``` 开发环境:nodejs18.20.4 框架:Saber4.2.0 开源版 avue版本:3.4.4 求教 这个是什么原因产生的报错,如何修复,以及深层数据为何没有绑定上 相关截图:  
需求是:根据选中的月份,动态生成配置项,下拉框数据根据选中的部门进行隔离 配置代码: 计算属性 ```javascript dynamicOption() { let monthDayOpt = []; // 如果初始化了月份 if (this.initData.mouth) { let dateArr = this.initData.mouth.split('-'); // 当月天数 let days = func.getDaysInMonth(dateArr[0], dateArr[1]); for (let i = 1; i <= days; i++) { let date = new Date(dateArr[0] * 1, dateArr[1] * 1 - 1, i); // 0~6 对应周一到周日 let dayIndex = date.getDay(); let week = ['日', '一', '二', '三', '四', '五', '六'][dayIndex]; let item = { label: i + ' ' + week, type: 'cascader', prop: this.initData.mouth + '-' + i, bind:'schedule.'+this.initData.mouth + '-' + i, width: 50, dicData: this.currDeptScheduleCode, change:({column,value})=>{ console.log(column,value); } }; monthDayOpt.push(item); } } return { height: 'auto', calcHeight: 210, searchShow: true, searchMenuSpan: 6, tip: false, border: true, index: true, viewBtn: true, selection: true, size: 'small', column: [ { label: '員工信息', children: [ { label: '姓名', prop: 'employeeName', display: false, search: true, }, { label: '工號', prop: 'employeeNo', display: false, search: true, }, { label: '部門', display: false, type: 'tree', prop: 'deptId', defaultExpandAll: true, dicData: this.deptDic, props: { label: 'title', value: 'id', }, }, ], }, { label: '月份',disabled:true, type: 'month', prop: 'date', valueFormat: 'YYYY-MM', }, { label: '日期', align: 'center',prop:"schedule", children: monthDayOpt, }, ], }; }, ``` 下拉框字典: ``` javascript currDeptScheduleCode: [ {label:"班",value:1,children:[]},// 这里的children 根据选中的部门动态获取 {label:"休",value:2,children:[ {label:"AL",value:"AL"}, {label:"SL",value:"SL"}, {label:"PH",value:"PH"} ]}, ], ``` 示例数据: ```json { "employeeId": 1, "employeeName": "林飞", "employeeNo": "1", "deptId": "1838059619350941697", "date": "2024-10", "schedule": { "2024-10-1": "1,A", "2024-10-2": "1,A", "2024-10-3": "1,A", "2024-10-4": "1,A", "2024-10-5": "1,A", "2024-10-6": "1,A", "2024-10-7": "1,A", "2024-10-8": "1,A", "2024-10-9": "1,A", "2024-10-10": "1,A", "2024-10-11": "1,A", ... } } ``` 表格显示正常,但是打开form表单编辑就会出现以下报错,且报错条数与动态生成的配置项数量相同 ``` SyntaxError: Unexpected number at setAsVal (avue.min.js:7:5806) at Proxy.<anonymous> (avue.min.js:7:181032) at callWithErrorHandling (runtime-core.esm-bundler.js:199:19) at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:206:17) at baseWatchOptions.call (runtime-core.esm-bundler.js:6139:47) at job (reactivity.esm-bundler.js:1854:18) at flushPreFlushCbs (runtime-core.esm-bundler.js:359:7) at updateComponentPreRender (runtime-core.esm-bundler.js:5409:5) at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5328:11) at ReactiveEffect.run (reactivity.esm-bundler.js:222:19) ``` 修改表单数据后,并没有将修改的值绑定到 schedule.xxx 数据上,提交表单数据如下: ```json { "employeeId": 1, "employeeName": "林飞", "employeeNo": "1", "deptId": "1838059619350941697", "date": "2024-10", "2024-10-1": "2,PCL", "schedule": { "2024-10-1": "1,A", "2024-10-2": "1,A", "2024-10-3": "1,A", "2024-10-4": "1,A", "2024-10-5": "1,A", "2024-10-6": "1,A", "2024-10-7": "1,A", "2024-10-8": "1,A", "2024-10-9": "1,A", "2024-10-10": "1,A", ... }, "2024-10-2": "1,A", "2024-10-3": "1,A", "2024-10-4": "1,E", "2024-10-5": "1,A", "2024-10-6": "1,A", "2024-10-7": "2,PCL", "2024-10-8": "1,A", "2024-10-9": "1,A", "2024-10-10": "1,A", ... } ``` 开发环境:nodejs18.20.4 框架:Saber4.2.0 开源版 avue版本:3.4.4 求教 这个是什么原因产生的报错,如何修复,以及深层数据为何没有绑定上 相关截图:  
评论 (
2
)
登录
后才可以发表评论
状态
已完成
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
v3.5.3
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (
-
)
标签 (
-
)
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(2)
JavaScript
1
https://gitee.com/smallweigit/avue.git
git@gitee.com:smallweigit/avue.git
smallweigit
avue
Avue
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册