Browse Source

代码格式化

master
yujintao 5 years ago
parent
commit
68e25772b6
  1. 178
      src/views/modules/heart/actuserclock-detail.vue

178
src/views/modules/heart/actuserclock-detail.vue

@ -117,43 +117,43 @@
</div>
</template>
<script>
import mixinViewModule from "@/mixins/view-module";
import debounce from "lodash/debounce";
import "element-ui/lib/theme-chalk/timeline.css";
import "element-ui/lib/theme-chalk/timeline-item.css";
import "element-ui/lib/theme-chalk/image.css";
var map;
var markerList = [];
var radiusList = [];
import mixinViewModule from '@/mixins/view-module'
import debounce from 'lodash/debounce'
import 'element-ui/lib/theme-chalk/timeline.css'
import 'element-ui/lib/theme-chalk/timeline-item.css'
import 'element-ui/lib/theme-chalk/image.css'
var map
var markerList = []
var radiusList = []
// var clockList = []
export default {
mixins: [mixinViewModule],
name: "ActUserClockDetail",
name: 'ActUserClockDetail',
data () {
return {
mixinViewModuleOptions: {
getDataListURL: "/heart/actuserclocklog/page",
getDataListURL: '/heart/actuserclocklog/page',
getDataListIsPage: true
},
dataForm: {
id: "",
actId: "",
status: "",
failureReason: "",
address: "",
latitude: "",
longitude: "",
id: '',
actId: '',
status: '',
failureReason: '',
address: '',
latitude: '',
longitude: '',
radius: 200,
clockPic: []
},
previewImgList: [],
isAble: false
};
}
},
mounted () {
this.dataForm.id = this.$route.query.id;
this.dataForm.actId = this.$route.query.actId;
this.init();
this.dataForm.id = this.$route.query.id
this.dataForm.actId = this.$route.query.actId
this.init()
},
computed: {
dataRule () {
@ -161,70 +161,70 @@ export default {
status: [
{
required: true,
message: this.$t("validate.required"),
trigger: "blur"
message: this.$t('validate.required'),
trigger: 'blur'
}
],
failureReason: [
{
required: true,
message: this.$t("validate.required"),
trigger: "blur"
message: this.$t('validate.required'),
trigger: 'blur'
}
]
};
}
}
},
methods: {
backToActClockList () {
this.$emit("refreshDataList");
this.$parent.selectComponent = "ActUserClockLog";
this.$emit('refreshDataList')
this.$parent.selectComponent = 'ActUserClockLog'
this.$router.push({
path: "/heart-actinfo",
path: '/heart-actinfo',
query: { id: this.dataForm.actId }
});
})
},
setMap (data) {
// 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 = {
zoom: zoom, //
center: myLatlng, //
mapTypeId: qq.maps.MapTypeId.ROADMAP // MapType
};
}
// //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({
center: new qq.maps.LatLng(data.latitude, data.longitude),
radius: this.dataForm.radius,
map: map
});
})
radiusList.push(radius);
radiusList.push(radius)
var marker = new qq.maps.Marker({
position: myLatlng,
map: map
});
markerList.push(marker);
})
markerList.push(marker)
},
init () {
this.$nextTick(() => {
if (this.dataForm.id) {
this.getInfo();
this.getInfo()
}
});
})
},
//
clickImg (url) {
this.previewImgList = [];
this.previewImgList.push(url);
this.previewImgList = []
this.previewImgList.push(url)
},
getDataList () {
this.dataListLoading = true;
this.dataListLoading = true
this.$http
.get(this.mixinViewModuleOptions.getDataListURL, {
params: {
@ -240,34 +240,34 @@ export default {
}
})
.then(({ data: res }) => {
this.dataListLoading = false;
this.dataListLoading = false
if (res.code !== 0) {
this.dataList = [];
this.total = 0;
return this.$message.error(res.msg);
this.dataList = []
this.total = 0
return this.$message.error(res.msg)
}
this.dataList = this.mixinViewModuleOptions.getDataListIsPage
? res.data.list
: res.data;
: res.data
this.total = this.mixinViewModuleOptions.getDataListIsPage
? res.data.total
: 0;
: 0
this.dataList.forEach(item => {
var LogLatlng = new qq.maps.LatLng(
item.clockLatitude,
item.clockLongitude
);
)
var LogMarker = new qq.maps.Marker({
position: LogLatlng,
map: map
});
markerList.push(LogMarker);
});
console.log(markerList);
})
markerList.push(LogMarker)
})
console.log(markerList)
})
.catch(() => {
this.dataListLoading = false;
});
this.dataListLoading = false
})
},
//
getInfo () {
@ -275,90 +275,90 @@ export default {
.get(`/heart/actuserclocklog/clockDetail/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
};
}
// if (res.data.status != '5' && res.data.status != '6') {
// this.dataForm.status = '5';
// this.dataForm.failureReason = '';
// } else {
// this.isAble = true;
// }
this.setMap(res.data);
this.setMap(res.data)
this.getDataList();
this.getDataList()
})
.catch(() => {});
.catch(() => {})
},
capacity (data) {
if (data.radius > 0 && data.radius <= 25) {
return 18;
return 18
} else if (data.radius > 25 && data.radius <= 50) {
return 17;
return 17
} else if (data.radius > 50 && data.radius <= 100) {
return 16;
return 16
} else if (data.radius > 100 && data.radius <= 200) {
return 15;
return 15
} else if (data.radius > 200 && data.radius <= 500) {
return 14;
return 14
} else if (data.radius > 500 && data.radius <= 1000) {
return 13;
return 13
} else if (data.radius > 1000 && data.radius <= 2000) {
return 12;
return 12
} else if (data.radius > 2000 && data.radius <= 5000) {
return 11;
return 11
}
},
formatSex: function (row, column) {
let state = row.sex;
if (state === "0") {
return "女";
} else if (state === "1") {
return "男";
let state = row.sex
if (state === '0') {
return '女'
} else if (state === '1') {
return '男'
}
},
//
dataFormSubmitHandle: debounce(
function () {
this.$refs["dataForm"].validate(valid => {
this.$refs['dataForm'].validate(valid => {
if (!valid) {
return false;
return false
}
if (this.dataForm.failureReason.length > 100) {
return this.$message.error("处理意见不超过100字");
return this.$message.error('处理意见不超过100字')
}
// this.isAble = true
this.$http["post"]("/heart/actuserclocklog/pointCheck", this.dataForm)
this.$http['post']('/heart/actuserclocklog/pointCheck', this.dataForm)
.then(({ data: res }) => {
// this.isAble = false
if (res.code !== 0) {
return this.$message.error(res.msg);
return this.$message.error(res.msg)
}
this.$message({
message: this.$t("prompt.success"),
type: "success",
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.$emit("refreshDataList");
this.$parent.selectComponent = "ActUserClockLog";
this.$emit('refreshDataList')
this.$parent.selectComponent = 'ActUserClockLog'
this.$router.push({
path: "/heart-actinfo",
path: '/heart-actinfo',
query: { id: this.dataForm.actId }
});
})
}
});
})
.catch(() => {});
});
})
.catch(() => {})
})
},
1000,
{ leading: true, trailing: false }
)
}
};
}
</script>
<style lang="scss">
.aui-wrapper .el-pagination {

Loading…
Cancel
Save