From bdae86f6649a06f3de850e8e306d7ce4698ecf95 Mon Sep 17 00:00:00 2001
From: "1378012178@qq.com" <1378012178@qq.com>
Date: Tue, 11 Nov 2025 08:36:20 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8C=87=E4=BB=A4=E5=8C=85?=
=?UTF-8?q?=EF=BC=9A=201=E3=80=81=E5=8F=AA=E8=83=BD=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E6=97=A5=E5=B8=B8=E3=80=81=E5=91=A8=E6=9C=9F=E7=B1=BB=E5=9E=8B?=
=?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8C=87=E4=BB=A4=202=E3=80=81=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E5=91=A8=E6=9C=9F=E7=B1=BB=E5=9E=8B=E6=9C=8D=E5=8A=A1?=
=?UTF-8?q?=E6=8C=87=E4=BB=A4=E6=97=B6=E5=BF=85=E9=A1=BB=E9=80=89=E6=8B=A9?=
=?UTF-8?q?=E5=91=A8=E5=87=A0=E6=88=96=E6=AF=8F=E6=9C=88=E5=87=A0=E5=8F=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/ConfigServiceDirectiveList.vue | 146 +++++++++++++++++-
1 file changed, 138 insertions(+), 8 deletions(-)
diff --git a/src/views/services/directivePackage/components/ConfigServiceDirectiveList.vue b/src/views/services/directivePackage/components/ConfigServiceDirectiveList.vue
index ec86012..f998419 100644
--- a/src/views/services/directivePackage/components/ConfigServiceDirectiveList.vue
+++ b/src/views/services/directivePackage/components/ConfigServiceDirectiveList.vue
@@ -10,8 +10,7 @@
分类标签
+ placeholder="请选择分类标签" allowClear :ignoreDisabled="true" @change="onInstructionTagChange" />
@@ -20,8 +19,7 @@
服务类别
+ placeholder="请选择服务类别" allowClear :ignoreDisabled="true" @change="onCategoryChange" />
@@ -44,7 +42,8 @@
查询
- 重置
+ 重置
@@ -104,6 +103,66 @@
+
+
+
+
+ 每周
+ 每月
+
+
+
+
+
+ 周一
+ 周二
+ 周三
+ 周四
+ 周五
+ 周六
+ 周日
+
+
+
+
+
+
+ 01
+ 02
+ 03
+ 04
+ 05
+ 06
+ 07
+ 08
+ 09
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+
+
+
+
+
@@ -128,6 +187,10 @@ const queryParam = reactive({});
const registerModal = ref();
const directiveInfo = ref({});
const checkListData = ref([]);
+const isModalVisible = ref(false); // 控制弹窗的显示与否
+const cycleType = ref('week'); // 周期类型:week 或 month
+const selectedDays = ref([]); // 存储选择的周几
+const selectedDaysInMonth = ref(null); // 选择的日期(每月)
// 接收已选择的指令列表
const props = defineProps({
@@ -170,6 +233,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
beforeFetch: async (params) => {
params.column = 'createTime';
params.order = 'desc';
+ params.cycleType = '1,2'
let rangerQuery = await setRangeQuery();
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) {
- console.log("🚀 ~ handleSelect ~ record:", record)
- checkListData.value.push(record);
- emit('checkDirective', checkListData.value);
+ if (record.cycleType == 2) {
+ isModalVisible.value = true;
+ // 将选中的指令记录传入弹窗内
+ 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) {
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;
+}
\ No newline at end of file