From 38e3523c6883eb3eaaf58995a9ad6db888ee4c43 Mon Sep 17 00:00:00 2001
From: yz3456 <2753272399@qq.com>
Date: 星期六, 30 三月 2024 17:44:25 +0800
Subject: [PATCH] 修改了魅宠饮食习惯
---
ruoyi-ui/src/views/self/show.vue | 66 +++++++++++-
ruoyi-ui/src/views/self/memoInfo.vue | 123 +++++++++++++++---------
ruoyi-ui/src/views/bignote/index.vue | 24 ++--
ruoyi-ui/src/views/pet/petInfo.vue | 8
ruoyi-ui/src/api/self/index.js | 2
ruoyi-ui/src/views/bignote/familyeventInfo.vue | 51 +++++-----
ruoyi-ui/src/views/pet/index.vue | 14 +-
7 files changed, 187 insertions(+), 101 deletions(-)
diff --git a/ruoyi-ui/src/api/self/index.js b/ruoyi-ui/src/api/self/index.js
index 13417ea..e29e54f 100644
--- a/ruoyi-ui/src/api/self/index.js
+++ b/ruoyi-ui/src/api/self/index.js
@@ -242,7 +242,7 @@
//涓婁紶鏂囦欢
export function uploadPic(data) {
return request({
- url: '/common/upload',
+ url: '/common/uploads',
method: 'post',
data: data
})
diff --git a/ruoyi-ui/src/views/bignote/familyeventInfo.vue b/ruoyi-ui/src/views/bignote/familyeventInfo.vue
index 077a2f0..e2252e4 100644
--- a/ruoyi-ui/src/views/bignote/familyeventInfo.vue
+++ b/ruoyi-ui/src/views/bignote/familyeventInfo.vue
@@ -48,7 +48,7 @@
multiple
ref="upload"
:show-file-list="true"
- :http-request="requestUpload"
+ :http-request="requestUpload"
:file-list="fileList"
:on-change="handleChange"
:auto-upload="false"
@@ -56,7 +56,7 @@
:class="{ hide: !btn }"
>
-
+
<!-- <div v-if="uploading" class="upload-status">姝e湪涓婁紶...</div> -->
<i v-if="!uploading" slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
@@ -105,23 +105,23 @@
@click="picUpload"
>涓婁紶鍒版湇鍔″櫒</el-button>
<h4 class="form-header">鍏朵粬闄勪欢 </h4>
-
+
<!-- <el-upload
action="#"
list-type="picture-card"
multiple
ref="upload"
-
- :http-request="requestUpload"
+
+ :http-request="requestUpload"
:file-list="fileList"
:on-change="handleChange"
:auto-upload="false"
:disabled="!btn"
:class="{ hide: !btn }"
-
+
>
-->
-
+
<el-upload
action="#"
multiple
@@ -136,7 +136,7 @@
:class="{ hide: !btn }"
>
-<!--
+<!--
<div v-if="uploading" class="upload-status">姝e湪涓婁紶...</div> -->
<i v-if="!uploading" slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
@@ -293,11 +293,12 @@
this.isShow=false
// alert(this.btn)
}
- this.ID = id;
+ this.ID = id;
let _this = this
if (id) {
this.loading = true;
getFamilyeventInfo(id).then((response) => {
+ // console.log(response,'666666666')
this.formData = response.data;
let paths = this.formData.url.split(",");
for(let i = 0; i < paths.length; i++)
@@ -322,7 +323,7 @@
_this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false})
else
_this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false})
-
+
}
}
// _this.fileList1 = _this.fileList
@@ -387,10 +388,10 @@
this.$delete(this.uploadFileList1, Math.abs(i - this.uploadFileList1.length-1))
}
this.$delete(this.fileListOther,i);
-
+
}
}
-
+
let ul = ""
this.fileList.map(function (elem){
if(elem.res==false)
@@ -407,11 +408,11 @@
updateFamilyevent(this.formData).then(response => {
this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
// this.open = false;
-
+
});
}
},
- handleRemove(file) {
+ handleRemove(file) {
//鍒ゆ柇鏄惁鏄箣鍓嶇殑鍥剧墖
let res = false
// alert(this.fileList.length)
@@ -431,7 +432,7 @@
// alert(this.uploadFileList.length)
}
this.$delete(this.fileList,i);
-
+
}
}
let ul = ""
@@ -501,7 +502,7 @@
//鑷畾涔変笂浼犳柟娉�
handleChange1(file, fileListOther1) {
//瀹氫箟涓�涓叏灞�鏁扮粍uploadFileList鏉ュ仛瀛樺偍
-
+
// this.uploadFileList.push(file.raw);
this.uploadFileList1.push(file.raw);
this.fileListOther.push({name:file.name,url:file.url,res:true})
@@ -520,10 +521,10 @@
if(this.uploadFileList1.length==0){
this.$modal.msgSuccess("鏂囨。涓婁紶鍒楄〃涓嶈兘涓虹┖锛�");
return}
-
+
this.uploadFileList1.forEach((elem)=>{
formData.append("files", elem)
-
+
})
console.log(this.uploadFileList1)
let _this = this
@@ -551,11 +552,11 @@
this.uploadFileList.forEach((elem)=>{
formData.append("files", elem)
-
+
})
let _this = this
-
+
uploadPic(formData).then(response => {
// console.log(response.originalFilenames)
// console.log(response.urls)
@@ -577,7 +578,7 @@
//console.log(_this.fileList)
// alert(response.fileNames)
_this.formData.url = _this.formData.url+","+response.fileNames
-
+
_this.uploadFileList = []
// alert(87)
updateFamilyevent(_this.formData).then(response => {
@@ -592,7 +593,7 @@
for(let i = 0; i < paths.length; i++)
{
if(paths[i]!="") {
-
+
let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
// alert(pth)
if (_this.fot.includes(pth) === true)
@@ -611,7 +612,7 @@
_this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false})
else
_this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false})
-
+
}
}
// _this.fileList1 = _this.fileList
@@ -635,8 +636,8 @@
// this.uploadFileList.push(params.file);
//alert(34)
-
-
+
+
},
requestUpload1(params)
{
diff --git a/ruoyi-ui/src/views/bignote/index.vue b/ruoyi-ui/src/views/bignote/index.vue
index c8ef1fd..26eb5eb 100644
--- a/ruoyi-ui/src/views/bignote/index.vue
+++ b/ruoyi-ui/src/views/bignote/index.vue
@@ -335,9 +335,9 @@
>
<i class="el-icon-zoom-in"></i>
</span>
-
+
<span
-
+
class="el-upload-list__item-delete"
@click="handleRemoveFile(file)"
>
@@ -406,7 +406,7 @@
// 瀹跺ぇ浜嬭琛ㄦ牸鏁版嵁
familyList: [],
-
+
// 寮瑰嚭灞傛爣棰�
title: "",
// 鏄惁鏄剧ず寮瑰嚭灞�
@@ -654,9 +654,9 @@
for(let i = 0; i < this.fileListOther.length; i++)
{
if(this.fileListOther[i].url==file.url)
- {
+ {
this.$delete(this.fileListOther,i);
- this.$delete(this.uploadFileList1,i);
+ this.$delete(this.uploadFileList1,i);
}
}
},
@@ -700,7 +700,7 @@
},
handleChange(file, fileList1) {
//瀹氫箟涓�涓叏灞�鏁扮粍uploadFileList鏉ュ仛瀛樺偍
-
+
// this.uploadFileList.push(file.raw);
console.log("=========5555=========")
console.log(file)
@@ -733,18 +733,18 @@
}
this.uploadFileList1.forEach((elem)=>{
formData.append("files", elem)
-
+
})
let _this = this
-
+
this.uploading = true;
uploadPic(formData).then(response => {
_this.uploadFileList1 = []
_this.formDat.url = _this.formDat.url+","+response.fileNames
_this.$modal.msgSuccess("鏂囦欢涓婁紶鎴愬姛!");
})
-
+
},
picUpload()
{
@@ -759,15 +759,17 @@
//console.log(this.uploadFileList)
this.uploadFileList.forEach((elem)=>{
formData.append("files", elem)
-
+
})
//alert(90)
let _this = this
//alert(9)
uploadPic(formData).then(response => {
// alert("dds")
+ // console.log(response)
+ // console.log(_this.formDat.url,'666')
_this.formDat.url = _this.formDat.url+","+response.fileNames
- // alert(_this.formDat.url)
+ // alert(_this.formDat.url)
_this.uploadFileList = []
_this.$modal.msgSuccess("鍥剧墖涓婁紶鎴愬姛");
diff --git a/ruoyi-ui/src/views/pet/index.vue b/ruoyi-ui/src/views/pet/index.vue
index 547de62..3b4ff76 100644
--- a/ruoyi-ui/src/views/pet/index.vue
+++ b/ruoyi-ui/src/views/pet/index.vue
@@ -194,8 +194,8 @@
<el-input v-model="formDat.eatHabit" placeholder="璇疯緭鍏ラギ椋熶範鎯�(鍠�)" clearable :style="{width: '100%'}" >
</el-input>
</el-form-item>
- <el-form-item label="楗涔犳儻(鎭�)" prop="diseatHabit">
- <el-input v-model="formDat.diseatHabit" placeholder="璇疯緭鍏ラギ椋熶範鎯�(鎭�)" clearable :style="{width: '100%'}" >
+ <el-form-item label="楗涔犳儻(鎭�)" prop="disEatHabit">
+ <el-input v-model="formDat.disEatHabit" placeholder="璇疯緭鍏ラギ椋熶範鎯�(鎭�)" clearable :style="{width: '100%'}" >
</el-input>
</el-form-item>
<el-form-item label="鐢熸椿涔犳儻(鍠�)" prop="lifeHabit">
@@ -397,7 +397,7 @@
dialect: undefined,
address:undefined,
eatHabit:undefined,
- diseatHabit: undefined,
+ disEatHabit: undefined,
LifeHabit: undefined,
disLifeHabit: undefined,
headPicture:undefined,
@@ -416,7 +416,7 @@
dialect: undefined,
address:undefined,
eatHabit:undefined,
- diseatHabit: undefined,
+ disEatHabit: undefined,
LifeHabit: undefined,
disLifeHabit: undefined,
url: undefined,
@@ -507,9 +507,9 @@
trigger: 'blur'
}],
- diseatHabit: [{
+ disEatHabit: [{
required: true,
- message: '璇疯緭鍏ラギ椋熶範鎯�(鍠�)',
+ message: '璇疯緭鍏ラギ椋熶範鎯�(鎭�)',
trigger: 'blur'
}],
masterName: [{
@@ -718,6 +718,8 @@
if (valid) {
addPet(this.formDat).then(response => {
+ // alert(this.formDat.diseatHabit)
+ // alert(this.formDat.eatHabit)
this.$modal.msgSuccess("鏂板鎴愬姛");
this.open = false;
// 娓呯┖formDat瀵硅薄鐨勬暟鎹�
diff --git a/ruoyi-ui/src/views/pet/petInfo.vue b/ruoyi-ui/src/views/pet/petInfo.vue
index 199962a..cf3fac5 100644
--- a/ruoyi-ui/src/views/pet/petInfo.vue
+++ b/ruoyi-ui/src/views/pet/petInfo.vue
@@ -110,7 +110,7 @@
</el-form-item>
</el-row>
<el-row :span="5">
- <el-form-item label="楗涔犳儻(鎭�)" prop="disEatHabit" label-width="100px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;">
+ <el-form-item label="楗涔犳儻(鎭�)" prop="disEatHabit" label-width="120px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;">
<el-input v-model="petList.disEatHabit" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb">
</el-input>
</el-form-item>
@@ -447,7 +447,7 @@
dialect: undefined,
address:undefined,
eatHabit:undefined,
- diseatHabit: undefined,
+ disEatHabit: undefined,
LifeHabit: undefined,
disLifeHabit: undefined,
url: undefined,
@@ -520,9 +520,9 @@
trigger: 'blur'
}],
- diseatHabit: [{
+ disEatHabit: [{
required: true,
- message: '璇疯緭鍏ラギ椋熶範鎯�(鍠�)',
+ message: '璇疯緭鍏ラギ椋熶範鎯�(鎭�)',
trigger: 'blur'
}],
masterName: [{
diff --git a/ruoyi-ui/src/views/self/memoInfo.vue b/ruoyi-ui/src/views/self/memoInfo.vue
index 5413138..17ee705 100644
--- a/ruoyi-ui/src/views/self/memoInfo.vue
+++ b/ruoyi-ui/src/views/self/memoInfo.vue
@@ -65,6 +65,11 @@
:file-list="fileList"
:disabled="!btn"
:class="{ hide: !btn }"
+ ref="upload"
+ :show-file-list="true"
+ :on-change="handleChange"
+ :auto-upload="false"
+
>
<div v-if="uploading" class="upload-status">姝e湪涓婁紶...</div>
<i v-if="!uploading" slot="default" class="el-icon-plus"></i>
@@ -195,8 +200,9 @@
// 鏁版嵁鑼冨洿閫夐」
fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx',
'.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'],
-
+
fileList:[],
+ fileList1:[],
fileListOther:[],
dsb:true,
btn:false,
@@ -275,24 +281,52 @@
if (id) {
this.loading = true;
getNote({id}).then((response) => {
+console.log(response , '666')
this.formData = response.data;
- let paths = response.data.url.split(",");
+ let paths = this.formData.url.split(",");
+ // for(let i = 0; i < paths.length; i++)
+ // {
+ // if(paths[i]!="") {
+
+ // let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
+
+ // if (_this.fot.includes(pth) === true)
+ // _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
+ // else {
+ // // alert(paths[i])
+ // let nms = paths[i].split("\/")
+ // let nm = nms[nms.length - 1]
+ // _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
+ // }
+ // }
+ // }
for(let i = 0; i < paths.length; i++)
- {
- if(paths[i]!="") {
+ {
+ if(paths[i]!="") {
- let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
+ let pth = paths[i].substr(paths[i].length - 4, paths[i].length)
+ // alert(pth)
+ if (_this.fot.includes(pth) === true)
+ {
+ if(paths[i][0]=="/")
+ _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false})
+ else
+ _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false})
+ }
+ else {
+ // alert(paths[i])
+ // alert()
+ let nms = paths[i].split("\/")
+ let nm = nms[nms.length - 1]
+ if(paths[i][0]=="/")
+ _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i].substr(1),res:false})
+ else
+ _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i],res:false})
- if (_this.fot.includes(pth) === true)
- _this.fileList.push({name:paths[i],url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
- else {
- // alert(paths[i])
- let nms = paths[i].split("\/")
- let nm = nms[nms.length - 1]
- _this.fileListOther.push({name:nm, url: process.env.VUE_APP_BASE_TRUE_API+paths[i]})
+ }
+ }
+ // _this.fileList1 = _this.fileList
}
- }
- }
this.loading = false;
});
this.getCateInfor()
@@ -421,39 +455,38 @@
this.isShow=false
},
- requestUpload(params)
- {
- var file = params.file;
- var formData = new FormData();
- formData.append('uploadFile', file);
- let _this = this
- this.uploading = true;
+ requestUpload(params){
+ // var file = params.file;
+ // var formData = new FormData();
+ // formData.append('uploadFile', file);
+ // let _this = this
+ // this.uploading = true;
- uploadPic(formData).then(response => {
- let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
- this.uploading = false;
- if(_this.fot.includes(pth) === true)
- {
- _this.fileList.push({name:response.data.fileName, "url":response.data.url})
- let ul = this.fileList.map(function (elem){
- return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
- }).join(",")
- let uls = this.fileListOther.map(function (elem){
- return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
- }).join(",")
- this.formData.url = ul+","+uls
- console.log(this.formData.url)
- updateNote(this.formData).then(response => {
- this.$modal.msgSuccess("鍥剧墖涓婁紶鎴愬姛");
- // this.open = false;
- // this.btn=false
- });
- }
- else{
- _this.fileListOther.push({name:response.data.fileName, url:response.data.url})
+ // uploadPic(formData).then(response => {
+ // let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length)
+ // this.uploading = false;
+ // if(_this.fot.includes(pth) === true)
+ // {
+ // _this.fileList.push({name:response.data.fileName, "url":response.data.url})
+ // let ul = this.fileList.map(function (elem){
+ // return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
+ // }).join(",")
+ // let uls = this.fileListOther.map(function (elem){
+ // return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"")
+ // }).join(",")
+ // this.formData.url = ul+","+uls
+ // console.log(this.formData.url)
+ // updateNote(this.formData).then(response => {
+ // this.$modal.msgSuccess("鍥剧墖涓婁紶鎴愬姛");
+ // // this.open = false;
+ // // this.btn=false
+ // });
+ // }
+ // else{
+ // _this.fileListOther.push({name:response.data.fileName, url:response.data.url})
- }
- })
+ // }
+ // })
},
requestUpload1(params)
{
diff --git a/ruoyi-ui/src/views/self/show.vue b/ruoyi-ui/src/views/self/show.vue
index 2d542b3..72919db 100644
--- a/ruoyi-ui/src/views/self/show.vue
+++ b/ruoyi-ui/src/views/self/show.vue
@@ -290,11 +290,11 @@
accept="image/jpeg, image/png,image/jpg, image/WMF,image/gif"
list-type="picture-card"
multiple
- :http-request="requestUploadm"
+ :http-request="requestUpload"
:file-list="fileList"
- :on-change="handleChange1"
- :auto-upload="false"
- ref="upload"
+ :on-change="handleChange"
+ :auto-upload="false"
+ ref="upload"
>
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{ file }">
@@ -328,6 +328,13 @@
</div>
</el-upload>
+ <el-button
+ style="margin-left: 10px"
+ size="small"
+ type="success"
+
+ @click="picUpload"
+ >涓婁紶鍒版湇鍔″櫒</el-button>
<h4 class="form-header">鍏朵粬闄勪欢 </h4>
<el-upload
action=""
@@ -367,7 +374,7 @@
<!--鎶樺彔闈㈡澘-->
- <el-collapse v-model="activeNames" @change="handleChange">
+ <el-collapse v-model="activeNames" @change="handleChange5">
<!-- <el-collapse-item title="绉诲眳鍥斤紙澧冿級鎯呭喌" name="3" >
<div>
<el-form v-loading="loading" :data="individualList" @selection-change="handleSelectionChange">
@@ -992,7 +999,7 @@
momId:undefined,
birth:undefined,
familyId:undefined,
-
+ url: '',
//涓昏瀛︿範鍙婂伐浣滅粡鍘�
id:undefined,
@@ -1018,7 +1025,7 @@
startTime:undefined,
endTime:undefined,
cause:undefined,
- url: undefined,
+
//鑷紶
ageBegin:undefined,
ageEnd:undefined,
@@ -1185,7 +1192,38 @@
}
}
},
- handleChange1(file, fileList1) {
+
+ picUpload()
+ {
+ var formData = new FormData();
+ //alert(976)
+ //this.$refs.upload.submit();
+ //alert(8)
+ //alert(this.uploadFileList.length)
+ if(this.uploadFileList.length==0){
+ this.$modal.msgSuccess("鍥剧墖涓婁紶鍒楄〃涓嶈兘涓虹┖锛�");
+ return}
+ //console.log(this.uploadFileList)
+ // alert(this.uploadFileList)
+ this.uploadFileList.forEach((elem)=>{
+ formData.append("uploadFile", elem)
+
+ })
+ //alert(90)
+ let _this = this
+ //alert(9)
+ uploadPic(formData).then(response => {
+ // console.log(response)
+ // console.log(_this.formDat.url,'666')
+ _this.formDat.url = _this.formDat.url+","+response.data.fileName
+ // alert(_this.formDat.url)
+ _this.uploadFileList = []
+ _this.$modal.msgSuccess("鍥剧墖涓婁紶鎴愬姛");
+
+ });
+ },
+
+ handleChange(file, fileList1) {
//瀹氫箟涓�涓叏灞�鏁扮粍uploadFileList鏉ュ仛瀛樺偍
// this.uploadFileList.push(file.raw);
@@ -1197,6 +1235,16 @@
this.uploadFileList.push(file.raw);
this.fileList.push({name:file.name,url:file.url})
//alert(fileList1.length)
+ },
+ handleChange1(file, fileOtherList1) {
+ //瀹氫箟涓�涓叏灞�鏁扮粍uploadFileList鏉ュ仛瀛樺偍
+ this.uploadFileList1.push(file.raw);
+ this.fileListOther.push({name:file.name,url:file.url})
+ // this.uploadFileList.push(file.raw);
+ console.log("=========5555=========")
+ //console.log(file)
+ // console.log(this.uploadFileList)
+ // this.fileList = fileList
},
@@ -1223,7 +1271,7 @@
},
//涓嬫媺
- handleChange(activeNames) {
+ handleChange5(activeNames) {
// console.log(activeNames);
this.reset();
},
--
Gitblit v1.9.1