1、服务指令包:1)新增分类标签,调整新增、编辑界面分类标签的选择与回显;2)选择过服务指令后不允许再更改分类标签;3)引用服务指令包、选择服务指令只展示对应分类标签相关的内容;

2、服务指令包的服务总时长允许保存0
3、服务指令的服务时长允许保存0
This commit is contained in:
1378012178@qq.com 2026-01-20 15:37:10 +08:00
parent 263bcaf93d
commit 6077d9a157
6 changed files with 70 additions and 79 deletions

View File

@ -34,7 +34,10 @@
<template #title> <template #title>
<a-row> <a-row>
<a-col> <a-col>
{{ directive.packageName }} <div class="directive-container">
<span class="package-name">{{ directive.packageName }}</span>
<span class="dict-text">{{ directive.instructionTagId_dictText }}</span>
</div>
</a-col> </a-col>
</a-row> </a-row>
</template> </template>
@ -288,4 +291,21 @@ onMounted(() => {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; 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;
}
</style> </style>

View File

@ -8,9 +8,9 @@
<a-col :lg="5"> <a-col :lg="5">
<a-form-item name="instructionTagId"> <a-form-item name="instructionTagId">
<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="props.instructionTagId"
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 'Y' order by sort asc`" :dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 'Y' order by sort asc`"
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" @change="onInstructionTagChange" /> placeholder="请选择分类标签" allowClear :ignoreDisabled="true" @change="onInstructionTagChange" disabled />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -197,7 +197,8 @@ const props = defineProps({
directiveList: { directiveList: {
type: Array, type: Array,
default: () => [] default: () => []
} },
instructionTagId:'',
}); });
// //
@ -335,8 +336,7 @@ function searchQuery() {
} }
function searchReset() { function searchReset() {
formRef.value.resetFields(); queryParam.directiveName = undefined;
queryParam.instructionTagId = undefined;
queryParam.categoryId = undefined; queryParam.categoryId = undefined;
queryParam.typeId = undefined; queryParam.typeId = undefined;
selectedRowKeys.value = []; selectedRowKeys.value = [];
@ -396,9 +396,9 @@ function handleTags(prefix, tagList, suffix) {
* 编辑方法供父组件调用 * 编辑方法供父组件调用
*/ */
function edit(record) { function edit(record) {
queryParam.instructionTagId = props.instructionTagId
checkListData.value = props.directiveList; checkListData.value = props.directiveList;
// directiveInfo.value = record; reload()
// queryParam.instructionTagId = record.instructionTagId;
} }
defineExpose({ edit }); defineExpose({ edit });
</script> </script>

View File

@ -5,66 +5,6 @@
<template #detail> <template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" <a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="DirectivePackageForm"> name="DirectivePackageForm">
<!-- <a-row>
<a-col :span="12">
<a-form-item label="指令包名称" v-bind="validateInfos.packageName" id="DirectivePackageForm-packageName"
name="packageName">
<a-input v-model:value="formData.packageName" placeholder="请输入服务指令包名称" allow-clear :maxlength="20"
:showCount="true"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="DirectivePackageForm-izEnabled"
name="izEnabled" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
placeholder="是否启用" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="服务总时长" v-bind="validateInfos.totalDuration" id="DirectivePackageForm-totalDuration"
name="totalDuration">
<a-input-number v-model:value="formData.totalDuration" :min="1" :step="5" addon-after="分钟"
placeholder="请输入服务时长(分钟)" allow-clear @keydown="onDurationKeydown" :disabled="disabled" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="服务包说明" v-bind="validateInfos.description" id="DirectivePackageForm-description"
name="description" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
<a-textarea v-model:value="formData.description" :maxlength="200" :autosize="{ minRows: 2 }"
:showCount="true" placeholder="请输入说明" />
</a-form-item>
</a-col>
</a-row> -->
<!-- <a-row>
<a-col :span="8">
<a-form-item label="指令包名称" v-bind="validateInfos.packageName" id="DirectivePackageForm-packageName"
name="packageName">
<a-input v-model:value="formData.packageName" placeholder="请输入服务指令包名称" allow-clear :maxlength="20"
:showCount="true"></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="服务总时长" v-bind="validateInfos.totalDuration" id="DirectivePackageForm-totalDuration"
name="totalDuration">
<a-input-number v-model:value="formData.totalDuration" :min="1" :step="5" addon-after="分钟"
placeholder="请输入服务时长(分钟)" allow-clear @keydown="onDurationKeydown" :disabled="disabled" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="DirectivePackageForm-izEnabled"
name="izEnabled">
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
placeholder="是否启用" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="指令包说明" v-bind="validateInfos.description" id="DirectivePackageForm-description"
name="description" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
<a-textarea v-model:value="formData.description" :maxlength="200" :autosize="{ minRows: 1 }"
:showCount="true" placeholder="请输入说明" />
</a-form-item>
</a-col>
</a-row> -->
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<a-row> <a-row>
@ -78,7 +18,7 @@
<a-col :span="24"> <a-col :span="24">
<a-form-item label="服务总时长" v-bind="validateInfos.totalDuration" <a-form-item label="服务总时长" v-bind="validateInfos.totalDuration"
id="DirectivePackageForm-totalDuration" name="totalDuration"> id="DirectivePackageForm-totalDuration" name="totalDuration">
<a-input-number v-model:value="formData.totalDuration" :min="1" :step="5" addon-after="分钟" <a-input-number v-model:value="formData.totalDuration" :min="0" :step="5" addon-after="分钟"
placeholder="请输入服务时长(分钟)" allow-clear @keydown="onDurationKeydown" :disabled="disabled" /> placeholder="请输入服务时长(分钟)" allow-clear @keydown="onDurationKeydown" :disabled="disabled" />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -93,6 +33,16 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-row> <a-row>
<a-col :span="24">
<a-form-item label="分类标签" v-bind="validateInfos.instructionTagId"
id="DirectivePackageForm-instructionTagId" name="instructionTagId" :labelCol="labelCol2"
:wrapperCol="wrapperCol2">
<j-dict-select-tag v-model:value="formData.instructionTagId"
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 'Y' order by sort asc`"
placeholder="请选择分类标签" allowClear
:disabled="!!props.seletedRecord && !!props.seletedRecord.directives && !!props.seletedRecord.directives.length > 0" />
</a-form-item>
</a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="DirectivePackageForm-izEnabled" <a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="DirectivePackageForm-izEnabled"
name="izEnabled" :labelCol="labelCol2" :wrapperCol="wrapperCol2"> name="izEnabled" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
@ -103,7 +53,7 @@
<a-col :span="24"> <a-col :span="24">
<a-form-item label="说明" v-bind="validateInfos.description" id="DirectivePackageForm-description" <a-form-item label="说明" v-bind="validateInfos.description" id="DirectivePackageForm-description"
name="description" :labelCol="labelCol2" :wrapperCol="wrapperCol2"> name="description" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
<a-textarea v-model:value="formData.description" :maxlength="200" :autosize="{ minRows: 3 }" <a-textarea v-model:value="formData.description" :maxlength="200" :autosize="{ minRows: 1 }"
:showCount="true" placeholder="请输入说明" /> :showCount="true" placeholder="请输入说明" />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -130,8 +80,13 @@ import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue'
const props = defineProps({ const props = defineProps({
formDisabled: { type: Boolean, default: false }, formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({}) }, 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 formRef = ref();
const useForm = Form.useForm; const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']); const emit = defineEmits(['register', 'ok']);
@ -156,9 +111,10 @@ const confirmLoading = ref<boolean>(false);
// //
const validatorRules = reactive({ const validatorRules = reactive({
packageName: [{ required: true, message: '请输入服务指令包名称!' },], packageName: [{ required: true, message: '请输入服务指令包名称!' },],
instructionTagId: [{ required: true, message: '请选择分类标签!' },],
totalDuration: [{ required: true, message: '请输入服务总时长(分钟)!' }, { totalDuration: [{ required: true, message: '请输入服务总时长(分钟)!' }, {
validator: (_, value) => { validator: (_, value) => {
if (value <= 0) { if (value < 0) {
return Promise.reject('请输入服务总时长!'); return Promise.reject('请输入服务总时长!');
} }
return Promise.resolve(); return Promise.resolve();
@ -313,6 +269,7 @@ defineExpose({
add, add,
edit, edit,
submitForm, submitForm,
formData,
}); });
</script> </script>

View File

@ -6,7 +6,7 @@
:footer-style="{ textAlign: 'right' }" @close="handleCancel" :bodyStyle="{ padding: '14px' }"> :footer-style="{ textAlign: 'right' }" @close="handleCancel" :bodyStyle="{ padding: '14px' }">
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
<DirectivePackageForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"> <DirectivePackageForm ref="registerForm" @ok="submitCallback" :seletedRecord="seletedRecord" :formDisabled="disableSubmit" :formBpm="false">
</DirectivePackageForm> </DirectivePackageForm>
</a-col> </a-col>
</a-row> </a-row>
@ -75,7 +75,7 @@
<a-drawer v-model:open="directiveEditDrawer" title="选择服务指令" width="100vw" :closable="false" <a-drawer v-model:open="directiveEditDrawer" title="选择服务指令" width="100vw" :closable="false"
:footer-style="{ textAlign: 'right' }" :body-style="{ padding: 0 }"> :footer-style="{ textAlign: 'right' }" :body-style="{ padding: 0 }">
<ConfigServiceDirectiveList ref="configServiceDirectiveListRef" :directiveList="seletedRecord.directives" <ConfigServiceDirectiveList ref="configServiceDirectiveListRef" :directiveList="seletedRecord.directives"
@checkDirective="checkDirective"> :instructionTagId="registerForm.formData.instructionTagId" @checkDirective="checkDirective">
</ConfigServiceDirectiveList> </ConfigServiceDirectiveList>
<template #footer> <template #footer>
<a-button style="margin-right: 8px" @click="handleDirectiveCancel">关闭</a-button> <a-button style="margin-right: 8px" @click="handleDirectiveCancel">关闭</a-button>
@ -86,7 +86,8 @@
<!-- 引用 --> <!-- 引用 -->
<a-drawer v-model:open="directiveQuoteDrawer" title="引用服务指令包" width="80vw" :closable="false" <a-drawer v-model:open="directiveQuoteDrawer" title="引用服务指令包" width="80vw" :closable="false"
:footer-style="{ textAlign: 'right' }" :body-style="{}"> :footer-style="{ textAlign: 'right' }" :body-style="{}">
<PackageList ref="directivePackageListRef"></PackageList> <PackageList ref="directivePackageListRef" :instructionTagId="registerForm.formData.instructionTagId">
</PackageList>
<template #footer> <template #footer>
<a-button style="margin-right: 8px" @click="handleQuoteDrawCancel">关闭</a-button> <a-button style="margin-right: 8px" @click="handleQuoteDrawCancel">关闭</a-button>
<a-button type="primary" @click="handleQuoteDrawOk">确定</a-button> <a-button type="primary" @click="handleQuoteDrawOk">确定</a-button>
@ -108,6 +109,8 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import PackageList from './PackageList.vue' import PackageList from './PackageList.vue'
import { filterDictTextByCache } from '/@/utils/dict/JDictSelectUtil'; import { filterDictTextByCache } from '/@/utils/dict/JDictSelectUtil';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { CodeSandboxOutlined } from '@ant-design/icons-vue';
import InstructionTag from '../../instructiontag/InstructionTag.vue';
const title = ref<string>(''); const title = ref<string>('');
const visible = ref<boolean>(false); const visible = ref<boolean>(false);
@ -213,6 +216,10 @@ function handleCancel() {
* 新增/编辑服务指令 * 新增/编辑服务指令
*/ */
const handleAddDirectives = () => { const handleAddDirectives = () => {
if (!registerForm.value.formData.instructionTagId) {
createMessage.warning('请先选择分类标签')
return
}
directiveEditDrawer.value = true; directiveEditDrawer.value = true;
nextTick(() => { nextTick(() => {
configServiceDirectiveListRef.value.edit(seletedRecord.value); configServiceDirectiveListRef.value.edit(seletedRecord.value);
@ -282,6 +289,10 @@ function checkDirective(directive_) {
* 引用 * 引用
*/ */
function handleQuoteDirectives() { function handleQuoteDirectives() {
if (!registerForm.value.formData.instructionTagId) {
createMessage.warning('请先选择分类标签')
return
}
directiveQuoteDrawer.value = true directiveQuoteDrawer.value = true
} }

View File

@ -88,6 +88,9 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import { filterDictTextByCache } from '/@/utils/dict/JDictSelectUtil'; import { filterDictTextByCache } from '/@/utils/dict/JDictSelectUtil';
import dayjs from "dayjs"; import dayjs from "dayjs";
const props = defineProps({
instructionTagId:'',
});
const selectedDirective = ref({ id: '' }) const selectedDirective = ref({ id: '' })
const registerModal = ref(); const registerModal = ref();
const searchForm = ref({}) const searchForm = ref({})
@ -147,7 +150,7 @@ function handleSuccess() {
*/ */
function queryList(params) { function queryList(params) {
resetSeletedDirectiveInfo() 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 tableData.value = res
selectedDirective.value = { id: '' } selectedDirective.value = { id: '' }
}) })

View File

@ -74,7 +74,7 @@
<a-col :span="12"> <a-col :span="12">
<a-form-item label="服务时长" v-bind="validateInfos.serviceDuration" <a-form-item label="服务时长" v-bind="validateInfos.serviceDuration"
id="ConfigServiceDirectiveForm-serviceDuration" name="serviceDuration"> id="ConfigServiceDirectiveForm-serviceDuration" name="serviceDuration">
<a-input-number v-model:value="formData.serviceDuration" :min="5" :max="55" :step="5" addon-after="分钟" <a-input-number v-model:value="formData.serviceDuration" :min="0" :max="55" :step="5" addon-after="分钟"
placeholder="请输入服务时长(分钟)" allow-clear @keydown="onDurationKeydown" :disabled="disabled" /> placeholder="请输入服务时长(分钟)" allow-clear @keydown="onDurationKeydown" :disabled="disabled" />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -349,8 +349,8 @@ const validatorRules = reactive({
}, },
{ {
validator: (_, value) => { validator: (_, value) => {
if (value < 5 || value > 55) { if (value < 0 || value > 55) {
return Promise.reject('请输入5到55之间的值!'); return Promise.reject('请输入0到55之间的值!');
} }
return Promise.resolve(); return Promise.resolve();
}, },