From 6077d9a15747a3939f6435b091a7a3b973f58d72 Mon Sep 17 00:00:00 2001 From: "1378012178@qq.com" <1378012178@qq.com> Date: Tue, 20 Jan 2026 15:37:10 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=9C=8D=E5=8A=A1=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E5=8C=85=EF=BC=9A1=EF=BC=89=E6=96=B0=E5=A2=9E=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E6=A0=87=E7=AD=BE=EF=BC=8C=E8=B0=83=E6=95=B4=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=81=E7=BC=96=E8=BE=91=E7=95=8C=E9=9D=A2=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E6=A0=87=E7=AD=BE=E7=9A=84=E9=80=89=E6=8B=A9=E4=B8=8E?= =?UTF-8?q?=E5=9B=9E=E6=98=BE=EF=BC=9B2=EF=BC=89=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E8=BF=87=E6=9C=8D=E5=8A=A1=E6=8C=87=E4=BB=A4=E5=90=8E=E4=B8=8D?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=86=8D=E6=9B=B4=E6=94=B9=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=EF=BC=9B3=EF=BC=89=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8C=87=E4=BB=A4=E5=8C=85=E3=80=81=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=9C=8D=E5=8A=A1=E6=8C=87=E4=BB=A4=E5=8F=AA=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=AF=B9=E5=BA=94=E5=88=86=E7=B1=BB=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=9A=84=E5=86=85=E5=AE=B9=EF=BC=9B=202?= =?UTF-8?q?=E3=80=81=E6=9C=8D=E5=8A=A1=E6=8C=87=E4=BB=A4=E5=8C=85=E7=9A=84?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=80=BB=E6=97=B6=E9=95=BF=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E4=BF=9D=E5=AD=980=203=E3=80=81=E6=9C=8D=E5=8A=A1=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E7=9A=84=E6=9C=8D=E5=8A=A1=E6=97=B6=E9=95=BF=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E4=BF=9D=E5=AD=980?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../directivePackage/DirectivePackageList.vue | 22 ++++- .../components/ConfigServiceDirectiveList.vue | 14 +-- .../components/DirectivePackageForm.vue | 85 +++++-------------- .../components/DirectivePackageModal.vue | 17 +++- .../components/PackageList.vue | 5 +- .../components/ConfigServiceDirectiveForm.vue | 6 +- 6 files changed, 70 insertions(+), 79 deletions(-) diff --git a/src/views/services/directivePackage/DirectivePackageList.vue b/src/views/services/directivePackage/DirectivePackageList.vue index a93bfac..a90a206 100644 --- a/src/views/services/directivePackage/DirectivePackageList.vue +++ b/src/views/services/directivePackage/DirectivePackageList.vue @@ -34,7 +34,10 @@ - {{ directive.packageName }} + + {{ directive.packageName }} + {{ directive.instructionTagId_dictText }} + @@ -288,4 +291,21 @@ onMounted(() => { overflow: hidden; text-overflow: ellipsis; } + +.directive-container { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; +} + +.package-name { + /* 可选的样式 */ + font-weight: 500; +} + +.dict-text { + /* 可选的样式 */ + color: #666; +} diff --git a/src/views/services/directivePackage/components/ConfigServiceDirectiveList.vue b/src/views/services/directivePackage/components/ConfigServiceDirectiveList.vue index de1b349..0f238ff 100644 --- a/src/views/services/directivePackage/components/ConfigServiceDirectiveList.vue +++ b/src/views/services/directivePackage/components/ConfigServiceDirectiveList.vue @@ -8,9 +8,9 @@ 分类标签 - + placeholder="请选择分类标签" allowClear :ignoreDisabled="true" @change="onInstructionTagChange" disabled /> @@ -197,7 +197,8 @@ const props = defineProps({ directiveList: { type: Array, default: () => [] - } + }, + instructionTagId:'', }); // 判断是否已被选中(用于高亮) @@ -335,8 +336,7 @@ function searchQuery() { } function searchReset() { - formRef.value.resetFields(); - queryParam.instructionTagId = undefined; + queryParam.directiveName = undefined; queryParam.categoryId = undefined; queryParam.typeId = undefined; selectedRowKeys.value = []; @@ -396,9 +396,9 @@ function handleTags(prefix, tagList, suffix) { * 编辑方法(供父组件调用) */ function edit(record) { + queryParam.instructionTagId = props.instructionTagId checkListData.value = props.directiveList; - // directiveInfo.value = record; - // queryParam.instructionTagId = record.instructionTagId; + reload() } defineExpose({ edit }); diff --git a/src/views/services/directivePackage/components/DirectivePackageForm.vue b/src/views/services/directivePackage/components/DirectivePackageForm.vue index cf39769..d901cb6 100644 --- a/src/views/services/directivePackage/components/DirectivePackageForm.vue +++ b/src/views/services/directivePackage/components/DirectivePackageForm.vue @@ -5,66 +5,6 @@ - - @@ -78,7 +18,7 @@ - @@ -93,6 +33,16 @@ + + + + + @@ -103,7 +53,7 @@ - @@ -130,8 +80,13 @@ import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue' const props = defineProps({ formDisabled: { type: Boolean, default: false }, formData: { type: Object, default: () => ({}) }, - formBpm: { type: Boolean, default: true } + formBpm: { type: Boolean, default: true }, + seletedRecord: null, }); +setInterval(() => { + console.log("🌊 ~ props:", props) +}, 2000); + const formRef = ref(); const useForm = Form.useForm; const emit = defineEmits(['register', 'ok']); @@ -156,9 +111,10 @@ const confirmLoading = ref(false); //表单验证 const validatorRules = reactive({ packageName: [{ required: true, message: '请输入服务指令包名称!' },], + instructionTagId: [{ required: true, message: '请选择分类标签!' },], totalDuration: [{ required: true, message: '请输入服务总时长(分钟)!' }, { validator: (_, value) => { - if (value <= 0) { + if (value < 0) { return Promise.reject('请输入服务总时长!'); } return Promise.resolve(); @@ -313,6 +269,7 @@ defineExpose({ add, edit, submitForm, + formData, }); diff --git a/src/views/services/directivePackage/components/DirectivePackageModal.vue b/src/views/services/directivePackage/components/DirectivePackageModal.vue index 4183a10..24b554b 100644 --- a/src/views/services/directivePackage/components/DirectivePackageModal.vue +++ b/src/views/services/directivePackage/components/DirectivePackageModal.vue @@ -6,7 +6,7 @@ :footer-style="{ textAlign: 'right' }" @close="handleCancel" :bodyStyle="{ padding: '14px' }"> - + @@ -75,7 +75,7 @@ + :instructionTagId="registerForm.formData.instructionTagId" @checkDirective="checkDirective"> 关闭 @@ -86,7 +86,8 @@ - + + 关闭 确定 @@ -108,6 +109,8 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'; import PackageList from './PackageList.vue' import { filterDictTextByCache } from '/@/utils/dict/JDictSelectUtil'; import { useMessage } from '/@/hooks/web/useMessage'; +import { CodeSandboxOutlined } from '@ant-design/icons-vue'; +import InstructionTag from '../../instructiontag/InstructionTag.vue'; const title = ref(''); const visible = ref(false); @@ -213,6 +216,10 @@ function handleCancel() { * 新增/编辑服务指令 */ const handleAddDirectives = () => { + if (!registerForm.value.formData.instructionTagId) { + createMessage.warning('请先选择分类标签') + return + } directiveEditDrawer.value = true; nextTick(() => { configServiceDirectiveListRef.value.edit(seletedRecord.value); @@ -282,6 +289,10 @@ function checkDirective(directive_) { * 引用 */ function handleQuoteDirectives() { + if (!registerForm.value.formData.instructionTagId) { + createMessage.warning('请先选择分类标签') + return + } directiveQuoteDrawer.value = true } diff --git a/src/views/services/directivePackage/components/PackageList.vue b/src/views/services/directivePackage/components/PackageList.vue index cbb73a5..d9660c9 100644 --- a/src/views/services/directivePackage/components/PackageList.vue +++ b/src/views/services/directivePackage/components/PackageList.vue @@ -88,6 +88,9 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils'; import { filterDictTextByCache } from '/@/utils/dict/JDictSelectUtil'; import dayjs from "dayjs"; +const props = defineProps({ + instructionTagId:'', +}); const selectedDirective = ref({ id: '' }) const registerModal = ref(); const searchForm = ref({}) @@ -147,7 +150,7 @@ function handleSuccess() { */ function queryList(params) { resetSeletedDirectiveInfo() - list({ pageNo: 1, pageSize: -1, packageName: searchForm.value.packageName }).then(res => { + list({ pageNo: 1, pageSize: -1, packageName: searchForm.value.packageName,instructionTagId:props.instructionTagId }).then(res => { tableData.value = res selectedDirective.value = { id: '' } }) diff --git a/src/views/services/serviceDirective/components/ConfigServiceDirectiveForm.vue b/src/views/services/serviceDirective/components/ConfigServiceDirectiveForm.vue index beba308..79fae7d 100644 --- a/src/views/services/serviceDirective/components/ConfigServiceDirectiveForm.vue +++ b/src/views/services/serviceDirective/components/ConfigServiceDirectiveForm.vue @@ -74,7 +74,7 @@ - @@ -349,8 +349,8 @@ const validatorRules = reactive({ }, { validator: (_, value) => { - if (value < 5 || value > 55) { - return Promise.reject('请输入5到55之间的值!'); + if (value < 0 || value > 55) { + return Promise.reject('请输入0到55之间的值!'); } return Promise.resolve(); },