feat: v3版疗休养优化6

This commit is contained in:
2026-10-26 16:50:49 +08:00
parent 4c03b389d4
commit 56cc3fee91
30 changed files with 868 additions and 342 deletions
@@ -280,9 +280,11 @@ module.exports = {
if (v.data && v.data.code === 0) {
insertImgFn(v.data.data)
} else {
this.$message.error("图片上传失败")
_this.$message.error(v.data && v.data.msg || "图片上传失败")
}
})
}).catch(() => {
_this.$message.error("图片上传失败,请重试")
})
}
this.editor.config.pasteFilterStyle = false
@@ -1,12 +1,14 @@
<template>
<el-drawer title="参加人员范围设置" :visible.sync="userScopeDialog" size="90%" :append-to-body="true" @closed="loadGroups">
<el-drawer title="参加人员范围设置" :visible.sync="userScopeDialog" size="40%" :append-to-body="true" @closed="loadGroups">
<div style="padding:0 20px 10px">
<el-select :value="group_id" placeholder="选择疗休养参加人员分组" filterable clearable @change="$emit('update:group_id', $event)">
<el-select :value="group_id" placeholder="选择疗休养参加人员分组" filterable clearable style="width:100%" @change="$emit('update:group_id', $event)">
<el-option v-for="group in groups" :key="group.groupId" :label="group.groupName" :value="group.groupId"></el-option>
</el-select>
<el-button type="text" @click="loadGroups">刷新分组</el-button>
</div>
<iframe v-if="userScopeDialog" src="/platform/activity/basic/scope" title="参加人员范围设置" style="width:100%;height:calc(100vh - 150px);border:0"></iframe>
<div style="padding:0 20px;text-align:right">
<el-button type="primary" @click="userScopeDialog = false">确定</el-button>
</div>
</el-drawer>
</template>
<script>
@@ -74,17 +74,17 @@
<el-table-column label="身份证号" prop="idCard"></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
<template slot-scope="{row}">
{{ row.bedInfo?.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
<template slot-scope="{row}">
{{ row.bedInfo?.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
<template slot-scope="{row}">
{{ row.bedInfo?.otherSleepUser ? row.bedInfo?.otherSleepUser : '暂无' }}
</template>
</el-table-column>
@@ -3,9 +3,9 @@
<div v-if="view">
<a v-for="file in files" :key="file.id || file.filepath" :href="file.downloadPath || file.filepath || preview(file.id)" target="_blank" style="display:block">{{ file.name || file.filename }}</a>
</div>
<el-upload v-else action="/platform/inclusiveTherapyV3/common/uploadFile" name="file"
<el-upload v-else action="/platform/sys/file/uploadDynamicReturnUrl" name="file"
:limit="max" :multiple="max > 1" :file-list="fileList" :drag="card"
:before-upload="beforeUpload" :on-success="success" :on-remove="remove" :on-preview="open">
:before-upload="beforeUpload" :on-success="success" :on-error="error" :on-remove="remove" :on-preview="open">
<el-button size="small" type="primary">选择文件</el-button>
<div slot="tip"><slot></slot></div>
</el-upload>
@@ -32,10 +32,17 @@ module.exports = {
list.splice(list.indexOf(file), 1);
this.$message.error(result.msg); return;
}
file.rawInfo = result.data;
file.url = result.data.downloadPath || result.data.filepath;
if (typeof result.data !== 'string' || !result.data) {
list.splice(list.indexOf(file), 1);
this.$message.error('上传未返回文件地址'); return;
}
const id = new URL(result.data, window.location.origin).searchParams.get('id');
file.rawInfo = {id: id, name: file.name, filename: file.name,
downloadPath: result.data, filepath: result.data, url: result.data};
file.url = result.data;
this.emit(list);
},
error() { this.$message.error('文件上传失败,请重试'); },
remove(file, list) { this.emit(list); },
emit(list) {
this.$emit('update:files', list.map(file => file.rawInfo || file.response && file.response.data).filter(Boolean));
@@ -1,7 +1,7 @@
<template>
<el-upload action="/platform/inclusiveTherapyV3/common/uploadFile" name="file" list-type="picture-card"
<el-upload action="/platform/sys/file/uploadDynamicReturnUrl" name="file" list-type="picture-card"
:file-list="fileList" :limit="limit" :before-upload="beforeUpload"
:on-success="success" :on-remove="remove" :on-preview="open"
:on-success="success" :on-error="error" :on-exceed="exceed" :on-remove="remove" :on-preview="open"
:style="{'--therapy-width': width + 'px', '--therapy-height': height + 'px'}">
<i class="el-icon-plus"></i>
</el-upload>
@@ -30,16 +30,27 @@ module.exports = {
list.splice(list.indexOf(file), 1);
this.$message.error(result.msg); return;
}
file.url = result.data.filepath;
file.storedValue = result.data.filepath;
if (typeof result.data !== 'string' || !result.data) {
list.splice(list.indexOf(file), 1);
this.$message.error('上传未返回图片地址'); return;
}
file.url = result.data;
file.storedValue = result.data;
this.emit(list);
},
error() { this.$message.error('图片上传失败,请重试'); },
exceed() { this.$message.warning('最多上传' + this.limit + '张图片'); },
remove(file, list) { this.emit(list); },
emit(list) {
const values = list.map(file => file.storedValue).filter(Boolean);
this.$emit('input', Array.isArray(this.value) ? values : values[0] || '');
},
open(file) { window.open(file.url); }
open(file) {
const img = new Image();
img.src = file.url;
const viewer = new Viewer(img, {hidden() { viewer.destroy(); }});
viewer.show();
}
}
};
</script>
@@ -67,17 +67,17 @@
<el-table-column label="身份证号" prop="idCard"></el-table-column>
<el-table-column label="年龄" prop="age"></el-table-column>
<el-table-column label="床型" prop="bedType">
<template scope="{row}">
<template slot-scope="{row}">
{{ row.bedInfo?.bedType }}
</template>
</el-table-column>
<el-table-column label="床位" prop="bedNum">
<template scope="{row}">
<template slot-scope="{row}">
{{ row.bedInfo?.bedNum }}
</template>
</el-table-column>
<el-table-column label="意向拼床人" prop="otherSleepUser">
<template scope="{row}">
<template slot-scope="{row}">
{{ row.bedInfo?.otherSleepUser ? row.bedInfo?.otherSleepUser : '暂无' }}
</template>
</el-table-column>