feat: 参数添加长度描述
This commit is contained in:
parent
b07097dcc3
commit
d57ea30f0e
|
@ -18,6 +18,8 @@ public class KeyValue {
|
||||||
private boolean enable = true;
|
private boolean enable = true;
|
||||||
private boolean encode = true;
|
private boolean encode = true;
|
||||||
private boolean required;
|
private boolean required;
|
||||||
|
private Integer min;
|
||||||
|
private Integer max;
|
||||||
|
|
||||||
public KeyValue() {
|
public KeyValue() {
|
||||||
this(null, null);
|
this(null, null);
|
||||||
|
|
|
@ -105,9 +105,6 @@ public class ProjectService {
|
||||||
long createTime = System.currentTimeMillis();
|
long createTime = System.currentTimeMillis();
|
||||||
project.setCreateTime(createTime);
|
project.setCreateTime(createTime);
|
||||||
project.setUpdateTime(createTime);
|
project.setUpdateTime(createTime);
|
||||||
// set workspace id
|
|
||||||
project.setWorkspaceId(project.getWorkspaceId());
|
|
||||||
project.setCreateUser(project.getCreateUser());
|
|
||||||
project.setSystemId(systemId);
|
project.setSystemId(systemId);
|
||||||
projectMapper.insertSelective(project);
|
projectMapper.insertSelective(project);
|
||||||
|
|
||||||
|
|
|
@ -74,17 +74,26 @@
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<el-col v-if="withMorSetting" class="item kv-setting">
|
||||||
|
<el-tooltip effect="dark" :content="$t('schema.adv_setting')" placement="top">
|
||||||
|
<i class="el-icon-setting" @click="openApiVariableSetting(item)"/>
|
||||||
|
</el-tooltip>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<el-col class="item kv-delete">
|
<el-col class="item kv-delete">
|
||||||
<el-button size="mini" class="el-icon-delete-solid" circle @click="remove(index)"
|
<el-button size="mini" class="el-icon-delete-solid" circle @click="remove(index)"
|
||||||
:disabled="isDisable(index) || isReadOnly"/>
|
:disabled="isDisable(index) || isReadOnly"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<ms-api-variable-advance ref="variableAdvance" :environment="environment" :scenario="scenario"
|
<ms-api-variable-advance ref="variableAdvance" :environment="environment" :scenario="scenario"
|
||||||
:parameters="parameters"
|
:parameters="parameters"
|
||||||
:current-item="currentItem"/>
|
:current-item="currentItem"/>
|
||||||
|
|
||||||
|
<api-variable-setting
|
||||||
|
ref="apiVariableSetting"/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -95,10 +104,11 @@
|
||||||
import MsApiBodyFileUpload from "./body/ApiBodyFileUpload";
|
import MsApiBodyFileUpload from "./body/ApiBodyFileUpload";
|
||||||
import {REQUIRED} from "../model/JsonData";
|
import {REQUIRED} from "../model/JsonData";
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
import ApiVariableSetting from "@/business/components/api/definition/components/ApiVariableSetting";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MsApiVariable",
|
name: "MsApiVariable",
|
||||||
components: {MsApiBodyFileUpload, MsApiVariableAdvance},
|
components: {ApiVariableSetting, MsApiBodyFileUpload, MsApiVariableAdvance},
|
||||||
props: {
|
props: {
|
||||||
keyPlaceholder: String,
|
keyPlaceholder: String,
|
||||||
valuePlaceholder: String,
|
valuePlaceholder: String,
|
||||||
|
@ -119,7 +129,8 @@
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
suggestions: Array
|
suggestions: Array,
|
||||||
|
withMorSetting: Boolean
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -249,6 +260,9 @@
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.isActive = true;
|
this.isActive = true;
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
openApiVariableSetting(item) {
|
||||||
|
this.$refs.apiVariableSetting.open(item);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -307,4 +321,9 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #1E90FF;
|
color: #1E90FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.kv-setting {
|
||||||
|
width: 40px;
|
||||||
|
padding: 0px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<template>
|
||||||
|
<ms-edit-dialog
|
||||||
|
:visible.sync="visible"
|
||||||
|
width="30%"
|
||||||
|
:title="$t('run_mode.other_config')"
|
||||||
|
:with-footer="false"
|
||||||
|
:close-on-click-modal="true">
|
||||||
|
<el-form>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item :label="$t('schema.minLength')">
|
||||||
|
<el-input-number :min="0" v-model="data.min" :placeholder="$t('schema.minLength')" size="small"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item :label="$t('schema.maxLength')">
|
||||||
|
<el-input-number :min="0" v-model="data.max" :placeholder="$t('schema.maxLength')" size="small"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</ms-edit-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import MsEditDialog from "@/business/components/common/components/MsEditDialog";
|
||||||
|
export default {
|
||||||
|
name: "ApiVariableSetting",
|
||||||
|
components: {MsEditDialog},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
data: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open(item) {
|
||||||
|
this.visible = true;
|
||||||
|
this.data = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -29,7 +29,7 @@
|
||||||
<el-row v-if="body.type == 'Form Data' || body.type == 'WWW_FORM'">
|
<el-row v-if="body.type == 'Form Data' || body.type == 'WWW_FORM'">
|
||||||
<el-link class="ms-el-link" @click="batchAdd"> {{$t("commons.batch_add")}}</el-link>
|
<el-link class="ms-el-link" @click="batchAdd"> {{$t("commons.batch_add")}}</el-link>
|
||||||
</el-row>
|
</el-row>
|
||||||
<ms-api-variable :is-read-only="isReadOnly"
|
<ms-api-variable :with-mor-setting="true" :is-read-only="isReadOnly"
|
||||||
:parameters="body.kvs"
|
:parameters="body.kvs"
|
||||||
:isShowEnable="isShowEnable" type="body"/>
|
:isShowEnable="isShowEnable" type="body"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-link class="ms-el-link" @click="batchAdd" style="color: #783887"> {{$t("commons.batch_add")}}</el-link>
|
<el-link class="ms-el-link" @click="batchAdd" style="color: #783887"> {{$t("commons.batch_add")}}</el-link>
|
||||||
</el-row>
|
</el-row>
|
||||||
<ms-api-variable :is-read-only="isReadOnly" :isShowEnable="isShowEnable" :parameters="request.arguments"/>
|
<ms-api-variable :with-mor-setting="true" :is-read-only="isReadOnly" :isShowEnable="isShowEnable" :parameters="request.arguments"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<!--REST 参数-->
|
<!--REST 参数-->
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-link class="ms-el-link" @click="batchAdd" style="color: #783887"> {{$t("commons.batch_add")}}</el-link>
|
<el-link class="ms-el-link" @click="batchAdd" style="color: #783887"> {{$t("commons.batch_add")}}</el-link>
|
||||||
</el-row>
|
</el-row>
|
||||||
<ms-api-variable :is-read-only="isReadOnly" :isShowEnable="isShowEnable" :parameters="request.rest"/>
|
<ms-api-variable :with-mor-setting="true" :is-read-only="isReadOnly" :isShowEnable="isShowEnable" :parameters="request.rest"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<!--请求体-->
|
<!--请求体-->
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog :close-on-click-modal="false"
|
<el-dialog :close-on-click-modal="closeOnClickModal"
|
||||||
:title="title"
|
:title="title"
|
||||||
:width="width"
|
:width="width"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
<slot name="footer">
|
<slot name="footer">
|
||||||
<div class="dialog-footer">
|
<div v-if="withFooter" class="dialog-footer">
|
||||||
<ms-dialog-footer
|
<ms-dialog-footer
|
||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
@confirm="handleConfirm"/>
|
@confirm="handleConfirm"/>
|
||||||
|
@ -53,7 +53,17 @@ export default {
|
||||||
default() {
|
default() {
|
||||||
return "50%";
|
return "50%";
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
withFooter: {
|
||||||
|
type: Boolean,
|
||||||
|
default() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
closeOnClickModal: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
|
|
Loading…
Reference in New Issue