|
@ -117,43 +117,43 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
|
import mixinViewModule from "@/mixins/view-module"; |
|
|
import mixinViewModule from '@/mixins/view-module' |
|
|
import debounce from "lodash/debounce"; |
|
|
import debounce from 'lodash/debounce' |
|
|
import "element-ui/lib/theme-chalk/timeline.css"; |
|
|
import 'element-ui/lib/theme-chalk/timeline.css' |
|
|
import "element-ui/lib/theme-chalk/timeline-item.css"; |
|
|
import 'element-ui/lib/theme-chalk/timeline-item.css' |
|
|
import "element-ui/lib/theme-chalk/image.css"; |
|
|
import 'element-ui/lib/theme-chalk/image.css' |
|
|
var map; |
|
|
var map |
|
|
var markerList = []; |
|
|
var markerList = [] |
|
|
var radiusList = []; |
|
|
var radiusList = [] |
|
|
// var clockList = [] |
|
|
// var clockList = [] |
|
|
export default { |
|
|
export default { |
|
|
mixins: [mixinViewModule], |
|
|
mixins: [mixinViewModule], |
|
|
name: "ActUserClockDetail", |
|
|
name: 'ActUserClockDetail', |
|
|
data () { |
|
|
data () { |
|
|
return { |
|
|
return { |
|
|
mixinViewModuleOptions: { |
|
|
mixinViewModuleOptions: { |
|
|
getDataListURL: "/heart/actuserclocklog/page", |
|
|
getDataListURL: '/heart/actuserclocklog/page', |
|
|
getDataListIsPage: true |
|
|
getDataListIsPage: true |
|
|
}, |
|
|
}, |
|
|
dataForm: { |
|
|
dataForm: { |
|
|
id: "", |
|
|
id: '', |
|
|
actId: "", |
|
|
actId: '', |
|
|
status: "", |
|
|
status: '', |
|
|
failureReason: "", |
|
|
failureReason: '', |
|
|
address: "", |
|
|
address: '', |
|
|
latitude: "", |
|
|
latitude: '', |
|
|
longitude: "", |
|
|
longitude: '', |
|
|
radius: 200, |
|
|
radius: 200, |
|
|
clockPic: [] |
|
|
clockPic: [] |
|
|
}, |
|
|
}, |
|
|
previewImgList: [], |
|
|
previewImgList: [], |
|
|
isAble: false |
|
|
isAble: false |
|
|
}; |
|
|
} |
|
|
}, |
|
|
}, |
|
|
mounted () { |
|
|
mounted () { |
|
|
this.dataForm.id = this.$route.query.id; |
|
|
this.dataForm.id = this.$route.query.id |
|
|
this.dataForm.actId = this.$route.query.actId; |
|
|
this.dataForm.actId = this.$route.query.actId |
|
|
this.init(); |
|
|
this.init() |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
dataRule () { |
|
|
dataRule () { |
|
@ -161,70 +161,70 @@ export default { |
|
|
status: [ |
|
|
status: [ |
|
|
{ |
|
|
{ |
|
|
required: true, |
|
|
required: true, |
|
|
message: this.$t("validate.required"), |
|
|
message: this.$t('validate.required'), |
|
|
trigger: "blur" |
|
|
trigger: 'blur' |
|
|
} |
|
|
} |
|
|
], |
|
|
], |
|
|
failureReason: [ |
|
|
failureReason: [ |
|
|
{ |
|
|
{ |
|
|
required: true, |
|
|
required: true, |
|
|
message: this.$t("validate.required"), |
|
|
message: this.$t('validate.required'), |
|
|
trigger: "blur" |
|
|
trigger: 'blur' |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
|
}; |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
backToActClockList () { |
|
|
backToActClockList () { |
|
|
this.$emit("refreshDataList"); |
|
|
this.$emit('refreshDataList') |
|
|
this.$parent.selectComponent = "ActUserClockLog"; |
|
|
this.$parent.selectComponent = 'ActUserClockLog' |
|
|
this.$router.push({ |
|
|
this.$router.push({ |
|
|
path: "/heart-actinfo", |
|
|
path: '/heart-actinfo', |
|
|
query: { id: this.dataForm.actId } |
|
|
query: { id: this.dataForm.actId } |
|
|
}); |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
setMap (data) { |
|
|
setMap (data) { |
|
|
// 步骤:定义map变量 调用 qq.maps.Map() 构造函数 获取地图显示容器 |
|
|
// 步骤:定义map变量 调用 qq.maps.Map() 构造函数 获取地图显示容器 |
|
|
// 设置地图中心点 |
|
|
// 设置地图中心点 |
|
|
var myLatlng = new qq.maps.LatLng(data.latitude, data.longitude); |
|
|
var myLatlng = new qq.maps.LatLng(data.latitude, data.longitude) |
|
|
// 定义工厂模式函数 |
|
|
// 定义工厂模式函数 |
|
|
var zoom = this.capacity(data); |
|
|
var zoom = this.capacity(data) |
|
|
var myOptions = { |
|
|
var myOptions = { |
|
|
zoom: zoom, // 设置地图缩放级别 |
|
|
zoom: zoom, // 设置地图缩放级别 |
|
|
center: myLatlng, // 设置中心点样式 |
|
|
center: myLatlng, // 设置中心点样式 |
|
|
mapTypeId: qq.maps.MapTypeId.ROADMAP // 设置地图样式详情参见MapType |
|
|
mapTypeId: qq.maps.MapTypeId.ROADMAP // 设置地图样式详情参见MapType |
|
|
}; |
|
|
} |
|
|
// //获取dom元素添加地图信息 |
|
|
// //获取dom元素添加地图信息 |
|
|
map = new qq.maps.Map(document.getElementById("mapContainer"), myOptions); |
|
|
map = new qq.maps.Map(document.getElementById('mapContainer'), myOptions) |
|
|
// 设置圆形 |
|
|
// 设置圆形 |
|
|
var radius = new qq.maps.Circle({ |
|
|
var radius = new qq.maps.Circle({ |
|
|
center: new qq.maps.LatLng(data.latitude, data.longitude), |
|
|
center: new qq.maps.LatLng(data.latitude, data.longitude), |
|
|
radius: this.dataForm.radius, |
|
|
radius: this.dataForm.radius, |
|
|
map: map |
|
|
map: map |
|
|
}); |
|
|
}) |
|
|
|
|
|
|
|
|
radiusList.push(radius); |
|
|
radiusList.push(radius) |
|
|
var marker = new qq.maps.Marker({ |
|
|
var marker = new qq.maps.Marker({ |
|
|
position: myLatlng, |
|
|
position: myLatlng, |
|
|
map: map |
|
|
map: map |
|
|
}); |
|
|
}) |
|
|
markerList.push(marker); |
|
|
markerList.push(marker) |
|
|
}, |
|
|
}, |
|
|
init () { |
|
|
init () { |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
if (this.dataForm.id) { |
|
|
if (this.dataForm.id) { |
|
|
this.getInfo(); |
|
|
this.getInfo() |
|
|
} |
|
|
} |
|
|
}); |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 点击查看大图 |
|
|
// 点击查看大图 |
|
|
clickImg (url) { |
|
|
clickImg (url) { |
|
|
this.previewImgList = []; |
|
|
this.previewImgList = [] |
|
|
this.previewImgList.push(url); |
|
|
this.previewImgList.push(url) |
|
|
}, |
|
|
}, |
|
|
getDataList () { |
|
|
getDataList () { |
|
|
this.dataListLoading = true; |
|
|
this.dataListLoading = true |
|
|
this.$http |
|
|
this.$http |
|
|
.get(this.mixinViewModuleOptions.getDataListURL, { |
|
|
.get(this.mixinViewModuleOptions.getDataListURL, { |
|
|
params: { |
|
|
params: { |
|
@ -240,34 +240,34 @@ export default { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.then(({ data: res }) => { |
|
|
.then(({ data: res }) => { |
|
|
this.dataListLoading = false; |
|
|
this.dataListLoading = false |
|
|
if (res.code !== 0) { |
|
|
if (res.code !== 0) { |
|
|
this.dataList = []; |
|
|
this.dataList = [] |
|
|
this.total = 0; |
|
|
this.total = 0 |
|
|
return this.$message.error(res.msg); |
|
|
return this.$message.error(res.msg) |
|
|
} |
|
|
} |
|
|
this.dataList = this.mixinViewModuleOptions.getDataListIsPage |
|
|
this.dataList = this.mixinViewModuleOptions.getDataListIsPage |
|
|
? res.data.list |
|
|
? res.data.list |
|
|
: res.data; |
|
|
: res.data |
|
|
this.total = this.mixinViewModuleOptions.getDataListIsPage |
|
|
this.total = this.mixinViewModuleOptions.getDataListIsPage |
|
|
? res.data.total |
|
|
? res.data.total |
|
|
: 0; |
|
|
: 0 |
|
|
this.dataList.forEach(item => { |
|
|
this.dataList.forEach(item => { |
|
|
var LogLatlng = new qq.maps.LatLng( |
|
|
var LogLatlng = new qq.maps.LatLng( |
|
|
item.clockLatitude, |
|
|
item.clockLatitude, |
|
|
item.clockLongitude |
|
|
item.clockLongitude |
|
|
); |
|
|
) |
|
|
var LogMarker = new qq.maps.Marker({ |
|
|
var LogMarker = new qq.maps.Marker({ |
|
|
position: LogLatlng, |
|
|
position: LogLatlng, |
|
|
map: map |
|
|
map: map |
|
|
}); |
|
|
}) |
|
|
markerList.push(LogMarker); |
|
|
markerList.push(LogMarker) |
|
|
}); |
|
|
}) |
|
|
console.log(markerList); |
|
|
console.log(markerList) |
|
|
}) |
|
|
}) |
|
|
.catch(() => { |
|
|
.catch(() => { |
|
|
this.dataListLoading = false; |
|
|
this.dataListLoading = false |
|
|
}); |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// 获取信息 |
|
|
// 获取信息 |
|
|
getInfo () { |
|
|
getInfo () { |
|
@ -275,90 +275,90 @@ export default { |
|
|
.get(`/heart/actuserclocklog/clockDetail/${this.dataForm.id}`) |
|
|
.get(`/heart/actuserclocklog/clockDetail/${this.dataForm.id}`) |
|
|
.then(({ data: res }) => { |
|
|
.then(({ data: res }) => { |
|
|
if (res.code !== 0) { |
|
|
if (res.code !== 0) { |
|
|
return this.$message.error(res.msg); |
|
|
return this.$message.error(res.msg) |
|
|
} |
|
|
} |
|
|
this.dataForm = { |
|
|
this.dataForm = { |
|
|
...this.dataForm, |
|
|
...this.dataForm, |
|
|
...res.data |
|
|
...res.data |
|
|
}; |
|
|
} |
|
|
// if (res.data.status != '5' && res.data.status != '6') { |
|
|
// if (res.data.status != '5' && res.data.status != '6') { |
|
|
// this.dataForm.status = '5'; |
|
|
// this.dataForm.status = '5'; |
|
|
// this.dataForm.failureReason = ''; |
|
|
// this.dataForm.failureReason = ''; |
|
|
// } else { |
|
|
// } else { |
|
|
// this.isAble = true; |
|
|
// this.isAble = true; |
|
|
// } |
|
|
// } |
|
|
this.setMap(res.data); |
|
|
this.setMap(res.data) |
|
|
|
|
|
|
|
|
this.getDataList(); |
|
|
this.getDataList() |
|
|
}) |
|
|
}) |
|
|
.catch(() => {}); |
|
|
.catch(() => {}) |
|
|
}, |
|
|
}, |
|
|
capacity (data) { |
|
|
capacity (data) { |
|
|
if (data.radius > 0 && data.radius <= 25) { |
|
|
if (data.radius > 0 && data.radius <= 25) { |
|
|
return 18; |
|
|
return 18 |
|
|
} else if (data.radius > 25 && data.radius <= 50) { |
|
|
} else if (data.radius > 25 && data.radius <= 50) { |
|
|
return 17; |
|
|
return 17 |
|
|
} else if (data.radius > 50 && data.radius <= 100) { |
|
|
} else if (data.radius > 50 && data.radius <= 100) { |
|
|
return 16; |
|
|
return 16 |
|
|
} else if (data.radius > 100 && data.radius <= 200) { |
|
|
} else if (data.radius > 100 && data.radius <= 200) { |
|
|
return 15; |
|
|
return 15 |
|
|
} else if (data.radius > 200 && data.radius <= 500) { |
|
|
} else if (data.radius > 200 && data.radius <= 500) { |
|
|
return 14; |
|
|
return 14 |
|
|
} else if (data.radius > 500 && data.radius <= 1000) { |
|
|
} else if (data.radius > 500 && data.radius <= 1000) { |
|
|
return 13; |
|
|
return 13 |
|
|
} else if (data.radius > 1000 && data.radius <= 2000) { |
|
|
} else if (data.radius > 1000 && data.radius <= 2000) { |
|
|
return 12; |
|
|
return 12 |
|
|
} else if (data.radius > 2000 && data.radius <= 5000) { |
|
|
} else if (data.radius > 2000 && data.radius <= 5000) { |
|
|
return 11; |
|
|
return 11 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
formatSex: function (row, column) { |
|
|
formatSex: function (row, column) { |
|
|
let state = row.sex; |
|
|
let state = row.sex |
|
|
if (state === "0") { |
|
|
if (state === '0') { |
|
|
return "女"; |
|
|
return '女' |
|
|
} else if (state === "1") { |
|
|
} else if (state === '1') { |
|
|
return "男"; |
|
|
return '男' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 表单提交 |
|
|
// 表单提交 |
|
|
dataFormSubmitHandle: debounce( |
|
|
dataFormSubmitHandle: debounce( |
|
|
function () { |
|
|
function () { |
|
|
this.$refs["dataForm"].validate(valid => { |
|
|
this.$refs['dataForm'].validate(valid => { |
|
|
if (!valid) { |
|
|
if (!valid) { |
|
|
return false; |
|
|
return false |
|
|
} |
|
|
} |
|
|
if (this.dataForm.failureReason.length > 100) { |
|
|
if (this.dataForm.failureReason.length > 100) { |
|
|
return this.$message.error("处理意见不超过100字"); |
|
|
return this.$message.error('处理意见不超过100字') |
|
|
} |
|
|
} |
|
|
// this.isAble = true |
|
|
// this.isAble = true |
|
|
this.$http["post"]("/heart/actuserclocklog/pointCheck", this.dataForm) |
|
|
this.$http['post']('/heart/actuserclocklog/pointCheck', this.dataForm) |
|
|
.then(({ data: res }) => { |
|
|
.then(({ data: res }) => { |
|
|
// this.isAble = false |
|
|
// this.isAble = false |
|
|
if (res.code !== 0) { |
|
|
if (res.code !== 0) { |
|
|
return this.$message.error(res.msg); |
|
|
return this.$message.error(res.msg) |
|
|
} |
|
|
} |
|
|
this.$message({ |
|
|
this.$message({ |
|
|
message: this.$t("prompt.success"), |
|
|
message: this.$t('prompt.success'), |
|
|
type: "success", |
|
|
type: 'success', |
|
|
duration: 500, |
|
|
duration: 500, |
|
|
onClose: () => { |
|
|
onClose: () => { |
|
|
this.$emit("refreshDataList"); |
|
|
this.$emit('refreshDataList') |
|
|
this.$parent.selectComponent = "ActUserClockLog"; |
|
|
this.$parent.selectComponent = 'ActUserClockLog' |
|
|
this.$router.push({ |
|
|
this.$router.push({ |
|
|
path: "/heart-actinfo", |
|
|
path: '/heart-actinfo', |
|
|
query: { id: this.dataForm.actId } |
|
|
query: { id: this.dataForm.actId } |
|
|
}); |
|
|
}) |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
}) |
|
|
}) |
|
|
.catch(() => {}); |
|
|
}) |
|
|
}); |
|
|
.catch(() => {}) |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
1000, |
|
|
1000, |
|
|
{ leading: true, trailing: false } |
|
|
{ leading: true, trailing: false } |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
}; |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
<style lang="scss"> |
|
|
<style lang="scss"> |
|
|
.aui-wrapper .el-pagination { |
|
|
.aui-wrapper .el-pagination { |
|
|