MyToDo.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. <template>
  2. <div id="home">
  3. <!-- 第一行 -->
  4. <a-row :gutter="24" class="firstLine">
  5. <!-- 我的 -->
  6. <a-col :xs="24" :sm="24" :md="24" :lg="7" :style="{ marginBottom: '8px', paddingRight: 0 }">
  7. <!-- 等高设置 -->
  8. <a-card title="我的" style="width: 100%;" :bordered="false" :style="{ marginBottom: '8px', height: '250px' }">
  9. <a-row :gutter="24">
  10. <!-- 头像 -->
  11. <a-col :xs="24" :sm="24" :md="12" :lg="14">
  12. <a-row :gutter="24">
  13. <a-col :xs="24" :sm="24" :md="12" :lg="8">
  14. <div class="userImg">
  15. <img src="../../assets/user.jpg" width="50px;" />
  16. </div>
  17. </a-col>
  18. <a-col :xs="24" :sm="24" :md="12" :lg="16">
  19. <div class="userInfo">
  20. <span>{{ userInfo.realname }}</span>
  21. <p>账号:{{ userInfo.username }}</p>
  22. <em>Tel:{{ userInfo.phone }}</em>
  23. </div>
  24. </a-col>
  25. </a-row>
  26. </a-col>
  27. <!-- 数量 -->
  28. <a-col :xs="24" :sm="24" :md="12" :lg="10" class="msgBox">
  29. <span> {{ todoList.length }}</span>
  30. <p>我的待办</p>
  31. <span>{{ msgTotal }}</span>
  32. <p>系统消息</p>
  33. </a-col>
  34. </a-row>
  35. </a-card>
  36. </a-col>
  37. <!-- 待办 -->
  38. <a-col :xs="24" :sm="24" :md="24" :lg="11" :style="{ marginBottom: '8px', paddingRight: 0 }">
  39. <MyoaTabs />
  40. </a-col>
  41. <!-- 按钮 -->
  42. <a-col :xs="24" :sm="24" :md="24" :lg="6" :style="{ marginBottom: '8px' }">
  43. <!-- 等高设置 -->
  44. <a-card title="常用流程" :bordered="false" style="height: 250px;">
  45. <div v-for="(item, index) in activeKeyAll.slice(5, 10)" :key="index" class="oaBig">
  46. <a @click.prevent="aClick(item)" class="oaItem fl">
  47. <!-- 图标 -->
  48. <a-avatar shape="square" :size="36" :src="item.iconAddress" />
  49. <h4>{{ item.name }}</h4>
  50. </a>
  51. </div>
  52. </a-card>
  53. </a-col>
  54. </a-row>
  55. <!-- 第二行-->
  56. <a-row :gutter="24" class="secondLine">
  57. <!-- 企业公告 -->
  58. <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="9" :style="{ marginBottom: '8px', paddingRight: 0 }">
  59. <a-card title="企业公告" :bordered="false" style="height:400px;">
  60. <template #extra>
  61. <!-- <a href="javascript:void(0);" @click="openEnterAnn">更多</a> -->
  62. <a href="javascript:void(0);" @click="()=>modal.visible=true">更多</a>
  63. </template>
  64. <div class="dataV">
  65. <dv-scroll-board class="board" :config="config" style="height:280px;" @click="getMethod" />
  66. </div>
  67. </a-card>
  68. </a-col>
  69. <!-- 计划 友情链接 -->
  70. <div>
  71. <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="7" :style="{ marginBottom: '8px' }">
  72. <a-row :gutter="24">
  73. <!-- 我的计划 -->
  74. <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" :style="{ marginBottom: '8px', paddingRight: 0 }">
  75. <a-card title="我的计划" :bordered="false" style="width:100%;height:176px">
  76. <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12" :style="{ marginBottom: '8px', paddingRight: 0 }">
  77. <p>
  78. 上月我的计划:
  79. <strong style="color:#fa6b5c;marginRight:4px;textDecoration: underline;">{{ mlp }}</strong
  80. >份
  81. </p>
  82. <p>
  83. 本月我的计划:
  84. <strong style="color:#fa6b5c;marginRight:4px;textDecoration: underline;">{{ mtp }}</strong
  85. >份
  86. </p>
  87. </a-col>
  88. <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
  89. <p>
  90. 上月他人计划:
  91. <strong style="color:#fa6b5c;marginRight:4px;textDecoration: underline;">{{ olp }}</strong
  92. >份
  93. </p>
  94. <p>
  95. 本月他人计划:
  96. <strong style="color:#fa6b5c;marginRight:4px;textDecoration: underline;">{{ otp }}</strong
  97. >份
  98. </p>
  99. </a-col>
  100. </a-card>
  101. </a-col>
  102. <!-- 友情链接 -->
  103. <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" :style="{ marginBottom: '8px', paddingRight: 0 }">
  104. <a-card title="友情链接" :bordered="false" style="width:100%;height:216px">
  105. <template #extra><a href="javascript:void(0);" @click="()=>modal1.visible=true">更多</a></template>
  106. <!-- <template #extra><a href="javascript:void(0);" @click="openMyLinks">更多</a></template> -->
  107. <div v-for="item in linksList.slice(0, 8)" :key="item.id" class="links">
  108. <button class="itemLink">
  109. <a href="#" @click="openItemLink(item)">
  110. <span width="2em"> {{ item.name }}</span>
  111. </a>
  112. </button>
  113. </div>
  114. </a-card>
  115. </a-col>
  116. </a-row>
  117. </a-col>
  118. <!-- 日历 -->
  119. <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="8" :style="{ marginBottom: '8px' }">
  120. <a-card title="日程" :bordered="false" class="dataStyle">
  121. <template #extra>
  122. <a href="javascript:void(0);" @click="openCalTab">详情</a>
  123. </template>
  124. <a-row :gutter="24">
  125. <!-- 小日历 -->
  126. <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
  127. <div class="ccfullCalendar">
  128. <FullCalendar :options="calendarOptions" class="eventDeal-wrap" />
  129. </div>
  130. </a-col>
  131. </a-row>
  132. </a-card>
  133. </a-col>
  134. </div>
  135. </a-row>
  136. <!-- 按钮弹框 -->
  137. <a-modal v-model="lcModal.visible" :title="lcModal.title" :footer="null" :maskClosable="false" width="90%">
  138. <component
  139. :disabled="lcModal.disabled"
  140. v-if="lcModal.visible"
  141. :is="lcModal.formComponent"
  142. :processData="lcModal.processData"
  143. :isNew="lcModal.isNew"
  144. @afterSubmit="afterSub"
  145. @close=";(lcModal.visible = false), (lcModal.disabled = false)"
  146. >
  147. </component>
  148. </a-modal>
  149. <!-- 企业公告详情 弹框-->
  150. <detAnn-modal ref="DetAnnModal" @ok="modalFormOk" :fatherData="annDetail"></detAnn-modal>
  151. <!-- 企业公告更多 弹框-->
  152. <j-modal
  153. :visible.sync="modal.visible"
  154. :width="1300"
  155. :title="modal.title"
  156. :fullscreen.sync="modal.fullscreen"
  157. :switchFullscreen="modal.switchFullscreen"
  158. >
  159. <dv-scroll-board class="board" :config="config" style="height:280px;" @click="getMethod" />
  160. <!-- <template v-for="(i,k) of 30">
  161. <p :key="k">这是主体内容,高度是自适应的</p>
  162. </template> -->
  163. </j-modal>
  164. <!-- 友情链接更多 弹框-->
  165. <j-modal
  166. :visible.sync="modal1.visible"
  167. :width="1300"
  168. :title="modal1.title"
  169. :fullscreen.sync="modal1.fullscreen"
  170. :switchFullscreen="modal1.switchFullscreen"
  171. >
  172. <div v-for="item in linksList.slice(0, 8)" :key="item.id" class="links">
  173. <button class="itemLink">
  174. <a href="#" @click="openItemLink(item)">
  175. <span width="2em"> {{ item.name }}</span>
  176. </a>
  177. </button>
  178. </div>
  179. </j-modal>
  180. </div>
  181. </template>
  182. <script>
  183. import Vue from 'vue'
  184. import MyoaTabs from '@views/dashboard/MyoaTabs.vue'
  185. import DetAnnModal from '@views/oa/enter-ann/add/detAnnModal.vue'
  186. import { mapGetters } from 'vuex'
  187. import { getAction } from '@/api/manage'
  188. import FullCalendar from '@fullcalendar/vue'
  189. import dayGridPlugin from '@fullcalendar/daygrid'
  190. import interactionPlugin from '@fullcalendar/interaction'
  191. import timeGridPlugin from '@fullcalendar/timegrid'
  192. import SchedulePlan from '@views/oa/my-plan/schedulePlan'
  193. // import '@fullcalendar/core/main.css'
  194. import { scheduleGetListByTime, scheduleQueryById, scheduleGetLastMonth } from '@api/oa/cd-schedule'
  195. import { enterpriseEQueryById } from '@api/oa/cd-enterprise-announcement'
  196. import { enterpriseEList } from '@api/oa/cd-enterprise-announcement'
  197. import '@fullcalendar/daygrid/main.css'
  198. import JEditor from '../../components/jeecg/JEditor.vue'
  199. import '@/assets/less/dataVTable.less' // 修改首页 DataV 轮播表样式
  200. import { getUserPermissionByTokenBottom, getListByCreateBy } from '@api/api.js'
  201. import { ACCESS_TOKEN } from '@/store/mutation-types'
  202. import { linksList } from '@api/oa/cd_links.js'
  203. export default {
  204. name: 'Mytodo',
  205. components: {
  206. FullCalendar, //日历
  207. JEditor, //富文本
  208. DetAnnModal, //公告详情弹框
  209. MyoaTabs //我的待办、已办、申请 tabs
  210. },
  211. data() {
  212. return {
  213. mlp: '', // 上月计划数量
  214. mtp: '', //本月我的计划
  215. olp: '', //上月他计划
  216. otp: '', //本月他计划
  217. modal: {
  218. title: '企业公告',
  219. visible: false,
  220. fullscreen: false,
  221. switchFullscreen: true,
  222. },
  223. modal1: {
  224. title: '友情链接',
  225. visible: false,
  226. fullscreen: false,
  227. switchFullscreen: true,
  228. },
  229. menuALL: [], //所有菜单
  230. // value: 0,
  231. annDetail: {}, //公告详情 数据
  232. annList: [], //公告列表 数据
  233. linksList: [], //友情链接 数据
  234. config: {}, //轮播表配置
  235. //日历组件 参数
  236. calendarOptions: {
  237. // 日程数组
  238. events: [
  239. {
  240. title: '啦啦啦啦',
  241. start: '2021-10-13T14:30:00',
  242. end: '2021-10-13T14:30:00',
  243. extendedProps: {
  244. status: 'done'
  245. },
  246. backgroundColor: '#ccd5ae',
  247. borderColor: 'red'
  248. }
  249. ],
  250. // 事件---------------------------------
  251. editable: true, // 是否可以进行(拖动、缩放)修改
  252. eventStartEditable: true, // Event日程开始时间可以改变,默认为true,若为false,则表示开始结束时间范围不能拉伸,只能拖拽
  253. eventDurationEditable: true, // Event日程的开始结束时间距离是否可以改变,默认为true,若为false,则表示开始结束时间范围不能拉伸,只能拖拽
  254. selectable: true, // 是否可以选中日历格
  255. selectMirror: true,
  256. selectMinDistance: 0, // 选中日历格的最小距离
  257. weekends: true,
  258. navLinks: false, // 天链接
  259. selectHelper: false,
  260. selectEventOverlap: false, // 相同时间段的多个日程视觉上是否允许重叠,默认为true,允许
  261. dayMaxEvents: true,
  262. dateClick: this.handleDateClick, // 日期点击
  263. eventsSet: this.handleEvents, // 事件点击
  264. eventClick: this.handleEventClick, // 日程点击信息展示
  265. eventDrop: this.handleEventDrop, // 日程拖动事件
  266. eventResize: this.eventResize, // 日程缩放事件
  267. // 引入的插件
  268. plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
  269. // 日历头部按钮位置
  270. headerToolbar: {
  271. /* -----------------------
  272. left: 'prev,next',
  273. center: 'title',
  274. right: 'dayGridMonth'
  275. -------------------------*/
  276. left: '',
  277. center: '',
  278. right: ''
  279. },
  280. // 日历头部按钮中文转换
  281. // buttonText: {
  282. // month: '月'
  283. // },
  284. initialView: 'dayGridMonth', // 指定默认显示视图
  285. locale: 'zh-ch', // 切换语言,当前为中文
  286. firstDay: '1', // 设置一周中显示的第一天是周几,周日是0,周一是1
  287. weekNumberCalculation: 'ISO', // 与 firstDay 配套使用
  288. // eventColor: 'red', // 全部日历日程背景色
  289. timeGridEventMinHeight: '20', // 设置事件的最小高度
  290. // aspectRatio: '8.5', // 设置日历单元格宽高比
  291. displayEventTime: false, // 是否显示事件时间
  292. allDaySlot: false, // 周、日视图时,all-day不显示
  293. eventLimit: true, // 设置月日程,与all-day slot 的最大显示数量,超过的通过弹窗展示
  294. eventTimeFormat: {
  295. hour: 'numeric',
  296. minute: '2-digit',
  297. hour12: false
  298. },
  299. slotLabelFormat: {
  300. hour: '2-digit',
  301. minute: '2-digit',
  302. meridiem: false,
  303. hour12: false // 设置时间为 24小时制
  304. }
  305. },
  306. userInfo: this.$store.getters.userInfo,
  307. todoList: [],
  308. activeKeyAll: [],
  309. msg1Count: '0',
  310. msg2Count: '0',
  311. url: {
  312. listCementByUser: '/sys/annountCement/listByUser'
  313. },
  314. //按钮弹框
  315. lcModal: {
  316. title: '',
  317. visible: false,
  318. disabled: false,
  319. formComponent: null,
  320. isNew: false
  321. },
  322. data: [], // 表单数据
  323. total: 0, // 表单数据总数
  324. ipagination: {
  325. current: 1,
  326. pageSize: 3,
  327. pageSizeOptions: ['10', '20', '30'],
  328. showTotal: (total, range) => {
  329. return range[0] + '-' + range[1] + ' 共' + total + '条'
  330. },
  331. showQuickJumper: true,
  332. showSizeChanger: true,
  333. total: 0
  334. }
  335. }
  336. },
  337. created() {
  338. this.getScheduleData() //查询日程数据
  339. this.getDataList() //待办数据
  340. this.getActiveKeyAll() //OA按钮
  341. this.getAnnList() //渲染公告(已发布)
  342. this.getFooterNav() // 获取快捷导航
  343. this.getMyLinks() //友情链接(已发布)
  344. this.getMyPlan() //我的计划数据
  345. },
  346. computed: {
  347. // 系统消息计算
  348. msgTotal() {
  349. return parseInt(this.msg1Count) + parseInt(this.msg2Count)
  350. }
  351. // scroll: function() {
  352. // var width = window.innerWidth
  353. // // ant-table
  354. // let $antTable = window.document.getElementsByClassName('ant-table')
  355. // if ($antTable[0]) {
  356. // width = $antTable[0].clientWidth
  357. // }
  358. // return {
  359. // x: 1160,
  360. // y: window.innerHeight / 2
  361. // }
  362. // },
  363. // innerHeight: function() {
  364. // var innerHeight = window.innerHeight
  365. // return innerHeight
  366. // }
  367. },
  368. mounted() {
  369. this.loadData()
  370. this.getAnnList()
  371. },
  372. methods: {
  373. // 我的计划 数据
  374. getMyPlan() {
  375. return new Promise(resolve => {
  376. /*---------------------------------------------------------
  377. createBy:'' ,人员账号(不传则查询全部人员)
  378. whereTimeType:'',时间类型(0无时间筛选 1查询上月 2本月)
  379. ----------------------------------------------------------*/
  380. // 我上月计划
  381. scheduleGetLastMonth({ createBy: this.userInfo.username, whereTimeType: '1' }).then(res => {
  382. console.log('上月我计划res', res)
  383. // console.log('this.userInfo.username', this.userInfo.username)
  384. if (res.success) {
  385. this.mlp = res.result
  386. }
  387. resolve()
  388. })
  389. // 我本月计划
  390. scheduleGetLastMonth({ createBy: this.userInfo.username, whereTimeType: '2' }).then(res => {
  391. console.log('本月我计划', res)
  392. if (res.success) {
  393. this.mtp = res.result
  394. }
  395. resolve()
  396. })
  397. // 他人上月计划 他人计划减一下我的计划数量
  398. scheduleGetLastMonth({ createBy: !this.userInfo.username, whereTimeType: '1' }).then(res => {
  399. console.log('上月他计划', res)
  400. if (res.success) {
  401. // this.olp = res.result - this.mlp
  402. this.olp = res.result
  403. }
  404. resolve()
  405. })
  406. // 他人本月计划
  407. scheduleGetLastMonth({ createBy: !this.userInfo.username, whereTimeType: '2' }).then(res => {
  408. console.log('本月他计划', res)
  409. if (res.success) {
  410. // this.otp = res.result - this.mtp
  411. this.otp = res.result
  412. }
  413. resolve()
  414. })
  415. })
  416. },
  417. // 友情链接跳转
  418. openItemLink(e) {
  419. window.open(e.link, '_blank') //新窗口打开
  420. console.log('e.link', e.link)
  421. },
  422. // 查询友情链接
  423. async getMyLinks() {
  424. // params:{xx1:'',xx2:'',......}
  425. // isRelease为 1 已发布(渲染)
  426. await linksList({ isRelease: '1' }).then(res => {
  427. console.log('友情链接后台返回结果', res)
  428. this.linksList = res.result.records
  429. console.log('this.linksList', this.linksList)
  430. })
  431. },
  432. // 获取底部快捷菜单
  433. async getFooterNav() {
  434. await getListByCreateBy().then(res => {
  435. if (res.success) {
  436. console.log('底部快捷菜单', res)
  437. this.selectList = res.result
  438. }
  439. })
  440. },
  441. // 公告数据 ----|**查询条件:已发布、数据条数**|------
  442. async getAnnList() {
  443. await enterpriseEList({ isRelease: '1', pageSize: 1000 }).then(res => {
  444. if (res.success) {
  445. // console.log('轮播公告列表-->', res.result.records)
  446. this.annList = res.result.records
  447. let scrollData = [] //轮播表数据
  448. // 拿到返回的数据进行遍历并渲染
  449. this.annList.map(item => {
  450. //企业公告类型
  451. var annType = ''
  452. if (item.type == '人事') {
  453. annType =
  454. '<span style="color:rgba(128, 0, 128,.3);border:1px solid rgba(128, 0, 128,.3);padding:0 4px;border-radius:3px;">人事</span>'
  455. }
  456. if (item.type == '财务') {
  457. annType =
  458. '<span style="color:rgba(19, 194, 197,.6);border:1px solid rgba(19, 194, 197,.6);padding:0 4px;border-radius:3px;">财务</span>'
  459. }
  460. if (item.type == '项目') {
  461. annType =
  462. '<span style="color:rgba(255, 165, 0,.8);border:1px solid rgba(255, 165, 0,.8);padding:0 4px;border-radius:3px;">项目</span>'
  463. }
  464. var list = [item.id, annType, item.title, item.createBy, item.createTime]
  465. scrollData.push(list) //取到的每一个数据放到轮播表数据中
  466. })
  467. //轮播表配置
  468. this.config = {
  469. oddRowBGC: 'white',
  470. evenRowBGC: 'white',
  471. columnWidth: [50, 200, 600, 300, 400],
  472. align: ['center'],
  473. rowNum: 8,
  474. waitTime: 2000,
  475. data: scrollData //双向绑定(轮播表数据 绑定到配置的 data数据中)
  476. }
  477. }
  478. })
  479. },
  480. //轮播图 点击事件
  481. getMethod(item) {
  482. this.$refs.DetAnnModal.annVisible = true
  483. // console.log('轮播自带的数据', item)
  484. this.$nextTick(() => {
  485. enterpriseEQueryById({ id: item.row[0] }).then(res => {
  486. this.$refs.DetAnnModal.annVisible = true
  487. if (res.success) {
  488. console.log(res.result)
  489. this.annDetail = res.result
  490. }
  491. })
  492. })
  493. },
  494. //查询日程数据
  495. getScheduleData() {
  496. this.$nextTick(() => {
  497. //发送查询请求
  498. scheduleGetListByTime(null).then(res => {
  499. if (res.success) {
  500. // console.log('查询到的总日程结果', res)
  501. let list = res.result // 已经的结果
  502. var eventList = [] // 装新日程的
  503. // 循环日程
  504. list.forEach(e => {
  505. let Object = {
  506. title: e.title,
  507. start: e.startTime,
  508. end: e.endTime,
  509. id: e.id,
  510. backgroundColor: e.backgroundColor,
  511. extendedProps: {
  512. status: 'done'
  513. },
  514. borderColor: 'none'
  515. }
  516. eventList.push(Object) // 把日程推到日程列表
  517. })
  518. // console.log('总共的日程', eventList)
  519. // 刷新 日程列表
  520. this.calendarOptions.events = eventList
  521. }
  522. })
  523. })
  524. },
  525. // 代办数据
  526. async getDataList() {
  527. this.loading = true
  528. await this.postFormAction('/actTask/todoList', {}).then(res => {
  529. this.loading = false
  530. if (res.success) {
  531. this.todoList = res.result || []
  532. // console.log('首页 我的待办数字:', this.todoList.length)
  533. this.total = this.data.leading
  534. // console.log('系统消息:', this.data)
  535. }
  536. })
  537. },
  538. // 获取 OA 按钮
  539. async getActiveKeyAll() {
  540. await this.postFormAction('/activiti_process/listData', { status: 1, roles: true }).then(res => {
  541. this.activeKeyAll = []
  542. if (res.success) {
  543. var result = res.result || []
  544. if (result.length > 0) {
  545. this.activeKeyAll = result
  546. }
  547. }
  548. })
  549. },
  550. handleEvents(info) {
  551. // console.log('what', info)
  552. // 打印了事件(完成、位置)
  553. // this.currentEvents = events
  554. },
  555. // 日期点击
  556. handleDateClick(selectInfo) {
  557. this.$router.push('/oa/my-plan/schedulePlan')
  558. },
  559. //企业公告
  560. openEnterAnn() {
  561. this.$router.push('/oa/enterpriseAnnouncement')
  562. },
  563. //友情链接
  564. openMyLinks() {
  565. this.$router.push('/oa/myLinks')
  566. },
  567. //日程计划列表
  568. openCalTab() {
  569. this.$router.push('/oa/my-plan/calTable')
  570. },
  571. // 系统消息
  572. loadData() {
  573. try {
  574. // 获取系统消息
  575. getAction(this.url.listCementByUser)
  576. .then(res => {
  577. if (res.success) {
  578. this.msg1Count = res.result.anntMsgTotal
  579. this.msg2Count = res.result.sysMsgTotal
  580. // console.log(this.msg2Count)
  581. }
  582. })
  583. .catch(error => {
  584. console.log('系统消息通知异常', error) // 这行打印permissionName is undefined
  585. this.stopTimer = true
  586. console.log('清理timer')
  587. })
  588. } catch (err) {
  589. this.stopTimer = true
  590. console.log('通知异常', err)
  591. }
  592. },
  593. ...mapGetters(['nickname', 'avatar']),
  594. //OA图标点击事件
  595. aClick(v) {
  596. console.log(v)
  597. if (!v.routeName) {
  598. this.$message.warning('该流程信息未配置表单,请联系开发人员!')
  599. return
  600. }
  601. if (v.routeName.indexOf('外部表单') != -1) {
  602. alert('调用其他项目页面')
  603. } else if (v.routeName.indexOf('自定义') != -1) {
  604. this.lcModal.disabled = false
  605. let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
  606. this.lcModal.formComponent = com.component
  607. this.lcModal.title = '发起流程:' + v.name
  608. this.lcModal.isNew = true
  609. this.lcModal.processData = v
  610. this.lcModal.visible = true
  611. } else {
  612. this.lcModal.disabled = false
  613. this.lcModal.formComponent = this.getFormComponent(v.routeName).component
  614. this.lcModal.title = '发起流程:' + v.name
  615. this.lcModal.isNew = true
  616. this.lcModal.processData = v
  617. this.lcModal.visible = true
  618. }
  619. console.log('发起', v)
  620. },
  621. //提交后
  622. afterSub(formData) {
  623. this.lcModal.visible = false
  624. },
  625. // 分页、排序、筛选变化时触发
  626. handleTableChange(pagination, filters, sorter) {
  627. if (Object.keys(sorter).length > 0) {
  628. this.isorter.column = sorter.field
  629. this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
  630. }
  631. this.ipagination = pagination
  632. // this.loadData();
  633. },
  634. // 去处理按钮
  635. toDealWith() {
  636. this.$router.push({ path: '/activiti/todoManage' })
  637. },
  638. prev() {
  639. this.calendarApi.prev()
  640. console.log(this.calendarApi.prev)
  641. },
  642. modalFormOk() {}
  643. }
  644. }
  645. </script>
  646. <style lang="less" scoped>
  647. @import '~@assets/less/common.less';
  648. // 单独首页样式
  649. @import '~@assets/less/mytodo.less';
  650. .contain {
  651. position: absolute;
  652. left: 0;
  653. right: 0;
  654. top: 0;
  655. bottom: 0;
  656. width: 100%;
  657. background: rgba(255, 255, 255, 0.3);
  658. }
  659. </style>