fix(crontab): 将radio组件的label属性替换为value属性
- 更新day.vue中所有radio组件的label为value属性 - 更新hour.vue中所有radio组件的label为value属性 - 更新min.vue中所有radio组件的label为value属性 - 更新month.vue中所有radio组件的label为value属性 - 更新second.vue中所有radio组件的label为value属性 - 更新week.vue中所有radio组件的label为value属性 - 更新year.vue中所有radio组件的label为value属性 - 修复TableLayout/FormItem.vue中的radio组件属性 - 修改surgicalPatientHandover.vue中的radio组件属性 - 修复template3.vue中的type数据类型定义 - 更新clinicRoom/index.vue中的radio组件属性 - 修复editTemplate.vue中的radio组件属性 - 更新caseTemplatesStatistics/index.vue中的radio组件属性 - 修复organization/index.vue中的radio组件属性 - 更新ward/index.vue中的radio组件属性 - 移除chargeDialog.vue中radio的无效label属性 - 修复多个组件中的Array类型定义问题 - 调整outpatientregistration/index.vue中的列宽度配置 - 添加getConfigKey的导入声明 - 修复多个表单组件中的radio组件属性配置
This commit is contained in:
50
openhis-ui-vue3/src/patches/xe-utils-hasownprop-plugin.js
Normal file
50
openhis-ui-vue3/src/patches/xe-utils-hasownprop-plugin.js
Normal file
@@ -0,0 +1,50 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
/**
|
||||
* Patch xe-utils hasOwnProp for Vue 3 Proxy compatibility.
|
||||
*
|
||||
* Root cause: Object.prototype.hasOwnProperty.call(proxyObj, key) throws
|
||||
* "TypeError: obj.hasOwnProperty is not a function"
|
||||
* when obj is a Vue 3 reactive Proxy, because Vue's reactivity system
|
||||
* intercepts the [[Get]] trap for 'hasOwnProperty'.
|
||||
*
|
||||
* Fix: Use try-catch. If direct call fails, use Reflect.has or key-in check.
|
||||
*/
|
||||
export default function patchXeUtilsHasOwnProp() {
|
||||
return {
|
||||
name: 'patch-xe-utils-hasownprop',
|
||||
enforce: 'pre',
|
||||
buildStart() {
|
||||
const targets = [
|
||||
path.resolve(process.cwd(), 'node_modules/xe-utils/hasOwnProp.js'),
|
||||
];
|
||||
for (const target of targets) {
|
||||
if (!fs.existsSync(target)) continue;
|
||||
const code = fs.readFileSync(target, 'utf-8');
|
||||
if (code.includes('[vue3-proxy-safe]')) continue;
|
||||
const patched = `/**
|
||||
* Check if object has own property - Vue 3 Proxy safe [vue3-proxy-safe]
|
||||
*/
|
||||
function hasOwnProp (obj, key) {
|
||||
if (obj == null) return false
|
||||
try {
|
||||
return Object.prototype.hasOwnProperty.call(obj, key)
|
||||
} catch (e) {
|
||||
// Vue 3 reactive Proxy throws on hasOwnProperty; fallback
|
||||
try {
|
||||
return key in Object(obj)
|
||||
} catch (e2) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = hasOwnProp
|
||||
`;
|
||||
fs.writeFileSync(target, patched, 'utf-8');
|
||||
console.log('[patch-xe-utils-hasownprop] Patched ' + target);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user