|
|
@@ -6,7 +6,7 @@ import ActionUtils from '@/utils/action'
|
|
|
import Utils from '@/utils/util'
|
|
|
import { findAllByCurrUserId, saveCalendarInfos, removeCalendarInfos } from '@/api/detection/newHomeApi'
|
|
|
import { delQuickNavigation, addQuickNavigation, getQuickNavigation } from '@/api/platform/message/innerMessage'
|
|
|
-import { add } from 'lodash'
|
|
|
+import { add, isObject } from 'lodash'
|
|
|
const defaultRouterAlias = '/router-alias/'
|
|
|
import newPng from '@/assets/images/homepage/new.png'
|
|
|
|
|
|
@@ -21,13 +21,11 @@ export function buildComponent (name, column, preview) {
|
|
|
props: {
|
|
|
params: {
|
|
|
type: Object,
|
|
|
- default: function () {
|
|
|
- return {}
|
|
|
- }
|
|
|
+ default: () => {}
|
|
|
},
|
|
|
height: {
|
|
|
type: Number,
|
|
|
- default: column.height ? column.height : 300
|
|
|
+ default: column.height || 300
|
|
|
},
|
|
|
visible: {
|
|
|
type: Boolean,
|
|
|
@@ -39,43 +37,35 @@ export function buildComponent (name, column, preview) {
|
|
|
if (Utils.isEmpty(val)) {
|
|
|
return ''
|
|
|
}
|
|
|
- if (type === 'pending') {
|
|
|
- const opt = taskTypeOptions.find(x => x['value'] === val)
|
|
|
- return opt ? opt['label'] || '' : ''
|
|
|
- } else if (type === 'already' || type === 'myRequest') {
|
|
|
- const opt = dashboardStatus.find(x => x['value'] === val)
|
|
|
- return opt ? opt['label'] || '' : ''
|
|
|
- } else if (type === 'gender') {
|
|
|
- const opt = genderOptions.find(x => x['value'] === val)
|
|
|
- return opt ? opt['label'] || '' : ''
|
|
|
- } else if (type === 'favorites') {
|
|
|
- const opt = favoritesOptions.find(x => x['value'] === val)
|
|
|
- return opt ? opt['label'] || '' : ''
|
|
|
- } else if (type === 'notice') {
|
|
|
- const opt = noticeOptions.find(x => x['value'] === val)
|
|
|
- return opt ? opt['label'] || '' : ''
|
|
|
- } else if (type === 'unreadMessage') {
|
|
|
- const opt = unreadMessageOptions.find(x => x['value'] === val)
|
|
|
- return opt ? opt['label'] || '' : ''
|
|
|
+ const typeMap = {
|
|
|
+ pending: taskTypeOptions,
|
|
|
+ already: dashboardStatus,
|
|
|
+ myRequest: dashboardStatus,
|
|
|
+ gender: genderOptions,
|
|
|
+ favorites: favoritesOptions,
|
|
|
+ notice: noticeOptions,
|
|
|
+ unreadMessage: unreadMessageOptions
|
|
|
+ }
|
|
|
+ if (!typeMap[type]) {
|
|
|
+ return val
|
|
|
}
|
|
|
- return val
|
|
|
+ return typeMap[type].find(x => x['value'] === val) ? typeMap[type].find(x => x['value'] === val).label : val
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
|
const { first = '', second = '' } = this.$store.getters.level
|
|
|
- const { userList = [], deptList = [], userId = '' } = this.$store.getters
|
|
|
- const t1 = deptList.find((i) => i.positionId === first) || {}
|
|
|
- const t2 = deptList.find((i) => i.positionId === second) || {}
|
|
|
+ const { userList = [], deptList = [], menus, userInfo } = this.$store.getters
|
|
|
+ const t1 = deptList.find(i => i.positionId === first) || {}
|
|
|
+ const t2 = deptList.find(i => i.positionId === second) || {}
|
|
|
const locationName = second ? t1.positionName + t2.positionName : t1.positionName
|
|
|
- const t3 = userList.find((i) => i.userId === userId) || {}
|
|
|
- const deptName = t3.positions ? deptList.filter((i) => t3.positions.includes(i.positionName)).map((i) => i.positionName) : []
|
|
|
- const roleName = t3.roles ? t3.roles.split(',') : []
|
|
|
return {
|
|
|
+ userList,
|
|
|
deptList,
|
|
|
+ menus,
|
|
|
locationName,
|
|
|
- deptName,
|
|
|
- roleName,
|
|
|
newPng,
|
|
|
+ imgOptionsData,
|
|
|
+ positions: userInfo.positions,
|
|
|
loading: false,
|
|
|
title: `${column.name}`,
|
|
|
alias: `${column.alias}`,
|
|
|
@@ -87,22 +77,20 @@ export function buildComponent (name, column, preview) {
|
|
|
stautusOptions: [],
|
|
|
bpmnFormrenderDialogVisible: false, // 表单
|
|
|
editId: '',
|
|
|
- imgOptionsData: imgOptionsData,
|
|
|
bodyShow: true,
|
|
|
show: false,
|
|
|
showHeight: '',
|
|
|
- cardHeight: 100 + '%',
|
|
|
+ cardHeight: '100%',
|
|
|
|
|
|
activeName: 'innerMessage',
|
|
|
unreadMessageOption: {},
|
|
|
-
|
|
|
formName: 'form',
|
|
|
dialogFormVisible: false,
|
|
|
formLabelWidth: '120px',
|
|
|
- form: {
|
|
|
- label: '',
|
|
|
- url: '',
|
|
|
- target: ''
|
|
|
+ quickNavform: {
|
|
|
+ urlName: '',
|
|
|
+ urlAddr: '',
|
|
|
+ display: '_blank'
|
|
|
},
|
|
|
defaultForm: {},
|
|
|
|
|
|
@@ -111,19 +99,19 @@ export function buildComponent (name, column, preview) {
|
|
|
pendingBusinessOption: {},
|
|
|
bpmn: [],
|
|
|
rules: {
|
|
|
- label: [
|
|
|
+ urlName: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: this.$t('validate.required')
|
|
|
}
|
|
|
],
|
|
|
- url: [
|
|
|
+ urlAddr: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: this.$t('validate.required')
|
|
|
}
|
|
|
],
|
|
|
- target: [
|
|
|
+ display: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: this.$t('validate.required')
|
|
|
@@ -148,8 +136,7 @@ export function buildComponent (name, column, preview) {
|
|
|
})
|
|
|
},
|
|
|
mounted () {
|
|
|
- this.defaultForm = JSON.parse(JSON.stringify(this.form))
|
|
|
- this.getNDlist()
|
|
|
+ this.defaultForm = JSON.parse(JSON.stringify(this.quickNavform))
|
|
|
this.$nextTick(() => {
|
|
|
this.fetchData()
|
|
|
})
|
|
|
@@ -158,57 +145,45 @@ export function buildComponent (name, column, preview) {
|
|
|
fetchData (columns, params = {}) {
|
|
|
this.loading = true
|
|
|
this.showHeight = this.getHeight()
|
|
|
- const param = Utils.isNotEmpty(columns)
|
|
|
- ? columns
|
|
|
- : column.alias === 'unreadMessage' || column.alias === 'pendingBusiness'
|
|
|
- ? { dataMode: column.dataMode, dataFrom: column.dataFrom }
|
|
|
- : column
|
|
|
+ const param = Utils.isNotEmpty(columns) && (column.alias === 'unreadMessage' || column.alias === 'pendingBusiness')
|
|
|
+ ? { dataMode: column.dataMode, dataFrom: column.dataFrom }
|
|
|
+ : column
|
|
|
if (param.alias === 'myCalendar') {
|
|
|
- const events = []
|
|
|
- findAllByCurrUserId().then((res) => {
|
|
|
+ const { getFormatDate, getDate } = this.$common
|
|
|
+ findAllByCurrUserId().then(res => {
|
|
|
const { data = [] } = res || {}
|
|
|
- for (const i of data) {
|
|
|
+ this.data = data.map(i => ({
|
|
|
+ id: i.id,
|
|
|
+ title: i.title,
|
|
|
+ content: i.content,
|
|
|
+ start: i.startTime,
|
|
|
// 日期组件日程显示里,end的时间需要多加一天,end:2024-01-02时,日程条只到2024-01-01的日期位置上
|
|
|
- const event = {
|
|
|
- id: i.id,
|
|
|
- title: i.title,
|
|
|
- content: i.content,
|
|
|
- start: i.startTime,
|
|
|
- end: this.updateDay('add', i.endTime, 1),
|
|
|
- jieShuShiJian: i.endTime,
|
|
|
- zhuangTai: i.emergencyState,
|
|
|
- color: this.colorStatus[Number(i.emergencyState) - 1]
|
|
|
- }
|
|
|
- events.push(event)
|
|
|
- }
|
|
|
- this.data = events
|
|
|
+ end: getFormatDate('string', 10, getDate('day', 1, i.endTime)),
|
|
|
+ jieShuShiJian: i.endTime,
|
|
|
+ zhuangTai: i.emergencyState,
|
|
|
+ color: this.colorStatus[Number(i.emergencyState) - 1]
|
|
|
+ }))
|
|
|
}).catch(() => {
|
|
|
- alert('获取日历日程失败!')
|
|
|
+ this.$message.error('获取日历日程失败!')
|
|
|
+ })
|
|
|
+ } else if (param.alias === 'quickNavigation') {
|
|
|
+ getQuickNavigation().then(res => {
|
|
|
+ this.quickNavigationData = res.data || []
|
|
|
})
|
|
|
} else {
|
|
|
- getData(param, params).then((response) => {
|
|
|
- let data = response.data
|
|
|
+ getData(param, params).then(res => {
|
|
|
+ let { data } = res || {}
|
|
|
if (Utils.isNotEmpty(data) && Utils.isString(data)) {
|
|
|
- data = Utils.parseData(response.data)
|
|
|
+ data = Utils.parseData(res.data)
|
|
|
}
|
|
|
- var check = Object.prototype.toString
|
|
|
- this.data = check.call(data) === '[object Object]' ? data.dataResult ? data.dataResult : data : data
|
|
|
- this.totality = check.call(data) === '[object Object]' ? data.pageResult ? data.pageResult : data : data
|
|
|
- // 公告栏目进行部门的数据过滤
|
|
|
- if (param.id === '776027232253509632' || param.alias === 'notice') {
|
|
|
- const postions = this.$store.getters.position
|
|
|
- const filDatas = []
|
|
|
- if (postions) {
|
|
|
- for (const i of this.data) {
|
|
|
- if (postions.indexOf(i.depId) > -1) {
|
|
|
- filDatas.push(i)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.data = filDatas
|
|
|
- this.totality = filDatas
|
|
|
+ this.data = data && data.dataResult ? data.dataResult : data
|
|
|
+ this.totality = data && data.dataResult ? data.pageResult : data
|
|
|
+ // 公告栏目对数据过滤
|
|
|
+ if (param.alias === 'notice') {
|
|
|
+ const deptIds = this.deptList.map(i => i.positionId)
|
|
|
+ this.data = data.filter(i => deptIds.includes(i.depId))
|
|
|
}
|
|
|
- this.variables = response.variables
|
|
|
+ this.variables = res.variables
|
|
|
this.loading = false
|
|
|
}).catch((e) => {
|
|
|
this.loading = false
|
|
|
@@ -218,28 +193,36 @@ export function buildComponent (name, column, preview) {
|
|
|
getPhoto (photo) {
|
|
|
return getFile(photo)
|
|
|
},
|
|
|
- getFilterTitle (t) {
|
|
|
- return t.match('#([^#]+)#') === null ? '' : t.match('^(.*?)#.*?#')[0]
|
|
|
- },
|
|
|
- getTransactionSpecification (t) {
|
|
|
- return t.match('#([^#]+)#') === null ? '' : t.match('#(.*?)#')[1]
|
|
|
- },
|
|
|
- getMid (m) {
|
|
|
- const bm = this.getBPBMID(m) || ''
|
|
|
- const a = this.deptList.find((i) => i.positionId === bm)
|
|
|
- return a ? a.positionName : ''
|
|
|
+ getTaskDesc (v) {
|
|
|
+ if (!v.includes('#')) {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ return v.split('#')[1] || ''
|
|
|
},
|
|
|
- getBPBMID (t) {
|
|
|
- return t.split('"dept":')[1] === null ? '' : t.split('"dept":')[1].replace(new RegExp('"', 'g'), '')
|
|
|
+ getTaskInfo (val, arg) {
|
|
|
+ const arr = val.split('#')
|
|
|
+ if (!arr[2]) {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ const result = JSON.parse(`{${arr[2]}}`)
|
|
|
+ if (!result.dept) {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ const depts = result.dept.split(',')
|
|
|
+ const deptNames = []
|
|
|
+ depts.forEach(item => {
|
|
|
+ const t = this.deptList.find(i => i.positionId === item)
|
|
|
+ deptNames.push(t ? t.positionName : result.dept)
|
|
|
+ })
|
|
|
+ result.deptName = deptNames.join(',')
|
|
|
+ return result[arg]
|
|
|
},
|
|
|
- getUser (val) {
|
|
|
- if (val === 'dd') {
|
|
|
- return this.locationName
|
|
|
- } else if (val === 'bm') {
|
|
|
- return this.deptName
|
|
|
- } else {
|
|
|
- return this.roleName
|
|
|
+ transformData (val, dataset, from, to) {
|
|
|
+ if (!val) {
|
|
|
+ return ''
|
|
|
}
|
|
|
+ const temp = this[dataset].find(u => u[from] === val)
|
|
|
+ return temp ? temp[to] : ''
|
|
|
},
|
|
|
getHeightNoUnit () {
|
|
|
// 高度 - header - 边框
|
|
|
@@ -249,31 +232,22 @@ export function buildComponent (name, column, preview) {
|
|
|
return 150
|
|
|
}
|
|
|
},
|
|
|
- getHeight () {
|
|
|
+ getHeight (h = 20) {
|
|
|
// 高度 - header - 边框
|
|
|
if (!this.visible) {
|
|
|
- return this.height ? (this.height - 80) + 'px' : '150px'
|
|
|
+ return this.height ? `${(this.height - 60 - h)}px` : '150px'
|
|
|
} else {
|
|
|
- return 100 + '%'
|
|
|
- }
|
|
|
- },
|
|
|
- getAddHeight (addH) {
|
|
|
- // 高度 - header - 边框
|
|
|
- if (!this.visible) {
|
|
|
- return this.height ? (this.height - 60 - (addH || 0)) + 'px' : '150px'
|
|
|
- } else {
|
|
|
- return 100 + '%'
|
|
|
+ return '100%'
|
|
|
}
|
|
|
},
|
|
|
getDashboardHeight () {
|
|
|
- return this.height ? (this.height + 20) + 'px' : '150px'
|
|
|
+ return this.height ? `${this.height + 20}px` : '150px'
|
|
|
},
|
|
|
getAttrs () {
|
|
|
const item = JSON.parse(JSON.stringify(column))
|
|
|
item.templateHtml = null
|
|
|
return item
|
|
|
},
|
|
|
- getFullCalendarEvents (data) {},
|
|
|
/**
|
|
|
* 构建首页日期组件的参数
|
|
|
* @param {*} data
|
|
|
@@ -352,6 +326,9 @@ export function buildComponent (name, column, preview) {
|
|
|
case 'expansion': // 展开
|
|
|
this.handleCollapseExpand(command, data, actions)
|
|
|
break
|
|
|
+ case 'add': // 新增
|
|
|
+ this.getFormData()
|
|
|
+ break
|
|
|
default:
|
|
|
break
|
|
|
}
|
|
|
@@ -363,10 +340,6 @@ export function buildComponent (name, column, preview) {
|
|
|
handleApprove (id) {
|
|
|
this.$emit('action-event', 'approve', id)
|
|
|
},
|
|
|
- // 截取日期
|
|
|
- getNewsDate (str, length) {
|
|
|
- return str.substring(0, length)
|
|
|
- },
|
|
|
handleUnreadMessage (id) {
|
|
|
this.$emit('action-event', 'unRead', id)
|
|
|
},
|
|
|
@@ -375,18 +348,24 @@ export function buildComponent (name, column, preview) {
|
|
|
this.emitActionEventHandler('fullscreen', { id: this.attrs.id })
|
|
|
},
|
|
|
openPlate (url) {
|
|
|
- this.$router.push(`/${url === 'myTraining' ? 'rygl/rypx/wdpx' : url}`)
|
|
|
+ const menuMap = {
|
|
|
+ myTraining: 'rygl/rypx/wdpx',
|
|
|
+ myTesting: 'rygl/kszx/wdks',
|
|
|
+ myDevices: 'sbgls/mywh'
|
|
|
+ }
|
|
|
+ if (menuMap[url]) {
|
|
|
+ const alias = menuMap[url].split('/')[0]
|
|
|
+ const resInfo = this.menus.find(i => i.alias === alias)
|
|
|
+ this.$store.dispatch('ibps/menu/activeHeaderSet', { activeHeader: resInfo.id, vm: this })
|
|
|
+ }
|
|
|
+ this.$router.push(`/${menuMap[url] || url}`)
|
|
|
},
|
|
|
/**
|
|
|
* 处理更多
|
|
|
*/
|
|
|
handleMore () {
|
|
|
if (this.attrs.colUrl === '') {
|
|
|
- this.$message({
|
|
|
- message: '未设置更多路径的url',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return
|
|
|
+ return this.$message.warning('未设置更多路径的url')
|
|
|
}
|
|
|
this.$router.push(`/${this.attrs.colUrl}`)
|
|
|
},
|
|
|
@@ -406,14 +385,6 @@ export function buildComponent (name, column, preview) {
|
|
|
params.$alias = this.alias
|
|
|
this.emitActionEventHandler('flow', params)
|
|
|
},
|
|
|
- addBreadcrumb () {
|
|
|
- let i = this.data.length
|
|
|
- i++
|
|
|
- this.data.push({
|
|
|
- url: 'http://bpmhome.cn/index.html',
|
|
|
- label: '地址' + i
|
|
|
- })
|
|
|
- },
|
|
|
handleCollapseExpand (command, data, actions) {
|
|
|
this.bodyShow = !this.bodyShow
|
|
|
const index = actions.findIndex((action) => action.key === data.key)
|
|
|
@@ -425,29 +396,29 @@ export function buildComponent (name, column, preview) {
|
|
|
this.showHeight = this.bodyShow ? this.getHeight() : 0
|
|
|
this.$refs['toolbar'].callback(actions)
|
|
|
},
|
|
|
-
|
|
|
formValidate () {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs[this.formName].validate(() => {})
|
|
|
})
|
|
|
},
|
|
|
getFormData () {
|
|
|
- // 固定模拟数据
|
|
|
- this.form = JSON.parse(JSON.stringify(this.defaultForm))
|
|
|
+ this.quickNavform = JSON.parse(JSON.stringify(this.defaultForm))
|
|
|
this.formValidate()
|
|
|
this.dialogFormVisible = true
|
|
|
- // this.$refs[this.formName] ? this.$refs[this.formName].resetFields() : null
|
|
|
- // TODO:接口暂未构建,先隐藏。
|
|
|
- // this.fetchData()
|
|
|
- },
|
|
|
- handleClose (taskid, i) {
|
|
|
- this.quickNavigationData.splice(i, 1)
|
|
|
- const delParam = { navigateIds: taskid }
|
|
|
- delQuickNavigation(delParam).then(response => {
|
|
|
- }).catch(() => {
|
|
|
- // this.loading = false
|
|
|
+ },
|
|
|
+ handleNavRemove (navId, i) {
|
|
|
+ this.$confirm('是否确认删除该快捷导航?', '提示', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ showClose: false,
|
|
|
+ closeOnClickModal: false
|
|
|
+ }).then(() => {
|
|
|
+ delQuickNavigation({ navigateIds: navId }).then(() => {
|
|
|
+ this.$message.success('删除成功')
|
|
|
+ this.quickNavigationData.splice(i, 1)
|
|
|
+ })
|
|
|
})
|
|
|
- // TODO: 传递后台删减后得数据。
|
|
|
},
|
|
|
// 错误头像的照片
|
|
|
errorAvatarHandler (data) {
|
|
|
@@ -458,51 +429,19 @@ export function buildComponent (name, column, preview) {
|
|
|
this.$refs[this.formName].resetFields()
|
|
|
this.dialogFormVisible = false
|
|
|
},
|
|
|
- getNDlist () {
|
|
|
- getQuickNavigation().then(response => {
|
|
|
- this.quickNavigationData = response.data || []
|
|
|
- }).catch(() => {
|
|
|
- // this.loading = false
|
|
|
- })
|
|
|
- },
|
|
|
- confirm () {
|
|
|
- // TODO:未有API接口 模拟数据不会因添加而变化
|
|
|
+ saveQuickNav () {
|
|
|
this.$refs[this.formName].validate(valid => {
|
|
|
if (valid) {
|
|
|
- this.quickNavigationData.push({
|
|
|
- urlName: this.form.label,
|
|
|
- urlAddr: this.form.url,
|
|
|
- display: this.form.target
|
|
|
- })
|
|
|
- this.dialogFormVisible = false
|
|
|
- const paramND = {
|
|
|
- urlName: this.form.label,
|
|
|
- urlAddr: this.form.url,
|
|
|
- display: this.form.target,
|
|
|
- id: ''
|
|
|
- }
|
|
|
- addQuickNavigation(paramND).then(response => {
|
|
|
- // console.log(111111)
|
|
|
- }).catch(() => {
|
|
|
- // this.loading = false
|
|
|
+ addQuickNavigation({ id: '', ...this.quickNavform }).then(() => {
|
|
|
+ this.$message.success('添加成功!')
|
|
|
+ this.quickNavigationData.push(this.quickNavform)
|
|
|
+ this.dialogFormVisible = false
|
|
|
})
|
|
|
} else {
|
|
|
ActionUtils.saveErrorMessage()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 更改指定日期是加还是减days天
|
|
|
- updateDay (state, date, days) {
|
|
|
- var d = new Date(date)
|
|
|
- if (state === 'add') {
|
|
|
- d.setDate(d.getDate() + days)
|
|
|
- } else {
|
|
|
- d.setDate(d.getDate() - days)
|
|
|
- }
|
|
|
- var mon = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
|
|
|
- const endD = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
|
|
|
- return `${d.getFullYear()}-${mon}-${endD}`
|
|
|
- },
|
|
|
// 父组件调用该方法给日程添加数据
|
|
|
async setCalendarEvents (param) {
|
|
|
const { userId = '', name = '' } = this.$store.getters
|
|
|
@@ -530,32 +469,10 @@ export function buildComponent (name, column, preview) {
|
|
|
this.refreshData()
|
|
|
},
|
|
|
// 公告栏是否显示new图标
|
|
|
- showNewIcon (row) {
|
|
|
- var nowDate = new Date((new Date()).getTime() + 8 * 60 * 60 * 1000)
|
|
|
- var time = nowDate.toJSON().split('T').join(' ').substr(0, 10)
|
|
|
- if (this.getOffsetDays(time, row.publicDate.substring(0, 10)) < 8) {
|
|
|
- return true
|
|
|
- } else {
|
|
|
- return false
|
|
|
- }
|
|
|
- },
|
|
|
- // 获取时间差
|
|
|
- getOffsetDays (startDate, endDate) {
|
|
|
- if (!startDate) {
|
|
|
- return false
|
|
|
- } else {
|
|
|
- var startDateArr = startDate.split('-')
|
|
|
- var checkStartDate = new Date()
|
|
|
- checkStartDate.setFullYear(startDateArr[0], startDateArr[1], startDateArr[2])
|
|
|
- var endDateArr = endDate.split('-')
|
|
|
- var checkEndDate = new Date()
|
|
|
- checkEndDate.setFullYear(endDateArr[0], endDateArr[1], endDateArr[2])
|
|
|
- var days = (checkStartDate.getTime() - checkEndDate.getTime()) / 3600000 / 24
|
|
|
- if (startDateArr[0] !== endDateArr[0]) {
|
|
|
- flag = true
|
|
|
- }
|
|
|
- return days
|
|
|
- }
|
|
|
+ showNewIcon (date, days) {
|
|
|
+ const nowDate = new Date().getTime
|
|
|
+ const targetDate = new Date(date).getTime
|
|
|
+ return targetDate + days * 24 * 60 * 60 * 1000 > nowDate
|
|
|
}
|
|
|
},
|
|
|
template: column.templateHtml !== '' ? `${column.templateHtml}` : `<div></div>`
|