Commit c7eb0ff6 by baihong

数据统计

parent 38a0921f
......@@ -46,51 +46,56 @@ export default {
endDate: this.date[1]
};
queryList(params).then(res => {
console.log(res)
const option = {
tooltip: {
trigger: "axis"
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: {
type: "category",
boundaryGap: false,
data: res.map((p)=>{
return p.group_date
})
},
yAxis: {
type: "value"
},
series: [
{
name: "报名人数",
type: "line",
stack: "总量",
data: res.map((p)=>{
return p.apply_num
})
},
{
name: "签到人数",
type: "line",
stack: "总量",
data: res.map((p)=>{
return p.clock_num
})
}
]
};
this.$nextTick(() => {
this.dom = echarts.init(this.$refs.dom);
console.log(this.dom);
this.dom.setOption(option);
on(window, "resize", this.resize);
});
});
}
},
mounted() {
this.search()
const option = {
tooltip: {
trigger: "axis"
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis: {
type: "category",
boundaryGap: false,
data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
},
yAxis: {
type: "value"
},
series: [
{
name: "报名人数",
type: "line",
stack: "总量",
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: "签到人数",
type: "line",
stack: "总量",
data: [220, 182, 191, 234, 290, 330, 310]
}
]
};
this.$nextTick(() => {
this.dom = echarts.init(this.$refs.dom);
console.log(this.dom);
this.dom.setOption(option);
on(window, "resize", this.resize);
});
this.search();
},
beforeDestroy() {
off(window, "resize", this.resize);
......
......@@ -188,14 +188,35 @@ export default {
formValidate: {
award_name: "",
award_type: "",
award_rate: "",
award_rate: null,
template_code: ""
},
ruleValidate: {
name: [
award_name: [
{
required: true,
message: "The name cannot be empty",
message: "请输入奖品名称",
trigger: "blur"
}
],
award_type: [
{
required: true,
message: "请输入奖品类型",
trigger: "change"
}
],
award_rate: [
{
required: true,
message: "请输入中奖概率",
trigger: "blur"
}
],
template_code: [
{
required: true,
message: "请输入模板编号",
trigger: "blur"
}
]
......@@ -284,6 +305,9 @@ export default {
});
},
submit() {
this.formValidate.type = this.tab === "3" ? 1 : 2;
this.formValidate.uuid = sessionStorage.getItem('admin_uuid')
this.formValidate.award_rate = Number(this.formValidate.award_rate)
if (this.add) {
addConfigAward(this.formValidate).then(res => {
console.log(res);
......
......@@ -36,6 +36,7 @@ export default {
console.log(data);
if (data.token && data.token.access_token) {
sessionStorage.setItem("token", data.token.access_token);
sessionStorage.setItem('admin_uuid',data.token.admin_uuid)
sessionStorage.setItem("username", data.user_info.name);
this.$Message.success("登录成功");
this.$router.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment