Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aixianling
2022-05-30 18:47:10 +08:00
15 changed files with 219 additions and 115 deletions

View File

@@ -28,7 +28,8 @@
return {
component: 'WorkReport',
configList: [],
currIndex: 0
currIndex: 0,
albumId: ''
}
},
@@ -47,7 +48,8 @@
}
},
onLoad () {
onLoad (query) {
this.albumId = query.id || ''
this.getConfig()
},
@@ -62,7 +64,7 @@
save () {
this.$loading()
this.$refs.reportItem.screenshot().then(canvas => {
this.$refs.reportItem.screenshot() && this.$refs.reportItem.screenshot().then(canvas => {
let dataURL = canvas.toDataURL('image/png')
const file = this.dataURLtoFile(dataURL, 'photo.png')
let formData = new FormData()
@@ -71,7 +73,7 @@
if (res.code === 0) {
const data = this.configList[this.currIndex]
uni.navigateTo({
url: `./ReportImg?img=${res.data.url}&type=${data.watermarkType}&templateId=${data.id}`
url: `./ReportImg?albumId=${this.albumId}&img=${res.data.url}&type=${data.watermarkType}&templateId=${data.id}`
})
}

View File

@@ -1,10 +1,10 @@
<template>
<div class="photo">
<div class="photo" v-if="pageShow">
<div class="photo-header">
<image :src="coverImg" mode="aspectFill" />
<div>
<h2>{{ info.albumName }}</h2>
<span @click="linkTo('./AddAlbum?id=' + id)">相册设置</span>
<h2>{{ info.albumName }}</h2>
<div class="right" @click="linkTo('./AddAlbum?id=' + id)" hover-class="text-hover" v-if="id !== '1'">
<image src="./images/setting.png" />
<span>相册设置</span>
</div>
</div>
<div class="photo-info">
@@ -27,23 +27,26 @@
</div>
<div class="photo-list">
<div class="photo-title">
<h2>照片列表</h2>
<div class="right">
<div class="left">
<picker mode="date" @change="onChange">
<div class="right-item">
<div class="left-item">
<span>{{ date || '所有日期' }}</span>
<image src="./images/down.png" />
</div>
</picker>
<div class="right-item" style="margin-right: 0;" @click="toChoose">
<div class="left-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 class="right" hover-class="text-hover" @click="toEdit">
<image src="./images/edit.png" />
<span>编辑照片</span>
</div>
</div>
<div class="photo-item__wrapper">
<div class="photo-item" @click="linkTo('./Photo?url=' + item.photoUrl + '&id=' + item.id)" v-for="(item, index) in list" :key="index">
<div class="photo-item" @click="linkTo('./Photo?id=' + item.id)" v-for="(item, index) in list" :key="index">
<image :src="item.photoUrl" mode="aspectFill" />
<div class="photo-item__text">
<h2><AiOpenData v-if="item.createUserId" type="userName" :openid="item.createUserId"></AiOpenData></h2>
@@ -54,7 +57,7 @@
</div>
</div>
<div class="btn-wrapper">
<div class="btn" hover-class="text-hover" @click="toEdit">编辑照片</div>
<div class="btn" @click="linkTo('./AddReport?id=' + id)">上传拼图汇报</div>
<div class="btn" @click="toAddImg" hover-class="text-hover">上传照片</div>
</div>
</div>
@@ -74,7 +77,6 @@
info: {},
name: '',
date: '',
coverImg: '',
imgList: [],
hideStatus: false,
pageShow: false,
@@ -140,7 +142,7 @@
fromDepartmentId: 0,
mode: 'single',
selectedOpenUserIds: this.userId ? [this.userId] : ''
}).then(res => {
}).then(res => {
console.log(res)
uni.hideLoading()
if (res.userList && res.userList) {
@@ -179,10 +181,13 @@
},
getInfo (id) {
this.$loading()
this.$http.post(`/api/appalbum/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
}
this.pageShow = true
})
},
@@ -235,10 +240,6 @@
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()
@@ -262,7 +263,9 @@
<style lang="scss" socped>
.photo {
min-height: 100vh;
padding-bottom: 130px;
box-sizing: border-box;
* {
box-sizing: border-box;
@@ -330,11 +333,11 @@
font-weight: 600;
}
.right {
.left {
display: flex;
align-items: center;
.right-item {
.left-item {
display: flex;
align-items: center;
margin-right: 32px;
@@ -351,49 +354,56 @@
}
}
}
.right {
display: flex;
align-items: center;
font-size: 26px;
color: #333;
image {
width: 32px;
height: 32px;
margin-right: 8px;
}
}
}
}
.photo-header {
position: relative;
height: 400px;
background: rgba(0,0,0, 0.7);
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 148px;
padding: 0 32rpx;
color: #Fff;
background: #3975C6;
div {
position: relative;
display: flex;
z-index: 1;
align-items: center;
justify-content: center;
flex-direction: column;
width: 100%;
height: 100%;
}
span {
width: 176px;
width: 216px;
height: 56px;
line-height: 56px;
margin-top: 16px;
text-align: center;
background: rgba(0, 0, 0, 0.6);
color: #fff;
justify-content: center;
border-radius: 28px;
font-size: 28px;
background: #285DA4;
}
image {
position: absolute;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 400px;
filter: blur(2px);
width: 32px;
height: 32px;
margin-right: 8px;
}
h2 {
flex: 1;
margin-right: 20px;
color: #fff;
font-size: 56px;
font-size: 38px;
}
}
@@ -401,8 +411,7 @@
display: flex;
align-items: center;
height: 168px;
background: #FFFFFF;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
background: #3975C6;
& > div {
flex: 1;
@@ -411,12 +420,12 @@
h2 {
margin-bottom: 10px;
font-weight: 600;
font-size: 38px;
color: #333333;
font-size: 44px;
color: #fff;
}
span {
color: #999999;
color: #C3D5EE;
font-size: 26px;
}
}
@@ -438,7 +447,7 @@
}
.btn:first-child {
width: 270px;
flex: 1;
height: 112px;
line-height: 112px;
text-align: center;

View File

@@ -206,14 +206,22 @@
return this.$u.toast('请选择下班打卡时间')
}
if (this.$dayjs('2020-06-01 ' + this.form.workOutTime).valueOf() <= this.$dayjs('2020-06-01 ' + this.form.workInTime).valueOf()) {
return this.$u.toast('下班时间不能早于上班时间')
}
if (this.form.openRestTime === '1') {
if (!this.form.restTimeBegin) {
return this.$u.toast('请选择休息时间')
return this.$u.toast('请选择休息开始时间')
}
if (!this.form.restTimeEnd) {
return this.$u.toast('请选择休息结束时间')
}
if (this.$dayjs('2020-06-01 ' + this.form.restTimeEnd).valueOf() <= this.$dayjs('2020-06-01 ' + this.form.restTimeBegin).valueOf()) {
return this.$u.toast('休息结束时间不能早于休息开始时间')
}
}
if (!this.form.workInFrom) {
@@ -224,6 +232,10 @@
return this.$u.toast('请选择下班打卡最晚时间')
}
if (this.$dayjs('2020-06-01 ' + this.form.workOutEnd).valueOf() <= this.$dayjs('2020-06-01 ' + this.form.workInFrom).valueOf()) {
return this.$u.toast('下班打卡最晚时间不能早于上班打卡最早时间')
}
if (this.form.openWorkPoint === '1' && !this.address.address) {
return this.$u.toast('请选择固定打卡点')
}

View File

@@ -193,6 +193,10 @@
return this.$u.toast('请选择最晚打卡时间')
}
if (this.$dayjs('2020-06-01 ' + this.form.workOutEnd).valueOf() <= this.$dayjs('2020-06-01 ' + this.form.workInFrom).valueOf()) {
return this.$u.toast('最晚打卡时间不能最早打卡时间')
}
if (this.form.openRestTime === '1') {
if (!this.form.restTimeBegin) {
return this.$u.toast('请选择休息时间')
@@ -201,6 +205,10 @@
if (!this.form.restTimeEnd) {
return this.$u.toast('请选择休息结束时间')
}
if (this.$dayjs('2020-06-01 ' + this.form.restTimeEnd).valueOf() <= this.$dayjs('2020-06-01 ' + this.form.restTimeBegin).valueOf()) {
return this.$u.toast('休息结束时间不能早于休息开始时间')
}
}
if (!this.form.workHoursLimit) {

View File

@@ -26,6 +26,7 @@
<image src="./images/remove.png" @click="remove(index)" />
</div>
</div>
<div class="tips">如选中人员未展示可能是未授权该成员应用权限需要先对这些成员进行应用授权 </div>
<div class="form-btn" hover-class="text-hover" @click="save">保存</div>
</div>
</template>

View File

@@ -36,7 +36,12 @@
onLoad (query) {
this.id = query.id
this.img = query.url
this.$http.post(`/api/appalbumphoto/queryDetailById?id=${query.id}`).then(res => {
if (res.code == 0) {
this.img = res.data.photoUrl
}
})
},
methods: {

View File

@@ -91,6 +91,7 @@
this.img = query.img
this.type = query.type
this.templateId = query.templateId
this.albumId = query.albumId
this.getWatermarkList()
},
@@ -145,8 +146,17 @@
}
})
this.albumName = this.albumList[0].label
this.albumId = this.albumList[0].value
if (this.albumId) {
this.albumName = this.albumList.filter((v, index) => {
if (v.value === this.albumId) {
this.currIndex = index
}
return v.value === this.albumId
})[0].label
} else {
this.albumName = this.albumList[0].label
this.albumId = this.albumList[0].value
}
}
})
}

View File

@@ -63,7 +63,7 @@
<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="isShowAlbum = false">取消</span>
<span @click="onConfirm">确定</span>
</div>
<scroll-view scroll-y class="album-list__wrapper">

View File

@@ -83,8 +83,7 @@
countPhotoNo: '',
countPhotographer: '',
list: [],
msgInfo: {},
userInfo: {}
msgInfo: {}
}
},
computed: { ...mapState(['user']) },
@@ -118,7 +117,7 @@
getUserInfo () {
this.$http.post('/api/user/info').then(res => {
if (res.code === 0) {
this.userInfo = res.data
this.$store.commit('setUser', res.data)
}
})
},

View File

@@ -42,6 +42,7 @@
<script>
import html2canvas from 'html2canvas'
import RenderContent from './RenderContent.vue'
import { mapFieldLable } from './../../config'
export default {
name: 'Daily',
label: '日报',
@@ -119,6 +120,13 @@
methods: {
screenshot () {
for (let i = 0; i < this.configList.length; i ++) {
if (['2', '3', '4', '5'].indexOf(this.configList[i].fieldType) === -1 && this.configList[i].fieldType && !this.configList[i].defaultValue && this.configList[i].status === '1') {
this.$u.toast(`请输入${mapFieldLable(this.config[i].type)}`)
return false
}
}
const height = this.$refs.report.offsetHeight - this.$refs.add.offsetHeight
return html2canvas(this.$refs.report, {
@@ -141,26 +149,33 @@
addPhoto () {
uni.chooseImage({
count: 1,
count: 9,
sizeType: ['compressed'],
success: res => {
this.$loading()
let formData = new FormData()
formData.append('file', res.tempFiles[0])
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
if (res.code === 0) {
this.richList.push({
type: 'img',
value: res.data.url
})
} else {
this.$u.toast(res.msg)
}
res.tempFiles.forEach(v => {
this.upload(v)
})
}
})
},
upload (img) {
let formData = new FormData()
formData.append('file', img)
this.$loading()
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
if (res.code === 0) {
this.richList.push({
type: 'img',
value: res.data.url
})
} else {
this.$u.toast(res.msg)
}
})
},
confirm () {
if (!this.content) {
return this.$u.toast('文本不能为空')

View File

@@ -43,6 +43,7 @@
<script>
import html2canvas from 'html2canvas'
import { mapFieldLable } from './../../config'
import RenderContent from './RenderContent.vue'
export default {
name: 'InspectLog',
@@ -128,6 +129,13 @@
methods: {
screenshot () {
for (let i = 0; i < this.configList.length; i ++) {
if (['2', '3', '4', '5'].indexOf(this.configList[i].fieldType) === -1 && this.configList[i].fieldType && !this.configList[i].defaultValue && this.configList[i].status === '1') {
this.$u.toast(`请输入${mapFieldLable(this.config[i].type)}`)
return false
}
}
const height = this.$refs.report.offsetHeight - this.$refs.add.offsetHeight
return html2canvas(this.$refs.report, {
@@ -150,26 +158,33 @@
addPhoto () {
uni.chooseImage({
count: 1,
count: 9,
sizeType: ['compressed'],
success: res => {
this.$loading()
let formData = new FormData()
formData.append('file', res.tempFiles[0])
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
if (res.code === 0) {
this.richList.push({
type: 'img',
value: res.data.url
})
} else {
this.$u.toast(res.msg)
}
res.tempFiles.forEach(v => {
this.upload(v)
})
}
})
},
upload (img) {
let formData = new FormData()
formData.append('file', img)
this.$loading()
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
if (res.code === 0) {
this.richList.push({
type: 'img',
value: res.data.url
})
} else {
this.$u.toast(res.msg)
}
})
},
confirm () {
if (!this.content) {
return this.$u.toast('文本不能为空')

View File

@@ -55,6 +55,7 @@
<script>
import html2canvas from 'html2canvas'
import RenderContent from './RenderContent.vue'
import { mapFieldLable } from './../../config'
export default {
name: 'MeetingMminutes',
@@ -149,6 +150,13 @@
methods: {
screenshot () {
for (let i = 0; i < this.configList.length; i ++) {
if (['2', '3', '4', '5'].indexOf(this.configList[i].fieldType) === -1 && this.configList[i].fieldType && !this.configList[i].defaultValue && this.configList[i].status === '1') {
this.$u.toast(`请输入${mapFieldLable(this.config[i].type)}`)
return false
}
}
const height = this.$refs.report.offsetHeight - this.$refs.add.offsetHeight
return html2canvas(this.$refs.report, {
@@ -171,26 +179,33 @@
addPhoto () {
uni.chooseImage({
count: 1,
count: 9,
sizeType: ['compressed'],
success: res => {
this.$loading()
let formData = new FormData()
formData.append('file', res.tempFiles[0])
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
if (res.code === 0) {
this.richList.push({
type: 'img',
value: res.data.url
})
} else {
this.$u.toast(res.msg)
}
res.tempFiles.forEach(v => {
this.upload(v)
})
}
})
},
upload (img) {
let formData = new FormData()
formData.append('file', img)
this.$loading()
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
if (res.code === 0) {
this.richList.push({
type: 'img',
value: res.data.url
})
} else {
this.$u.toast(res.msg)
}
})
},
confirm () {
if (!this.content) {
return this.$u.toast('文本不能为空')

View File

@@ -41,6 +41,7 @@
<script>
import html2canvas from 'html2canvas'
import RenderContent from './RenderContent.vue'
import { mapFieldLable } from './../../config'
export default {
name: 'WorkReport',
@@ -119,8 +120,14 @@
methods: {
screenshot () {
const height = this.$refs.report.offsetHeight - this.$refs.add.offsetHeight
for (let i = 0; i < this.configList.length; i ++) {
if (['2', '3', '4', '5'].indexOf(this.configList[i].fieldType) === -1 && this.configList[i].fieldType && !this.configList[i].defaultValue && this.configList[i].status === '1') {
this.$u.toast(`请输入${mapFieldLable(this.config[i].type)}`)
return false
}
}
const height = this.$refs.report.offsetHeight - this.$refs.add.offsetHeight
return html2canvas(this.$refs.report, {
allowTaint: true,
useCORS: true,
@@ -141,27 +148,33 @@
addPhoto () {
uni.chooseImage({
count: 1,
count: 9,
sizeType: ['compressed'],
success: res => {
this.$loading()
let formData = new FormData()
formData.append('file', res.tempFiles[0])
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
console.log(res)
if (res.code === 0) {
this.richList.push({
type: 'img',
value: res.data.url
})
} else {
this.$u.toast(res.msg)
}
res.tempFiles.forEach(v => {
this.upload(v)
})
}
})
},
upload (img) {
let formData = new FormData()
formData.append('file', img)
this.$loading()
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
if (res.code === 0) {
this.richList.push({
type: 'img',
value: res.data.url
})
} else {
this.$u.toast(res.msg)
}
})
},
confirm () {
if (!this.content) {
return this.$u.toast('文本不能为空')

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B