feate:添加创建参数的必选参数
This commit is contained in:
@@ -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') {
|
||||||
|
|||||||
Reference in New Issue
Block a user