|
@@ -29,9 +29,8 @@ import dayjs from 'dayjs'
|
|
|
import { scheduleType } from '@/views/constants/schedule'
|
|
import { scheduleType } from '@/views/constants/schedule'
|
|
|
import { attendanceDetailClockIn } from '@/api/business/attendance'
|
|
import { attendanceDetailClockIn } from '@/api/business/attendance'
|
|
|
import { lifeTimeData } from '@/views/business/deviceManagement/constants/simulated'
|
|
import { lifeTimeData } from '@/views/business/deviceManagement/constants/simulated'
|
|
|
-import {
|
|
|
|
|
- queryScheduleConfigItem
|
|
|
|
|
-} from '@/api/business/schedule'
|
|
|
|
|
|
|
+import { queryScheduleConfigItem } from '@/api/business/schedule'
|
|
|
|
|
+import { querySystemGuide } from '@/api/business/general'
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 创建组件
|
|
* 创建组件
|
|
@@ -46,7 +45,7 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
props: {
|
|
props: {
|
|
|
params: {
|
|
params: {
|
|
|
type: Object,
|
|
type: Object,
|
|
|
- default: () => { }
|
|
|
|
|
|
|
+ default: () => {}
|
|
|
},
|
|
},
|
|
|
height: {
|
|
height: {
|
|
|
type: Number,
|
|
type: Number,
|
|
@@ -114,6 +113,9 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
data: null,
|
|
data: null,
|
|
|
totalCount: 0,
|
|
totalCount: 0,
|
|
|
quickNavigationData: [],
|
|
quickNavigationData: [],
|
|
|
|
|
+ cyzxbdData: [],
|
|
|
|
|
+ cyzxbdCommonData: [],
|
|
|
|
|
+ cyzxbdSelfData: [],
|
|
|
navigationList: [],
|
|
navigationList: [],
|
|
|
stautusOptions: [],
|
|
stautusOptions: [],
|
|
|
bpmnFormrenderDialogVisible: false, // 表单
|
|
bpmnFormrenderDialogVisible: false, // 表单
|
|
@@ -122,7 +124,10 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
show: false,
|
|
show: false,
|
|
|
showHeight: '',
|
|
showHeight: '',
|
|
|
cardHeight: '100%',
|
|
cardHeight: '100%',
|
|
|
-
|
|
|
|
|
|
|
+ pagination: {
|
|
|
|
|
+ limit: 10000,
|
|
|
|
|
+ page: 1
|
|
|
|
|
+ },
|
|
|
activeName: 'innerMessage',
|
|
activeName: 'innerMessage',
|
|
|
unreadMessageOption: {},
|
|
unreadMessageOption: {},
|
|
|
formName: 'quickNavform',
|
|
formName: 'quickNavform',
|
|
@@ -136,7 +141,10 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
},
|
|
},
|
|
|
defaultForm: {},
|
|
defaultForm: {},
|
|
|
|
|
|
|
|
- pendingTabActiveName: 'user-type',
|
|
|
|
|
|
|
+ pendingTabActiveName:
|
|
|
|
|
+ column.templateHtml && column.templateHtml.includes('commonlyForm')
|
|
|
|
|
+ ? 'commonlyForm'
|
|
|
|
|
+ : 'user-type',
|
|
|
bodyParams: ActionUtils.formatParams({}, {}, {}),
|
|
bodyParams: ActionUtils.formatParams({}, {}, {}),
|
|
|
pendingBusinessOption: {},
|
|
pendingBusinessOption: {},
|
|
|
bpmn: [],
|
|
bpmn: [],
|
|
@@ -190,7 +198,8 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
todaySchedule: [],
|
|
todaySchedule: [],
|
|
|
tempSelectedValue: '',
|
|
tempSelectedValue: '',
|
|
|
searchText: '',
|
|
searchText: '',
|
|
|
- keysList: []
|
|
|
|
|
|
|
+ keysList: [],
|
|
|
|
|
+ sorts: { SN_: 'ASC' }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -206,18 +215,26 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
// this.scheduleData = await this.getScheduleData()
|
|
// this.scheduleData = await this.getScheduleData()
|
|
|
this.todaySchedule = await this.getTodaySchedule()
|
|
this.todaySchedule = await this.getTodaySchedule()
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 受控文件查阅模块搜索
|
|
// 受控文件查阅模块搜索
|
|
|
- searchFile () {
|
|
|
|
|
- this.$router.push({ path: '/xxgl/nbwj', query: { searchText: this.searchText } })
|
|
|
|
|
|
|
+ searchFile() {
|
|
|
|
|
+ this.$router.push({
|
|
|
|
|
+ path: '/xxgl/nbwj',
|
|
|
|
|
+ query: { searchText: this.searchText }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
goDetail(nodeInfo) {
|
|
goDetail(nodeInfo) {
|
|
|
- if(!nodeInfo){
|
|
|
|
|
|
|
+ if (!nodeInfo) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- this.$router.push({ path: '/xxgl/nbwj', query: {info: JSON.parse(JSON.stringify(nodeInfo)), id:nodeInfo.id} })
|
|
|
|
|
|
|
+ this.$router.push({
|
|
|
|
|
+ path: '/xxgl/nbwj',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ info: JSON.parse(JSON.stringify(nodeInfo)),
|
|
|
|
|
+ id: nodeInfo.id
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
fetchData(columns, params = {}) {
|
|
fetchData(columns, params = {}) {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
@@ -225,8 +242,8 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
this.showHeight = this.getHeight()
|
|
this.showHeight = this.getHeight()
|
|
|
const param =
|
|
const param =
|
|
|
Utils.isNotEmpty(columns) &&
|
|
Utils.isNotEmpty(columns) &&
|
|
|
- (column.alias === 'unreadMessage' ||
|
|
|
|
|
- column.alias === 'pendingBusiness')
|
|
|
|
|
|
|
+ (column.alias === 'unreadMessage' ||
|
|
|
|
|
+ column.alias === 'pendingBusiness')
|
|
|
? { dataMode: column.dataMode, dataFrom: column.dataFrom }
|
|
? { dataMode: column.dataMode, dataFrom: column.dataFrom }
|
|
|
: column
|
|
: column
|
|
|
if (param.alias === 'myCalendar') {
|
|
if (param.alias === 'myCalendar') {
|
|
@@ -267,11 +284,13 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
})
|
|
})
|
|
|
this.quickNavigationData = data
|
|
this.quickNavigationData = data
|
|
|
})
|
|
})
|
|
|
|
|
+ } else if (param.alias === 'cyzxbd') {
|
|
|
|
|
+ this.loadCyzxbdData()
|
|
|
} else {
|
|
} else {
|
|
|
const { first = '', second = '' } = this.$store.getters.level || {}
|
|
const { first = '', second = '' } = this.$store.getters.level || {}
|
|
|
// console.log('11111111', param, params, typeof params)
|
|
// console.log('11111111', param, params, typeof params)
|
|
|
let type = true
|
|
let type = true
|
|
|
- if(param.alias == 'newmk'){
|
|
|
|
|
|
|
+ if (param.alias == 'newmk') {
|
|
|
type = false
|
|
type = false
|
|
|
params['diDian'] = second || first
|
|
params['diDian'] = second || first
|
|
|
}
|
|
}
|
|
@@ -289,7 +308,7 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
Bus.$emit('getMessageCount', this.totalCount)
|
|
Bus.$emit('getMessageCount', this.totalCount)
|
|
|
}
|
|
}
|
|
|
this.variables = res.variables
|
|
this.variables = res.variables
|
|
|
- if(param.alias == 'newmk'){
|
|
|
|
|
|
|
+ if (param.alias == 'newmk') {
|
|
|
this.keysList = Object.keys(this.variables)
|
|
this.keysList = Object.keys(this.variables)
|
|
|
}
|
|
}
|
|
|
this.loading = false
|
|
this.loading = false
|
|
@@ -299,10 +318,162 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ getSearchFormDatacyzxbd(page = { page: 1, limit: 100 }) {
|
|
|
|
|
+ const params = {}
|
|
|
|
|
+ // 默认过滤 SN 字段值不为空的数据
|
|
|
|
|
+ params[`Q^sn_^SNE`] = '1'
|
|
|
|
|
+ // 当前后端接口未实现字符串字段【SN】的正确排序,获取全部数据前端过滤
|
|
|
|
|
+ return {
|
|
|
|
|
+ parameters: this.formatParameters(params),
|
|
|
|
|
+ ...ActionUtils.formatParams(null, page, this.sorts)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ parseCyzxbdRoleIds(value) {
|
|
|
|
|
+ if (Utils.isEmpty(value)) return []
|
|
|
|
|
+ if (Array.isArray(value)) {
|
|
|
|
|
+ return value
|
|
|
|
|
+ .map((v) => (typeof v === 'object' ? v.id : v))
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ }
|
|
|
|
|
+ const str = String(value)
|
|
|
|
|
+ if (Utils.isJSON(str)) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const data = Utils.parseData(str)
|
|
|
|
|
+ const arr = Array.isArray(data) ? data : [data]
|
|
|
|
|
+ return arr.map((d) => d.id || d).filter(Boolean)
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ return []
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return str
|
|
|
|
|
+ .split(',')
|
|
|
|
|
+ .map((s) => s.trim())
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ },
|
|
|
|
|
+ async fetchAllCyzxbdGuideData() {
|
|
|
|
|
+ const pageSize = 100
|
|
|
|
|
+ let page = 1
|
|
|
|
|
+ let all = []
|
|
|
|
|
+ let total = Infinity
|
|
|
|
|
+ while (all.length < total) {
|
|
|
|
|
+ const res = await querySystemGuide(
|
|
|
|
|
+ this.getSearchFormDatacyzxbd({ page, limit: pageSize })
|
|
|
|
|
+ )
|
|
|
|
|
+ const { dataResult = [], pageResult = {} } = res.data || {}
|
|
|
|
|
+ all = all.concat(dataResult)
|
|
|
|
|
+ total =
|
|
|
|
|
+ pageResult.totalCount != null
|
|
|
|
|
+ ? Number(pageResult.totalCount)
|
|
|
|
|
+ : all.length
|
|
|
|
|
+ if (!dataResult.length || dataResult.length < pageSize) break
|
|
|
|
|
+ page += 1
|
|
|
|
|
+ }
|
|
|
|
|
+ return all
|
|
|
|
|
+ },
|
|
|
|
|
+ async loadCyzxbdData() {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const userRoles = this.$store.getters.role || []
|
|
|
|
|
+ const allRoleId = userRoles.map((item) => item.id)
|
|
|
|
|
+ const roleFields = [
|
|
|
|
|
+ 'bianZhiJiaoSe',
|
|
|
|
|
+ 'jieDianSiJiaoSe',
|
|
|
|
|
+ 'jieDianWuJiaoSe',
|
|
|
|
|
+ 'shenHeJiaoSe',
|
|
|
|
|
+ 'shenPiJiaoSe'
|
|
|
|
|
+ ]
|
|
|
|
|
+ const [dataResult, collectRes] = await Promise.all([
|
|
|
|
|
+ this.fetchAllCyzxbdGuideData(),
|
|
|
|
|
+ this.$common.request('query', {
|
|
|
|
|
+ key: 'zxbdryglgxcx',
|
|
|
|
|
+ params: [this.userId]
|
|
|
|
|
+ })
|
|
|
|
|
+ ])
|
|
|
|
|
+ const { isEmpty } = this.$utils
|
|
|
|
|
+ if (isEmpty(this.sorts)) {
|
|
|
|
|
+ dataResult.sort((a, b) => +a.sn - +b.sn)
|
|
|
|
|
+ }
|
|
|
|
|
+ const collectIds = new Set(
|
|
|
|
|
+ ((collectRes.variables && collectRes.variables.data) || [])
|
|
|
|
|
+ .map((item) => item.ji_lu_biao_dan_id)
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ .map((id) => String(id))
|
|
|
|
|
+ )
|
|
|
|
|
+ this.cyzxbdCommonData = dataResult.filter((item) => {
|
|
|
|
|
+ const itemRoleIds = roleFields.reduce(
|
|
|
|
|
+ (ids, field) =>
|
|
|
|
|
+ ids.concat(this.parseCyzxbdRoleIds(item[field])),
|
|
|
|
|
+ []
|
|
|
|
|
+ )
|
|
|
|
|
+ return allRoleId.some((roleId) => itemRoleIds.includes(roleId))
|
|
|
|
|
+ })
|
|
|
|
|
+ this.cyzxbdSelfData = dataResult.filter((item) =>
|
|
|
|
|
+ collectIds.has(String(item.id))
|
|
|
|
|
+ )
|
|
|
|
|
+ this.applyCyzxbdTabData()
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ this.cyzxbdCommonData = []
|
|
|
|
|
+ this.cyzxbdSelfData = []
|
|
|
|
|
+ this.cyzxbdData = []
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ applyCyzxbdTabData() {
|
|
|
|
|
+ this.cyzxbdData =
|
|
|
|
|
+ this.pendingTabActiveName === 'selfForm'
|
|
|
|
|
+ ? this.cyzxbdSelfData
|
|
|
|
|
+ : this.cyzxbdCommonData
|
|
|
|
|
+ },
|
|
|
|
|
+ handleCyzxbdTabClick(tab) {
|
|
|
|
|
+ if (tab && tab.name) {
|
|
|
|
|
+ this.pendingTabActiveName = tab.name
|
|
|
|
|
+ }
|
|
|
|
|
+ this.applyCyzxbdTabData()
|
|
|
|
|
+ },
|
|
|
|
|
+ findPagePath(res) {
|
|
|
|
|
+ const resList = res.split('.')
|
|
|
|
|
+ const findAlias = (nodes, path) => {
|
|
|
|
|
+ const [currentId, ...rest] = path
|
|
|
|
|
+ const node = nodes.find((n) => n.id === currentId)
|
|
|
|
|
+ return node && rest.length
|
|
|
|
|
+ ? [node.alias, ...findAlias(node.children, rest)]
|
|
|
|
|
+ : node && [node.alias]
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$store.dispatch('ibps/menu/activeHeaderSet', {
|
|
|
|
|
+ activeHeader: resList[0],
|
|
|
|
|
+ vm: this
|
|
|
|
|
+ })
|
|
|
|
|
+ return findAlias(this.menus, resList).join('/')
|
|
|
|
|
+ },
|
|
|
|
|
+ handleCyzxbdClick(data) {
|
|
|
|
|
+ const { ziYuanLuJing = '' } = data
|
|
|
|
|
+ if (!ziYuanLuJing) {
|
|
|
|
|
+ this.$message.warning('未配置资源菜单!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const path = '/' + this.findPagePath(ziYuanLuJing)
|
|
|
|
|
+ this.$router.push(path)
|
|
|
|
|
+ },
|
|
|
|
|
+ formatParameters(data) {
|
|
|
|
|
+ if (this.$utils.isEmpty(data)) {
|
|
|
|
|
+ return []
|
|
|
|
|
+ }
|
|
|
|
|
+ const parameters = Object.entries(data).map(([key, value]) =>
|
|
|
|
|
+ Array.isArray(value)
|
|
|
|
|
+ ? {
|
|
|
|
|
+ relation: 'OR',
|
|
|
|
|
+ parameters: value.map((v) => ({
|
|
|
|
|
+ key,
|
|
|
|
|
+ value: v,
|
|
|
|
|
+ param: this.$utils.guid()
|
|
|
|
|
+ }))
|
|
|
|
|
+ }
|
|
|
|
|
+ : { key, value }
|
|
|
|
|
+ )
|
|
|
|
|
+ return parameters.length === 1
|
|
|
|
|
+ ? [parameters[0]]
|
|
|
|
|
+ : [{ relation: 'AND', parameters }]
|
|
|
|
|
+ },
|
|
|
// 过滤日程提醒数据
|
|
// 过滤日程提醒数据
|
|
|
filterAlertData(data, dayNumber = 3) {
|
|
filterAlertData(data, dayNumber = 3) {
|
|
|
if (dayNumber <= 0) return
|
|
if (dayNumber <= 0) return
|
|
@@ -532,7 +703,7 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
notice: 'tygl/tzgg',
|
|
notice: 'tygl/tzgg',
|
|
|
myFacility: 'sshjgl/sshjjk/sshjkzzl',
|
|
myFacility: 'sshjgl/sshjjk/sshjkzzl',
|
|
|
quickNavigation: 'xtgl/xtsjpz/tyglpz/kjdhpz',
|
|
quickNavigation: 'xtgl/xtsjpz/tyglpz/kjdhpz',
|
|
|
- moreFile: 'xxgl/nbwj' //受控文件查阅
|
|
|
|
|
|
|
+ moreFile: 'xxgl/nbwj' //受控文件查阅
|
|
|
}
|
|
}
|
|
|
if (menuMap[url]) {
|
|
if (menuMap[url]) {
|
|
|
const alias = menuMap[url].split('/')[0]
|
|
const alias = menuMap[url].split('/')[0]
|
|
@@ -551,6 +722,9 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
if (this.attrs.alias === 'quickNavigation') {
|
|
if (this.attrs.alias === 'quickNavigation') {
|
|
|
return this.openPlate('quickNavigation')
|
|
return this.openPlate('quickNavigation')
|
|
|
}
|
|
}
|
|
|
|
|
+ if (this.attrs.alias === 'cyzxbd') {
|
|
|
|
|
+ return this.openPlate('mySysGuide')
|
|
|
|
|
+ }
|
|
|
if (!this.attrs.colUrl) {
|
|
if (!this.attrs.colUrl) {
|
|
|
return this.$message.warning('未设置更多路径的url')
|
|
return this.$message.warning('未设置更多路径的url')
|
|
|
}
|
|
}
|
|
@@ -586,7 +760,7 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
},
|
|
},
|
|
|
formValidate(formName) {
|
|
formValidate(formName) {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
- this.$refs[formName].validate(() => { })
|
|
|
|
|
|
|
+ this.$refs[formName].validate(() => {})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
getFormData() {
|
|
getFormData() {
|
|
@@ -713,15 +887,19 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
if (item.ban_ci_bie_ming_) {
|
|
if (item.ban_ci_bie_ming_) {
|
|
|
let obj = {}
|
|
let obj = {}
|
|
|
obj.label = item.ban_ci_ming_ + '/' + item.ban_ci_bie_ming_
|
|
obj.label = item.ban_ci_ming_ + '/' + item.ban_ci_bie_ming_
|
|
|
- obj.type = 'info' //班次默认显示灰色
|
|
|
|
|
- if (item.da_ka_shi_jian_1_ && item.da_ka_shi_jian_2_) { //上下班时间都打卡了,班次显示绿色
|
|
|
|
|
|
|
+ obj.type = 'info' //班次默认显示灰色
|
|
|
|
|
+ if (item.da_ka_shi_jian_1_ && item.da_ka_shi_jian_2_) {
|
|
|
|
|
+ //上下班时间都打卡了,班次显示绿色
|
|
|
obj.type = 'success'
|
|
obj.type = 'success'
|
|
|
- } else if (item.da_ka_shi_jian_1_ || item.da_ka_shi_jian_2_) {//上下班时间打卡了其中一个,班次显示橙色
|
|
|
|
|
|
|
+ } else if (
|
|
|
|
|
+ item.da_ka_shi_jian_1_ ||
|
|
|
|
|
+ item.da_ka_shi_jian_2_
|
|
|
|
|
+ ) {
|
|
|
|
|
+ //上下班时间打卡了其中一个,班次显示橙色
|
|
|
obj.type = 'warning'
|
|
obj.type = 'warning'
|
|
|
}
|
|
}
|
|
|
todaySchedule.push(obj) // 加入今日班次
|
|
todaySchedule.push(obj) // 加入今日班次
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
})
|
|
})
|
|
|
resolve(todaySchedule)
|
|
resolve(todaySchedule)
|
|
|
})
|
|
})
|
|
@@ -782,7 +960,7 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
data.forEach((item) => {
|
|
data.forEach((item) => {
|
|
|
// 跳过“休息”班次,不显示在日历上
|
|
// 跳过“休息”班次,不显示在日历上
|
|
|
if (item.ban_ci_ming_ === '休息') return
|
|
if (item.ban_ci_ming_ === '休息') return
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 构建全天事件,每个班次显示为一个方块
|
|
// 构建全天事件,每个班次显示为一个方块
|
|
|
const event = {
|
|
const event = {
|
|
|
id: item.id_,
|
|
id: item.id_,
|
|
@@ -871,14 +1049,18 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
return d.type === 'allday'
|
|
return d.type === 'allday'
|
|
|
? '全天'
|
|
? '全天'
|
|
|
: `当天 ${d.startTime}` +
|
|
: `当天 ${d.startTime}` +
|
|
|
- ' 至 ' +
|
|
|
|
|
- `${d.isSecondDay === 'Y' ? '第二天' : '当天'} ${d.endTime}`
|
|
|
|
|
|
|
+ ' 至 ' +
|
|
|
|
|
+ `${
|
|
|
|
|
+ d.isSecondDay === 'Y' ? '第二天' : '当天'
|
|
|
|
|
+ } ${d.endTime}`
|
|
|
})
|
|
})
|
|
|
.join('\n'),
|
|
.join('\n'),
|
|
|
title: s,
|
|
title: s,
|
|
|
start: date,
|
|
start: date,
|
|
|
- end: t.dateRange[0].isSecondDay == 'Y' ? nextdate : date, //是否跨天班次,跨天班次要设置为结束日期的下一天,即开始日期的后天
|
|
|
|
|
- jieShuShiJian: t.dateRange[0].isSecondDay == 'Y' ? nextdate : date,
|
|
|
|
|
|
|
+ end:
|
|
|
|
|
+ t.dateRange[0].isSecondDay == 'Y' ? nextdate : date, //是否跨天班次,跨天班次要设置为结束日期的下一天,即开始日期的后天
|
|
|
|
|
+ jieShuShiJian:
|
|
|
|
|
+ t.dateRange[0].isSecondDay == 'Y' ? nextdate : date,
|
|
|
kaishishijian: date,
|
|
kaishishijian: date,
|
|
|
zhuangTai: '',
|
|
zhuangTai: '',
|
|
|
// id: i,
|
|
// id: i,
|
|
@@ -913,7 +1095,8 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
param.event._def.title
|
|
param.event._def.title
|
|
|
)
|
|
)
|
|
|
},
|
|
},
|
|
|
- showDaKaBtn(targetDay1, targetDay2) { //班次开始或结束时间有一个是今天就显示打卡按钮
|
|
|
|
|
|
|
+ showDaKaBtn(targetDay1, targetDay2) {
|
|
|
|
|
+ //班次开始或结束时间有一个是今天就显示打卡按钮
|
|
|
|
|
|
|
|
// 判断是否展示打卡按钮,当前日期则展示
|
|
// 判断是否展示打卡按钮,当前日期则展示
|
|
|
const today = this.$common.getDateNow()
|
|
const today = this.$common.getDateNow()
|
|
@@ -948,28 +1131,31 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
// 港大新首页打卡处理逻辑
|
|
// 港大新首页打卡处理逻辑
|
|
|
handleClockFromTabNew() {
|
|
handleClockFromTabNew() {
|
|
|
const { userInfo } = this.$store.getters || {}
|
|
const { userInfo } = this.$store.getters || {}
|
|
|
- const buMen = userInfo.mainPosition?.id || userInfo.positions[0]?.id || ''
|
|
|
|
|
|
|
+ const buMen =
|
|
|
|
|
+ userInfo.mainPosition?.id || userInfo.positions[0]?.id || ''
|
|
|
const params = {
|
|
const params = {
|
|
|
- "pageNo": 1,
|
|
|
|
|
- "limit": 50,
|
|
|
|
|
- "param": {
|
|
|
|
|
- "buMen": buMen,
|
|
|
|
|
- "shengXiaoBiaoZhi":"Y"
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ pageNo: 1,
|
|
|
|
|
+ limit: 50,
|
|
|
|
|
+ param: {
|
|
|
|
|
+ buMen: buMen,
|
|
|
|
|
+ shengXiaoBiaoZhi: 'Y'
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
//获取当前用户所在部门的班次信息
|
|
//获取当前用户所在部门的班次信息
|
|
|
queryScheduleConfigItem(params)
|
|
queryScheduleConfigItem(params)
|
|
|
- .then((res) => {
|
|
|
|
|
- const data = res.data.dataResult || []
|
|
|
|
|
- if (data.length > 0) {
|
|
|
|
|
- this.$emit('action-event', 'daka', data)
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.warning('您所在部门目前没有配置生效的班次,无法打卡')
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => {
|
|
|
|
|
- console.log('获取班次信息失败')
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ const data = res.data.dataResult || []
|
|
|
|
|
+ if (data.length > 0) {
|
|
|
|
|
+ this.$emit('action-event', 'daka', data)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.warning(
|
|
|
|
|
+ '您所在部门目前没有配置生效的班次,无法打卡'
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ console.log('获取班次信息失败')
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 首页打卡处理逻辑
|
|
// 首页打卡处理逻辑
|
|
@@ -980,7 +1166,11 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
this.$emit('dakaSingle', todaySchedule[0].label.split('/')[1])
|
|
this.$emit('dakaSingle', todaySchedule[0].label.split('/')[1])
|
|
|
return
|
|
return
|
|
|
} else {
|
|
} else {
|
|
|
- this.$emit('action-event', 'daka', todaySchedule.map(item => item.label.split('/')[1]))
|
|
|
|
|
|
|
+ this.$emit(
|
|
|
|
|
+ 'action-event',
|
|
|
|
|
+ 'daka',
|
|
|
|
|
+ todaySchedule.map((item) => item.label.split('/')[1])
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
/*
|
|
/*
|
|
@@ -1084,96 +1274,97 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
this.$emit('action-event', 'mySchedule', scheduleConfig)
|
|
this.$emit('action-event', 'mySchedule', scheduleConfig)
|
|
|
}*/
|
|
}*/
|
|
|
|
|
|
|
|
- async showMySchedule() {
|
|
|
|
|
- // 直接获取考勤事件数组,不再获取排班数据
|
|
|
|
|
- const events = await this.getAttendanceDataNew()
|
|
|
|
|
-
|
|
|
|
|
- const scheduleConfig = {
|
|
|
|
|
- height: '100%',
|
|
|
|
|
- locale: 'zh-cn',
|
|
|
|
|
- selectable: true,
|
|
|
|
|
- buttonText: {
|
|
|
|
|
- today: '今天',
|
|
|
|
|
- dayGridMonth: '月',
|
|
|
|
|
- listMonth: '',
|
|
|
|
|
- month: '月',
|
|
|
|
|
- week: '周视图',
|
|
|
|
|
- day: '日视图',
|
|
|
|
|
- list: '表'
|
|
|
|
|
- },
|
|
|
|
|
- headerToolbar: {
|
|
|
|
|
- right: 'prev,next today',
|
|
|
|
|
- left: '',
|
|
|
|
|
- center: 'title'
|
|
|
|
|
- },
|
|
|
|
|
- events: events,
|
|
|
|
|
- eventColor: '#ffffff',
|
|
|
|
|
- // 自定义事件渲染
|
|
|
|
|
- eventContent: (arg) => {
|
|
|
|
|
- const event = arg.event
|
|
|
|
|
- const ext = event.extendedProps
|
|
|
|
|
- const titleStr = `${ext.banCiMing}`
|
|
|
|
|
-
|
|
|
|
|
- const rawStart = ext.daKaShiJian1
|
|
|
|
|
- const rawEnd = ext.daKaShiJian2
|
|
|
|
|
-
|
|
|
|
|
- const startTimeText = rawStart ? rawStart.substring(11, 19) : '未打卡'
|
|
|
|
|
- const endTimeText = rawEnd ? rawEnd.substring(11, 19) : '未打卡'
|
|
|
|
|
-
|
|
|
|
|
- const hasStart = !!rawStart
|
|
|
|
|
- const hasEnd = !!rawEnd
|
|
|
|
|
|
|
+ async showMySchedule() {
|
|
|
|
|
+ // 直接获取考勤事件数组,不再获取排班数据
|
|
|
|
|
+ const events = await this.getAttendanceDataNew()
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- // 迟到判断(仅当有上班打卡时)
|
|
|
|
|
- let isLate = false
|
|
|
|
|
- if (hasStart && (ext.zhuangTai1 !== '正常')) {
|
|
|
|
|
- const startDateTime = new Date(rawStart)
|
|
|
|
|
- const banStart = new Date(ext.banCiKaiShi)
|
|
|
|
|
- isLate = startDateTime > banStart
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 早退判断(仅当有下班打卡时)
|
|
|
|
|
- let isEarlyLeave = false
|
|
|
|
|
- if (hasEnd && (ext.zhuangTai2 !== '正常')) {
|
|
|
|
|
- const endDateTime = new Date(rawEnd)
|
|
|
|
|
- const banEnd = new Date(ext.banCiJieShu)
|
|
|
|
|
- isEarlyLeave = endDateTime < banEnd
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 最终是否完全正常:有两次打卡 && 不迟到 && 不早退 && 两次打卡状态都为正常
|
|
|
|
|
- const isAllNormal = hasStart && hasEnd && !isLate && !isEarlyLeave && ext.zhuangTai1 == '正常' && ext.zhuangTai2 == '正常'
|
|
|
|
|
-
|
|
|
|
|
- // 小方块颜色与状态图标
|
|
|
|
|
- const dotColor = isAllNormal ? '#67C23A' : '#F56C6C'
|
|
|
|
|
- const statusIconHtml = isAllNormal
|
|
|
|
|
- ? '<i class="el-icon-check" style="color:#67C23A; font-size:14px;"></i>'
|
|
|
|
|
- : '<i class="el-icon-warning-outline" style="color:#F56C6C; font-size:14px;"></i>'
|
|
|
|
|
-
|
|
|
|
|
- // 上班打卡显示
|
|
|
|
|
- let startDisplay = startTimeText
|
|
|
|
|
- let startColorStyle = ''
|
|
|
|
|
- if (!hasStart) {
|
|
|
|
|
- startColorStyle = 'style="color:#F56C6C; font-weight:500;"'
|
|
|
|
|
- } else if (isLate) {
|
|
|
|
|
- startDisplay = startTimeText + ' (迟到)'
|
|
|
|
|
- startColorStyle = 'style="color:#F56C6C; font-weight:500;"'
|
|
|
|
|
- }
|
|
|
|
|
- const startTimeHtml = `<span ${startColorStyle}>${startDisplay}</span>`
|
|
|
|
|
-
|
|
|
|
|
- // 下班打卡显示
|
|
|
|
|
- let endDisplay = endTimeText
|
|
|
|
|
- let endColorStyle = ''
|
|
|
|
|
- if (!hasEnd) {
|
|
|
|
|
- endColorStyle = 'style="color:#F56C6C; font-weight:500;"'
|
|
|
|
|
- } else if (isEarlyLeave) {
|
|
|
|
|
- endDisplay = endTimeText + ' (早退)'
|
|
|
|
|
- endColorStyle = 'style="color:#F56C6C; font-weight:500;"'
|
|
|
|
|
- }
|
|
|
|
|
- const endTimeHtml = `<span ${endColorStyle}>${endDisplay}</span>`
|
|
|
|
|
-
|
|
|
|
|
- const fragment = document.createDocumentFragment()
|
|
|
|
|
- const content = document.createElement('div')
|
|
|
|
|
- content.innerHTML = `
|
|
|
|
|
|
|
+ const scheduleConfig = {
|
|
|
|
|
+ height: '100%',
|
|
|
|
|
+ locale: 'zh-cn',
|
|
|
|
|
+ selectable: true,
|
|
|
|
|
+ buttonText: {
|
|
|
|
|
+ today: '今天',
|
|
|
|
|
+ dayGridMonth: '月',
|
|
|
|
|
+ listMonth: '',
|
|
|
|
|
+ month: '月',
|
|
|
|
|
+ week: '周视图',
|
|
|
|
|
+ day: '日视图',
|
|
|
|
|
+ list: '表'
|
|
|
|
|
+ },
|
|
|
|
|
+ headerToolbar: {
|
|
|
|
|
+ right: 'prev,next today',
|
|
|
|
|
+ left: '',
|
|
|
|
|
+ center: 'title'
|
|
|
|
|
+ },
|
|
|
|
|
+ events: events,
|
|
|
|
|
+ eventColor: '#ffffff',
|
|
|
|
|
+ // 自定义事件渲染
|
|
|
|
|
+ eventContent: (arg) => {
|
|
|
|
|
+ const event = arg.event
|
|
|
|
|
+ const ext = event.extendedProps
|
|
|
|
|
+ const titleStr = `${ext.banCiMing}`
|
|
|
|
|
+
|
|
|
|
|
+ const rawStart = ext.daKaShiJian1
|
|
|
|
|
+ const rawEnd = ext.daKaShiJian2
|
|
|
|
|
+
|
|
|
|
|
+ const startTimeText = rawStart
|
|
|
|
|
+ ? rawStart.substring(11, 19)
|
|
|
|
|
+ : '未打卡'
|
|
|
|
|
+ const endTimeText = rawEnd ? rawEnd.substring(11, 19) : '未打卡'
|
|
|
|
|
+
|
|
|
|
|
+ const hasStart = !!rawStart
|
|
|
|
|
+ const hasEnd = !!rawEnd
|
|
|
|
|
+
|
|
|
|
|
+ // 迟到判断(仅当有上班打卡时)
|
|
|
|
|
+ let isLate = false
|
|
|
|
|
+ if (hasStart) {
|
|
|
|
|
+ const startDateTime = new Date(rawStart)
|
|
|
|
|
+ const banStart = new Date(ext.banCiKaiShi)
|
|
|
|
|
+ isLate = startDateTime > banStart
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 早退判断(仅当有下班打卡时)
|
|
|
|
|
+ let isEarlyLeave = false
|
|
|
|
|
+ if (hasEnd) {
|
|
|
|
|
+ const endDateTime = new Date(rawEnd)
|
|
|
|
|
+ const banEnd = new Date(ext.banCiJieShu)
|
|
|
|
|
+ isEarlyLeave = endDateTime < banEnd
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 最终是否完全正常:有两次打卡 && 不迟到 && 不早退
|
|
|
|
|
+ const isAllNormal = hasStart && hasEnd && !isLate && !isEarlyLeave
|
|
|
|
|
+
|
|
|
|
|
+ // 小方块颜色与状态图标
|
|
|
|
|
+ const dotColor = isAllNormal ? '#67C23A' : '#F56C6C'
|
|
|
|
|
+ const statusIconHtml = isAllNormal
|
|
|
|
|
+ ? '<i class="el-icon-check" style="color:#67C23A; font-size:14px;"></i>'
|
|
|
|
|
+ : '<i class="el-icon-warning-outline" style="color:#F56C6C; font-size:14px;"></i>'
|
|
|
|
|
+
|
|
|
|
|
+ // 上班打卡显示
|
|
|
|
|
+ let startDisplay = startTimeText
|
|
|
|
|
+ let startColorStyle = ''
|
|
|
|
|
+ if (!hasStart) {
|
|
|
|
|
+ startColorStyle = 'style="color:#F56C6C; font-weight:500;"'
|
|
|
|
|
+ } else if (isLate) {
|
|
|
|
|
+ startDisplay = startTimeText + ' (迟到)'
|
|
|
|
|
+ startColorStyle = 'style="color:#F56C6C; font-weight:500;"'
|
|
|
|
|
+ }
|
|
|
|
|
+ const startTimeHtml = `<span ${startColorStyle}>${startDisplay}</span>`
|
|
|
|
|
+
|
|
|
|
|
+ // 下班打卡显示
|
|
|
|
|
+ let endDisplay = endTimeText
|
|
|
|
|
+ let endColorStyle = ''
|
|
|
|
|
+ if (!hasEnd) {
|
|
|
|
|
+ endColorStyle = 'style="color:#F56C6C; font-weight:500;"'
|
|
|
|
|
+ } else if (isEarlyLeave) {
|
|
|
|
|
+ endDisplay = endTimeText + ' (早退)'
|
|
|
|
|
+ endColorStyle = 'style="color:#F56C6C; font-weight:500;"'
|
|
|
|
|
+ }
|
|
|
|
|
+ const endTimeHtml = `<span ${endColorStyle}>${endDisplay}</span>`
|
|
|
|
|
+
|
|
|
|
|
+ const fragment = document.createDocumentFragment()
|
|
|
|
|
+ const content = document.createElement('div')
|
|
|
|
|
+ content.innerHTML = `
|
|
|
<div class="event-header" style="display:flex; justify-content:space-between; align-items:center;">
|
|
<div class="event-header" style="display:flex; justify-content:space-between; align-items:center;">
|
|
|
<div>
|
|
<div>
|
|
|
<div style="background:${dotColor}; height:10px; width:10px; display:inline-block; border-radius:2px;"></div>
|
|
<div style="background:${dotColor}; height:10px; width:10px; display:inline-block; border-radius:2px;"></div>
|
|
@@ -1186,12 +1377,12 @@ export function buildComponent(name, column, preview, vm) {
|
|
|
<div>下班打卡时间:${endTimeHtml}</div>
|
|
<div>下班打卡时间:${endTimeHtml}</div>
|
|
|
</div>
|
|
</div>
|
|
|
`
|
|
`
|
|
|
- fragment.appendChild(content)
|
|
|
|
|
- return { domNodes: [fragment] }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ fragment.appendChild(content)
|
|
|
|
|
+ return { domNodes: [fragment] }
|
|
|
}
|
|
}
|
|
|
- this.$emit('action-event', 'mySchedule', scheduleConfig)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ this.$emit('action-event', 'mySchedule', scheduleConfig)
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
template:
|
|
template:
|
|
|
column.templateHtml !== '' ? `${column.templateHtml}` : `<div></div>`
|
|
column.templateHtml !== '' ? `${column.templateHtml}` : `<div></div>`
|