Commit f26f51b2 authored by mzx's avatar mzx

Merge branch 'develop' of http://gitlab.91isoft.com:90/car-test/web into mengzixuan

parents ae3cf41e 2711cef7
......@@ -6,6 +6,18 @@
:wrapper-closable="false"
@close="closeMaterial"
>
<div
style="
color: rgb(26, 111, 215);
position: absolute;
top: 22px;
left: 90px;
cursor: pointer;
"
@click="refresh"
>
<i class="el-icon-refresh"></i>刷新
</div>
<div
v-for="(item, index) in materialList"
:key="index"
......@@ -15,7 +27,7 @@
<div class="tips"></div>
<div>
<span style="color: #1a6fd7">
{{ item.createTime }}
{{ isTodayOrYesterday(item.createTime) }}
</span>
</div>
</div>
......@@ -67,6 +79,30 @@ export default {
this.getMaterialList()
},
methods: {
refresh() {
this.selectList = []
this.getMaterialList()
},
// 根据日期判断是今天还是昨天啊
isTodayOrYesterday(dateString) {
const inputDate = new Date(dateString)
const today = new Date()
const yesterday = new Date(today)
yesterday.setDate(today.getDate() - 1)
const inputDateStr = inputDate.toDateString()
const todayStr = today.toDateString()
const yesterdayStr = yesterday.toDateString()
if (inputDateStr === todayStr) {
return '今天'
} else if (inputDateStr === yesterdayStr) {
return '昨天'
} else {
return dateString
}
},
selectImage(a, b, path, id) {
if (this.selectList.length >= this.limit) {
this.$message({
......
......@@ -444,10 +444,9 @@ export default {
data.forEach(item => {
item.path = item.path.replace('http://49.232.167.247:22038', '')
})
}
if (this.materialFlag === 'trademark') {
this.editParamsForm.trademark = data[0].path
} else {
} else if (this.materialFlag === 'sample') {
var arr = []
if (this.editParamsForm.samplePhotos) {
arr = this.editParamsForm.samplePhotos.split(',')
......@@ -457,6 +456,7 @@ export default {
})
this.editParamsForm.samplePhotos = arr.join(',')
}
}
this.materialShow = false
},
selectTrademarkMaterial() {
......@@ -508,7 +508,6 @@ export default {
console.log(this.editParamsForm)
this.$refs['editForm'].validate(valid => {
if (valid) {
this.addLoading = true
if (
this.editParamsForm.id === null ||
this.editParamsForm.id === ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment