TaskPanel.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <div class="group-box" :style="{height:height}">
  3. <div class="group-title">
  4. 工作任务
  5. <el-link @click="linkTo">更多 <i class="el-icon-caret-right" /></el-link>
  6. </div>
  7. <vuescroll v-if="dataList" :ops="ops" style="height: calc(100% - 40px)">
  8. <div class="task-management">
  9. <div
  10. v-for="(item, index) in dataList"
  11. :key="index"
  12. class="item"
  13. @click="linkTo"
  14. >
  15. <div class="icon">
  16. <i class="el-icon-tickets" />
  17. </div>
  18. <div class="info">
  19. <div class="lf">
  20. <h4 class="taskTitle">{{ item.taskTitle }}</h4>
  21. <span v-if="item.handleAccountId" style="font-size: 8px;color:#c4c1c1;">
  22. <i class="el-icon-user" />
  23. <span style="padding:0 6px;">{{ item.status===0?item.curAccountName:item.handleAccountName }}</span>
  24. </span>
  25. </div>
  26. <div class="rt">
  27. <div class="el-tag-taskCat">
  28. <el-tag size="mini" class="custom-tag" :class="'tag-'+item.taskCatId">{{ item.taskCatTitle }}</el-tag>
  29. </div>
  30. <template v-if="item.taskStatus===0">
  31. <vac :end-time="item.expectedEndTime">
  32. <p
  33. slot="process"
  34. slot-scope="{ timeObj }"
  35. >
  36. <i class="el-icon-time" />
  37. <span style="padding-left:6px;">{{ `${timeObj.d}天${timeObj.h}:${timeObj.m}:${timeObj.s}` }}</span>
  38. </p>
  39. <p slot="finish">过期</p>
  40. </vac>
  41. </template>
  42. <template v-else>
  43. <span style="font-size: 8px;color:#868282;">{{ item.status | taskStatusFilter }}</span>
  44. </template>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </vuescroll>
  50. </div>
  51. </template>
  52. <script>
  53. import commonMixin from '@/mixin/commonMethodMixin'
  54. import vuescroll from 'vuescroll'
  55. import { getRecentTaskByList } from '@/api/system/taskApi'
  56. export default {
  57. name: 'TaskPanel',
  58. components: {
  59. vuescroll
  60. },
  61. mixins: [commonMixin],
  62. props: {
  63. more: {
  64. type: String,
  65. default: undefined
  66. },
  67. taskCatId: {
  68. type: [String, Number],
  69. default: undefined
  70. },
  71. height: {
  72. type: [String],
  73. default: 'calc(100vh - 85px)'
  74. }
  75. },
  76. data() {
  77. return {
  78. ops: {
  79. bar: {
  80. keepShow: false,
  81. background: 'rgba(144, 147, 153, 0.4)',
  82. onlyShowBarOnScroll: false
  83. }
  84. },
  85. dataList: [],
  86. conditions: {
  87. taskCatId: this.taskCatId
  88. }
  89. }
  90. },
  91. mounted() {
  92. this.getData()
  93. },
  94. methods: {
  95. linkTo() {
  96. if (this.more) {
  97. this.$router.push({
  98. path: this.more
  99. })
  100. }
  101. },
  102. // Fetch Data
  103. getData() {
  104. this.listLoading = true
  105. getRecentTaskByList(this.conditions).then((resp) => {
  106. const { code, data, msg } = resp
  107. this.listLoading = false
  108. if (code === 200) {
  109. this.dataList = data
  110. } else {
  111. this.$message.error(msg)
  112. }
  113. }).catch((error) => {
  114. console.log(error)
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss">
  121. .group-box {
  122. width: calc(100% - 15px);
  123. background-color: #0C3242;
  124. border-top: 4px solid #1F3C51;
  125. border-radius: 5px 5px 0 0;
  126. padding: 15px;
  127. .group-title {
  128. font-size: 16px;
  129. color: #FFF;
  130. margin-bottom: 15px;
  131. font-weight: bold;
  132. .el-link {
  133. float: right;
  134. font-size: 14px;
  135. color: #C1C6C8;
  136. -webkit-text-fill-color: #C1C6C8;
  137. }
  138. }
  139. .group-content{
  140. height: 80%;
  141. overflow: auto;
  142. }
  143. }
  144. .task-management{
  145. margin-top: 20px;
  146. .item{
  147. display: flex;
  148. justify-content: flex-start;
  149. line-height: 1;
  150. margin-bottom: 20px;
  151. position: relative;
  152. cursor: pointer;
  153. .info{
  154. flex: 1;
  155. &::after{
  156. display: block;
  157. content: "";
  158. clear: both;
  159. }
  160. .lf{
  161. float: left;
  162. }
  163. .rt{
  164. float: right;
  165. .el-tag-taskCat{
  166. text-align: right;
  167. margin-top: 5px;
  168. .custom-tag{
  169. color:#fff;
  170. border-color:#eaeaea;
  171. background-color:transparent;
  172. &.tag-2{color: #b97741;border-color:#b97741;}
  173. &.tag-3{color: #97cd38;border-color:#97cd38;}
  174. &.tag-4{color: #dc5a2c;border-color:#dc5a2c;}
  175. &.tag-5{color: #414ab9;border-color:#414ab9;}
  176. &.tag-6{color: #c13ac9;border-color:#c13ac9;}
  177. &.tag-7{color: #29c761;border-color:#29c761;}
  178. }
  179. }
  180. }
  181. }
  182. .tag{
  183. height: 22px;
  184. display: inline-block;
  185. position: absolute;
  186. right: 0;
  187. padding: 0 5px;
  188. line-height: 20px;
  189. font-size: 12px;
  190. color: #fff;
  191. border-radius: 4px;
  192. box-sizing: border-box;
  193. white-space: nowrap;
  194. // background-color: #c78148;
  195. border: 1px solid #868282;
  196. &.none{
  197. background-color: transparent;
  198. border-color: transparent;
  199. }
  200. }
  201. p,h4{
  202. margin: 0;
  203. font-size: 14px;
  204. }
  205. p{
  206. padding-top: 6px;
  207. font-size: 8px;
  208. color: #f5f5f5;
  209. }
  210. h4{
  211. .status{
  212. font-size: 12px;
  213. }
  214. &.taskTitle{
  215. padding-bottom: 6px;
  216. }
  217. }
  218. .icon{
  219. width: 36px;
  220. height: 36px;
  221. font-size: 20px;
  222. }
  223. }
  224. }
  225. </style>