MyToDo.vue 27 KB

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