|
|
@ -7,7 +7,7 @@ |
|
|
|
:panel-num="2" |
|
|
|
:panel-num="2" |
|
|
|
placement="bottom-end" |
|
|
|
placement="bottom-end" |
|
|
|
@on-change="_datepicker" |
|
|
|
@on-change="_datepicker" |
|
|
|
:value="scheduleTime" |
|
|
|
:value="[searchParams.startDate,searchParams.endDate]" |
|
|
|
type="daterange" |
|
|
|
type="daterange" |
|
|
|
:placeholder="$t('Select date range')" |
|
|
|
:placeholder="$t('Select date range')" |
|
|
|
format="YYYY-MM-DD HH:mm:ss"> |
|
|
|
format="YYYY-MM-DD HH:mm:ss"> |
|
|
@ -30,7 +30,7 @@ |
|
|
|
<th>{{$t('Number')}}</th> |
|
|
|
<th>{{$t('Number')}}</th> |
|
|
|
<th>{{$t('State')}}</th> |
|
|
|
<th>{{$t('State')}}</th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<tr v-for="(item,$index) in taskCountDtosList"> |
|
|
|
<tr v-for="(item,$index) in taskCtatusList"> |
|
|
|
<td><span>{{$index+1}}</span></td> |
|
|
|
<td><span>{{$index+1}}</span></td> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<span> |
|
|
|
<span> |
|
|
@ -60,7 +60,65 @@ |
|
|
|
<th>{{$t('Number')}}</th> |
|
|
|
<th>{{$t('Number')}}</th> |
|
|
|
<th>{{$t('State')}}</th> |
|
|
|
<th>{{$t('State')}}</th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<tr v-for="(item,$index) in processStateCountList"> |
|
|
|
<tr v-for="(item,$index) in processStateList"> |
|
|
|
|
|
|
|
<td><span>{{$index+1}}</span></td> |
|
|
|
|
|
|
|
<td><span><a href="javascript:" @click="id && _goProcess(item.key)" :class="id ?'links':''">{{item.value}}</a></span></td> |
|
|
|
|
|
|
|
<td><span class="ellipsis" style="width: 98%;" :title="item.key">{{item.key}}</span></td> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
</table> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="row" style="padding-top: 20px;"> |
|
|
|
|
|
|
|
<div class="col-md-6"> |
|
|
|
|
|
|
|
<div class="chart-title"> |
|
|
|
|
|
|
|
<span>命令状态统计</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
|
|
|
|
<div class="col-md-7"> |
|
|
|
|
|
|
|
<div id="command-state-pie" style="height:260px;margin-top: 100px;"></div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="col-md-5"> |
|
|
|
|
|
|
|
<div class="table-small-model"> |
|
|
|
|
|
|
|
<table> |
|
|
|
|
|
|
|
<tr> |
|
|
|
|
|
|
|
<th width="40">{{$t('#')}}</th> |
|
|
|
|
|
|
|
<th>{{$t('Number')}}</th> |
|
|
|
|
|
|
|
<th>{{$t('State')}}</th> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
<tr v-for="(item,$index) in taskCtatusList"> |
|
|
|
|
|
|
|
<td><span>{{$index+1}}</span></td> |
|
|
|
|
|
|
|
<td> |
|
|
|
|
|
|
|
<span> |
|
|
|
|
|
|
|
<a href="javascript:" @click="id && _goTask(item.key)" :class="id ?'links':''">{{item.value}}</a> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</td> |
|
|
|
|
|
|
|
<td><span class="ellipsis" style="width: 98%;" :title="item.key">{{item.key}}</span></td> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
</table> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="col-md-6"> |
|
|
|
|
|
|
|
<div class="chart-title"> |
|
|
|
|
|
|
|
<span>队列统计</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="row"> |
|
|
|
|
|
|
|
<div class="col-md-7"> |
|
|
|
|
|
|
|
<div id="process-state-pie" style="height:260px;margin-top: 100px;"></div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="col-md-5"> |
|
|
|
|
|
|
|
<div class="table-small-model"> |
|
|
|
|
|
|
|
<table> |
|
|
|
|
|
|
|
<tr> |
|
|
|
|
|
|
|
<th width="40">{{$t('#')}}</th> |
|
|
|
|
|
|
|
<th>{{$t('Number')}}</th> |
|
|
|
|
|
|
|
<th>{{$t('State')}}</th> |
|
|
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
<tr v-for="(item,$index) in processStateList"> |
|
|
|
<td><span>{{$index+1}}</span></td> |
|
|
|
<td><span>{{$index+1}}</span></td> |
|
|
|
<td><span><a href="javascript:" @click="id && _goProcess(item.key)" :class="id ?'links':''">{{item.value}}</a></span></td> |
|
|
|
<td><span><a href="javascript:" @click="id && _goProcess(item.key)" :class="id ?'links':''">{{item.value}}</a></span></td> |
|
|
|
<td><span class="ellipsis" style="width: 98%;" :title="item.key">{{item.key}}</span></td> |
|
|
|
<td><span class="ellipsis" style="width: 98%;" :title="item.key">{{item.key}}</span></td> |
|
|
@ -103,22 +161,27 @@ |
|
|
|
name: 'perject-chart', |
|
|
|
name: 'perject-chart', |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
taskCountDtosList: [], |
|
|
|
isLoading: true, |
|
|
|
processStateCountList: [], |
|
|
|
taskCtatusList: [], |
|
|
|
userList: [], |
|
|
|
processStateList: [], |
|
|
|
scheduleTime: ['2018-11-16 00:00:00', '2018-11-16 17:13:11'], |
|
|
|
defineUserList: [], |
|
|
|
isLoading: true |
|
|
|
commandStateList: [], |
|
|
|
|
|
|
|
searchParams: { |
|
|
|
|
|
|
|
projectId: this.id, |
|
|
|
|
|
|
|
startDate: '', |
|
|
|
|
|
|
|
endDate: '' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
id: Number |
|
|
|
id: Number |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
...mapActions('projects', ['getTaskCtatusCount', 'getProcessStateCount', 'getDefineUserCount']), |
|
|
|
...mapActions('projects', ['getTaskCtatusCount', 'getProcessStateCount', 'getDefineUserCount', 'getCommandStateCount', 'getQueueCount']), |
|
|
|
_datepicker (val) { |
|
|
|
_datepicker (val) { |
|
|
|
this.scheduleTime = val |
|
|
|
this.searchParams.startDate = val[0] |
|
|
|
this._stateTypePie() |
|
|
|
this.searchParams.endDate = val[1] |
|
|
|
this._processStatePie() |
|
|
|
this._getData(false) |
|
|
|
}, |
|
|
|
}, |
|
|
|
_goTask (name) { |
|
|
|
_goTask (name) { |
|
|
|
this.$router.push({ |
|
|
|
this.$router.push({ |
|
|
@ -140,22 +203,17 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
_stateTypePie () { |
|
|
|
|
|
|
|
this.taskCountDtosList = [] |
|
|
|
_handleTaskCtatus (res) { |
|
|
|
this.getTaskCtatusCount({ |
|
|
|
|
|
|
|
projectId: this.id, |
|
|
|
|
|
|
|
startDate: this.scheduleTime[0], |
|
|
|
|
|
|
|
endDate: this.scheduleTime[1] |
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
let data = res.data.taskCountDtos |
|
|
|
let data = res.data.taskCountDtos |
|
|
|
this.taskCountDtosList = _.map(data, v => { |
|
|
|
this.taskCtatusList = _.map(data, v => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
key: _.find(stateType, ['code', v.taskStateType])['label'], |
|
|
|
key: _.find(stateType, ['code', v.taskStateType])['label'], |
|
|
|
value: v.count, |
|
|
|
value: v.count, |
|
|
|
type: 'type' |
|
|
|
type: 'type' |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
const myChart = Chart.pie('#task-status-pie', this.taskCountDtosList, { title: '' }) |
|
|
|
const myChart = Chart.pie('#task-status-pie', this.taskCtatusList, { title: '' }) |
|
|
|
myChart.echart.setOption(pie) |
|
|
|
myChart.echart.setOption(pie) |
|
|
|
|
|
|
|
|
|
|
|
// 首页不允许跳转 |
|
|
|
// 首页不允许跳转 |
|
|
@ -164,23 +222,16 @@ |
|
|
|
this._goTask(e.data.name) |
|
|
|
this._goTask(e.data.name) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(e => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
_processStatePie () { |
|
|
|
_handleProcessState (res) { |
|
|
|
this.processStateCountList = [] |
|
|
|
|
|
|
|
this.getProcessStateCount({ |
|
|
|
|
|
|
|
projectId: this.id, |
|
|
|
|
|
|
|
startDate: this.scheduleTime[0], |
|
|
|
|
|
|
|
endDate: this.scheduleTime[1] |
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
let data = res.data.taskCountDtos |
|
|
|
let data = res.data.taskCountDtos |
|
|
|
this.processStateCountList = _.map(data, v => { |
|
|
|
this.processStateList = _.map(data, v => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
key: _.find(stateType, ['code', v.taskStateType])['label'], |
|
|
|
key: _.find(stateType, ['code', v.taskStateType])['label'], |
|
|
|
value: v.count |
|
|
|
value: v.count |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
const myChart = Chart.pie('#process-state-pie', this.processStateCountList, { title: '' }) |
|
|
|
const myChart = Chart.pie('#process-state-pie', this.processStateList, { title: '' }) |
|
|
|
myChart.echart.setOption(pie) |
|
|
|
myChart.echart.setOption(pie) |
|
|
|
// 首页不允许跳转 |
|
|
|
// 首页不允许跳转 |
|
|
|
if (this.id) { |
|
|
|
if (this.id) { |
|
|
@ -188,20 +239,16 @@ |
|
|
|
this._goProcess(e.data.name) |
|
|
|
this._goProcess(e.data.name) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(e => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
_processDefinitionBar () { |
|
|
|
_handleDefineUser (res) { |
|
|
|
this.getDefineUserCount({ |
|
|
|
|
|
|
|
projectId: this.id |
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
let data = res.data.userList |
|
|
|
let data = res.data.userList |
|
|
|
this.userList = _.map(data, v => { |
|
|
|
this.defineUserList = _.map(data, v => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
key: v.userName + ',' + v.userId + ',' + v.count, |
|
|
|
key: v.userName + ',' + v.userId + ',' + v.count, |
|
|
|
value: v.count |
|
|
|
value: v.count |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
const myChart = Chart.bar('#process-definition-bar', this.userList, {}) |
|
|
|
const myChart = Chart.bar('#process-definition-bar', this.defineUserList, {}) |
|
|
|
myChart.echart.setOption(bar) |
|
|
|
myChart.echart.setOption(bar) |
|
|
|
// 首页不允许跳转 |
|
|
|
// 首页不允许跳转 |
|
|
|
if (this.id) { |
|
|
|
if (this.id) { |
|
|
@ -214,25 +261,49 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(e => {}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
_handleCommandState (res) { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
created () { |
|
|
|
_handleQueue () {}, |
|
|
|
this.scheduleTime = [dayjs().format('YYYY-MM-DD 00:00:00'), dayjs().format('YYYY-MM-DD HH:mm:ss')] |
|
|
|
|
|
|
|
|
|
|
|
_getData (is = true) { |
|
|
|
this.isLoading = true |
|
|
|
this.isLoading = true |
|
|
|
Promise.all([ |
|
|
|
let ioList = [ |
|
|
|
this._stateTypePie(), |
|
|
|
this.getTaskCtatusCount(this.searchParams), |
|
|
|
this._processStatePie(), |
|
|
|
this.getProcessStateCount(this.searchParams), |
|
|
|
this._processDefinitionBar() |
|
|
|
this.getCommandStateCount(this.searchParams), |
|
|
|
]).then(res => { |
|
|
|
this.getQueueCount(this.searchParams) |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (is) { |
|
|
|
|
|
|
|
ioList.push(this.getDefineUserCount(_.pick(this.searchParams, ['projectId']))) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Promise.all(ioList).then(res => { |
|
|
|
|
|
|
|
this._handleTaskCtatus(res[0]) |
|
|
|
|
|
|
|
this._handleProcessState(res[1]) |
|
|
|
|
|
|
|
this._handleCommandState(res[2]) |
|
|
|
|
|
|
|
this._handleQueue(res[3]) |
|
|
|
|
|
|
|
if (is) { |
|
|
|
|
|
|
|
this._handleDefineUser(res[4]) |
|
|
|
|
|
|
|
} |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
this.isLoading = false |
|
|
|
this.isLoading = false |
|
|
|
}, 800) |
|
|
|
}, 800) |
|
|
|
}).catch(e => { |
|
|
|
}).catch(e => { |
|
|
|
|
|
|
|
console.log(e) |
|
|
|
this.isLoading = false |
|
|
|
this.isLoading = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
created () { |
|
|
|
|
|
|
|
this.searchParams.startDate = dayjs().format('YYYY-MM-DD 00:00:00') |
|
|
|
|
|
|
|
this.searchParams.endDate = dayjs().format('YYYY-MM-DD HH:mm:ss') |
|
|
|
|
|
|
|
// init get data |
|
|
|
|
|
|
|
this._getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
|
|
|
|
|
|
|
|
|