This commit is contained in:
liuye
2022-05-25 16:02:14 +08:00
17 changed files with 130 additions and 36 deletions

View File

@@ -41,10 +41,13 @@
</div> </div>
</div> </div>
</div> </div>
<button v-if="user.openId === info.createUserId" @click="remove" class="form-btn form-btn__remove" hover-class="text-hover">删除相册</button>
<button :loading="isLoading" @click="save" class="form-btn" hover-class="text-hover">保存</button> <button :loading="isLoading" @click="save" class="form-btn" hover-class="text-hover">保存</button>
</div> </div>
</template> </template>
<script> <script>
import { mapState } from 'vuex'
export default { export default {
name: 'AddAlbum', name: 'AddAlbum',
@@ -58,10 +61,15 @@
watermarkId: '', watermarkId: '',
isLoading: false, isLoading: false,
id: '', id: '',
info: {},
albumUserList: [] albumUserList: []
} }
}, },
computed: {
...mapState(['user']),
},
onLoad (query) { onLoad (query) {
this.id = query.id || '' this.id = query.id || ''
@@ -70,7 +78,6 @@
} }
uni.$on('change', e => { uni.$on('change', e => {
console.log(e)
if (e.type === 'watermark') { if (e.type === 'watermark') {
this.watermarkId = e.value this.watermarkId = e.value
} }
@@ -92,6 +99,24 @@
}) })
}, },
remove () {
this.$confirm('确定删除该相册?').then(() => {
this.$http.post(`/api/appalbum/delete?ids=${this.id}`).then(res => {
if (res.code == 0) {
this.$u.toast('删除成功')
uni.$emit('update')
setTimeout(() => {
uni.reLaunch({
url: './AppCountryAlbum'
})
}, 500)
}
})
}).catch(() => {
})
},
getInfo (id) { getInfo (id) {
this.$http.post(`/api/appalbum/queryDetailById?id=${id}`).then(res => { this.$http.post(`/api/appalbum/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) { if (res.code === 0) {
@@ -168,6 +193,12 @@
&:active { &:active {
opacity: 0.8; opacity: 0.8;
} }
&.form-btn__remove {
bottom: 140rpx;
background: #FF4466;
color: #fff;
}
} }
.form-group { .form-group {
margin-bottom: 16px; margin-bottom: 16px;

View File

@@ -22,7 +22,7 @@
export default { export default {
name: 'Report', name: 'Report',
appName: '工作汇报', appName: '拼图汇报',
data () { data () {
return { return {

View File

@@ -117,6 +117,10 @@
}, },
toEdit () { toEdit () {
if (!this.list.length) {
return this.$u.toast('相册无照片,请上传照片')
}
this.linkTo(`./EditAlbum?id=${this.id}`) this.linkTo(`./EditAlbum?id=${this.id}`)
}, },
@@ -288,8 +292,8 @@
line-height: 56px; line-height: 56px;
margin-top: 16px; margin-top: 16px;
text-align: center; text-align: center;
background: rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.6);
color: #beb2ab; color: #fff;
border-radius: 28px; border-radius: 28px;
} }

View File

@@ -103,14 +103,14 @@
<switch color="#1088F9" :checked="form.openWorkPoint === '1'" @change="onWorkPointChange" /> <switch color="#1088F9" :checked="form.openWorkPoint === '1'" @change="onWorkPointChange" />
</div> </div>
</div> </div>
<div class="form-group__item form-group__checked" v-if="form.openWorkPoint === '1' && address.address"> <div class="form-group__item form-item__address form-group__checked" v-if="form.openWorkPoint === '1' && address.address">
<div class="left"> <div class="left">
<h2>{{ address.title }}</h2> <h2>{{ address.title }}</h2>
<p>{{ address.address }}</p> <p>{{ address.address }}</p>
<p style="margin-top: 8px;">允许打卡范围{{ address.distance }}</p> <p style="margin-top: 8px;">允许打卡范围{{ address.distance }}</p>
</div> </div>
<div class="right" @click="address = {}"> <div class="right" @click="address = {}">
<image :src="`${$cdn}askform/sc1.png`" /> <image src="./images/remove.png" />
<span>删除</span> <span>删除</span>
</div> </div>
</div> </div>
@@ -378,5 +378,24 @@
} }
} }
} }
.form-item__address {
.left {
flex: 1;
margin-right: 10px;
p {
line-height: 1.3;
}
}
.right {
span {
margin-left: 10px;
color: #1088F9;
font-size: 28px;
}
}
}
} }
</style> </style>

View File

@@ -90,14 +90,14 @@
<switch color="#1088F9" :checked="form.openWorkPoint === '1'" @change="onWorkPointChange" /> <switch color="#1088F9" :checked="form.openWorkPoint === '1'" @change="onWorkPointChange" />
</div> </div>
</div> </div>
<div class="form-group__item form-group__checked" v-if="form.openWorkPoint === '1' && address.address"> <div class="form-group__item form-group__checked form-item__address" v-if="form.openWorkPoint === '1' && address.address">
<div class="left"> <div class="left">
<h2>{{ address.title }}</h2> <h2>{{ address.title }}</h2>
<p>{{ address.address }}</p> <p>{{ address.address }}</p>
<p style="margin-top: 8px;">允许打卡范围{{ address.distance }}</p> <p style="margin-top: 8px;">允许打卡范围{{ address.distance }}</p>
</div> </div>
<div class="right" @click="address = {}"> <div class="right" @click="address = {}">
<image :src="`${$cdn}askform/sc1.png`" /> <image src="./images/remove.png" />
<span>删除</span> <span>删除</span>
</div> </div>
</div> </div>
@@ -367,5 +367,24 @@
} }
} }
} }
.form-item__address {
.left {
flex: 1;
margin-right: 10px;
p {
line-height: 1.3;
}
}
.right {
span {
margin-left: 10px;
color: #1088F9;
font-size: 28px;
}
}
}
} }
</style> </style>

View File

@@ -109,12 +109,13 @@
return this.$u.toast('请选择相片') return this.$u.toast('请选择相片')
} }
this.$confirm('确定删除该数据').then(() => { this.$confirm('确定删除这些图片').then(() => {
this.$http.post(`/api/appalbumphoto/delete?ids=${this.chooseImg}`).then(res => { this.$http.post(`/api/appalbumphoto/delete?ids=${this.chooseImg}`).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$u.toast('删除成功') this.$u.toast('删除成功')
this.getAlbumList() this.getAlbumList()
this.getList() this.getList()
uni.$emit('update')
} }
}) })
}).catch(() => { }).catch(() => {

View File

@@ -4,7 +4,7 @@
<div class="form-item" :class="[config.fieldType === '1' ? 'textarea' : '']"> <div class="form-item" :class="[config.fieldType === '1' ? 'textarea' : '']">
<span>{{ mapFieldLable(config.type) }}</span> <span>{{ mapFieldLable(config.type) }}</span>
<div class="form-item__right" v-if="config.fieldType === '0'"> <div class="form-item__right" v-if="config.fieldType === '0'">
<input :placeholder="'请输入' + mapFieldLable(config.type)" v-model="config.defaultValue"> <input :placeholder="'请输入' + mapFieldLable(config.type)" :maxlength="10" v-model="config.defaultValue">
<span></span> <span></span>
</div> </div>
<div class="form-item__right" v-if="config.fieldType === 'date'" @click="isShowDate = true"> <div class="form-item__right" v-if="config.fieldType === 'date'" @click="isShowDate = true">

View File

@@ -76,7 +76,7 @@
}, },
remove () { remove () {
this.$confirm('确定删除该数据').then(() => { this.$confirm('确定删除该图片').then(() => {
this.$http.post(`/api/appalbumphoto/delete?ids=${this.id}`).then(res => { this.$http.post(`/api/appalbumphoto/delete?ids=${this.id}`).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$u.toast('删除成功') this.$u.toast('删除成功')

View File

@@ -27,7 +27,7 @@
v-for="(item, index) in watermarkList" v-for="(item, index) in watermarkList"
:key="item.id" :key="item.id"
@click.stop="currIndex = index"> @click.stop="currIndex = index">
<image :src="item.thum" mode="aspectFill" /> <image :src="item.thum" />
<div class="water-item__bottom">{{ item.name }}</div> <div class="water-item__bottom">{{ item.name }}</div>
</div> </div>
</div> </div>
@@ -123,8 +123,11 @@
this.img = query.url this.img = query.url
this.height = uni.getSystemInfoSync().windowHeight this.height = uni.getSystemInfoSync().windowHeight
this.getWatermarkList()
this.getLocation() this.getLocation()
this.$nextTick(() => {
this.getWatermarkList()
})
}, },
methods: { methods: {
@@ -273,7 +276,7 @@
}) })
this.$http.post('/api/appalbum/list', null, { this.$http.post('/api/appalbum/list', null, {
parmas: { params: {
size: 1000 size: 1000
} }
}).then(res => { }).then(res => {
@@ -407,7 +410,7 @@
} }
image { image {
width: 176px; width: 236px;
height: 200px; height: 200px;
} }

View File

@@ -5,7 +5,7 @@
<span>*选择水印后相册只能上传该水印照片</span> <span>*选择水印后相册只能上传该水印照片</span>
</div> </div>
<div class="cell-group"> <div class="cell-group">
<div class="cell-item" hover-class="bg-hover" @click="currIndex = 0, checkedList = []"> <div class="cell-item" hover-class="bg-hover" @click="currIndex = 0, chooseIndex = -1">
<div class="cell-item__left"> <div class="cell-item__left">
<h2>不限</h2> <h2>不限</h2>
</div> </div>
@@ -22,9 +22,9 @@
<h2>水印库</h2> <h2>水印库</h2>
</div> </div>
<div class="watermark-list" v-if="currIndex === 1"> <div class="watermark-list" v-if="currIndex === 1">
<div class="item" @click="checked(item.id)" v-for="(item, index) in list" :key="index" :class="[checkedList.includes(item.id) ? 'active' : '']"> <div class="item" @click="chooseIndex = index" v-for="(item, index) in list" :key="index" :class="[chooseIndex === index ? 'active' : '']">
<image class="checked" v-if="checkedList.includes(item.id)" src="./images/xuanzhong.png" /> <image class="checked" v-if="chooseIndex === index" src="./images/xuanzhong.png" />
<image class="watermark" :src="item.thum" mode="aspectFill" /> <image class="watermark" :src="item.thum" mode="scaleToFill" />
</div> </div>
</div> </div>
<div class="form-btn" hover-class="text-hover" @click="save">保存</div> <div class="form-btn" hover-class="text-hover" @click="save">保存</div>
@@ -42,8 +42,8 @@
return { return {
currIndex: 0, currIndex: 0,
config, config,
checkedList: [],
list: [], list: [],
chooseIndex: -1,
pageShow: false pageShow: false
} }
}, },
@@ -51,7 +51,7 @@
onLoad (query) { onLoad (query) {
if (query.value) { if (query.value) {
this.currIndex = 1 this.currIndex = 1
this.checkedList = query.value.split(',') this.chooseIndex = query.value ? Number(query.value) : -1
} }
this.getList() this.getList()
@@ -60,7 +60,7 @@
methods: { methods: {
getList () { getList () {
this.$loading() this.$loading()
this.$http.post(`/api/appalbumtemplate/list?size=100&status=1`).then(res => { this.$http.post(`/api/appalbumtemplate/list?size=1000&status=1`).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.list = res.data.records this.list = res.data.records
} }
@@ -74,20 +74,11 @@
save () { save () {
uni.$emit('change', { uni.$emit('change', {
type: 'watermark', type: 'watermark',
value: this.checkedList.length ? this.checkedList.join(',') : '' value: this.chooseIndex > -1 ? this.chooseIndex : ''
}) })
uni.navigateBack({ uni.navigateBack({
delta: 1 delta: 1
}) })
},
checked (type) {
const i = this.checkedList.indexOf(type)
if (i > -1) {
this.checkedList.splice(i, 1)
} else {
this.checkedList.push(type)
}
} }
} }
} }
@@ -135,7 +126,7 @@
} }
.watermark { .watermark {
width: 200px; width: 236px;
height: 200px; height: 200px;
} }

View File

@@ -140,8 +140,8 @@
getAlbumList () { getAlbumList () {
this.$http.post('/api/appalbum/list', null, { this.$http.post('/api/appalbum/list', null, {
parmas: { params: {
size: 100 size: 10000
} }
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {

View File

@@ -157,6 +157,11 @@
image { image {
display: block; display: block;
width: 100%; width: 100%;
margin-bottom: 10px;
&:last-child {
margin-bottom: 20px;
}
} }
} }

View File

@@ -150,6 +150,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.InspectLog { .InspectLog {
min-height: calc(100vh - 240px);
padding: 48px 32px 0; padding: 48px 32px 0;
background: #133CA5; background: #133CA5;
@@ -159,9 +160,15 @@
.imgs { .imgs {
margin-top: 20px; margin-top: 20px;
image { image {
display: block; display: block;
width: 100%; width: 100%;
margin-bottom: 10px;
&:last-child {
margin-bottom: 20px;
}
} }
} }

View File

@@ -175,9 +175,15 @@
.imgs { .imgs {
margin-top: 20px; margin-top: 20px;
image { image {
display: block; display: block;
width: 100%; width: 100%;
margin-bottom: 10px;
&:last-child {
margin-bottom: 20px;
}
} }
} }

View File

@@ -161,9 +161,15 @@
.imgs { .imgs {
margin-top: 20px; margin-top: 20px;
image { image {
display: block; display: block;
width: 100%; width: 100%;
margin-bottom: 10px;
&:last-child {
margin-bottom: 20px;
}
} }
} }

View File

@@ -61,7 +61,7 @@
watch: { watch: {
configList: { configList: {
handler: function (v) { handler: function (v) {
if (v.length) { if (v && v.length) {
const date = v.filter(v => v.type === '1')[0] const date = v.filter(v => v.type === '1')[0]
const time = v.filter(v => v.type === '0')[0] const time = v.filter(v => v.type === '0')[0]
const title = v.filter(v => v.type === '5')[0] const title = v.filter(v => v.type === '5')[0]
@@ -80,6 +80,7 @@
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => { this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
if (v.fieldType === '3') { if (v.fieldType === '3') {
v.defaultValue = uni.getStorageSync('address').address || '' v.defaultValue = uni.getStorageSync('address').address || ''
this.address = uni.getStorageSync('address').address || ''
} }
if (v.fieldType === '7') { if (v.fieldType === '7') {

View File

@@ -120,6 +120,7 @@
this.configList = JSON.parse(JSON.stringify(this.config)).map(v => { this.configList = JSON.parse(JSON.stringify(this.config)).map(v => {
if (v.fieldType === '3') { if (v.fieldType === '3') {
v.defaultValue = uni.getStorageSync('address').address || '' v.defaultValue = uni.getStorageSync('address').address || ''
this.address = uni.getStorageSync('address').address || ''
} }
return v return v