手动解决冲突(王家东)

dev_2307
gegeya 1 year ago
parent d9f93d7d90
commit 2c9e266488
  1. 3
      ant-design-vue-jeecg/package.json
  2. 2
      ant-design-vue-jeecg/src/App.vue
  3. 60
      ant-design-vue-jeecg/src/utils/devicePixelRatio.js
  4. 170
      ant-design-vue-jeecg/src/views/newLayout/myTask/list/assignment.vue

@ -10,6 +10,9 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"moment": "^2.29.4",
"postcss-px2rem": "^0.3.0",
"px2rem-loader": "^0.1.9",
"@antv/data-set": "^0.11.4", "@antv/data-set": "^0.11.4",
"@jeecg/antd-online-mini": "2.4.5-RC", "@jeecg/antd-online-mini": "2.4.5-RC",
"@jiaminghi/data-view": "^2.10.0", "@jiaminghi/data-view": "^2.10.0",

@ -8,6 +8,7 @@
<script> <script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN' import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import enquireScreen from '@/utils/device' import enquireScreen from '@/utils/device'
import DevicePixelRatio from './utils/devicePixelRatio'
export default { export default {
data() { data() {
@ -16,6 +17,7 @@ export default {
} }
}, },
created() { created() {
new DevicePixelRatio().init()
let that = this let that = this
enquireScreen((deviceType) => { enquireScreen((deviceType) => {
// tablet // tablet

@ -0,0 +1,60 @@
class DevicePixelRatio {
constructor() {
// this.flag = false;
}
// 获取系统类型
_getSystem() {
let flag = false
var agent = navigator.userAgent.toLowerCase()
// var isMac = /macintosh|mac os x/i.test(navigator.userAgent);
// if(isMac) {
// return false;
// }
// 现只针对windows处理,其它系统暂无该情况,如有,继续在此添加
if (agent.indexOf('windows') >= 0) {
return true
}
}
// 获取页面缩放比例
// _getDevicePixelRatio() {
// let t = this;
// }
// 监听方法兼容写法
_addHandler(element, type, handler) {
if (element.addEventListener) {
element.addEventListener(type, handler, false)
} else if (element.attachEvent) {
element.attachEvent('on' + type, handler)
} else {
element['on' + type] = handler
}
}
// 校正浏览器缩放比例
_correct() {
let t = this
// 页面devicePixelRatio(设备像素比例)变化后,计算页面body标签zoom修改其大小,来抵消devicePixelRatio带来的变化。
document.getElementsByTagName('body')[0].style.zoom =
1 / window.devicePixelRatio
}
// 监听页面缩放
_watch() {
let t = this
t._addHandler(window, 'resize', function () {
// 注意这个方法是解决全局有两个window.resize
// 重新校正
t._correct()
})
}
// 初始化页面比例
init() {
let t = this
if (t._getSystem()) {
// 判断设备,目前只在windows系统下校正浏览器缩放比例
// 初始化页面校正浏览器缩放比例
t._correct()
// 开启监听页面缩放
t._watch()
}
}
}
export default DevicePixelRatio

@ -176,19 +176,14 @@
<div class="date"> <div class="date">
<div class="cycle"> <div class="cycle">
<label>任务周期</label> <label>任务周期</label>
<span> {{ item.startTime }}</span> - <span> {{ item.startTime | timeFilter }}</span> -
<span>{{ item.expectedEndTime }}</span> <span>{{ item.expectedEndTime | timeFilter }}</span>
</div> </div>
<div class="publish"> <div class="publish">
<label>发布提交</label> <label>发布提交</label>
<span>{{ item.publishTime }}</span> - <span>{{ item.publishTime | timeFilter }}</span>
<span>{{ -
`${ <span>{{ item.submitTime | timeFilter }}</span>
item.submitTime !== '1970-01-01'
? item.submitTime
: '待提交'
}`
}}</span>
</div> </div>
<div class="expected_duration"> <div class="expected_duration">
<label>预计时长</label <label>预计时长</label
@ -233,6 +228,7 @@
<Container <Container
drag-class="card-ghost" drag-class="card-ghost"
drop-class="card-ghost-drop" drop-class="card-ghost-drop"
:drop-placeholder="dropPlaceholderOptions"
group-name="col" group-name="col"
@drop="(e) => onDevelopedCardDrop(e)" @drop="(e) => onDevelopedCardDrop(e)"
:get-child-payload="getDevelopedCardPayload()" :get-child-payload="getDevelopedCardPayload()"
@ -323,19 +319,13 @@
<div class="date"> <div class="date">
<div class="cycle"> <div class="cycle">
<label>任务周期</label> <label>任务周期</label>
<span> {{ item.startTime }}</span> - <span> {{ item.startTime | timeFilter }}</span> -
<span>{{ item.expectedEndTime }}</span> <span>{{ item.expectedEndTime | timeFilter }}</span>
</div> </div>
<div class="publish"> <div class="publish">
<label>发布提交</label> <label>发布提交</label>
<span>{{ item.publishTime }}</span> - <span>{{ item.publishTime | timeFilter }}</span> -
<span>{{ <span>{{ item.submitTime | timeFilter }}</span>
`${
item.submitTime !== '1970-01-01'
? item.submitTime
: '待提交'
}`
}}</span>
</div> </div>
<div class="expected_duration"> <div class="expected_duration">
<label>预计时长</label <label>预计时长</label
@ -455,19 +445,13 @@
<div class="date"> <div class="date">
<div class="cycle"> <div class="cycle">
<label>任务周期</label> <label>任务周期</label>
<span> {{ item.startTime }}</span> - <span> {{ item.startTime | timeFilter }}</span> -
<span>{{ item.expectedEndTime }}</span> <span>{{ item.expectedEndTime | timeFilter }}</span>
</div> </div>
<div class="publish"> <div class="publish">
<label>发布提交</label> <label>发布提交</label>
<span>{{ item.publishTime }}</span> - <span>{{ item.publishTime | timeFilter }}</span> -
<span>{{ <span>{{ item.submitTime | timeFilter }}</span>
`${
item.submitTime !== '1970-01-01'
? item.submitTime
: '待提交'
}`
}}</span>
</div> </div>
<div class="expected_duration"> <div class="expected_duration">
<label>预计时长</label <label>预计时长</label
@ -583,19 +567,14 @@
<div class="date"> <div class="date">
<div class="cycle"> <div class="cycle">
<label>任务周期</label> <label>任务周期</label>
<span> {{ item.startTime }}</span> - <span> {{ item.startTime | timeFilter }}</span> -
<span>{{ item.expectedEndTime }}</span> <span>{{ item.expectedEndTime | timeFilter }}</span>
</div> </div>
<div class="publish"> <div class="publish">
<label>发布提交</label> <label>发布提交</label>
<span>{{ item.publishTime }}</span> - <span>{{ item.publishTime | timeFilter }}</span>
<span>{{ -
`${ <span>{{ item.submitTime | timeFilter }}</span>
item.submitTime !== '1970-01-01'
? item.submitTime
: '待提交'
}`
}}</span>
</div> </div>
<div class="expected_duration"> <div class="expected_duration">
<label>预计时长</label <label>预计时长</label
@ -683,23 +662,26 @@ import { Container, Draggable } from 'vue-smooth-dnd'
import TaskModal from '@/views/task/modules/TaskModal' import TaskModal from '@/views/task/modules/TaskModal'
import { mixinDevice } from '@/utils/mixin' import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import moment from 'moment'
const changeTime = (time) => { const changeTime = (time) => {
let date = new Date(time) // let date = new Date(time)
let Y = date.getFullYear() // let Y = date.getFullYear()
let M = String(date.getMonth() + 1).padStart(2, '0') // let M = String(date.getMonth() + 1).padStart(2, '0')
let D = String(date.getDate()).padStart(2, '0') // let D = String(date.getDate()).padStart(2, '0')
let newDate = [Y, M, D].join('-') // let newDate = [Y, M, D].join('-')
return newDate // return newDate
return moment(item.startTime * 1000).format('YYYY-MM-DD HH:mm:ss')
} }
const changeStyle = (arr) => { const changeStyle = (arr) => {
let newArr = arr.map((item) => { let newArr = arr.map((item) => {
item.headpic = getFileAccessHttpUrl(item.headpic) item.headpic = getFileAccessHttpUrl(item.headpic)
item.taskPic = getFileAccessHttpUrl(item.taskPic) item.taskPic = getFileAccessHttpUrl(item.taskPic)
item.taskFile = getFileAccessHttpUrl(item.taskFile) item.taskFile = getFileAccessHttpUrl(item.taskFile)
item.expectedEndTime = changeTime(item.expectedEndTime) // item.expectedEndTime = moment(item.expectedEndTime).format('YYYY-MM-DD')
item.startTime = changeTime(item.startTime) // item.expectedEndTime = changeTime(item.expectedEndTime)
item.submitTime = changeTime(item.submitTime) // item.startTime = moment(item.startTime).format('YYYY-MM-DD')
item.publishTime = changeTime(item.publishTime) // item.submitTime =moment(item.startTime).format('YYYY-MM-DD')
// item.publishTime = changeTime(item.publishTime)
}) })
return newArr return newArr
} }
@ -743,7 +725,7 @@ export default {
drawerData: {}, drawerData: {},
dropPlaceholderOptions: { dropPlaceholderOptions: {
className: 'drop-preview', className: 'drop-preview',
animationDuration: '1000', animationDuration: '150',
showOnTop: true showOnTop: true
}, },
time: [ time: [
@ -756,6 +738,9 @@ export default {
} }
}, },
methods: { methods: {
modalFormOk() {
this.allUpadate()
},
timeSearch(time) { timeSearch(time) {
this.timeSearchData = time.id this.timeSearchData = time.id
console.log('this.timeSearchData', this.timeSearchData) console.log('this.timeSearchData', this.timeSearchData)
@ -893,9 +878,9 @@ export default {
window.open(this.dialogurl) window.open(this.dialogurl)
}, },
// //
assignmnetScroll(e) { assignmnetScroll() {
let isLoading = true // let isLoading = true //
this.$refs.assignmnetcards.onscroll = async () => { this.$refs.assignmnetcards.onscroll = async (e) => {
const { scrollTop, clientHeight, scrollHeight } = e.target const { scrollTop, clientHeight, scrollHeight } = e.target
console.log(scrollTop, clientHeight, scrollHeight) console.log(scrollTop, clientHeight, scrollHeight)
let bottomOfWindow = scrollTop + clientHeight === scrollHeight let bottomOfWindow = scrollTop + clientHeight === scrollHeight
@ -933,42 +918,44 @@ export default {
} }
} }
}, },
async developedScroll(e) { developedScroll() {
let isLoading = true // let isLoading = true //
const { scrollTop, clientHeight, scrollHeight } = e.target this.$refs.developedcards.onscroll = async (e) => {
console.log(scrollTop, clientHeight, scrollHeight) const { scrollTop, clientHeight, scrollHeight } = e.target
let bottomOfWindow = scrollTop + clientHeight === scrollHeight let bottomOfWindow = scrollTop + clientHeight === scrollHeight
if (bottomOfWindow && isLoading == true) { console.log(scrollTop, clientHeight, scrollHeight)
this.developedData.page = this.developedData.page + 1 //+1 if (bottomOfWindow && isLoading) {
let workStatus = 2 this.developedData.page = this.developedData.page + 1 //+1
let pageNo = this.developedData.page let workStatus = 2
let pageSize = this.developedData.limit let pageNo = this.developedData.page
let typeId = this.queryParam.typeId let pageSize = this.developedData.limit
let projectId = this.queryParam.projectId let typeId = this.queryParam.typeId
let time = this.timeSearchData let projectId = this.queryParam.projectId
// console.log(pageNo, pageSize) let time = this.timeSearchData
await getMyTaskData({ await getMyTaskData({
workStatus, workStatus,
pageNo, pageNo,
pageSize, pageSize,
typeId, typeId,
projectId, projectId,
time time
}).then(({ result: res }) => { }).then(({ result: res }) => {
// //
if (res.records.length > 0) { console.log(res.records)
changeStyle(res.records) if (res.records.length === 0) {
this.developedData.cardList.push(...res.records) // 使 ... this.$notify({
isLoading = true title: '温馨提示:',
} else { message: '暂无更多数据信息!',
this.$notify({ position: 'bottom-right'
title: '温馨提示:', })
message: '暂无更多数据信息!', isLoading = false //
position: 'bottom-right' } else {
}) changeStyle(res.records)
isLoading = false // this.developedData.cardList.push(...res.records) // 使 ...
} isLoading = true
}) }
})
}
} }
}, },
completedScroll(e) { completedScroll(e) {
@ -1184,6 +1171,11 @@ export default {
this.completedScroll() this.completedScroll()
this.auditedScroll() this.auditedScroll()
this.updateWorkStatus() this.updateWorkStatus()
},
filters: {
timeFilter: function (value) {
return moment(value).format('YYYY-MM-DD')
}
} }
} }
</script> </script>
@ -1415,7 +1407,7 @@ header {
} }
} }
.cards { .cards {
height: 100dvh; height: 700px;
overflow-x: auto; overflow-x: auto;
} }
.content { .content {

Loading…
Cancel
Save