|
|
@@ -18,7 +18,7 @@
|
|
|
<div class="operate">
|
|
|
<template v-for="btn in toolbars">
|
|
|
<el-button
|
|
|
- v-if="!btn.steps || btn.steps.includes(activeStep)"
|
|
|
+ v-if="btn.show && (!btn.steps || btn.steps.includes(activeStep)) "
|
|
|
:key="btn.key"
|
|
|
:type="btn.type"
|
|
|
:icon="btn.icon"
|
|
|
@@ -67,6 +67,7 @@
|
|
|
</template>
|
|
|
<el-date-picker
|
|
|
v-model="formData.dateRange"
|
|
|
+ :disabled="readonly"
|
|
|
type="daterange"
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始日期"
|
|
|
@@ -197,7 +198,7 @@
|
|
|
:ref="`day${dIndex}`"
|
|
|
:key="dIndex"
|
|
|
class="date"
|
|
|
- @click="showShiftSetting($event, date)"
|
|
|
+ @click="!readonly && showShiftSetting($event, date)"
|
|
|
>{{ date.split('-')[2] }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -298,9 +299,9 @@
|
|
|
ref="shiftItem"
|
|
|
class="shift-item"
|
|
|
:style="{ display: viewType === 'users' ? 'grid' : 'flex', height:viewType === 'users' ? '59px' : '129px'}"
|
|
|
- @mouseenter="hoveredIndex = `${row.value}-${cIndex}`"
|
|
|
- @mouseleave="hoveredIndex = null"
|
|
|
- @click.prevent="handleShiftClick($event, {row, rIndex, column, cIndex})"
|
|
|
+ @mouseenter=" hoveredIndex = !readonly && `${row.value}-${cIndex}`"
|
|
|
+ @mouseleave=" hoveredIndex = !readonly && null"
|
|
|
+ @click.prevent="!readonly && handleShiftClick($event, {row, rIndex, column, cIndex})"
|
|
|
>
|
|
|
<div
|
|
|
v-for="(shift, sIndex) in scheduleData[row.value][cIndex]"
|
|
|
@@ -416,17 +417,17 @@ export default {
|
|
|
configOptions: [],
|
|
|
maxHeight: '250px',
|
|
|
toolbars: [
|
|
|
- { key: 'prev', icon: 'el-icon-d-arrow-left', label: '上一步', type: 'primary', steps: '2,3' },
|
|
|
- { key: 'next', icon: 'el-icon-d-arrow-right', label: '下一步', type: 'primary', steps: '1,2' },
|
|
|
- { key: 'changeView', icon: 'el-icon-set-up', label: '切换视图', type: 'primary', steps: '2' },
|
|
|
+ { key: 'prev', icon: 'el-icon-d-arrow-left', label: '上一步', type: 'primary', steps: '2,3', show: true },
|
|
|
+ { key: 'next', icon: 'el-icon-d-arrow-right', label: '下一步', type: 'primary', steps: '1,2', show: true },
|
|
|
+ { key: 'changeView', icon: 'el-icon-set-up', label: '切换视图', type: 'primary', steps: '2', show: true },
|
|
|
// { key: 'history', icon: 'el-icon-time', label: '排班历史', type: 'info', steps: '2,3' },
|
|
|
- { key: 'record', icon: 'el-icon-tickets', label: '修改记录', type: 'warning', steps: '2,3' },
|
|
|
- { key: 'export', icon: 'el-icon-download', label: '导出', type: 'primary', steps: '2,3' },
|
|
|
- { key: 'reset', icon: 'el-icon-refresh', label: '重置', type: 'warning', steps: '2' },
|
|
|
+ { key: 'record', icon: 'el-icon-tickets', label: '修改记录', type: 'warning', steps: '2,3', show: readonly },
|
|
|
+ { key: 'export', icon: 'el-icon-download', label: '导出', type: 'primary', steps: '2,3', show: true },
|
|
|
+ { key: 'reset', icon: 'el-icon-refresh', label: '重置', type: 'warning', steps: '2', show: readonly },
|
|
|
// { key: 'edit', icon: 'el-icon-edit', label: '编辑', type: 'primary', steps: '2,3' },
|
|
|
- { key: 'save', icon: 'ibps-icon-save', label: '保存', type: 'primary' },
|
|
|
- { key: 'submit', icon: 'ibps-icon-send', label: '提交', type: 'success', steps: '3' },
|
|
|
- { key: 'cancel', icon: 'el-icon-close', label: '关闭', type: 'danger' }
|
|
|
+ { key: 'save', icon: 'ibps-icon-save', label: '保存', type: 'primary', show: readonly },
|
|
|
+ { key: 'submit', icon: 'ibps-icon-send', label: '提交', type: 'success', steps: '3', show: readonly },
|
|
|
+ { key: 'cancel', icon: 'el-icon-close', label: '关闭', type: 'danger', show: true }
|
|
|
],
|
|
|
viewType: 'users',
|
|
|
scheduleData: {},
|