1、服务指令包:1)新增分类标签,调整新增、编辑界面分类标签的选择与回显;2)选择过服务指令后不允许再更改分类标签;3)引用服务指令包、选择服务指令只展示对应分类标签相关的内容;
2、服务指令包的服务总时长允许保存0 3、服务指令的服务时长允许保存0
This commit is contained in:
parent
263bcaf93d
commit
6077d9a157
|
|
@ -34,7 +34,10 @@
|
|||
<template #title>
|
||||
<a-row>
|
||||
<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-row>
|
||||
</template>
|
||||
|
|
@ -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;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
<a-col :lg="5">
|
||||
<a-form-item name="instructionTagId">
|
||||
<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`"
|
||||
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" @change="onInstructionTagChange" />
|
||||
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" @change="onInstructionTagChange" disabled />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
|
|
@ -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 });
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -5,66 +5,6 @@
|
|||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
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-col :span="12">
|
||||
<a-row>
|
||||
|
|
@ -78,7 +18,7 @@
|
|||
<a-col :span="24">
|
||||
<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="分钟"
|
||||
<a-input-number v-model:value="formData.totalDuration" :min="0" :step="5" addon-after="分钟"
|
||||
placeholder="请输入服务时长(分钟)" allow-clear @keydown="onDurationKeydown" :disabled="disabled" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
|
@ -93,6 +33,16 @@
|
|||
</a-col>
|
||||
<a-col :span="12">
|
||||
<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-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="DirectivePackageForm-izEnabled"
|
||||
name="izEnabled" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
|
||||
|
|
@ -103,7 +53,7 @@
|
|||
<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: 3 }"
|
||||
<a-textarea v-model:value="formData.description" :maxlength="200" :autosize="{ minRows: 1 }"
|
||||
:showCount="true" placeholder="请输入说明" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
|
@ -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<boolean>(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,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
:footer-style="{ textAlign: 'right' }" @close="handleCancel" :bodyStyle="{ padding: '14px' }">
|
||||
<a-row>
|
||||
<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>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
<a-drawer v-model:open="directiveEditDrawer" title="选择服务指令" width="100vw" :closable="false"
|
||||
:footer-style="{ textAlign: 'right' }" :body-style="{ padding: 0 }">
|
||||
<ConfigServiceDirectiveList ref="configServiceDirectiveListRef" :directiveList="seletedRecord.directives"
|
||||
@checkDirective="checkDirective">
|
||||
:instructionTagId="registerForm.formData.instructionTagId" @checkDirective="checkDirective">
|
||||
</ConfigServiceDirectiveList>
|
||||
<template #footer>
|
||||
<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"
|
||||
:footer-style="{ textAlign: 'right' }" :body-style="{}">
|
||||
<PackageList ref="directivePackageListRef"></PackageList>
|
||||
<PackageList ref="directivePackageListRef" :instructionTagId="registerForm.formData.instructionTagId">
|
||||
</PackageList>
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" @click="handleQuoteDrawCancel">关闭</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 { 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<string>('');
|
||||
const visible = ref<boolean>(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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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: '' }
|
||||
})
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
<a-col :span="12">
|
||||
<a-form-item label="服务时长" v-bind="validateInfos.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" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
|
@ -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();
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue