Commit 1305e957 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 3c7aa78e 18854792
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
import { deepClone } from "@/utils/js/common.js"; import { deepClone } from "@/utils/js/common.js";
import lodash from "lodash"; import lodash from "lodash";
import{getStatisticAges} from '@/api/dataAdmin.js' import { getStatisticAges } from "@/api/dataAdmin.js";
export default { export default {
props: { props: {
info: { info: {
...@@ -12,7 +12,7 @@ export default { ...@@ -12,7 +12,7 @@ export default {
default: () => [ default: () => [
{ {
value: 200, value: 200,
name: "20", name: "20",
}, },
{ {
value: 400, value: 400,
...@@ -40,16 +40,30 @@ export default { ...@@ -40,16 +40,30 @@ export default {
type: Object, type: Object,
default: () => {}, default: () => {},
}, },
day: {
type: String,
default: () => "0",
},
},
watch: {
day(newval, oldval) {
newval ? this.getData() : "";
},
}, },
async mounted() { async mounted() {
let res = await getStatisticAges() this.getData();
if (res.code != 1) return
let label = res.data.map(item=> item.age_area)
let value = res.data.map(item=> item.nums)
this._initEcharts(label,value);
}, },
methods: { methods: {
_initEcharts(label,value) { async getData() {
let res = await getStatisticAges({
selected: this.day == 5 ? null : this.day,
});
if (res.code != 1) return;
let label = res.data.map((item) => item.age_area);
let value = res.data.map((item) => item.nums);
this._initEcharts(label, value);
},
_initEcharts(label, value) {
const myChart = this.$echarts.init(this.$el); const myChart = this.$echarts.init(this.$el);
const echarts = this.$echarts; const echarts = this.$echarts;
let option = { let option = {
...@@ -72,9 +86,9 @@ export default { ...@@ -72,9 +86,9 @@ export default {
xAxis: { xAxis: {
type: "category", type: "category",
data: label, data: label,
axisTick:{ axisTick: {
show:false show: false,
} },
}, },
yAxis: { yAxis: {
type: "value", type: "value",
...@@ -105,4 +119,4 @@ export default { ...@@ -105,4 +119,4 @@ export default {
}, },
}, },
}; };
</script> </script>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
import { deepClone } from "@/utils/js/common.js"; import { deepClone } from "@/utils/js/common.js";
import lodash from "lodash"; import lodash from "lodash";
import{getStatisticSexual} from '@/api/dataAdmin.js' import { getStatisticSexual } from "@/api/dataAdmin.js";
export default { export default {
props: { props: {
info: { info: {
...@@ -24,14 +24,31 @@ export default { ...@@ -24,14 +24,31 @@ export default {
type: Object, type: Object,
default: () => {}, default: () => {},
}, },
day: {
type: String,
default: () => "0",
},
},
watch: {
day(newval, oldval) {
newval ? this.getData() : "";
},
}, },
async mounted() { mounted() {
let res = await getStatisticSexual() this.getData();
if (res.code != 1) return
let value = res.data.map(({idcard_Sex,nums})=>({name:idcard_Sex,value:nums}))
this._initEcharts(value);
}, },
methods: { methods: {
async getData() {
let res = await getStatisticSexual({
selected: this.day == 5 ? null : this.day,
});
if (res.code != 1) return;
let value = res.data.map(({ idcard_Sex, nums }) => ({
name: idcard_Sex,
value: nums,
}));
this._initEcharts(value);
},
_initEcharts(value) { _initEcharts(value) {
const myChart = this.$echarts.init(this.$el); const myChart = this.$echarts.init(this.$el);
const echarts = this.$echarts; const echarts = this.$echarts;
...@@ -87,13 +104,13 @@ export default { ...@@ -87,13 +104,13 @@ export default {
rich_green: { rich_green: {
color: "#50CCCB", color: "#50CCCB",
}, },
} },
},
label: {
normal: {
formatter: "{d}%", //自定义显示格式(b:name, c:value, d:百分比)
},
}, },
label: {
normal: {
formatter: '{d}%' //自定义显示格式(b:name, c:value, d:百分比)
}
},
labelLine: { labelLine: {
length: 10, length: 10,
length2: 60, length2: 60,
...@@ -119,4 +136,4 @@ export default { ...@@ -119,4 +136,4 @@ export default {
}, },
}, },
}; };
</script> </script>
\ No newline at end of file
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
<a-select-option value="0"> 今天 </a-select-option> <a-select-option value="0"> 今天 </a-select-option>
<a-select-option value="1"> 近7天 </a-select-option> <a-select-option value="1"> 近7天 </a-select-option>
<a-select-option value="2"> 近30天 </a-select-option> <a-select-option value="2"> 近30天 </a-select-option>
<a-select-option value="3">90天 </a-select-option> <a-select-option value="3">3月 </a-select-option>
<a-select-option value="4"> 近180天 </a-select-option> <a-select-option value="4"> 本年度 </a-select-option>
<a-select-option value="5"> 自定义 </a-select-option> <!-- <a-select-option value="5"> 自定义 </a-select-option> -->
</a-select> </a-select>
<a-button type="primary" class="addclass" @click="getData">搜索</a-button> <a-button type="primary" class="addclass" @click="getData">搜索</a-button>
......
...@@ -8,23 +8,25 @@ ...@@ -8,23 +8,25 @@
class="range_picker_style" class="range_picker_style"
@change="rangePickerChange" @change="rangePickerChange"
v-model="BegindAndEndTime" v-model="BegindAndEndTime"
v-if="day == 5" v-if="day == 5"
> >
</a-range-picker> </a-range-picker>
<a-select v-model="day"> <a-select v-model="day">
<a-select-option value="0"> 今天 </a-select-option> <a-select-option value="0"> 今天 </a-select-option>
<a-select-option value="1"> 近7天 </a-select-option> <a-select-option value="1"> 近7天 </a-select-option>
<a-select-option value="2"> 近30天 </a-select-option> <a-select-option value="2"> 近30天 </a-select-option>
<a-select-option value="3"> 近90天 </a-select-option> <a-select-option value="3"> 近3月 </a-select-option>
<a-select-option value="4"> 近180天 </a-select-option> <a-select-option value="4"> 本年度 </a-select-option>
<a-select-option value="5"> 自定义 </a-select-option> <!-- <a-select-option value="5"> 自定义 </a-select-option> -->
</a-select> </a-select>
<a-button type="primary" class="addclass" @click="getData">搜索</a-button> <a-button type="primary" class="addclass" @click="getData"
>搜索</a-button
>
</template> </template>
</Head> </Head>
<div class="echarts"> <div class="echarts">
<Brokenline :info="chartsData" v-if="chartsData"/> <Brokenline :info="chartsData" v-if="chartsData" />
</div> </div>
</div> </div>
<div class="fx"> <div class="fx">
...@@ -36,11 +38,13 @@ ...@@ -36,11 +38,13 @@
:pagination="false" :pagination="false"
:columns="tableHeaders" :columns="tableHeaders"
:dataSource="tableSourceData" :dataSource="tableSourceData"
:scroll="{ y: 590 }" :scroll="{ y: 590 }"
> >
</a-table> </a-table>
<p class="updateTime"> <p class="updateTime">
<i class="fa fa-info-circle"></i>数据更新时间:{{date}},受数据波动影响,可能会有延迟。 <i class="fa fa-info-circle"></i>数据更新时间:{{
date
}},受数据波动影响,可能会有延迟。
</p> </p>
</div> </div>
</div> </div>
...@@ -50,16 +54,16 @@ ...@@ -50,16 +54,16 @@
<script> <script>
import Head from "./components/header.vue"; import Head from "./components/header.vue";
import Brokenline from "./components/line.vue"; import Brokenline from "./components/line.vue";
import {getTrend} from '@/api/dataAdmin.js' import { getTrend } from "@/api/dataAdmin.js";
import moment from 'moment' import moment from "moment";
export default { export default {
name: "PortalAdminVueMakeDataAnalyse", name: "PortalAdminVueMakeDataAnalyse",
data() { data() {
return { return {
day:'0', day: "0",
date:'', date: "",
BegindAndEndTime: [], BegindAndEndTime: [],
chartsData:null, chartsData: null,
tableSourceData: [], tableSourceData: [],
tableHeaders: [ tableHeaders: [
{ {
...@@ -99,33 +103,33 @@ export default { ...@@ -99,33 +103,33 @@ export default {
Head, Head,
Brokenline, Brokenline,
}, },
watch:{ watch: {
day(val){ day(val) {
if (val != 5) this.BegindAndEndTime = [] if (val != 5) this.BegindAndEndTime = [];
} },
}, },
mounted() { mounted() {
this.date = moment().format('yyyy-MM-DD hh:mm:ss') this.date = moment().format("yyyy-MM-DD hh:mm:ss");
this.getData() this.getData();
}, },
methods: { methods: {
getData(){ getData() {
getTrend({ getTrend({
selected:this.day == 5 ? null : this.day, selected: this.day == 5 ? null : this.day,
time:this.BegindAndEndTime time: this.BegindAndEndTime,
}).then(res=>{ }).then((res) => {
this.chartsData = res.data.list this.chartsData = res.data.list;
this.tableSourceData.push({ this.tableSourceData.push({
研究对象: `预约次数`, 研究对象: `预约次数`,
预约总量: res.data.orderAll, 预约总量: res.data.orderAll,
开放预约天数: res.data.openday, 开放预约天数: res.data.openday,
预约日均值: res.data.prev_num, 预约日均值: res.data.prev_num,
整体同比: res.data.tbi, 整体同比: res.data.tbi,
整体环比: res.data.hbi, 整体环比: res.data.hbi,
}); });
}) });
}, },
rangePickerChange(val) { rangePickerChange(val) {
console.log(val); console.log(val);
}, },
...@@ -234,4 +238,4 @@ export default { ...@@ -234,4 +238,4 @@ export default {
} }
} }
} }
</style> </style>
\ No newline at end of file
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