parent
5edd47c1c9
commit
bdae86f664
|
|
@ -10,8 +10,7 @@
|
||||||
<template #label><span title="分类标签">分类标签</span></template>
|
<template #label><span title="分类标签">分类标签</span></template>
|
||||||
<j-dict-select-tag v-model:value="queryParam.instructionTagId"
|
<j-dict-select-tag v-model:value="queryParam.instructionTagId"
|
||||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
|
||||||
placeholder="请选择分类标签" allowClear :ignoreDisabled="true"
|
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" @change="onInstructionTagChange" />
|
||||||
@change="onInstructionTagChange" />
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
|
|
@ -20,8 +19,7 @@
|
||||||
<template #label><span title="服务类别">服务类别</span></template>
|
<template #label><span title="服务类别">服务类别</span></template>
|
||||||
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId"
|
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId"
|
||||||
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 and iz_enabled = 0 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
|
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 and iz_enabled = 0 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
|
||||||
placeholder="请选择服务类别" allowClear :ignoreDisabled="true"
|
placeholder="请选择服务类别" allowClear :ignoreDisabled="true" @change="onCategoryChange" />
|
||||||
@change="onCategoryChange" />
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
|
|
@ -44,7 +42,8 @@
|
||||||
<a-col :xl="4" :lg="7" :md="8" :sm="24">
|
<a-col :xl="4" :lg="7" :md="8" :sm="24">
|
||||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||||
|
style="margin-left: 8px">重置</a-button>
|
||||||
</span>
|
</span>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
@ -104,6 +103,66 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
|
<!-- 弹窗:选择周几或每月几号 -->
|
||||||
|
<a-modal v-model:visible="isModalVisible" title="选择周期" @ok="onConfirm" @cancel="onCancel" width="600px">
|
||||||
|
<div class="modal-content">
|
||||||
|
<a-radio-group v-model:value="cycleType">
|
||||||
|
<a-radio value="week">每周</a-radio>
|
||||||
|
<a-radio value="month">每月</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
|
||||||
|
<!-- 周期选择:每周 -->
|
||||||
|
<div v-if="cycleType === 'week'" class="week-selection">
|
||||||
|
<a-radio-group v-model:value="selectedDays">
|
||||||
|
<a-radio value="0">周一</a-radio>
|
||||||
|
<a-radio value="1">周二</a-radio>
|
||||||
|
<a-radio value="2">周三</a-radio>
|
||||||
|
<a-radio value="3">周四</a-radio>
|
||||||
|
<a-radio value="4">周五</a-radio>
|
||||||
|
<a-radio value="5">周六</a-radio>
|
||||||
|
<a-radio value="6">周日</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 周期选择:每月 -->
|
||||||
|
<div v-if="cycleType === 'month'" class="month-selection">
|
||||||
|
<a-radio-group v-model:value="selectedDaysInMonth">
|
||||||
|
<a-radio value="01">01</a-radio>
|
||||||
|
<a-radio value="02">02</a-radio>
|
||||||
|
<a-radio value="03">03</a-radio>
|
||||||
|
<a-radio value="04">04</a-radio>
|
||||||
|
<a-radio value="05">05</a-radio>
|
||||||
|
<a-radio value="06">06</a-radio>
|
||||||
|
<a-radio value="07">07</a-radio>
|
||||||
|
<a-radio value="08">08</a-radio>
|
||||||
|
<a-radio value="09">09</a-radio>
|
||||||
|
<a-radio value="10">10</a-radio>
|
||||||
|
<a-radio value="11">11</a-radio>
|
||||||
|
<a-radio value="12">12</a-radio>
|
||||||
|
<a-radio value="13">13</a-radio>
|
||||||
|
<a-radio value="14">14</a-radio>
|
||||||
|
<a-radio value="15">15</a-radio>
|
||||||
|
<a-radio value="16">16</a-radio>
|
||||||
|
<a-radio value="17">17</a-radio>
|
||||||
|
<a-radio value="18">18</a-radio>
|
||||||
|
<a-radio value="19">19</a-radio>
|
||||||
|
<a-radio value="20">20</a-radio>
|
||||||
|
<a-radio value="21">21</a-radio>
|
||||||
|
<a-radio value="22">22</a-radio>
|
||||||
|
<a-radio value="23">23</a-radio>
|
||||||
|
<a-radio value="24">24</a-radio>
|
||||||
|
<a-radio value="25">25</a-radio>
|
||||||
|
<a-radio value="26">26</a-radio>
|
||||||
|
<a-radio value="27">27</a-radio>
|
||||||
|
<a-radio value="28">28</a-radio>
|
||||||
|
<a-radio value="29">29</a-radio>
|
||||||
|
<a-radio value="30">30</a-radio>
|
||||||
|
<a-radio value="31">31</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a-modal>
|
||||||
|
|
||||||
<!-- 表单弹窗 -->
|
<!-- 表单弹窗 -->
|
||||||
<ConfigServiceDirectiveModal ref="registerModal" @success="handleSuccess" />
|
<ConfigServiceDirectiveModal ref="registerModal" @success="handleSuccess" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -128,6 +187,10 @@ const queryParam = reactive<any>({});
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
const directiveInfo = ref<any>({});
|
const directiveInfo = ref<any>({});
|
||||||
const checkListData = ref<any>([]);
|
const checkListData = ref<any>([]);
|
||||||
|
const isModalVisible = ref(false); // 控制弹窗的显示与否
|
||||||
|
const cycleType = ref('week'); // 周期类型:week 或 month
|
||||||
|
const selectedDays = ref<number[]>([]); // 存储选择的周几
|
||||||
|
const selectedDaysInMonth = ref<number | null>(null); // 选择的日期(每月)
|
||||||
|
|
||||||
// 接收已选择的指令列表
|
// 接收已选择的指令列表
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -170,6 +233,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
beforeFetch: async (params) => {
|
beforeFetch: async (params) => {
|
||||||
params.column = 'createTime';
|
params.column = 'createTime';
|
||||||
params.order = 'desc';
|
params.order = 'desc';
|
||||||
|
params.cycleType = '1,2'
|
||||||
let rangerQuery = await setRangeQuery();
|
let rangerQuery = await setRangeQuery();
|
||||||
return Object.assign(params, rangerQuery);
|
return Object.assign(params, rangerQuery);
|
||||||
},
|
},
|
||||||
|
|
@ -188,10 +252,53 @@ function handleSuccess() {
|
||||||
/**
|
/**
|
||||||
* 选择指令
|
* 选择指令
|
||||||
*/
|
*/
|
||||||
|
// function handleCheck(record) {
|
||||||
|
// console.log("🚀 ~ handleSelect ~ record:", record)
|
||||||
|
// checkListData.value.push(record);
|
||||||
|
// emit('checkDirective', checkListData.value);
|
||||||
|
// }
|
||||||
function handleCheck(record) {
|
function handleCheck(record) {
|
||||||
console.log("🚀 ~ handleSelect ~ record:", record)
|
if (record.cycleType == 2) {
|
||||||
checkListData.value.push(record);
|
isModalVisible.value = true;
|
||||||
emit('checkDirective', checkListData.value);
|
// 将选中的指令记录传入弹窗内
|
||||||
|
directiveInfo.value = record;
|
||||||
|
} else {
|
||||||
|
checkListData.value.push(record);
|
||||||
|
emit('checkDirective', checkListData.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点击确认
|
||||||
|
function onConfirm() {
|
||||||
|
if (cycleType.value === 'week' && selectedDays.value.length === 0) {
|
||||||
|
alert('请至少选择一个星期几');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (cycleType.value === 'month' && (!selectedDaysInMonth.value || selectedDaysInMonth.value.length === 0)) {
|
||||||
|
alert('请至少选择一个日期');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理选择的周期
|
||||||
|
let content_ = [{
|
||||||
|
...directiveInfo.value
|
||||||
|
}]
|
||||||
|
if (cycleType.value === 'week') {
|
||||||
|
content_[0].cycleTypeShow = '每周'
|
||||||
|
content_[0].cycleTypeValue = selectedDays.value[0]
|
||||||
|
}
|
||||||
|
if (cycleType.value === 'month') {
|
||||||
|
content_[0].cycleTypeShow = '每月'
|
||||||
|
content_[0].cycleTypeValue = selectedDaysInMonth.value
|
||||||
|
}
|
||||||
|
checkListData.value.push(content_[0]);
|
||||||
|
isModalVisible.value = false; // 关闭弹窗
|
||||||
|
emit('checkDirective', checkListData.value); // 更新父组件数据
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点击取消
|
||||||
|
function onCancel() {
|
||||||
|
isModalVisible.value = false; // 关闭弹窗
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -329,4 +436,27 @@ audio::-webkit-media-controls-time-remaining-display {
|
||||||
:deep(.ant-table-title) {
|
:deep(.ant-table-title) {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal-content {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.week-selection,
|
||||||
|
.month-selection {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a-radio-group {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a-checkbox-group {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a-checkbox {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Loading…
Reference in New Issue