Files
his/openhis-ui-vue3/public/help-center/vuepress-theme-vdoing-doc/fix-lodash.sh
chenqi ac1cd3afc8 fix(prescription): 解决处方列表中手术类型和其他医嘱类型的问题
- 更新 lodash.template 修复脚本以处理 assignWith 函数的自定义器参数
- 在多个处方组件中引入 drord_doctor_type 字典用于动态生成医嘱类型列表
- 修复手术类型(adviceType=6)的特殊处理逻辑,包括类型映射和字段过滤
- 调整后端医嘱保存服务中的类型分类逻辑,正确处理手术类型
- 更新数据库查询映射以支持手术类型的正确显示和数据传输
- 修复费用对话框和订单表单中的相关类型显示问题
2026-04-01 18:24:24 +08:00

58 lines
1.7 KiB
Bash

#!/bin/bash
# Fix lodash.template assignWith issue for Linux/Mac servers - V2
# Run this script after npm/yarn install
LODGASH_TEMPLATE="node_modules/lodash.template/index.js"
if [ ! -f "$LODGASH_TEMPLATE" ]; then
echo "❌ lodash.template not found. Please run npm install or yarn install first."
exit 1
fi
# Check if already patched with v2
if grep -q "LODASH_TEMPLATE_PATCHED_V2" "$LODGASH_TEMPLATE"; then
echo "✓ lodash.template already patched with v2"
exit 0
fi
# Remove old patch if exists
if grep -q "LODASH_TEMPLATE_PATCHED" "$LODGASH_TEMPLATE"; then
echo "🔄 Removing old patch..."
# Use sed to remove old patch (multi-line)
sed -i '/\/\* LODASH_TEMPLATE_PATCHED \*\//,/^}$/d' "$LODGASH_TEMPLATE"
fi
echo "🔧 Patching lodash.template with v2..."
# Create a temporary file with the patch
PATCH='/* LODASH_TEMPLATE_PATCHED_V2 */
// assignWith polyfill for lodash.template - Fixed version
function assignWith(object, source, customizer) {
if (object == null) return object;
if (typeof customizer !== "function") {
customizer = function(objValue, srcValue) {
return srcValue;
};
}
var props = Object.keys(Object(source));
for (var i = 0; i < props.length; i++) {
var key = props[i];
var value = source[key];
var assignedValue = customizer(object[key], value, key, object, source);
if (assignedValue !== undefined) {
object[key] = assignedValue;
}
}
return object;
}
'
# Insert after the first line (license comment)
{
head -n 1 "$LODGASH_TEMPLATE"
echo "$PATCH"
tail -n +2 "$LODGASH_TEMPLATE"
} > "$LODGASH_TEMPLATE.tmp" && mv "$LODGASH_TEMPLATE.tmp" "$LODGASH_TEMPLATE"
echo "✅ Successfully patched lodash.template with assignWith function (v2)"