util.js 32 KB

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