|
@@ -32,9 +32,6 @@
|
|
|
<el-table v-loading="loading" :data="clocksList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="护理时间" align="center" prop="nursingTime" width="180">
|
|
|
- <template #default="scope">
|
|
|
- <span>{{ parseTime(scope.row.nursingTime, '{y}-{m}-{d}') }}</span>
|
|
|
- </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="图片路径" align="center" prop="imgPaths" />
|
|
|
<el-table-column label="图片数量" align="center" prop="imgNum" />
|
|
@@ -61,23 +58,26 @@
|
|
|
<el-form-item label="护理时间" prop="nursingTime">
|
|
|
<el-date-picker clearable
|
|
|
v-model="form.nursingTime"
|
|
|
- type="date"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
+ type="datetime"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
placeholder="请选择护理时间">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="图片路径" prop="imgPaths">
|
|
|
<el-upload
|
|
|
v-model:file-list="fileList"
|
|
|
- :action="uploadImgUrl"
|
|
|
- :headers="uploadHeaders"
|
|
|
- list-type="picture-card"
|
|
|
+ class="upload-demo"
|
|
|
+ :action=uploadImgUrl
|
|
|
:on-preview="handlePreview"
|
|
|
:on-remove="handleRemove"
|
|
|
- :before-upload="beforeUpload"
|
|
|
- :on-success="handleSuccess"
|
|
|
+ list-type="picture"
|
|
|
>
|
|
|
- <el-icon><Plus /></el-icon>
|
|
|
+ <el-button type="primary">Click to upload</el-button>
|
|
|
+ <template #tip>
|
|
|
+ <div class="el-upload__tip">
|
|
|
+ jpg/png files with a size less than 500kb
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
|
|
@@ -102,8 +102,6 @@
|
|
|
<script setup name="Clocks">
|
|
|
import { listClocks, getClocks, delClocks, addClocks, updateClocks } from "@/api/care/clocks";
|
|
|
import { ref } from 'vue'
|
|
|
-import { Plus } from '@element-plus/icons-vue'
|
|
|
-import { getToken } from '@/utils/auth'
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
|
const clocksList = ref([]);
|
|
@@ -116,11 +114,8 @@ const multiple = ref(true);
|
|
|
const total = ref(0);
|
|
|
const title = ref("");
|
|
|
const uploadImgUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // 上传的图片服务器地址
|
|
|
-const uploadHeaders={Authorization: 'Bearer ' + getToken()};
|
|
|
const fileList =ref([]);
|
|
|
|
|
|
-const dialogImageUrl = ref('')
|
|
|
-const dialogVisible = ref(false)
|
|
|
// 定义 props
|
|
|
const props = defineProps({
|
|
|
applyId: {
|
|
@@ -134,7 +129,7 @@ const data = reactive({
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- nursingRecordId: props.applyId,
|
|
|
+ applyId: props.applyId,
|
|
|
nursingTime: null,
|
|
|
imgPaths: null,
|
|
|
imgNum: null,
|
|
@@ -183,7 +178,8 @@ function reset() {
|
|
|
createTime: null,
|
|
|
updateBy: null,
|
|
|
updateTime: null,
|
|
|
- remark: null
|
|
|
+ remark: null,
|
|
|
+ applyId:props.applyId
|
|
|
};
|
|
|
proxy.resetForm("clocksRef");
|
|
|
}
|
|
@@ -227,13 +223,13 @@ function handleUpdate(row) {
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
function submitForm() {
|
|
|
- form.value.imgNum=0;
|
|
|
-
|
|
|
- fileList.forEach(item => {
|
|
|
- console.info(item);
|
|
|
- form.value.imgNum++;
|
|
|
- form.value.imgPaths+=item.url;
|
|
|
- });
|
|
|
+ form.value.imgNum=1;
|
|
|
+ form.value.imgPaths="11111"
|
|
|
+ // fileList.forEach(item => {
|
|
|
+ // console.info(item);
|
|
|
+ // form.value.imgNum++;
|
|
|
+ // form.value.imgPaths+=item.url;
|
|
|
+ // });
|
|
|
|
|
|
proxy.$refs["clocksRef"].validate(valid => {
|
|
|
if (valid) {
|
|
@@ -280,26 +276,5 @@ function handlePreview(file) {
|
|
|
function handleRemove(file, fileList) {
|
|
|
console.log('移除文件:', file, '剩余文件:', fileList);
|
|
|
}
|
|
|
-function beforeUpload(file) {
|
|
|
- const isJPGOrPNG = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
|
- const isLt500K = file.size / 1024 < 500;
|
|
|
-
|
|
|
- if (!isJPGOrPNG) {
|
|
|
- this.$message.error('只能上传 JPG 或 PNG 格式的图片!');
|
|
|
- }
|
|
|
- if (!isLt500K) {
|
|
|
- this.$message.error('图片大小不能超过 500KB!');
|
|
|
- }
|
|
|
-
|
|
|
- return isJPGOrPNG && isLt500K;
|
|
|
-}
|
|
|
-function handleSuccess(response, file, fileList)
|
|
|
-{
|
|
|
- if(response.code==200){
|
|
|
- console.log('上传成功:', response, file, fileList);
|
|
|
- fileList.value = fileList;
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
getList();
|
|
|
</script>
|