util.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. import { getData } from '@/api/platform/desktop/column'
  2. import { getFile } from '@/utils/avatar'
  3. import { mapState } from 'vuex'
  4. import { taskTypeOptions, dashboardStatus, genderOptions, favoritesOptions, noticeOptions, unreadMessageOptions, imgOptionsData } from '@/business/platform/bpmn/constants'
  5. import ActionUtils from '@/utils/action'
  6. import Utils from '@/utils/util'
  7. import { findAllByCurrUserId, saveCalendarInfos, removeCalendarInfos, delNavigation, addNavigation, getNavigation, sortNavigation } from '@/api/detection/newHomeApi'
  8. import { isEqual } from 'lodash'
  9. import Bus from '@/utils/EventBus'
  10. import newPng from '@/assets/images/homepage/new.png'
  11. import { BASE_URL } from '@/constant'
  12. import dayjs from 'dayjs'
  13. /**
  14. * 创建组件
  15. */
  16. export function buildComponent (name, column, preview, vm) {
  17. try {
  18. return {
  19. name,
  20. components: {
  21. VueDraggable: () => import('vuedraggable')
  22. },
  23. props: {
  24. params: {
  25. type: Object,
  26. default: () => {}
  27. },
  28. height: {
  29. type: Number,
  30. default: column.height || 300
  31. },
  32. visible: {
  33. type: Boolean,
  34. default: false
  35. },
  36. fullScreen: {
  37. type: Boolean,
  38. default: false
  39. }
  40. },
  41. filters: {
  42. filterStatus (val, type) {
  43. if (Utils.isEmpty(val)) {
  44. return ''
  45. }
  46. const typeMap = {
  47. pending: taskTypeOptions,
  48. already: dashboardStatus,
  49. myRequest: dashboardStatus,
  50. gender: genderOptions,
  51. favorites: favoritesOptions,
  52. notice: noticeOptions,
  53. unreadMessage: unreadMessageOptions
  54. }
  55. if (!typeMap[type]) {
  56. return val
  57. }
  58. return typeMap[type].find(x => x['value'] === val) ? typeMap[type].find(x => x['value'] === val).label : val
  59. }
  60. },
  61. data () {
  62. const { first = '', second = '' } = this.$store.getters.level
  63. const { userId, userList = [], deptList = [], menus, userInfo } = this.$store.getters
  64. const t1 = deptList.find(i => i.positionId === first) || {}
  65. const t2 = deptList.find(i => i.positionId === second) || {}
  66. const locationName = second ? t1.positionName + t2.positionName : t1.positionName
  67. return {
  68. userId,
  69. userList,
  70. deptList,
  71. menus,
  72. locationName,
  73. newPng,
  74. imgOptionsData,
  75. positions: userInfo.positions,
  76. loading: false,
  77. title: `${column.name}`,
  78. alias: `${column.alias}`,
  79. attrs: this.getAttrs(),
  80. variables: {}, // 一些变量,比如分页信息
  81. data: null,
  82. totalCount: 0,
  83. quickNavigationData: [],
  84. navigationList: [],
  85. stautusOptions: [],
  86. bpmnFormrenderDialogVisible: false, // 表单
  87. editId: '',
  88. bodyShow: true,
  89. show: false,
  90. showHeight: '',
  91. cardHeight: '100%',
  92. activeName: 'innerMessage',
  93. unreadMessageOption: {},
  94. formName: 'quickNavform',
  95. dialogFormVisible: false,
  96. formLabelWidth: '120px',
  97. quickNavform: {
  98. urlName: '',
  99. urlAddr: '',
  100. display: '_blank',
  101. diDian: second || first
  102. },
  103. defaultForm: {},
  104. pendingTabActiveName: 'user-type',
  105. bodyParams: ActionUtils.formatParams({}, {}, {}),
  106. pendingBusinessOption: {},
  107. bpmn: [],
  108. rules: {
  109. urlName: [
  110. {
  111. required: true,
  112. message: this.$t('validate.required')
  113. }
  114. ],
  115. urlAddr: [
  116. {
  117. required: true,
  118. message: this.$t('validate.required')
  119. }
  120. ],
  121. display: [
  122. {
  123. required: true,
  124. message: this.$t('validate.required')
  125. }
  126. ]
  127. },
  128. calendarDialogForm: {
  129. id: '',
  130. biaoTi: '',
  131. neiRong: '',
  132. kaiShiShiJian: '',
  133. jieShuShiJian: '',
  134. formDate: []
  135. },
  136. colorStatus: ['#e7505a', '#f3c200', '#578ebe', '#1BBC9B'],
  137. // const status = ['急', '重', '轻','缓']
  138. isDragging: false,
  139. draggableOptions: {
  140. handle: '.draggable',
  141. ghostClass: 'sortable-ghost',
  142. distance: 1,
  143. disabled: false,
  144. animation: 200,
  145. axis: 'y'
  146. },
  147. calendarToolbar: this.fullScreen ? [{ key: 'refresh' }] : [{ key: 'refresh' }, { key: 'fullscreen' }, { key: 'collapse' }],
  148. isFirstAlert: true, // 是否首次日程提醒
  149. scheduleData: [],
  150. scheduleShift: [],
  151. todaySchedule: []
  152. }
  153. },
  154. computed: {
  155. ...mapState({
  156. userInfo: state => state.ibps.user.info
  157. })
  158. },
  159. mounted () {
  160. this.defaultForm = JSON.parse(JSON.stringify(this.quickNavform))
  161. this.$nextTick(async () => {
  162. this.fetchData()
  163. this.scheduleData = await this.getScheduleData()
  164. })
  165. },
  166. methods: {
  167. fetchData (columns, params = {}) {
  168. this.loading = true
  169. this.data = []
  170. this.showHeight = this.getHeight()
  171. const param = Utils.isNotEmpty(columns) && (column.alias === 'unreadMessage' || column.alias === 'pendingBusiness')
  172. ? { dataMode: column.dataMode, dataFrom: column.dataFrom }
  173. : column
  174. if (param.alias === 'myCalendar') {
  175. const { getFormatDate, getDate } = this.$common
  176. findAllByCurrUserId().then(res => {
  177. const { data = [] } = res || {}
  178. if (this.isFirstAlert) {
  179. this.isFirstAlert = false
  180. this.showAlert(data)
  181. }
  182. this.data = data.map(i => ({
  183. id: i.id,
  184. title: i.title,
  185. content: i.content,
  186. start: i.startTime,
  187. // 日期组件日程显示里,end的时间需要多加一天,end:2024-01-02时,日程条只到2024-01-01的日期位置上
  188. end: getFormatDate('string', 10, getDate('day', 1, i.endTime)),
  189. jieShuShiJian: i.endTime,
  190. zhuangTai: i.emergencyState,
  191. color: this.colorStatus[Number(i.emergencyState) - 1]
  192. }))
  193. }).catch(() => {
  194. this.$message.error('获取日历日程失败!')
  195. })
  196. } else if (param.alias === 'quickNavigation') {
  197. getNavigation().then(res => {
  198. const { data = [] } = res || {}
  199. data.forEach(item => {
  200. if (!item.userId) {
  201. item.urlAddr = `${BASE_URL}#${item.urlAddr}`
  202. }
  203. })
  204. this.quickNavigationData = data
  205. })
  206. } else {
  207. getData(param, params).then(res => {
  208. let { data } = res || {}
  209. if (Utils.isNotEmpty(data) && Utils.isString(data)) {
  210. data = Utils.parseData(res.data)
  211. }
  212. this.data = data && data.dataResult ? data.dataResult : data
  213. this.totalCount = data && data.pageResult ? data.pageResult.totalCount : 0
  214. // 更新小铃铛消息数量
  215. if (param.alias === 'unreadMessage') {
  216. Bus.$emit('getMessageCount', this.totalCount)
  217. }
  218. this.variables = res.variables
  219. this.loading = false
  220. }).catch((e) => {
  221. this.loading = false
  222. })
  223. }
  224. },
  225. // 过滤日程提醒数据
  226. filterAlertData (data, dayNumber = 3) {
  227. if (dayNumber <= 0) return
  228. const today = dayjs()
  229. const tempCalendarAlertData = data.filter(day => {
  230. const startTime = dayjs(day.startTime)
  231. const endTime = dayjs(day.endTime)
  232. if (day.popUp) {
  233. if ((startTime.diff(today, 'day') <= 0 && endTime.diff(today, 'day') >= 0) || (startTime.diff(today, 'day') <= dayNumber - 2 && startTime.diff(today, 'day') >= 0)) {
  234. return true
  235. }
  236. }
  237. })
  238. tempCalendarAlertData.sort((a, b) => new Date(a.startTime) - new Date(b.startTime))
  239. const calendarIds = tempCalendarAlertData.map(item => item.id)
  240. const calendarAlertData = {}
  241. tempCalendarAlertData.forEach(item => {
  242. if (calendarAlertData[item.startTime]) {
  243. calendarAlertData[item.startTime].push(item)
  244. } else {
  245. calendarAlertData[item.startTime] = []
  246. calendarAlertData[item.startTime].push(item)
  247. }
  248. })
  249. return { calendarAlertData, calendarIds }
  250. },
  251. // 日程提醒
  252. showAlert (data) {
  253. const calendarAlertData = this.filterAlertData(data)
  254. this.$emit('action-event', 'calendarAlert', calendarAlertData)
  255. },
  256. getPhoto (photo) {
  257. return getFile(photo)
  258. },
  259. getTaskDesc (v) {
  260. if (!v.includes('#')) {
  261. return ''
  262. }
  263. return v.split('#')[1] || ''
  264. },
  265. getTaskInfo (val, arg) {
  266. const arr = val.split('#')
  267. if (!arr[2]) {
  268. return ''
  269. }
  270. // 中文冒号转英文冒号 防止流程定义时输入的冒号格式错误导致转换报错
  271. arr[2] = arr[2].replace(':', ':')
  272. const result = JSON.parse(`{${arr[2]}}`)
  273. if (!result.dept) {
  274. return ''
  275. }
  276. const depts = result.dept.split(',')
  277. const deptNames = []
  278. depts.forEach(item => {
  279. const t = this.deptList.find(i => i.positionId === item)
  280. deptNames.push(t ? t.positionName : result.dept)
  281. })
  282. result.deptName = deptNames.join(',')
  283. return result[arg]
  284. },
  285. transformData (val, dataset, from, to) {
  286. if (!val) {
  287. return ''
  288. }
  289. const temp = this[dataset].find(u => u[from] === val)
  290. return temp ? temp[to] : ''
  291. },
  292. getHeightNoUnit () {
  293. // 高度 - header - 边框
  294. if (!this.visible) {
  295. return this.height ? (this.height - 60 - 20) : 150
  296. } else {
  297. return 150
  298. }
  299. },
  300. getHeight (h = 20) {
  301. // 高度 - header - 边框
  302. if (!this.visible) {
  303. return this.height ? `${(this.height - 60 - h)}px` : '150px'
  304. } else {
  305. return '100%'
  306. }
  307. },
  308. getDashboardHeight () {
  309. return this.height ? `${this.height + 20}px` : '150px'
  310. },
  311. getAttrs () {
  312. const item = JSON.parse(JSON.stringify(column))
  313. item.templateHtml = null
  314. return item
  315. },
  316. /**
  317. * 构建首页日期组件的参数
  318. * @param {*} data
  319. * @returns
  320. */
  321. getFullCalendarConfig (data) {
  322. const events = data === null ? [] : Utils.parseJSON(data)
  323. const config = {
  324. height: preview ? '100%' : (this.height ? this.height : 180),
  325. // editable: true, // 允许拖动缩放,不写默认就是false
  326. selectable: true,
  327. dayMaxEvents: 1, // 最多显示3个日程
  328. locale: this.$i18n.locale ? this.$i18n.locale.toLowerCase() : 'zh-cn',
  329. events: events,
  330. buttonText: {
  331. today: '今天',
  332. dayGridMonth: '月',
  333. listMonth: '日程'
  334. // week: '周视图',
  335. // day: '日视图',
  336. // prev: '<i class="icon-chevron-left">后退</i>',
  337. // next: '<i class="icon-chevron-right">前进</i>'
  338. },
  339. dateClick: this.handleDateClick, // 日期点击
  340. eventClick: this.handleEventClick,
  341. moreLinkClick: this.handleMoreLinkClick
  342. }
  343. if (preview) {
  344. config.headerToolbar = {
  345. start: '',
  346. center: 'title',
  347. end: 'prev,next,today'
  348. // end: 'prev,next,today,month,agendaWeek,agendaDay,listWeek'
  349. }
  350. delete config['dayMaxEvents']
  351. }
  352. return config
  353. },
  354. handleDateClick (param) {
  355. this.$emit(
  356. 'open',
  357. 'calendar',
  358. [param.dateStr, param.dateStr],
  359. this.data
  360. )
  361. },
  362. handleEventClick (param) {
  363. this.$emit(
  364. 'open',
  365. 'calendar',
  366. [param.event.startStr, param.event._def.extendedProps.jieShuShiJian],
  367. this.data,
  368. param.event.id
  369. )
  370. },
  371. handleMoreLinkClick (date) {
  372. this.$emit(
  373. 'open',
  374. 'calendar',
  375. [date.allSegs[0].event.startStr, date.allSegs[0].event._def.extendedProps.jieShuShiJian],
  376. this.data,
  377. date.allSegs[0].event.id
  378. )
  379. },
  380. refreshData () {
  381. this.fetchData()
  382. },
  383. /**
  384. * 处理按钮事件
  385. * @param {*} command
  386. * @param {*} position
  387. * @param {*} data
  388. * @param {*} actions
  389. */
  390. handleActionEvent (command, position, data, actions) {
  391. switch (command) {
  392. case 'refresh': // 刷新
  393. this.refreshData()
  394. break
  395. case 'fullscreen': // 全屏
  396. this.handleFullscreen()
  397. break
  398. case 'more': // 更多
  399. this.handleMore()
  400. break
  401. case 'collapse': // 收缩
  402. case 'expansion': // 展开
  403. this.handleCollapseExpand(command, data, actions)
  404. break
  405. case 'add': // 新增
  406. this.getFormData()
  407. break
  408. default:
  409. break
  410. }
  411. },
  412. emitActionEventHandler (command) {
  413. this.$emit('action-event', command, ...Array.from(arguments).slice(1))
  414. },
  415. // 公告栏目点击事件
  416. handleApprove (id, title) {
  417. this.$emit('action-event', 'approve', {
  418. id, title
  419. })
  420. },
  421. handleUnreadMessage (id, tableId, tableName) {
  422. this.$emit('action-event', 'unRead', { id, tableId, tableName })
  423. },
  424. // 处理全屏
  425. handleFullscreen () {
  426. this.emitActionEventHandler('fullscreen', { id: this.attrs.id })
  427. },
  428. openPlate (url) {
  429. const menuMap = {
  430. myTraining: 'rygl/rypx/wdpx',
  431. myTesting: 'rygl/kszx/wdks',
  432. myDevices: 'sbgls/mywh',
  433. notice: 'tygl/tzgg',
  434. myFacility: 'sshjgl/sshjjk/sshjkzzl',
  435. quickNavigation: 'xtgl/xtsjpz/tyglpz/kjdhpz'
  436. }
  437. if (menuMap[url]) {
  438. const alias = menuMap[url].split('/')[0]
  439. const resInfo = this.menus.find(i => i.alias === alias)
  440. this.$store.dispatch('ibps/menu/activeHeaderSet', { activeHeader: resInfo.id, vm: this })
  441. }
  442. this.$router.push(`/${menuMap[url] || url}`)
  443. },
  444. /**
  445. * 处理更多
  446. */
  447. handleMore () {
  448. if (this.attrs.alias === 'quickNavigation') {
  449. return this.openPlate('quickNavigation')
  450. }
  451. if (!this.attrs.colUrl) {
  452. return this.$message.warning('未设置更多路径的url')
  453. }
  454. this.openPlate(this.attrs.colUrl)
  455. },
  456. // 未读消息
  457. handleClick (option) {
  458. this.unreadMessageOption = option
  459. option[this.activeName].dataMode = column.dataMode
  460. this.fetchData(option[this.activeName])
  461. },
  462. // 待办事务
  463. handleTabClick (option) {
  464. this.pendingBusinessOption = option
  465. option[this.pendingTabActiveName].dataMode = column.dataMode
  466. this.fetchData(option[this.pendingTabActiveName])
  467. },
  468. handleFlowClick (params) {
  469. params.$alias = this.alias
  470. this.emitActionEventHandler('flow', params)
  471. },
  472. handleCollapseExpand (command, data, actions) {
  473. this.bodyShow = !this.bodyShow
  474. const index = actions.findIndex((action) => action.key === data.key)
  475. actions[index].key = this.bodyShow ? 'collapse' : 'expansion'
  476. if (!this.visible) {
  477. this.emitActionEventHandler(command, {})
  478. return
  479. }
  480. this.showHeight = this.bodyShow ? this.getHeight() : 0
  481. this.$refs['toolbar'].callback(actions)
  482. },
  483. formValidate (formName) {
  484. this.$nextTick(() => {
  485. this.$refs[formName].validate(() => {})
  486. })
  487. },
  488. getFormData () {
  489. this.quickNavform = JSON.parse(JSON.stringify(this.defaultForm))
  490. this.formValidate('quickNavform')
  491. this.dialogFormVisible = true
  492. },
  493. handleNavRemove (navId, i) {
  494. this.$confirm('是否确认删除该快捷导航?', '提示', {
  495. confirmButtonText: '确认',
  496. cancelButtonText: '取消',
  497. type: 'warning',
  498. showClose: false,
  499. closeOnClickModal: false
  500. }).then(() => {
  501. delNavigation({ navigateIds: navId }).then(() => {
  502. this.$message.success('删除成功')
  503. this.quickNavigationData.splice(i, 1)
  504. })
  505. })
  506. },
  507. // 错误头像的照片
  508. errorAvatarHandler (data) {
  509. // data.photo = require('https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png')
  510. return true
  511. },
  512. close () {
  513. this.$refs[this.formName].resetFields()
  514. this.dialogFormVisible = false
  515. },
  516. saveQuickNav () {
  517. this.$refs[this.formName].validate(valid => {
  518. if (valid) {
  519. addNavigation({ id: '', ...this.quickNavform }).then(res => {
  520. this.$message.success('添加成功!')
  521. const { id } = res.variables || {}
  522. this.quickNavigationData.unshift({ id, ...this.quickNavform, userId: this.userId })
  523. this.dialogFormVisible = false
  524. })
  525. } else {
  526. ActionUtils.saveErrorMessage()
  527. }
  528. })
  529. },
  530. handleSortChange () {
  531. this.isDragging = false
  532. const newSort = this.quickNavigationData.map(i => i.id)
  533. if (isEqual(this.navigationList, newSort)) {
  534. return
  535. }
  536. this.navigationList = newSort
  537. sortNavigation({ orders: this.navigationList.join(',') }).then(() => {
  538. this.$message.success('排序成功!')
  539. })
  540. },
  541. // 父组件调用该方法给日程添加数据
  542. async setCalendarEvents (param) {
  543. const { name = '' } = this.$store.getters
  544. const form = param.form
  545. const paramObject = {
  546. id: form.id ? form.id : '11111',
  547. // diDian: "string", // 地点
  548. userId: this.userId, // 用户id
  549. userName: name, // 用户名
  550. title: form.biaoTi, // 标题
  551. content: form.neiRong, // 内容
  552. startTime: form.formDate[0], // 开始时间
  553. endTime: form.formDate[1], // 结束时间
  554. emergencyState: form.zhuangTai // 紧急状态
  555. }
  556. await saveCalendarInfos(paramObject)
  557. this.refreshData()
  558. },
  559. async hanldeCalendardel (param) {
  560. if (param.form.id) {
  561. await removeCalendarInfos({
  562. calendarIds: param.form.id
  563. })
  564. }
  565. this.refreshData()
  566. },
  567. // 公告栏是否显示new图标
  568. showNewIcon (date, days) {
  569. const nowDate = new Date().getTime()
  570. const targetDate = new Date(date).getTime()
  571. return targetDate + days * 24 * 60 * 60 * 1000 > nowDate
  572. },
  573. handleOverflow (val, length) {
  574. if (val.length > length) {
  575. return val.slice(0, length - 2) + '...'
  576. }
  577. return val
  578. },
  579. getDays (start, end) {
  580. if (!start || !end) {
  581. return 0
  582. }
  583. return Math.ceil((new Date(end) - new Date(start)) / (1000 * 60 * 60 * 24))
  584. },
  585. getScheduleData () {
  586. const sql = `select a.*, b.title_, b.start_date_, b.end_date_, b.config_, b.overview_ from t_schedule_detail a, t_schedule b where a.parent_id_ = b.id_ and a.user_id_ = '${this.userId}'`
  587. return new Promise((resolve, reject) => {
  588. this.$common.request('sql', sql).then(res => {
  589. const { data = [] } = res.variables || {}
  590. const eventList = []
  591. data.forEach(item => {
  592. const days = this.getDays(item.start_date_, item.end_date_)
  593. const config = item.config_ ? JSON.parse(item.config_) : {}
  594. const { scheduleShift } = config
  595. this.scheduleShift = scheduleShift
  596. for (let i = 1; i <= days; i++) {
  597. const shift = item[`d${i}_`]
  598. if (shift) {
  599. const date = this.$common.getFormatDate('string', 10, this.$common.getDate('day', i - 1, item.start_date_))
  600. const shiftList = shift.split(',')
  601. shiftList.forEach(s => {
  602. const t = scheduleShift.find(i => i.alias === s)
  603. eventList.push({
  604. color: t ? t.color : '',
  605. content: t.dateRange.map(d => {
  606. return d.type === 'allday' ? '全天' : (`当天 ${d.startTime}` + ' 至 ' + `${d.isSecondDay === 'Y' ? '第二天' : '当天'} ${d.endTime}`)
  607. }).join('\n'),
  608. title: s,
  609. start: date,
  610. end: date,
  611. jieShuShiJian: date,
  612. zhuangTai: '',
  613. id: i
  614. })
  615. })
  616. }
  617. }
  618. })
  619. const today = this.$common.getDateNow()
  620. this.todaySchedule = eventList.filter(i => i.start === today).map(i => i.title)
  621. console.log(this.todaySchedule)
  622. resolve(eventList)
  623. }).catch(error => {
  624. reject(error)
  625. })
  626. })
  627. },
  628. handleScheduleEventClick (param) {
  629. this.$emit(
  630. 'open',
  631. 'banci',
  632. [param.event.startStr, param.event._def.extendedProps.jieShuShiJian],
  633. this.scheduleShift,
  634. param.event._def.title
  635. )
  636. },
  637. showMySchedule () {
  638. const scheduleConfig = {
  639. height: '100%',
  640. locale: 'zh-cn', // 语言
  641. selectable: true, // 是否可以选中日历格
  642. buttonText: { // 日历头部按钮中文转换
  643. today: '今天',
  644. dayGridMonth: '月',
  645. listMonth: '',
  646. month: '月',
  647. week: '周视图',
  648. day: '日视图',
  649. list: '表'
  650. // prev: '<i class="icon-chevron-left">后退</i>',
  651. // next: '<i class="icon-chevron-right">前进</i>'
  652. },
  653. headerToolbar: { // 日历头部按钮位置
  654. // left: 'prev,next today',
  655. // start: '',
  656. right: 'prev,next today',
  657. center: 'title'
  658. // right: 'dayGridMonth,timeGridWeek,timeGridDay'
  659. // end: 'prev,next,today,month,agendaWeek,agendaDay,listWeek'
  660. },
  661. events: this.scheduleData, // 日程数组
  662. eventClick: this.handleScheduleEventClick, // 日程点击信息展示
  663. scheduleShift: this.scheduleShift
  664. }
  665. this.$emit('action-event', 'mySchedule', scheduleConfig)
  666. }
  667. },
  668. template: column.templateHtml !== '' ? `${column.templateHtml}` : `<div></div>`
  669. }
  670. } catch (error) {
  671. console.error(error)
  672. }
  673. }