|
@@ -17,6 +17,23 @@
|
|
|
<el-checkbox label="workday">显示调休上班</el-checkbox>
|
|
<el-checkbox label="workday">显示调休上班</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 单个设置按钮 -->
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ plain
|
|
|
|
|
+ @click="openSingleForm('create')"
|
|
|
|
|
+ >
|
|
|
|
|
+ <Icon icon="ep:plus" class="mr-5px" /> 设置节假日
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 批量设置按钮 -->
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ plain
|
|
|
|
|
+ @click="openBatchForm('create')"
|
|
|
|
|
+ >
|
|
|
|
|
+ <Icon icon="ep:plus" class="mr-5px" /> 批量设置节假日
|
|
|
|
|
+ </el-button>
|
|
|
</ContentWrap>
|
|
</ContentWrap>
|
|
|
|
|
|
|
|
<div class="calendar-wrapper">
|
|
<div class="calendar-wrapper">
|
|
@@ -50,19 +67,40 @@
|
|
|
</el-calendar>
|
|
</el-calendar>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 引入子表单组件 -->
|
|
|
|
|
+ <SingleHolidayForm ref="singleFormRef" @success="refresh" />
|
|
|
|
|
+ <BatchHolidayForm ref="batchFormRef" @success="refresh" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { ref, computed, onMounted, watch } from 'vue';
|
|
import { ref, computed, onMounted, watch } from 'vue';
|
|
|
import axios from 'axios';
|
|
import axios from 'axios';
|
|
|
-
|
|
|
|
|
|
|
+// 引入子组件
|
|
|
|
|
+import SingleHolidayForm from './SingleHolidayForm.vue'
|
|
|
|
|
+import BatchHolidayForm from './BatchHolidayForm.vue'
|
|
|
// 当前年
|
|
// 当前年
|
|
|
const currentYear = new Date().getFullYear();
|
|
const currentYear = new Date().getFullYear();
|
|
|
const selectedYear = ref(currentYear);
|
|
const selectedYear = ref(currentYear);
|
|
|
const selectedDate = ref(new Date());
|
|
const selectedDate = ref(new Date());
|
|
|
const holidayData = ref({});
|
|
const holidayData = ref({});
|
|
|
const showOptions = ref(['weekend', 'legal', 'holiday', 'workday']);
|
|
const showOptions = ref(['weekend', 'legal', 'holiday', 'workday']);
|
|
|
|
|
+// ref
|
|
|
|
|
+const singleFormRef = ref()
|
|
|
|
|
+const batchFormRef = ref()
|
|
|
|
|
+
|
|
|
|
|
+// 打开
|
|
|
|
|
+const openSingleForm = (type) => {
|
|
|
|
|
+ singleFormRef.value.open(type)
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
+const openBatchForm = (type) => {
|
|
|
|
|
+ batchFormRef.value.open(type)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 成功回调
|
|
|
|
|
+const refresh = () => {
|
|
|
|
|
+ console.log('重新拉列表或做后续操作')
|
|
|
|
|
+}
|
|
|
// 年份选项
|
|
// 年份选项
|
|
|
const yearOptions = computed(() => {
|
|
const yearOptions = computed(() => {
|
|
|
const years = [];
|
|
const years = [];
|