Files
qhmes/web-dist/js/EditableCellIdTest-CzFehDLB.js

8 lines
8.6 KiB
Java
Raw Normal View History

2026-06-16 18:19:57 +08:00
var v=(I,d,r)=>new Promise((f,p)=>{var _=o=>{try{s(r.next(o))}catch(l){p(l)}},g=o=>{try{s(r.throw(o))}catch(l){p(l)}},s=o=>o.done?f(o.value):Promise.resolve(o.value).then(_,g);s((r=r.apply(I,d)).next())});import{P as x}from"./index-Ckh_BVlA.js";import B from"./BasicTable-C6eG0bgK.js";import"./TableAction.vue_vue_type_style_index_0_lang-BIWZ0bGo.js";import"./TableImg.vue_vue_type_style_index_0_lang-65ZOQtFn.js";import{u as S}from"./useTable-DbHE4FHE.js";import{s as E,aE as T,au as z}from"./index-X7Y8jykP.js";import{C as D}from"./index-BwqG9R3y.js";import{D as V,a as N}from"./index-DWDasoBX.js";import{T as J}from"./index-J2mOtM3w.js";import{e as R,y as k,z as b,A as i,u as y,f as t,Q as e,E as n,r as $,G as c,C as j,F,D as A}from"./vue-vendor-DNhG1Cve.js";import{b as K}from"./index-CeNCCWzL.js";import"./useMenuSetting-BwQ9LkAm.js";import"./useFullContent-B3OUGaJG.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";import"./useContentHeight-vWUZcXk1.js";import"./onMountedOrActivated-DhSdLlqP.js";import"./useWindowSizeFn-C-0M9_Ul.js";import"./useContentViewHeight-Cja8zrBg.js";import"./usePageContext-9jIr04Op.js";import"./injectionKey-DPVn4AgL.js";import"./ArrowLeftOutlined-B3JgaWh-.js";import"./ArrowRightOutlined-CZG1QCpB.js";import"./index-lcIOKfa7.js";import"./dropdown-jkliuVyN.js";import"./index-B4gPlWQt.js";import"./eagerComputed-BTlOruLW.js";import"./transButton-B2CWzlQO.js";import"./operationUnit-vCu2co3e.js";import"./BasicTable.vue_vue_type_style_index_0_lang-B9DxrWas.js";import"./BasicForm-ClUSoD_-.js";import"./helper-DcLcf4v6.js";import"./index-BzChaRPg.js";import"./useAppInject-DPZGPcR3.js";import"./BasicForm.vue_vue_type_style_index_0_lang-B29PWQy0.js";import"./index-DO7ZhK45.js";import"./index-ByCwbQDV.js";import"./index-Upeu4GGa.js";import"./index-C4wWpZeQ.js";import"./useTimeout-D5AmIBZw.js";import"./index-M9QP6cvf.js";import"./Skeleton-CimgOdM7.js";import"./useScrollTo-0FPEw5-K.js";import"./useIntersectionObserver-BGOgyKyu.js";import"./index-saD4h7VJ.js";import"./useBreakpoint-DXhPW7nV.js";import"./useEventListener-BRXjwk7A.js";import"./breakpointEnum-BhAg6bcX.js";import"./uniqBy--vsL0WVB.js";import"./index-BDvqZ5j4.js";import"./BasicModal-xH56XuRZ.js";import"./ModalHeader-Sr8KwhJJ.js";import"./index-CuWaQdlK.js";import"./useForm-D61zovon.js";import"./index-DSsDi_fL.js";import"./Group-UHkub2tu.js";import"./Checkbox-Dbxs4we4.js";import"./index-BuONesFs.js";import"./FormOutlined-Y84itqS0.js";import"./useTableContext-CncNVXgp.js";import"./index-DTjkSGYl.js";import"./fromPairs-Dx9PT-t0.js";import"./useMaxLevel-DE205ncc.js";import"./index-CfNJyBRj.js";import"./index-DfHu-LAS.js";import"./Group-DBzJABA_.js";import"./RadioButton-DRBix2Fq.js";import"./index-C7ckZv9Z.js";import"./DirectoryTree-nk_YTTIy.js";import"./FolderOpenOutlined-SzIPA7z0.js";import"./index-Cl-8Hzo4.js";import"./scrollTo-D49dA-9c.js";import"./index-C69VKHba.js";import"./index-DklMb9Qc.js";import"./UpOutlined-B1UMbtrP.js";import"./index-DsixALRt.js";import"./dayjs-jnKD3YGS.js";import"./index-aCD42OrZ.js";import"./quarterOfYear-BU2sPnff.js";import"./dayjs-ALi1pEeb.js";import"./clickOutside-DHfwTU6R.js";import"./throttle-De_jAmBh.js";import"./uuid-CODpppBC.js";import"./sortable.esm-DJNoJSdJ.js";import"./RedoOutlined-Cq2g4Slp.js";import"./index-fAAIzD3j.js";import"./index-DfX9t4DO.js";import"./isNumeric-DjvBa-1E.js";const M={class:"p-4"},O={class:"test-result-json"},P=R({__name:"EditableCellIdTest",setup(I){const{createMessage:d}=E(),r=$({title:"📊 测试结果点击对号后显示",bgColor:"#909399",hasId:!1,idValue:null,fields:[],recordJson:"暂无数据请编辑单元格并点击对号",conclusion:"等待测试..."}),f=[{title:"姓名",dataIndex:"name",width:150,edit:!0,editComponent:"Input"},{title:"年龄",dataIndex:"age",width:120,edit:!0,editComponent:"InputNumber"},{title:"邮箱",dataIndex:"email",width:200,edit:!0,editComponent:"Input"},{title:"地址",dataIndex:"address",width:200,edit:!0,editComponent:"Input"}],p=[{id:1,name:"张三",age:25,email:"zhangsan@example.com",address:"北京市朝阳区"},{id:2,name:"李四",age:30,email:"li
2. 修改内容后点击对号 提交\r
3. 查看测试结果观察 record 是否包含 id 字段`,type:"info","show-icon":""}),t(l,{message:"预期结果",type:"success","show-icon":""},{description:i(()=>[...o[1]||(o[1]=[e("p",null,[e("strong",null,"如果代码正常:")],-1),e("p",null,"✅ record 应该包含 id 字段",-1),e("p",null,"✅ 可以使用 record.id 进行数据更新",-1),e("p",null,"✅ 控制台显示绿色成功消息",-1)])]),_:1}),t(l,{message:"Bug 症状Issue #8924",type:"error","show-icon":""},{description:i(()=>[...o[2]||(o[2]=[e("p",null,[e("strong",null,"如果存在 Bug")],-1),e("p",null,"❌ record 中没有 id 字段",-1),e("p",null,"❌ record 只包含 columns 中定义的字段name, age, email, address",-1),e("p",null,"❌ 无法执行数据更新操作",-1),e("p",null,"❌ 控制台显示红色错误消息",-1)])]),_:1}),t(m,{size:"small",title:"🔍 原因分析",bordered:!1},{default:i(()=>[...o[3]||(o[3]=[e("p",null,[n("原代码使用 "),e("code",null,"pick(record, keys)"),n(" 过滤字段:")],-1),e("pre",{class:"code-block"},`const keys = columns.map(c => c.dataIndex).filter(f => !!f);
// keys = ['name', 'age', 'email', 'address'] // ⚠️ 没有 id
record: pick(record, keys)
// 只保留 keys 中的字段id 被过滤掉了`,-1)])]),_:1})]),_:1})]),_:1})])]),_:1})}}}),kt=z(P,[["__scopeId","data-v-9d9177b2"]]);export{kt as default};