fix(项目设置): 删除无用组件

This commit is contained in:
shiziyuan9527 2021-10-29 15:15:16 +08:00 committed by 刘瑞斌
parent 20d94396ec
commit d54a22b2af
2 changed files with 0 additions and 94 deletions

View File

@ -90,7 +90,6 @@
<script>
import MsInputTag from "@/business/components/api/automation/scenario/MsInputTag";
import FunctionParams from "@/business/components/project/menu/function/FunctionParams";
import MsCodeEdit from "@/business/components/common/components/MsCodeEdit";
import MsDropdown from "@/business/components/common/components/MsDropdown";
import {FUNC_TEMPLATE} from "@/business/components/project/menu/function/custom-function";
@ -109,7 +108,6 @@ export default {
CustomFunctionRelate,
FunctionRun,
MsCodeEdit,
FunctionParams,
MsInputTag,
MsDropdown,
MsRun,

View File

@ -1,92 +0,0 @@
<template>
<div>
<div class="kv-row" v-for="(item, index) in items" :key="index">
<el-row type="flex" :gutter="20" style="margin-top: 7px;">
<el-col :span="7">
<!-- todo 过滤中文 -->
<el-input :disabled="isReadOnly" v-model="item.name" size="small" maxlength="200"
@change="change"
:placeholder="'参数名称'" show-word-limit/>
</el-col>
<el-col :span="7">
<el-input :disabled="isReadOnly" v-model="item.value" size="small" @change="change"
:placeholder="'参数值'" show-word-limit/>
</el-col>
<el-col :span="7">
<el-input :disabled="isReadOnly" v-model="item.remark" size="small" @change="change"
:placeholder="'备注'" show-word-limit/>
</el-col>
<el-col class="kv-delete" :span="3">
<el-button size="mini" class="el-icon-delete-solid" circle @click="remove(index)"
:disabled="isDisable(index) || isReadOnly"/>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
export default {
name: "FunctionParams",
props: {
items: {
type: Array,
default() {
return [];
}
},
isReadOnly: {
type: Boolean,
default: false
},
},
data() {
return {
}
},
methods: {
remove: function (index) {
//
this.items.splice(index, 1);
this.$emit('change', this.items);
},
change: function () {
let isNeedCreate = true;
let removeIndex = -1;
this.items.forEach((item, index) => {
if (!item.name && !item.value) {
//
if (index !== this.items.length - 1) {
removeIndex = index;
}
//
isNeedCreate = false;
}
});
if (isNeedCreate) {
this.items.push({});
}
this.$emit('change', this.items);
// TODO key
},
isDisable: function (index) {
return this.items.length - 1 === index;
},
},
created() {
if (this.items.length === 0 || this.items[this.items.length - 1].name) {
this.items.push({});
}
}
}
</script>
<style scoped>
</style>