|
@@ -47,6 +47,7 @@ import brokenLineGraph from '../../../components/brokenLineGraph/index'
|
47
|
47
|
import ringChart from '../../../components/ringChart/index'
|
48
|
48
|
import dashboard from '../../../components/dashboard/index'
|
49
|
49
|
import brokenLineGraphGroup from '../../../components/brokenLineGraphGroup/index'
|
|
50
|
+
|
50
|
51
|
const { mapActions: mapStaActions } = createNamespacedHelpers('sta')
|
51
|
52
|
|
52
|
53
|
export default {
|
|
@@ -94,36 +95,46 @@ export default {
|
94
|
95
|
}),
|
95
|
96
|
CaseId: {
|
96
|
97
|
get () {
|
97
|
|
- return this.postData.caseid || this.defaultCaseId
|
|
98
|
+ return this.postData.caseid || this.defaultCaseId || this.cases[0].CaseId
|
98
|
99
|
},
|
99
|
100
|
set (val) {
|
100
|
101
|
this.postData.caseid = val
|
101
|
102
|
}
|
102
|
103
|
}
|
103
|
104
|
},
|
|
105
|
+ watch: {
|
|
106
|
+ defaultCaseId: function (val) {
|
|
107
|
+ if (!this.postData.caseid) {
|
|
108
|
+ this.postData.caseid = val
|
|
109
|
+ }
|
|
110
|
+ this.getData(val)
|
|
111
|
+ this.getBottomData(val, 'week')
|
|
112
|
+ },
|
|
113
|
+ },
|
104
|
114
|
mounted () {
|
105
|
115
|
this.$nextTick(function () {
|
106
|
|
- console.log(this.defaultCaseId)
|
107
|
|
- console.log(JSON.stringify(this.cases))
|
108
|
|
- this.postData.caseid = this.postData.caseid || this.cases[0].CaseId
|
|
116
|
+ })
|
|
117
|
+ },
|
|
118
|
+ methods: {
|
|
119
|
+ ...mapStaActions([
|
|
120
|
+ 'getDashboardData',
|
|
121
|
+ 'getDashboardBottomData',
|
|
122
|
+ ]),
|
|
123
|
+ getData (id) {
|
109
|
124
|
this.getDashboardData({
|
110
|
|
- caseid: this.postData.caseid
|
|
125
|
+ caseid: id
|
111
|
126
|
}).then((res) => {
|
112
|
127
|
console.log(JSON.stringify(res))
|
113
|
128
|
})
|
|
129
|
+ },
|
|
130
|
+ getBottomData (id, type) {
|
114
|
131
|
this.getDashboardBottomData({
|
115
|
|
- caseid: this.postData.caseid,
|
116
|
|
- statype: 'week'
|
|
132
|
+ caseid: id,
|
|
133
|
+ statype: type
|
117
|
134
|
}).then((res) => {
|
118
|
135
|
console.log(JSON.stringify(res))
|
119
|
136
|
})
|
120
|
|
- })
|
121
|
|
- },
|
122
|
|
- methods: {
|
123
|
|
- ...mapStaActions([
|
124
|
|
- 'getDashboardData',
|
125
|
|
- 'getDashboardBottomData',
|
126
|
|
- ]),
|
|
137
|
+ },
|
127
|
138
|
}
|
128
|
139
|
}
|
129
|
140
|
</script>
|