| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679 |
- <template>
- <div class="page-container">
- <el-row type="flex" justify="space-between" :gutter="10">
- <el-col :span="19">
- <div class="evaluate">
- <div class="title">
- <div class="name">年满意度评价</div>
- <div class="select">
- <el-select v-model="year" class="year-sel border" placeholder="请选择年份" @change="changeYear">
- <el-option
- v-for="item in yearList"
- :key="item"
- :label="item+'年'"
- :value="item"
- />
- </el-select>
- </div>
- </div>
- <div class="statistics">
- <div class="number">
- <div class="total">
- <span>评分</span>
- <span class="score">{{ yearOverview.score }}</span>
- <span class="unit">分</span>
- </div>
- <div class="other">
- <div class="item">
- <div class="score small">{{ yearOverview.recordQty }}<span class="unit">次</span></div>
- <div class="name">评价次数</div>
- </div>
- <div class="item">
- <div class="score small">{{ yearOverview.groupQty }}<span class="unit">个</span></div>
- <div class="name">科室</div>
- </div>
- <div class="item">
- <div class="score small">{{ yearOverview.doctorQty }}<span class="unit">人</span></div>
- <div class="name">医务人员</div>
- </div>
- </div>
- </div>
- <div class="chart-container">
- <FullYearChart :values="showYearScore(yearOverview.monthScoreCounter)" />
- </div>
- </div>
- </div>
- <div class="evaluate month">
- <div class="title">
- <div class="name">月满意度评价</div>
- <div class="select">
- <el-select v-model="year" placeholder="请选择年份" class="year-sel" @change="changeYear">
- <el-option
- v-for="item in yearList"
- :key="item"
- :label="item+'年'"
- :value="item"
- />
- </el-select>
- <el-select v-model="month" placeholder="请选择月份" class="month-sel" @change="changeMonth">
- <el-option
- v-for="item in 12"
- :key="item"
- :label="item+'月'"
- :value="item"
- />
- </el-select>
- </div>
- </div>
- <div class="statistics">
- <div class="number">
- <div class="total">
- <span>评分</span>
- <span class="score">{{ yearOverview.score }}</span>
- <span class="unit">分</span>
- </div>
- <div class="other">
- <div class="item">
- <div class="score small">{{ yearOverview.recordQty }}<span class="unit">次</span></div>
- <div class="name">评价次数</div>
- </div>
- <div class="item">
- <div class="score small">{{ yearOverview.groupQty }}<span class="unit">个</span></div>
- <div class="name">科室</div>
- </div>
- <div class="item">
- <div class="score small">{{ yearOverview.doctorQty }}<span class="unit">人</span></div>
- <div class="name">医务人员</div>
- </div>
- </div>
- </div>
- <div class="chart-container">
- <FullYearChart :values="showYearScore(yearOverview.monthScoreCounter)" />
- </div>
- </div>
- </div>
- <el-row v-if="false" style="margin-top:10px">
- <el-col class="group-box-month">
- <div class="group-box-head-container"><div class="group-box-head">月满意度评价</div></div>
- <div class="monthOverview-container">
- <div v-for="(monthItem,mIndex) in monthOverview" :key="mIndex" class="group-box border">
- <div class="group-title">
- <div>{{ monthItem.score }}</div>
- <div>{{ monthItem.groupName }}</div>
- </div>
- <div class="panorama-scoreIcon-container">
- <div class="item">
- <div class="score small">{{ checklist.score }}</div>
- <div class="name">评分</div>
- </div>
- <div class="item">
- <div class="score small">{{ checklist.targetQty }}</div>
- <div class="name">总人次</div>
- </div>
- <div class="item">
- <div class="score small">{{ checklist.recordQty }}</div>
- <div class="name">评价数</div>
- </div>
- </div>
- <div class="group-content">
- <div v-for="(checklist,cklIndex) in monthItem.checklistList" :key="cklIndex" class="group-content-item block">
- <div class="checklist-title">{{ checklist.checklistTitle }}</div>
- <div class="checklist-content flex-start">
- <div class="chart-container">
- <monthChart :id="'monthChart-'+cklIndex" :key="'checklist-'+cklIndex" :keys="monthScoreKeys" :values="formatCheckListValues(checklist.dayScoreList)" :axis-label="false" />
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </el-col>
- </el-row>
- <el-row style="margin-top:10px" type="flex" justify="space-between" :gutter="10">
- <el-col :span="12">
- <div class="rank-list">
- <div class="item-title">
- <div class="name">科室-英雄榜</div>
- <div class="more" @click="handleMoreAssess('/hos/satisfy/statis/grid')">更多</div>
- </div>
- <el-row>
- <vuescroll :ops="ops" style="height: calc(100vh - 646px)">
- <GroupScoreRank :data="groupDataList" />
- </vuescroll>
- </el-row>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="rank-list">
- <div class="item-title">
- <div class="name">医生-英雄榜</div>
- <div class="more" @click="handleMoreAssess('/hos/satisfy/statis/doctor')">更多</div>
- </div>
- <el-row>
- <vuescroll :ops="ops" style="height: calc(100vh - 646px)">
- <DoctorScoreRank :data="doctorDataList" />
- </vuescroll>
- </el-row>
- </div>
- </el-col>
- </el-row>
- </el-col>
- <el-col :span="5">
- <div class="todayNews">
- <div class="head">
- <div class="item-title">
- <div class="name">今日动态</div>
- <div class="more" @click="handleMoreAssess('/hos/satisfy/data')">更多</div>
- </div>
- <div class="statistics">
- <div class="item">
- <img class="icon" src="./images/notice.png" alt="总次数">
- <div class="cont">
- <div class="top">
- <span class="number">{{ todayOverview.recordQty }}</span>
- <span class="unit">次</span>
- </div>
- <div class="name">总次数</div>
- </div>
- </div>
- <div class="item">
- <img class="icon" src="./images/satisfy.png" alt="评分">
- <div class="cont">
- <div class="top">
- <span class="number">{{ todayOverview.score }}</span>
- <span class="unit">分</span>
- </div>
- <div class="name">评分</div>
- </div>
- </div>
- <div class="item clearfix">
- <img class="icon" src="./images/doctor.png" alt="医生">
- <div class="cont">
- <div class="top">
- <span class="number">{{ todayOverview.doctorQty }}</span>
- <span class="unit">人</span>
- </div>
- <div class="name">医生</div>
- </div>
- </div>
- <div class="item">
- <img class="icon" src="./images/office.png" alt="科室">
- <div class="cont">
- <div class="top">
- <span class="number">{{ todayOverview.gridQty }}</span>
- <span class="unit">个</span>
- </div>
- <div class="name">科室</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <RecentRecord more="/hos/satisfy/news/index" height="calc(100vh - 330px)" :data="todayOverview.data" />
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import { gridByList, groupByList, doctorByList } from '@/api/hos/satisfyStatisApi'
- import { yearOverview, monthOverview, todayOverview } from '@/api/hos/satisfyPanoramaApi'
- import monthChart from './components/monthChart'
- import FullYearChart from './components/FullYearChart'
- import RecentRecord from './components/RecentRecord'
- import DoctorScoreRank from '@/views/hos/panorama/components/DoctorScoreRank'
- import GroupScoreRank from '@/views/hos/panorama/components/GroupScoreRank'
- import vuescroll from 'vuescroll'
- import mqtt from 'mqtt'
- import { mqttUrl } from '@/settings'
- export default {
- name: 'SatisfyIndex',
- components: {
- monthChart,
- FullYearChart,
- RecentRecord,
- DoctorScoreRank,
- GroupScoreRank,
- vuescroll
- },
- data() {
- return {
- ops: {
- bar: {
- keepShow: false,
- background: 'rgba(144, 147, 153, 0.4)',
- onlyShowBarOnScroll: false
- }
- },
- year: '',
- month: '',
- yearList: [],
- yearScoreValues: [10, 20, 30, 40, 50, 60, 50, 30, 35, 20, 55],
- monthScoreKeys: [],
- monthScoreValues: [],
- conditions: {},
- todayOverview: {
- data: [],
- day: undefined,
- targetQty: 0,
- recordQty: 0,
- score: 0,
- doctorQty: 0,
- doctorRank: [],
- doctorRecordQty: 0,
- doctorScore: 0,
- gridQty: 0,
- gridRecordQty: 0,
- gridScore: 0,
- gridRank: [],
- groupRank: []
- },
- yearOverview: {
- doctorQty: 0,
- gridQty: 0,
- groupName: '',
- groupQty: 0,
- monthScoreCounter: {},
- recordQty: 0,
- score: 0
- },
- monthOverview: [],
- doctorDataList: [],
- groupDataList: [],
- gridDataList: []
- }
- },
- mounted() {
- this.init()
- },
- destroyed() {
- /*
- if (this.client.connected) {
- try {
- this.client.end(false, () => {
- console.log('Successfully disconnected!')
- })
- } catch (error) {
- console.log('Disconnect failed', error.toString())
- }
- } */
- },
- methods: {
- init() {
- const d = new Date()
- this.year = d.getFullYear()
- this.month = d.getMonth() + 1
- this.initYearList()
- this.monthScoreKeys = this.getMonthScoreKeys()
- this.getData()
- // this.initMqtt()
- },
- initYearList() {
- const d = new Date()
- const yearList = []
- for (let i = -5; i < 1; i++) {
- yearList.push(d.getFullYear() + i)
- }
- this.yearList = yearList
- },
- initMqtt() {
- const self = this
- const options = {
- clean: true,
- connectTimeout: 4000,
- clientId: 'emqx_test',
- username: 'emqx_test',
- password: 'emqx_test'
- }
- const client = mqtt.connect(mqttUrl, options)
- client.on('connect', function() {
- console.log('Connected')
- client.subscribe('topic/#', function(err) {
- if (!err) {
- // client.publish('topic/1', 'Hello mqtt')
- }
- })
- })
- client.on('message', function(topic, message) {
- self.mqttResponse(message)
- })
- this.client = client
- },
- handleAssessDetail(row) {},
- viewIndexScoreDetail(data) {},
- // Get Data
- getData() {
- this.getYearOverview()
- this.getMonthOverview()
- this.getTodayOverview()
- this.getGridByList()
- this.getDoctorByList()
- this.getGroupByList()
- },
- getTodayOverview() {
- todayOverview().then((resp) => {
- const { data } = resp
- if (data) {
- this.todayOverview = data
- } else {
- this.$set(this.todayOverview, { data: [], doctorRank: [], gridRank: [], groupName: '', groupRank: [], recordQty: 0, score: 0 })
- }
- })
- },
- getYearOverview() {
- yearOverview(this.year).then((resp) => {
- const { data } = resp
- if (data) {
- this.yearOverview = data
- } else {
- this.$set(this.yearOverview, { doctorQty: 0, gridQty: 0, groupName: '', groupQty: 0, monthScoreCounter: {}, recordQty: 0, score: 0 })
- }
- })
- },
- getMonthOverview() {
- monthOverview(this.year, this.month).then((resp) => {
- const { data } = resp
- if (data) {
- this.monthOverview = data.data
- } else {
- this.monthOverview = []
- }
- })
- },
- getGridByList() {
- gridByList(this.conditions).then((resp) => {
- const { data } = resp
- this.gridDataList = data
- })
- },
- getGroupByList() {
- groupByList(this.conditions).then((resp) => {
- const { data } = resp
- this.groupDataList = data
- })
- },
- getDoctorByList() {
- doctorByList(this.conditions).then((resp) => {
- const { data } = resp
- this.doctorDataList = data
- })
- },
- getMonthScoreKeys(date = (new Date()), unit = '') {
- var days = []
- if (typeof (date) === 'string') { // 2022/09
- date = new Date(date)
- }
- const y = date.getFullYear()
- const m = date.getMonth()
- const lastDay = new Date(y, m + 1, 0).getDate()
- for (let i = 1; i <= lastDay; i++) {
- days.push(i)
- }
- return days
- },
- showYearScore(data) {
- if (Array.isArray(data)) return data
- var arr = []
- for (let i = 1; i <= 12; i++) {
- arr.push(data[`m${i}`] ? data[`m${i}`] : 0)
- }
- return arr
- },
- handleMoreAssess(url) {
- this.$router.push({
- path: url
- })
- },
- formatCheckListValues(data) {
- if (!data) return []
- const enums = {}
- const len = (this.getMonthScoreKeys(`${this.year}/${this.month}`)).length
- const months = []
- data.forEach(item => { enums[item.day] = item })
- for (let i = 1; i <= len; i++) {
- months[i - 1] = enums[i] ? enums[i].score : 0
- }
- return months
- },
- mqttResponse(message) {
- // console.log('message', message.toString())
- this.getData()
- },
- changeYear(params) {
- this.getYearOverview()
- },
- changeMonth() {
- this.monthScoreKeys = this.getMonthScoreKeys(`${this.year}/${this.month}`)
- this.getMonthOverview()
- },
- linkTo(url) {
- if (url) {
- this.$router.push(url)
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .page-container {
- padding: 10px;
- color: #FFF;
- position: relative;
- .evaluate{
- height: 242px;
- padding: 20px;
- background-color: #1F3C51;
- border: 5px;
- border-top: 5px solid rgba(31, 60, 81, 1);
- background: linear-gradient(0deg, #1B3144, #1B3144),linear-gradient(0deg, #1F3C51, #1F3C51);
- &.month{
- margin-top: 10px;
- }
- .title{
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- position: relative;
- margin-top: -8px;
- .name{
- font-size: 16px;
- font-weight: 700;
- line-height: 16px;
- color: #fff;
- background-image:linear-gradient(180deg, #FFFFFF 0%, #98A8B7 100%);
- background-clip:text;
- -webkit-text-fill-color:transparent;
- }
- .select{
- // position: absolute;
- // right: 0;
- // top: -10px;
- &::v-deep{
- .el-select {
- width: 75px;
- height: 26px;
- line-height: 1;
- border-radius: 20px;
- background: rgba(255, 255, 255, 0.12);
- display: inline-block;
- font-size: 14px;
- border: 0;
- &.year-sel{
- border-radius: 20px 0 0 20px;
- }
- &.month-sel{
- width: 50px;
- border-radius: 0 20px 20px 0;
- }
- &.border{
- border-radius: 20px;
- }
- .el-input--medium .el-input__inner,.el-input{
- height: 100%;
- line-height: inherit;
- border: 0;
- border-radius:inherit;
- padding: 0;
- .el-input__icon{
- line-height: 1;
- }
- }
- .el-input__suffix{
- right: 1px;
- }
- }
- input{
- border-radius:inherit;
- background: rgba(255, 255, 255, 0.12);
- box-sizing: border-box;
- text-indent: 5px;
- }
- }
- }
- }
- .statistics{
- display: flex;
- justify-content: space-between;
- align-items: center;
- .number{
- width: 342px;
- .total{
- height: 68px;
- font-size: 14px;
- font-weight: 400;
- line-height: 14px;
- color: #fff;
- padding-left: 20px;
- border-bottom: 1px solid rgba(255, 255, 255, 0.05);
- .score{
- font-size: 48px;
- font-weight: 700;
- line-height: 48px;
- padding: 0 8px 0 20px;
- }
- .unit{
- color: rgba(134, 144, 156, 1);
- }
- }
- .other{
- display: flex;
- align-items: center;
- padding-left: 24px;
- margin-top: 24px;
- .item{
- width: 33.33%;
- .score{
- color: #fff;
- font-size: 24px;
- font-weight: 700;
- .unit{
- font-size: 12px;
- font-weight: 400;
- color: #86909C;
- padding-left: 2px;
- }
- }
- .name{
- font-size: 14px;
- line-height: 1;
- padding-top: 8px;
- }
- }
- }
- }
- .chart-container{
- flex: 1;
- height: 178px;
- padding-left: 20px;
- }
- }
- }
- .todayNews{
- background: linear-gradient(0deg, #1B3144, #1B3144),linear-gradient(0deg, #1F3C51, #1F3C51);
- .head{
- padding: 20px;
- .statistics{
- display: flex;
- justify-content: center;
- align-items: center;
- flex-wrap: wrap;
- margin-top: 42px;
- .item{
- width: 50%;
- display: flex;
- align-items: center;
- &:nth-child(n+3){
- padding-top: 32px;
- }
- .icon{
- display: block;
- width: 56px;
- margin-right: 16px;
- }
- .top{
- .number{
- font-size: 24px;
- line-height: 24px;
- font-weight: 700;
- }
- .unit{
- font-size: 12px;
- font-weight: 400;
- color: #86909C;
- padding-left: 2px;
- }
- }
- .name{
- font-size: 14px;
- line-height: 14px;
- padding-top: 8px;
- }
- }
- }
- }
- }
- .rank-list{
- padding: 20px;
- background: linear-gradient(0deg, #1B3144, #1B3144),linear-gradient(0deg, #1F3C51, #1F3C51);
- }
- .item-title{
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: linear-gradient(0deg, #1B3144, #1B3144),linear-gradient(0deg, #1F3C51, #1F3C51);
- .more{
- font-size: 14px;
- line-height: 14px;
- color: #C1C6C8;
- position: relative;
- padding-right: 10px;
- background: url(./images/more.png) no-repeat center right;
- background-size: 5px 8px;
- cursor: pointer;
- }
- }
- }
- </style>
|