Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<AiSelect v-model="form.objectType" dict="integralGiveObjType"/>
|
||||
</AiItem>
|
||||
<AiItem label="选择人员" required v-if="form.objectType">
|
||||
<AiPagePicker v-if="form.objectType==0" single @select="handleSelectUser">
|
||||
<AiPagePicker v-if="form.objectType==0" single auditStatus="1" @select="handleSelectUser">
|
||||
<AiMore v-model="form.userName"/>
|
||||
</AiPagePicker>
|
||||
<AiPagePicker v-if="form.objectType==1" single @select="handleSelectUser" type="sysUser">
|
||||
|
||||
@@ -57,14 +57,16 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
let {householdName} = this.$route.query
|
||||
console.log(this.$route.query)
|
||||
let {householdName, auditStatus} = this.$route.query
|
||||
this.$http.post(`/app/appresident/list`, null, {
|
||||
params: {
|
||||
current: this.current,
|
||||
size: 20,
|
||||
areaId: this.user.areaId,
|
||||
con: this.name,
|
||||
householdName
|
||||
householdName,
|
||||
auditStatus: auditStatus || ''
|
||||
}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
|
||||
@@ -10,16 +10,6 @@
|
||||
<input placeholder="请输入相册名称" v-model="albumName" placeholder-style="color: #999" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group__item">
|
||||
<div class="left">
|
||||
<label>*</label>
|
||||
<span>水印</span>
|
||||
</div>
|
||||
<div class="right" @click="linkTo('./WatermarkSetting?value=' + watermarkId)">
|
||||
<span>{{ watermarkId ? '已选择' : '不限' }}</span>
|
||||
<image src="./images/right.png" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group__item">
|
||||
<div class="left">
|
||||
<label>*</label>
|
||||
@@ -27,7 +17,7 @@
|
||||
</div>
|
||||
<div class="right" @click="linkTo('./PersonnelSetting?id=' + id)">
|
||||
<span>{{ albumUserList.length ? '已选择' : '不限' }}</span>
|
||||
<image src="./images/right.png" />
|
||||
<image src="./images/right.png" v-if="!id || isAdmin" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group__item" @click="linkTo('./SourceSetting?value=' + photoSource)">
|
||||
@@ -37,12 +27,12 @@
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>{{ photoSource == 1 ? '仅限乡村相册拍摄' : '不限' }}</span>
|
||||
<image src="./images/right.png" />
|
||||
<image src="./images/right.png" v-if="!id || isAdmin" />
|
||||
</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 v-if="id && isAdmin" @click="remove" class="form-btn form-btn__remove" hover-class="text-hover">删除相册</button>
|
||||
<button v-if="!id || isAdmin" :loading="isLoading" @click="save" class="form-btn" hover-class="text-hover">保存</button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -62,6 +52,7 @@
|
||||
isLoading: false,
|
||||
id: '',
|
||||
info: {},
|
||||
isAdmin: false,
|
||||
albumUserList: []
|
||||
}
|
||||
},
|
||||
@@ -71,6 +62,7 @@
|
||||
},
|
||||
|
||||
onLoad (query) {
|
||||
this.isAdmin = !!this.$store.state.user.adminAuthType
|
||||
this.id = query.id || ''
|
||||
|
||||
if (query.id) {
|
||||
@@ -78,10 +70,6 @@
|
||||
}
|
||||
|
||||
uni.$on('watermarkChange', e => {
|
||||
if (e.type === 'watermark') {
|
||||
this.watermarkId = e.value
|
||||
}
|
||||
|
||||
if (e.type === 'photoSource') {
|
||||
this.photoSource = e.value
|
||||
}
|
||||
@@ -94,6 +82,10 @@
|
||||
|
||||
methods: {
|
||||
linkTo (url) {
|
||||
if (this.id && !this.isAdmin) {
|
||||
return false
|
||||
}
|
||||
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
@@ -122,9 +114,7 @@
|
||||
if (res.code === 0) {
|
||||
this.info = res.data
|
||||
this.albumName = res.data.albumName
|
||||
this.createUserId = res.data.createUserId || ''
|
||||
this.photoSource = res.data.photoSource || 0
|
||||
this.watermarkId = res.data.watermarkId || ''
|
||||
this.albumUserList = res.data.albumUserList || []
|
||||
}
|
||||
})
|
||||
@@ -139,9 +129,8 @@
|
||||
|
||||
this.$http.post('/api/appalbum/addOrUpdate', {
|
||||
albumName: this.albumName,
|
||||
createUserId: this.createUserId,
|
||||
photoSource: this.photoSource,
|
||||
watermarkId: this.watermarkId,
|
||||
watermarkId: '',
|
||||
albumUserList: this.albumUserList,
|
||||
id: this.id || ''
|
||||
}).then(res => {
|
||||
|
||||
@@ -30,15 +30,16 @@
|
||||
<h2>照片列表</h2>
|
||||
<div class="right">
|
||||
<picker mode="date" @change="onChange">
|
||||
<div class="right-item" style="margin-right: 0;">
|
||||
<div class="right-item">
|
||||
<span>{{ date || '所有日期' }}</span>
|
||||
<image src="./images/down.png" />
|
||||
</div>
|
||||
</picker>
|
||||
<!-- <div class="right-item" style="margin-right: 0;">
|
||||
<span>所有干部</span>
|
||||
<div class="right-item" style="margin-right: 0;" @click="toChoose">
|
||||
<span v-if="userId"><AiOpenData v-if="userId" type="userName" :openid="userId"></AiOpenData></span>
|
||||
<span v-else>所有干部</span>
|
||||
<image src="./images/down.png" />
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="photo-item__wrapper">
|
||||
@@ -60,7 +61,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import { mapState, mapActions } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AlbumDetail',
|
||||
@@ -80,12 +81,13 @@
|
||||
id: '',
|
||||
current: 1,
|
||||
totalInfo: {},
|
||||
isMore: false
|
||||
isMore: false,
|
||||
userId: ''
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['user', 'token'])
|
||||
...mapState(['user'])
|
||||
},
|
||||
|
||||
onLoad (query) {
|
||||
@@ -118,12 +120,36 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapActions(['selectPrivilegedContact']),
|
||||
|
||||
linkTo (url) {
|
||||
uni.navigateTo({
|
||||
url
|
||||
})
|
||||
},
|
||||
|
||||
toChoose () {
|
||||
this.$loading()
|
||||
this.selectPrivilegedContact({
|
||||
fromDepartmentId: 0,
|
||||
mode: 'single',
|
||||
selectedOpenUserIds: this.userId ? [this.userId] : ''
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
uni.hideLoading()
|
||||
this.userId = res.userList.map(e => e.openUserId) || []
|
||||
|
||||
this.isMore = false
|
||||
this.current = 1
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
})
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
},
|
||||
|
||||
toEdit () {
|
||||
if (!this.list.length) {
|
||||
return this.$u.toast('相册无照片,请上传照片')
|
||||
@@ -166,10 +192,12 @@
|
||||
success: res => {
|
||||
let formData = new FormData()
|
||||
formData.append('file', res.tempFiles[0])
|
||||
this.$loading()
|
||||
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.linkTo(`./Watermark?url=${res.data.url}&albumId=${this.id}`)
|
||||
|
||||
} else {
|
||||
this.$u.toast(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -178,6 +206,8 @@
|
||||
|
||||
getList () {
|
||||
if (this.isMore) return
|
||||
|
||||
this.$loading()
|
||||
this.$http.post(`/api/appalbumphoto/DetailByAlbumID`, null, {
|
||||
params: {
|
||||
albumId: this.id,
|
||||
@@ -193,18 +223,21 @@
|
||||
this.list = res.data.records
|
||||
}
|
||||
|
||||
if (res.data.records.length && !this.coverImg) {
|
||||
this.coverImg = res.data.records[0].photoUrl
|
||||
}
|
||||
|
||||
if (res.data.records.length < 10) {
|
||||
this.isMore = true
|
||||
uni.hideLoading()
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
this.current = this.current + 1
|
||||
|
||||
if (res.data.records.length && this.coverImg) {
|
||||
this.coverImg = res.data.records[0].photoUrl
|
||||
}
|
||||
}
|
||||
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<span @click="changeTab(1)" :class="[currIndex === 1 ? 'active' : '']">已出勤 {{ attendanceCount.hasIn || 0 }}</span>
|
||||
<span @click="changeTab(2)" :class="[currIndex === 2 ? 'active' : '']">未出勤 {{ attendanceCount.hasOut || 0 }}</span>
|
||||
</div>
|
||||
<div class="right" @click="linkTo('./AttendanceSetting')">考勤设置</div>
|
||||
<div class="right" @click="linkTo('./AttendanceSetting')" v-if="isAdmin">考勤设置</div>
|
||||
</div>
|
||||
<div class="info-table">
|
||||
<div class="table-header">
|
||||
@@ -61,7 +61,8 @@
|
||||
attendanceCount: {},
|
||||
all: '1',
|
||||
hasIn: '',
|
||||
hasOut: ''
|
||||
hasOut: '',
|
||||
isAdmin: false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -84,6 +85,7 @@
|
||||
},
|
||||
|
||||
created () {
|
||||
this.isAdmin = !!this.$store.state.user.adminAuthType
|
||||
this.date = this.$dayjs(new Date).format('YYYY年MM月DD')
|
||||
this.getList()
|
||||
this.getTotal()
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
:key="index"
|
||||
:class="[currIndex === index ? 'active' : '']">
|
||||
<image class="checked" v-if="currIndex === index" src="./images/xuanzhong.png" />
|
||||
<image class="icon" src="./images/icon.png" />
|
||||
<image class="icon" v-if="!item.lastPhotoUrl" src="./images/icon.png" />
|
||||
<image class="img" v-if="item.lastPhotoUrl" :src="item.lastPhotoUrl" mode="aspectFill" />
|
||||
<div class="item-bottom">
|
||||
<h2>{{ item.albumName }}</h2>
|
||||
<div class="item-bottom__info">
|
||||
@@ -55,6 +56,7 @@
|
||||
isShow: false,
|
||||
list: [],
|
||||
currIndex: 0,
|
||||
isAdmin: false,
|
||||
albumList: []
|
||||
}
|
||||
},
|
||||
@@ -70,6 +72,7 @@
|
||||
},
|
||||
|
||||
onLoad (query) {
|
||||
this.isAdmin = !!this.$store.state.user.adminAuthType
|
||||
this.id = query.id
|
||||
this.getAlbumList()
|
||||
|
||||
@@ -80,7 +83,13 @@
|
||||
|
||||
methods: {
|
||||
getList () {
|
||||
this.$http.post(`/api/appalbumphoto/DetailByAlbumID?albumId=${this.id}&pageSize=100000`).then(res => {
|
||||
this.$http.post(`/api/appalbumphoto/DetailByAlbumID`, null, {
|
||||
params: {
|
||||
albumId: this.id,
|
||||
pageSize: 100000,
|
||||
userId: this.isAdmin ? '' : this.$store.state.user.openId
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.list = res.data.records.map(v => {
|
||||
return {
|
||||
@@ -190,6 +199,11 @@
|
||||
border: 4px solid #2477F1;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.item-bottom {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<div class="photo">
|
||||
<image mode="aspectFit" :src="img" @click="preview(img)" />
|
||||
<div class="photo-wrapper">
|
||||
<image mode="widthFix" :src="img" />
|
||||
</div>
|
||||
<div class="photo-footer">
|
||||
<div class="item" @click="back">
|
||||
<image src="./images/fanhui.png" />
|
||||
@@ -104,8 +106,24 @@
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
overflow: auto;
|
||||
background: #000;
|
||||
overflow-y: auto;
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.photo-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 216px;
|
||||
|
||||
& > image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.photo-footer {
|
||||
display: flex;
|
||||
@@ -137,10 +155,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > image {
|
||||
width: 100%;
|
||||
min-height: calc(100% - 216px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,141 +0,0 @@
|
||||
<template>
|
||||
<div class="report-config">
|
||||
<div class="form-group">
|
||||
<div class="form-item" v-for="(item, index) in list" :key="index" :class="[item.type === 'textarea' ? 'textarea' : '']">
|
||||
<span>{{ item.label }}</span>
|
||||
<div class="form-item__right" v-if="item.type === 'text'">
|
||||
<input :placeholder="'请输入' + item.label" v-model="item.value">
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="form-item__right" v-if="item.type === 'date'" @click="currIndex = index, isShowDate = true">
|
||||
<span :style="{color: item.value ? '#333' : '#999'}">{{ item.value || '请选择' + item.label }}</span>
|
||||
<u-icon name="arrow-right" color="#E1E2E3" size="#E1E2E3"></u-icon>
|
||||
</div>
|
||||
<div class="form-item__right" v-if="item.type === 'textarea'">
|
||||
<textarea :placeholder="'请输入' + item.label" v-model="item.value" :maxlength="-1"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-btn" hover-class="text-hover" @click="save">保存</div>
|
||||
<u-picker mode="time" v-model="isShowDate" :params="params" @confirm="onChange"></u-picker>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
list: [],
|
||||
isShowDate: false,
|
||||
params: {
|
||||
year: true,
|
||||
month: true,
|
||||
day: true
|
||||
},
|
||||
currIndex: 0
|
||||
}
|
||||
},
|
||||
|
||||
onLoad (query) {
|
||||
this.list = JSON.parse(query.params)
|
||||
},
|
||||
|
||||
methods: {
|
||||
onChange (e) {
|
||||
this.$set(this.list[this.currIndex], 'value', `${e.year}-${e.month}-${e.day}`)
|
||||
},
|
||||
|
||||
save () {
|
||||
uni.$emit('change', this.list)
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.report-config {
|
||||
padding-bottom: 130px;
|
||||
|
||||
* {
|
||||
line-height: 1;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.form-btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
height: 112px;
|
||||
line-height: 112px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 32px;
|
||||
background: #1365DD;
|
||||
|
||||
&:active {
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 16px;
|
||||
padding: 0 32px;
|
||||
background: #fff;
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 120px;
|
||||
font-size: 32px;
|
||||
color: #333333;
|
||||
border-bottom: 1px solid #DDDDDD;
|
||||
|
||||
&:last-child {
|
||||
border: none;
|
||||
}
|
||||
|
||||
& > span {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
&.textarea {
|
||||
display: block;
|
||||
height: auto;
|
||||
padding: 32px 0;
|
||||
|
||||
textarea {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.form-item__right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
text-align: right;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
|
||||
span {
|
||||
font-size: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: right;
|
||||
font-size: 30px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,13 +2,15 @@
|
||||
<div class="photo">
|
||||
<div class="photo-top">
|
||||
<image src="./images/close.png" @click="back" />
|
||||
<div class="photo-top__middle" @click="isShowAlbum = true">
|
||||
<div class="photo-top__middle" @click="isShow = true">
|
||||
<span>保存至:{{ albumName || '默认相册' }}</span>
|
||||
<image src="./images/to-right.png" />
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<image mode="aspectFit" :src="img" @click="preview(img)" />
|
||||
<div class="photo-wrapper">
|
||||
<image mode="widthFix" :src="img" />
|
||||
</div>
|
||||
<div class="photo-footer">
|
||||
<div class="item" @click="back">
|
||||
<image src="./images/fanhui.png" />
|
||||
@@ -19,7 +21,40 @@
|
||||
<span>上传</span>
|
||||
</div>
|
||||
</div>
|
||||
<u-select v-model="isShowAlbum" :default-value="defaultValue" :list="albumList" @confirm="onConfirm"></u-select>
|
||||
<u-popup v-model="isShow" :closeable="false" border-radius="32" height="70%" mode="bottom">
|
||||
<div class="album">
|
||||
<div class="top">
|
||||
<span @click="isShow = false">取消</span>
|
||||
<span @click="onConfirm">确定</span>
|
||||
</div>
|
||||
<scroll-view scroll-y class="album-list__wrapper">
|
||||
<div
|
||||
class="item"
|
||||
@click="currIndex = index"
|
||||
v-for="(item, index) in albumList"
|
||||
:key="index"
|
||||
:class="[currIndex === index ? 'active' : '']">
|
||||
<image class="checked" v-if="currIndex === index" src="./images/xuanzhong.png" />
|
||||
<image class="icon" v-if="!item.lastPhotoUrl" src="./images/icon.png" />
|
||||
<image class="img" v-if="item.lastPhotoUrl" :src="item.lastPhotoUrl" mode="aspectFill" />
|
||||
<div class="item-bottom">
|
||||
<h2>{{ item.albumName }}</h2>
|
||||
<div class="item-bottom__info">
|
||||
<div class="left">
|
||||
<span>今日新增</span>
|
||||
<i>{{ item.dayPhtoto }}</i>
|
||||
<span>张</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<image src="./images/zhaopianshuliang.png" />
|
||||
<span>{{ item.photoTotal || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
</div>
|
||||
</u-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -37,7 +72,8 @@
|
||||
albumName: '',
|
||||
albumId: '',
|
||||
templateId: '',
|
||||
isShowAlbum: false
|
||||
isShow: false,
|
||||
currIndex: 0
|
||||
}
|
||||
},
|
||||
|
||||
@@ -87,9 +123,11 @@
|
||||
})
|
||||
},
|
||||
|
||||
onConfirm (e) {
|
||||
this.albumId = e[0].value
|
||||
this.albumName = e[0].label
|
||||
onConfirm () {
|
||||
this.albumId = this.albumList[this.currIndex].value
|
||||
this.albumName = this.albumList[this.currIndex].label
|
||||
|
||||
this.isShow = false
|
||||
},
|
||||
|
||||
getWatermarkList () {
|
||||
@@ -101,6 +139,7 @@
|
||||
if (res.code === 0) {
|
||||
this.albumList = res.data.records.map(v => {
|
||||
return {
|
||||
...v,
|
||||
label: v.albumName,
|
||||
value: v.id
|
||||
}
|
||||
@@ -110,13 +149,6 @@
|
||||
this.albumId = this.albumList[0].value
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
preview (url) {
|
||||
uni.previewImage({
|
||||
urls: [url],
|
||||
current: url
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,9 +159,177 @@
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
overflow: auto;
|
||||
overflow-y: auto;
|
||||
background: #000;
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.album {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
.album-list__wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.item {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 328px;
|
||||
height: 328px;
|
||||
margin-bottom: 32px;
|
||||
box-shadow: 0px 4px 8px 0px rgba(17, 67, 110, 0.1);
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
background: #EFF5FA;
|
||||
|
||||
&:nth-of-type(2n) {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
&.active {
|
||||
border: 4px solid #2477F1;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.item-bottom {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
padding: 20px 16px 16px;
|
||||
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
|
||||
box-shadow: 0px 4px 8px 0px rgba(17, 67, 110, 0.1);
|
||||
|
||||
& > h2 {
|
||||
margin-bottom: 14px;
|
||||
font-size: 32px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.item-bottom__info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 86px;
|
||||
height: 48px;
|
||||
padding: 0 8px;
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
box-shadow: 0px 4px 8px 0px rgba(17, 67, 110, 0.1);
|
||||
border-radius: 8px;
|
||||
|
||||
image {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.left {
|
||||
span {
|
||||
color: #c6c5c4;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
i {
|
||||
padding: 0 3px;
|
||||
color: #fff;
|
||||
font-size: 28px;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > span {
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
top: 16px;
|
||||
z-index: 1;
|
||||
width: 94px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 28px;
|
||||
background: #FF524F;
|
||||
box-shadow: 0px 4px 8px 0px rgba(17, 67, 110, 0.1);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.checked {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
z-index: 1;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scroll-view {
|
||||
height: calc(100% - 96px);
|
||||
padding: 0 32px;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 96px;
|
||||
padding: 0 32px;
|
||||
font-size: 32px;
|
||||
color: #999;
|
||||
font-weight: 600;
|
||||
|
||||
span:last-child {
|
||||
color: #222;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.photo-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 216px;
|
||||
|
||||
& > image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.photo-top {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<template>
|
||||
<div class="photo" :class="[isHide ? 'home-active' : '']" :style="{height: height + 'px'}" @click="isHide = true">
|
||||
<div class="photo-top" data-html2canvas-ignore>
|
||||
<image src="./images/close.png" @click="back" />
|
||||
<div class="photo-top__middle" @click="isShowAlbum = true">
|
||||
<span>保存至:{{ albumName || '默认相册' }}</span>
|
||||
<image src="./images/to-right.png" />
|
||||
</div>
|
||||
<span @click.stop="save">保存</span>
|
||||
</div>
|
||||
<div ref="waterMarker" class="waterMarker-wrapper" :style="{height: canvasHeight + 'px'}">
|
||||
<image class="waterMarker-img" :src="img" mode="widthFix" @load="onImgLoad" />
|
||||
@@ -51,7 +49,40 @@
|
||||
<div>上传</div>
|
||||
</div>
|
||||
</div>
|
||||
<u-select v-model="isShowAlbum" :default-value="defaultValue" :list="albumList" @confirm="onConfirm"></u-select>
|
||||
<u-popup v-model="isShowAlbum" :closeable="false" border-radius="32" height="70%" mode="bottom">
|
||||
<div class="album">
|
||||
<div class="top">
|
||||
<span @click="isShow = false">取消</span>
|
||||
<span @click="onConfirm">确定</span>
|
||||
</div>
|
||||
<scroll-view scroll-y class="album-list__wrapper">
|
||||
<div
|
||||
class="item"
|
||||
@click="currIndex = index"
|
||||
v-for="(item, index) in albumList"
|
||||
:key="index"
|
||||
:class="[currIndex === index ? 'active' : '']">
|
||||
<image class="checked" v-if="currIndex === index" src="./images/xuanzhong.png" />
|
||||
<image class="icon" v-if="!item.lastPhotoUrl" src="./images/icon.png" />
|
||||
<image class="img" v-if="item.lastPhotoUrl" :src="item.lastPhotoUrl" mode="aspectFill" />
|
||||
<div class="item-bottom">
|
||||
<h2>{{ item.albumName }}</h2>
|
||||
<div class="item-bottom__info">
|
||||
<div class="left">
|
||||
<span>今日新增</span>
|
||||
<i>{{ item.dayPhtoto }}</i>
|
||||
<span>张</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<image src="./images/zhaopianshuliang.png" />
|
||||
<span>{{ item.photoTotal || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</scroll-view>
|
||||
</div>
|
||||
</u-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -87,7 +118,7 @@
|
||||
return {
|
||||
img: '',
|
||||
currIndex: 0,
|
||||
isHide: false,
|
||||
isHide: true,
|
||||
height: '100%',
|
||||
waterSrc: '',
|
||||
albumId: '1',
|
||||
@@ -268,9 +299,11 @@
|
||||
return new File([u8arr], filename, { type: mime })
|
||||
},
|
||||
|
||||
onConfirm (e) {
|
||||
this.albumId = e[0].value
|
||||
this.albumName = e[0].label
|
||||
onConfirm () {
|
||||
this.albumId = this.albumList[this.currIndex].value
|
||||
this.albumName = this.albumList[this.currIndex].label
|
||||
|
||||
this.isShowAlbum = false
|
||||
},
|
||||
|
||||
getWatermarkList () {
|
||||
@@ -288,6 +321,7 @@
|
||||
if (res.code === 0) {
|
||||
this.albumList = res.data.records.map(v => {
|
||||
return {
|
||||
...v,
|
||||
label: v.albumName,
|
||||
value: v.id
|
||||
}
|
||||
@@ -327,6 +361,158 @@
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.album {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
.album-list__wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.item {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 328px;
|
||||
height: 328px;
|
||||
margin-bottom: 32px;
|
||||
box-shadow: 0px 4px 8px 0px rgba(17, 67, 110, 0.1);
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
background: #EFF5FA;
|
||||
|
||||
&:nth-of-type(2n) {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
&.active {
|
||||
border: 4px solid #2477F1;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.item-bottom {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
padding: 20px 16px 16px;
|
||||
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
|
||||
box-shadow: 0px 4px 8px 0px rgba(17, 67, 110, 0.1);
|
||||
|
||||
& > h2 {
|
||||
margin-bottom: 14px;
|
||||
font-size: 32px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.item-bottom__info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 86px;
|
||||
height: 48px;
|
||||
padding: 0 8px;
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
box-shadow: 0px 4px 8px 0px rgba(17, 67, 110, 0.1);
|
||||
border-radius: 8px;
|
||||
|
||||
image {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.left {
|
||||
span {
|
||||
color: #c6c5c4;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
i {
|
||||
padding: 0 3px;
|
||||
color: #fff;
|
||||
font-size: 28px;
|
||||
font-style: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > span {
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
top: 16px;
|
||||
z-index: 1;
|
||||
width: 94px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 28px;
|
||||
background: #FF524F;
|
||||
box-shadow: 0px 4px 8px 0px rgba(17, 67, 110, 0.1);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.checked {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
z-index: 1;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scroll-view {
|
||||
height: calc(100% - 96px);
|
||||
padding: 0 32px;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 96px;
|
||||
padding: 0 32px;
|
||||
font-size: 32px;
|
||||
color: #999;
|
||||
font-weight: 600;
|
||||
|
||||
span:last-child {
|
||||
color: #222;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.waterMarker-wrapper {
|
||||
width: 100%;
|
||||
max-height: 100vh;
|
||||
@@ -463,7 +649,7 @@
|
||||
display: flex;
|
||||
position: fixed;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
justify-content: center;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 11;
|
||||
|
||||
@@ -155,12 +155,16 @@
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ['compressed'],
|
||||
sourceType: ['camera'],
|
||||
success: res => {
|
||||
let formData = new FormData()
|
||||
formData.append('file', res.tempFiles[0])
|
||||
this.$loading()
|
||||
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.linkTo(`./Watermark?url=${res.data.url}`)
|
||||
} else {
|
||||
this.$u.toast(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -20,30 +20,38 @@
|
||||
<label>总结:</label>
|
||||
<span class="">{{ remark }}</span>
|
||||
</div>
|
||||
<div class="imgs">
|
||||
<image :src="item" v-for="(item, index) in imgs" mode="widthFix" :key="index" />
|
||||
</div>
|
||||
<RenderContent style="margin-top: 20px" :richList="richList" @onLongpress="onLongpress"></RenderContent>
|
||||
</div>
|
||||
<div class="add" data-html2canvas-ignore ref="add">
|
||||
<div class="add-btn" @click.stop="addPhoto">
|
||||
<span>添加图片</span>
|
||||
</div>
|
||||
<!-- <div class="add-btn">
|
||||
<div class="add-btn" @click.stop="content = '', isShowText = true">
|
||||
<span>添加文字</span>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<u-modal v-model="isShowText" @confirm="confirm" title="文本">
|
||||
<view class="slot-content">
|
||||
<textarea placeholder="请输入文本" :maxlength="-1" v-model="content"></textarea>
|
||||
</view>
|
||||
</u-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
export default {
|
||||
name: 'Daily',
|
||||
label: '日报',
|
||||
|
||||
props: ['config'],
|
||||
|
||||
components: {
|
||||
RenderContent
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
imgs: [],
|
||||
@@ -60,6 +68,10 @@
|
||||
isShowReporter: true,
|
||||
isShowUnit: true,
|
||||
isShowRemark: false,
|
||||
richList: [],
|
||||
isShowText: false,
|
||||
content: '',
|
||||
currIndex: -1
|
||||
}
|
||||
},
|
||||
|
||||
@@ -116,6 +128,17 @@
|
||||
})
|
||||
},
|
||||
|
||||
onLongpress (e) {
|
||||
if (e.action === 'remove') {
|
||||
this.richList.splice(e.index, 1)
|
||||
} else {
|
||||
this.currIndex = e.index
|
||||
this.content = e.value
|
||||
|
||||
this.isShowText = true
|
||||
}
|
||||
},
|
||||
|
||||
addPhoto () {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
@@ -125,13 +148,37 @@
|
||||
formData.append('file', res.tempFiles[0])
|
||||
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.imgs.push(res.data.url)
|
||||
this.richList.push({
|
||||
type: 'img',
|
||||
value: res.data.url
|
||||
})
|
||||
} else {
|
||||
this.$u.toast(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
confirm () {
|
||||
if (!this.content) {
|
||||
return this.$toast('文本不能为空')
|
||||
}
|
||||
|
||||
if (this.currIndex >= 0) {
|
||||
this.richList[this.currIndex].value = this.content
|
||||
} else {
|
||||
this.richList.push({
|
||||
type: 'text',
|
||||
value: this.content
|
||||
})
|
||||
}
|
||||
|
||||
this.isShowText = false
|
||||
this.content = ''
|
||||
this.currIndex = -1
|
||||
},
|
||||
|
||||
linkTo () {
|
||||
uni.setStorageSync('waterConfig', this.configList)
|
||||
uni.navigateTo({
|
||||
@@ -151,17 +198,12 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.imgs {
|
||||
.slot-content {
|
||||
margin-top: 20px;
|
||||
padding: 0 30px;
|
||||
|
||||
image {
|
||||
display: block;
|
||||
textarea {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,27 +22,38 @@
|
||||
<label>巡查情况:</label>
|
||||
<span>{{ remark }}</span>
|
||||
</div>
|
||||
<div class="imgs">
|
||||
<image :src="item" v-for="(item, index) in imgs" mode="widthFix" :key="index" />
|
||||
</div>
|
||||
</div>
|
||||
<RenderContent class="RenderContent" style="margin-top: 20px" :richList="richList" @onLongpress="onLongpress"></RenderContent>
|
||||
<div class="add" data-html2canvas-ignore ref="add">
|
||||
<div class="add-btn" @click="addPhoto">
|
||||
<span>添加图片</span>
|
||||
</div>
|
||||
<div class="add-btn" @click.stop="content = '', isShowText = true">
|
||||
<span>添加文字</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<u-modal v-model="isShowText" @confirm="confirm" title="文本">
|
||||
<view class="slot-content">
|
||||
<textarea placeholder="请输入文本" :maxlength="-1" v-model="content"></textarea>
|
||||
</view>
|
||||
</u-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
export default {
|
||||
name: 'InspectLog',
|
||||
label: '巡查日志',
|
||||
|
||||
props: ['config'],
|
||||
|
||||
components: {
|
||||
RenderContent
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
title: '巡查日志',
|
||||
@@ -59,7 +70,11 @@
|
||||
isShowAddress: false,
|
||||
isShowRemark: false,
|
||||
imgs: [],
|
||||
configList: []
|
||||
configList: [],
|
||||
richList: [],
|
||||
isShowText: false,
|
||||
content: '',
|
||||
currIndex: -1
|
||||
}
|
||||
},
|
||||
|
||||
@@ -122,6 +137,17 @@
|
||||
})
|
||||
},
|
||||
|
||||
onLongpress (e) {
|
||||
if (e.action === 'remove') {
|
||||
this.richList.splice(e.index, 1)
|
||||
} else {
|
||||
this.currIndex = e.index
|
||||
this.content = e.value
|
||||
|
||||
this.isShowText = true
|
||||
}
|
||||
},
|
||||
|
||||
addPhoto () {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
@@ -131,13 +157,37 @@
|
||||
formData.append('file', res.tempFiles[0])
|
||||
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.imgs.push(res.data.url)
|
||||
this.richList.push({
|
||||
type: 'img',
|
||||
value: res.data.url
|
||||
})
|
||||
} else {
|
||||
this.$u.toast(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
confirm () {
|
||||
if (!this.content) {
|
||||
return this.$toast('文本不能为空')
|
||||
}
|
||||
|
||||
if (this.currIndex >= 0) {
|
||||
this.richList[this.currIndex].value = this.content
|
||||
} else {
|
||||
this.richList.push({
|
||||
type: 'text',
|
||||
value: this.content
|
||||
})
|
||||
}
|
||||
|
||||
this.isShowText = false
|
||||
this.content = ''
|
||||
this.currIndex = -1
|
||||
},
|
||||
|
||||
linkTo () {
|
||||
uni.setStorageSync('waterConfig', this.configList)
|
||||
uni.navigateTo({
|
||||
@@ -158,17 +208,18 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.imgs {
|
||||
::v-deep .RenderContent {
|
||||
p {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.slot-content {
|
||||
margin-top: 20px;
|
||||
padding: 0 30px;
|
||||
|
||||
image {
|
||||
display: block;
|
||||
textarea {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,21 +33,28 @@
|
||||
<td colspan="3">{{ remark }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="imgs">
|
||||
<image :src="item" v-for="(item, index) in imgs" mode="widthFix" :key="index" />
|
||||
</div>
|
||||
<RenderContent style="margin-top: 20px" :richList="richList" @onLongpress="onLongpress"></RenderContent>
|
||||
<div class="bottom" data-html2canvas-ignore ref="add">
|
||||
<div class="add">
|
||||
<div class="add-btn" @click="addPhoto">
|
||||
<span>添加图片</span>
|
||||
</div>
|
||||
<div class="add-btn" @click.stop="content = '', isShowText = true">
|
||||
<span>添加文字</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<u-modal v-model="isShowText" @confirm="confirm" title="文本">
|
||||
<view class="slot-content">
|
||||
<textarea placeholder="请输入文本" :maxlength="-1" v-model="content"></textarea>
|
||||
</view>
|
||||
</u-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
export default {
|
||||
name: 'MeetingMminutes',
|
||||
|
||||
@@ -55,6 +62,10 @@
|
||||
|
||||
props: ['config'],
|
||||
|
||||
components: {
|
||||
RenderContent
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
title: '巡查日志',
|
||||
@@ -76,7 +87,11 @@
|
||||
isShowRemark: true,
|
||||
isShowHoster: true,
|
||||
imgs: [],
|
||||
configList: []
|
||||
configList: [],
|
||||
richList: [],
|
||||
isShowText: false,
|
||||
content: '',
|
||||
currIndex: -1
|
||||
}
|
||||
},
|
||||
|
||||
@@ -142,6 +157,17 @@
|
||||
})
|
||||
},
|
||||
|
||||
onLongpress (e) {
|
||||
if (e.action === 'remove') {
|
||||
this.richList.splice(e.index, 1)
|
||||
} else {
|
||||
this.currIndex = e.index
|
||||
this.content = e.value
|
||||
|
||||
this.isShowText = true
|
||||
}
|
||||
},
|
||||
|
||||
addPhoto () {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
@@ -151,13 +177,37 @@
|
||||
formData.append('file', res.tempFiles[0])
|
||||
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.imgs.push(res.data.url)
|
||||
this.richList.push({
|
||||
type: 'img',
|
||||
value: res.data.url
|
||||
})
|
||||
} else {
|
||||
this.$u.toast(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
confirm () {
|
||||
if (!this.content) {
|
||||
return this.$toast('文本不能为空')
|
||||
}
|
||||
|
||||
if (this.currIndex >= 0) {
|
||||
this.richList[this.currIndex].value = this.content
|
||||
} else {
|
||||
this.richList.push({
|
||||
type: 'text',
|
||||
value: this.content
|
||||
})
|
||||
}
|
||||
|
||||
this.isShowText = false
|
||||
this.content = ''
|
||||
this.currIndex = -1
|
||||
},
|
||||
|
||||
linkTo () {
|
||||
uni.setStorageSync('waterConfig', this.configList)
|
||||
uni.navigateTo({
|
||||
@@ -173,17 +223,12 @@
|
||||
padding: 48px 32px 0;
|
||||
background: #fff;
|
||||
|
||||
.imgs {
|
||||
.slot-content {
|
||||
margin-top: 20px;
|
||||
padding: 0 30px;
|
||||
|
||||
image {
|
||||
display: block;
|
||||
textarea {
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
82
src/saas/AppCountryAlbum/components/report/RenderContent.vue
Normal file
82
src/saas/AppCountryAlbum/components/report/RenderContent.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div class="rich">
|
||||
<div class="rich-item" v-for="(item, index) in richList" :key="index">
|
||||
<p @click="onLongpress(item, index)" v-if="item.type === 'text'">{{ item.value }}</p>
|
||||
<image @click="onLongpress(item, index)" v-else mode="widthFix" :src="item.value" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['richList'],
|
||||
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
onLongpress (item, index) {
|
||||
if (item.type === 'text') {
|
||||
uni.showActionSheet({
|
||||
itemList: ['编辑', '删除'],
|
||||
success: res => {
|
||||
this.$emit('onLongpress', {
|
||||
type: item.type,
|
||||
value: item.value,
|
||||
index: index,
|
||||
action: res.tapIndex === 0 ? 'edit' : 'remove'
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showActionSheet({
|
||||
itemList: ['删除'],
|
||||
success: () => {
|
||||
this.$emit('onLongpress', {
|
||||
type: item.type,
|
||||
value: item.value,
|
||||
index: index,
|
||||
action: 'remove'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
prview (url) {
|
||||
uni.previewImage({
|
||||
urls: [url],
|
||||
current: url
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.rich {
|
||||
.rich-item {
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 1.3;
|
||||
word-break: break-all;
|
||||
text-align: justify;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -19,30 +19,39 @@
|
||||
<div class="bottom-item" v-if="isShowRemark" @click="linkTo">
|
||||
<span>备注:{{ remark }}</span>
|
||||
</div>
|
||||
<div class="imgs">
|
||||
<image :src="item" v-for="(item, index) in imgs" mode="widthFix" :key="index" />
|
||||
</div>
|
||||
<RenderContent :richList="richList" @onLongpress="onLongpress"></RenderContent>
|
||||
</div>
|
||||
<div class="add" data-html2canvas-ignore ref="add">
|
||||
<div class="add-btn" @click.stop="addPhoto">
|
||||
<span>添加图片</span>
|
||||
</div>
|
||||
<!-- <div class="add-btn">
|
||||
<div class="add-btn" @click.stop="content = '', isShowText = true">
|
||||
<span>添加文字</span>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<u-modal v-model="isShowText" @confirm="confirm" title="文本">
|
||||
<view class="slot-content">
|
||||
<textarea placeholder="请输入文本" :maxlength="-1" v-model="content"></textarea>
|
||||
</view>
|
||||
</u-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
|
||||
export default {
|
||||
name: 'WorkReport',
|
||||
label: '工作汇报',
|
||||
|
||||
props: ['config'],
|
||||
|
||||
components: {
|
||||
RenderContent
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
title: '工作汇报',
|
||||
@@ -58,7 +67,11 @@
|
||||
isShowUnit: true,
|
||||
isShowRemark: false,
|
||||
imgs: [],
|
||||
configList: []
|
||||
configList: [],
|
||||
richList: [],
|
||||
isShowText: false,
|
||||
content: '',
|
||||
currIndex: -1
|
||||
}
|
||||
},
|
||||
|
||||
@@ -115,6 +128,17 @@
|
||||
})
|
||||
},
|
||||
|
||||
onLongpress (e) {
|
||||
if (e.action === 'remove') {
|
||||
this.richList.splice(e.index, 1)
|
||||
} else {
|
||||
this.currIndex = e.index
|
||||
this.content = e.value
|
||||
|
||||
this.isShowText = true
|
||||
}
|
||||
},
|
||||
|
||||
addPhoto () {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
@@ -124,13 +148,37 @@
|
||||
formData.append('file', res.tempFiles[0])
|
||||
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.imgs.push(res.data.url)
|
||||
this.richList.push({
|
||||
type: 'img',
|
||||
value: res.data.url
|
||||
})
|
||||
} else {
|
||||
this.$u.toast(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
confirm () {
|
||||
if (!this.content) {
|
||||
return this.$toast('文本不能为空')
|
||||
}
|
||||
|
||||
if (this.currIndex >= 0) {
|
||||
this.richList[this.currIndex].value = this.content
|
||||
} else {
|
||||
this.richList.push({
|
||||
type: 'text',
|
||||
value: this.content
|
||||
})
|
||||
}
|
||||
|
||||
this.isShowText = false
|
||||
this.content = ''
|
||||
this.currIndex = -1
|
||||
},
|
||||
|
||||
linkTo () {
|
||||
uni.setStorageSync('waterConfig', this.configList)
|
||||
uni.navigateTo({
|
||||
@@ -150,6 +198,15 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.slot-content {
|
||||
margin-top: 20px;
|
||||
padding: 0 30px;
|
||||
|
||||
textarea {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
& > image {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
||||
Reference in New Issue
Block a user