feate:添加创建参数的必选参数
Build and Deploy Vue3 / build (push) Successful in 1m20s
Build and Deploy Vue3 / deploy (push) Successful in 1m24s

This commit is contained in:
2026-02-05 17:00:39 +08:00
parent fdc9db9a9c
commit 2f38932878
+14 -1
View File
@@ -325,6 +325,15 @@
<el-radio label="select">选择</el-radio> <el-radio label="select">选择</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="是否必选" prop="must">
<el-switch
v-model="paramForm.must"
:active-value="true"
:inactive-value="false"
active-text="必选"
inactive-text="可选"
/>
</el-form-item>
<!-- number 类型参数的额外配置 --> <!-- number 类型参数的额外配置 -->
<template v-if="paramForm.arg_type === 'number'"> <template v-if="paramForm.arg_type === 'number'">
<el-divider content-position="left">数值参数配置</el-divider> <el-divider content-position="left">数值参数配置</el-divider>
@@ -1335,6 +1344,7 @@ const paramForm = reactive({
arg_id: undefined, arg_id: undefined,
arg_name: '', arg_name: '',
arg_type: 'string', arg_type: 'string',
must: false,
arg_step: 1, arg_step: 1,
arg_min: 0, arg_min: 0,
arg_max: 100 arg_max: 100
@@ -1415,6 +1425,7 @@ const handleAddParameter = () => {
arg_id: undefined, arg_id: undefined,
arg_name: '', arg_name: '',
arg_type: 'string', arg_type: 'string',
must: false,
arg_step: 1, arg_step: 1,
arg_min: 0, arg_min: 0,
arg_max: 100 arg_max: 100
@@ -1432,6 +1443,7 @@ const handleEditParameter = (row) => {
arg_id: row.id, arg_id: row.id,
arg_name: row.name, arg_name: row.name,
arg_type: row.type, arg_type: row.type,
must: row.must || false,
arg_step: row.step || 1, arg_step: row.step || 1,
arg_min: row.min || 0, arg_min: row.min || 0,
arg_max: row.max || 100 arg_max: row.max || 100
@@ -1463,7 +1475,8 @@ const submitParamForm = () => {
const submitData = { const submitData = {
good_id: Number(currentProductId.value), good_id: Number(currentProductId.value),
arg_name: paramForm.arg_name, arg_name: paramForm.arg_name,
arg_type: paramForm.arg_type arg_type: paramForm.arg_type,
must: paramForm.must === true
} }
// number 类型添加额外参数 // number 类型添加额外参数
if (paramForm.arg_type === 'number') { if (paramForm.arg_type === 'number') {