2019-12-18 17:00:44 +08:00
|
|
|
|
<template>
|
2020-07-28 19:42:25 +08:00
|
|
|
|
<div class="right-box right-box-edit-endpoint" v-clickoutside="clickOutside">
|
|
|
|
|
|
<!-- begin--顶部按钮-->
|
2020-10-15 14:27:46 +08:00
|
|
|
|
<div class="right-box-top-btns right-box-form-delete">
|
|
|
|
|
|
<button id="edit-ep-del" type="button" v-if="editEndpoint.id" @click="del" class="nz-btn nz-btn-size-normal nz-btn-size-alien">
|
2020-09-10 17:00:32 +08:00
|
|
|
|
<span class="right-box-top-btn-icon"><i class="nz-icon nz-icon-delete"></i></span>
|
2020-07-28 19:42:25 +08:00
|
|
|
|
<span class="right-box-top-btn-txt">{{$t('overall.delete')}}</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!-- end--顶部按钮-->
|
2019-12-18 17:00:44 +08:00
|
|
|
|
|
2020-07-28 19:42:25 +08:00
|
|
|
|
<!-- begin--标题-->
|
|
|
|
|
|
<div class="right-box-title">{{$t("project.endpoint.editEndpoint") + " ID:" + editEndpoint.id}}</div>
|
|
|
|
|
|
<!-- end--标题-->
|
2020-01-07 17:41:46 +08:00
|
|
|
|
|
2020-07-28 19:42:25 +08:00
|
|
|
|
<!-- begin--表单-->
|
|
|
|
|
|
<el-scrollbar class="right-box-form-box">
|
|
|
|
|
|
<el-form class="right-box-form right-box-form-left" :model="editEndpoint" label-position="right" label-width="120px" :rules="rules" ref="endpointForm">
|
|
|
|
|
|
<!--project-->
|
|
|
|
|
|
<el-form-item :label="$t('project.project.project')" prop="project.id">
|
|
|
|
|
|
<el-select @change="((val) => {changeProject(val);})" value-key="id" popper-class="config-dropdown" v-model="editEndpoint.projectId" placeholder="" size="small">
|
|
|
|
|
|
<el-option :id="'edit-project-'+item.id" v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--module-->
|
|
|
|
|
|
<el-form-item :label="$t('project.module.module')" prop="module.id">
|
|
|
|
|
|
<el-select @change="((val) => {changeModule(val);})" value-key="id" popper-class="config-dropdown" v-model="editEndpoint.moduleId" placeholder="" size="small">
|
|
|
|
|
|
<el-option :id="'edit-module-'+item.id" v-for="item in moduleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--asset-->
|
|
|
|
|
|
<el-form-item :label="$t('asset.asset')" prop="assetId">
|
|
|
|
|
|
<el-autocomplete
|
|
|
|
|
|
:fetch-suggestions="assetSuggestion"
|
|
|
|
|
|
v-model.trim="editEndpoint.asset.host"
|
|
|
|
|
|
placeholder=""
|
|
|
|
|
|
@select="selectAsset"
|
|
|
|
|
|
@change.native="inputAsset"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
value-key="host"
|
|
|
|
|
|
popper-class="no-style-class"
|
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
|
>
|
|
|
|
|
|
</el-autocomplete>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--host-->
|
|
|
|
|
|
<el-form-item :label="$t('project.endpoint.host')" prop="host">
|
|
|
|
|
|
<el-input placeholder="" v-model="editEndpoint.host" size="small"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--port-->
|
|
|
|
|
|
<el-form-item :label="$t('project.endpoint.port')" prop="port">
|
|
|
|
|
|
<el-input placeholder="" v-model="editEndpoint.port" size="small"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--path-->
|
|
|
|
|
|
<el-form-item :label="$t('project.endpoint.path')" prop="path" v-if="editEndpoint.module.type.toLowerCase() == 'http'">
|
|
|
|
|
|
<el-input placeholder="" v-model="editEndpoint.path" size="small"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<!--param-->
|
|
|
|
|
|
<el-form-item class="right-box-form-param" v-if="editEndpoint.module.type.toLowerCase() == 'http'">
|
|
|
|
|
|
<template slot="label">
|
|
|
|
|
|
<span>{{$t('project.endpoint.param')}}</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<div style="text-align: right">
|
|
|
|
|
|
<button style="display: none;">第一个button会出现意料之外的hover样式,找不到原因,只好加个不可见的button规避问题</button>
|
2020-10-15 09:28:40 +08:00
|
|
|
|
<!--<button type="button" id="edit-clear-all" @click="clearAllParam" class="nz-btn nz-btn-size-normal nz-btn-style-light">-->
|
|
|
|
|
|
<!--<span><i class="nz-icon nz-icon-delete"></i></span>-->
|
|
|
|
|
|
<!--</button>-->
|
2020-10-15 14:27:46 +08:00
|
|
|
|
<span id="edit-add-param" @click="addParam" class="right-box-form-add">
|
|
|
|
|
|
<i style="" class="nz-icon nz-icon-create-square"></i>
|
2020-10-15 09:28:40 +08:00
|
|
|
|
</span>
|
2020-07-28 19:42:25 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="param-box param-box-module">
|
|
|
|
|
|
<el-scrollbar ref="paramBoxScrollbar" style="height: 100%">
|
|
|
|
|
|
<div class="param-box-row" v-for="(item, index) in editEndpoint.paramObj">
|
|
|
|
|
|
<el-form-item class="param-box-row-key" :rules="{required: true, message: $t('validate.required'), trigger: 'blur'}" :prop="'paramObj.' + index + '.key'">
|
|
|
|
|
|
<el-input placeholder="key" size="mini" v-model="item.key"></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<span class="param-box-row-eq">=</span>
|
|
|
|
|
|
<el-form-item class="param-box-row-value" :rules="{required: true, message: $t('validate.required'), trigger: 'blur'}" :prop="'paramObj.' + index + '.value'">
|
|
|
|
|
|
<el-input placeholder="value" size="mini" v-model="item.value"></el-input>
|
|
|
|
|
|
</el-form-item>
|
2020-10-15 14:27:46 +08:00
|
|
|
|
<span class="param-box-row-symbol" @click="removeParam(index)"><i class="nz-icon nz-icon-shanchu1" style="color: #666666"></i></span>
|
2020-01-07 17:41:46 +08:00
|
|
|
|
</div>
|
2020-07-28 19:42:25 +08:00
|
|
|
|
</el-scrollbar>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</el-scrollbar>
|
2019-12-18 17:00:44 +08:00
|
|
|
|
|
2020-07-28 19:42:25 +08:00
|
|
|
|
<!-- end--表单-->
|
2020-01-16 18:11:15 +08:00
|
|
|
|
|
2020-07-28 19:42:25 +08:00
|
|
|
|
<!--底部按钮-->
|
|
|
|
|
|
<div class="right-box-bottom-btns">
|
2020-10-22 16:03:51 +08:00
|
|
|
|
<button @click="esc" id="ep-edit-esc" class="nz-btn nz-btn-size-normal-new nz-btn-style-light-new">
|
2020-07-28 19:42:25 +08:00
|
|
|
|
<span>{{$t('overall.cancel')}}</span>
|
|
|
|
|
|
</button>
|
2020-10-22 16:03:51 +08:00
|
|
|
|
<button @click="save" id="ep-edit-save" class="nz-btn nz-btn-size-normal-new nz-btn-style-normal-new">
|
2020-07-28 19:42:25 +08:00
|
|
|
|
<span>{{$t('overall.save')}}</span>
|
|
|
|
|
|
</button>
|
2019-12-18 17:00:44 +08:00
|
|
|
|
</div>
|
2020-07-28 19:42:25 +08:00
|
|
|
|
</div>
|
2019-12-18 17:00:44 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: "endpointBox",
|
|
|
|
|
|
props: {
|
2020-07-28 19:42:25 +08:00
|
|
|
|
endpoint: Object,
|
2019-12-18 17:00:44 +08:00
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2020-07-28 19:42:25 +08:00
|
|
|
|
editEndpoint: {},
|
2019-12-19 17:22:18 +08:00
|
|
|
|
subBox: {show: false, title: this.$t("overall.asset")}, //asset子弹框
|
|
|
|
|
|
assetSearch: {host: '', sn: '', text: '', label: 'IP', dropdownShow: false}, //侧滑框中asset的搜索相关
|
|
|
|
|
|
assetPageObj: {pageNo: 1, pageSize: 11, total: 0},
|
|
|
|
|
|
selectedAsset: {id: '', host: '', sn: ''}, //endpoint侧滑框中选中的asset
|
|
|
|
|
|
projectList: [],
|
|
|
|
|
|
moduleList: [],
|
2020-01-07 17:41:46 +08:00
|
|
|
|
assetList: [],
|
|
|
|
|
|
rules:{
|
|
|
|
|
|
'project.id':[
|
|
|
|
|
|
{required:true,message:this.$t('validate.required'),trigger:'change'}
|
|
|
|
|
|
],
|
|
|
|
|
|
'module.id':[
|
|
|
|
|
|
{required:true,message:this.$t('validate.required'),trigger:'change'}
|
|
|
|
|
|
],
|
2020-01-08 22:19:46 +08:00
|
|
|
|
assetId: [
|
|
|
|
|
|
{required:true,message:this.$t('validate.required'),trigger:'blur'}
|
|
|
|
|
|
],
|
2020-01-07 17:41:46 +08:00
|
|
|
|
port:[
|
|
|
|
|
|
{required:true,message:this.$t('validate.required'),trigger:'blur'}
|
|
|
|
|
|
],
|
|
|
|
|
|
path:[
|
|
|
|
|
|
{required:true,message:this.$t('validate.required'),trigger:'blur'}
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
2019-12-19 17:22:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
//endpoint弹框中asset子弹框控制
|
|
|
|
|
|
showSubBox(show) {
|
|
|
|
|
|
this.subBox.show = show;
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/*关闭弹框*/
|
2020-07-28 19:42:25 +08:00
|
|
|
|
esc(refresh) {
|
|
|
|
|
|
this.$emit("close", refresh);
|
2019-12-19 17:22:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/*关闭子弹框*/
|
|
|
|
|
|
subEsc() {
|
|
|
|
|
|
this.subBox.show = false;
|
|
|
|
|
|
},
|
|
|
|
|
|
|
2020-07-28 19:42:25 +08:00
|
|
|
|
clickOutside() {
|
|
|
|
|
|
this.esc(false);
|
2020-02-26 18:26:55 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
2019-12-19 17:22:18 +08:00
|
|
|
|
// 清除param
|
|
|
|
|
|
clearAllParam() {
|
|
|
|
|
|
this.endpoint.paramObj = [];
|
2020-04-16 15:02:50 +08:00
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.$refs.paramBoxScrollbar.update();
|
|
|
|
|
|
});
|
2019-12-19 17:22:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 新增param
|
|
|
|
|
|
addParam() {
|
|
|
|
|
|
this.endpoint.paramObj.push({key: '', value: ''});
|
2020-04-16 15:02:50 +08:00
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.$refs.paramBoxScrollbar.update();
|
|
|
|
|
|
});
|
2019-12-19 17:22:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 移除单个param
|
|
|
|
|
|
removeParam(index) {
|
|
|
|
|
|
this.endpoint.paramObj.splice(index, 1);
|
2020-04-16 15:02:50 +08:00
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.$refs.paramBoxScrollbar.update();
|
|
|
|
|
|
});
|
2019-12-19 17:22:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//将param转为json字符串格式
|
|
|
|
|
|
paramToJson(param) {
|
|
|
|
|
|
let tempParam = {};
|
|
|
|
|
|
for (let i = 0; i < param.length; i++) {
|
2019-12-24 17:31:51 +08:00
|
|
|
|
eval('tempParam["' + param[i].key + '"]="' + param[i].value + '"');
|
2019-12-19 17:22:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
let jsonString = JSON.stringify(tempParam);
|
|
|
|
|
|
if (jsonString == '{}') {
|
|
|
|
|
|
return "";
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return jsonString;
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/*获取project列表*/
|
|
|
|
|
|
getProjectList() {
|
2020-07-28 19:42:25 +08:00
|
|
|
|
return new Promise(resolve => {
|
|
|
|
|
|
this.$get('project', {pageSize: -1, pageNo: 1}).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.projectList = response.data.list;
|
|
|
|
|
|
if (!this.editEndpoint.projectId && this.projectList.length > 0) {
|
|
|
|
|
|
this.editEndpoint.projectId = this.projectList[0].id;
|
|
|
|
|
|
}
|
2019-12-20 17:18:30 +08:00
|
|
|
|
}
|
2020-07-28 19:42:25 +08:00
|
|
|
|
resolve();
|
|
|
|
|
|
});
|
2019-12-19 17:22:18 +08:00
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
|
2019-12-20 17:18:30 +08:00
|
|
|
|
//project下拉框点击事件
|
2020-05-09 16:54:41 +08:00
|
|
|
|
changeProject(projectId) {
|
|
|
|
|
|
this.getModuleList(projectId);
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.editEndpoint.projectId = projectId;
|
|
|
|
|
|
this.editEndpoint.moduleId = '';
|
2019-12-20 17:18:30 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//project下拉框点击事件
|
2020-05-09 16:54:41 +08:00
|
|
|
|
changeModule(moduleId) {
|
2020-07-28 19:42:25 +08:00
|
|
|
|
let newModule = this.moduleList.find(item => {return item.id == this.endpoint.moduleId});
|
|
|
|
|
|
this.editEndpoint.moduleId = moduleId;
|
|
|
|
|
|
this.editEndpoint.port = newModule.port;
|
|
|
|
|
|
this.editEndpoint.path = newModule.path;
|
|
|
|
|
|
this.editEndpoint.paramObj = newModule.paramObj;
|
2019-12-20 17:18:30 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
2019-12-19 17:22:18 +08:00
|
|
|
|
// 获取endpoint弹框中的asset子弹框里asset列表数据
|
|
|
|
|
|
getAssetList(currentPage) {
|
|
|
|
|
|
if (currentPage) {
|
|
|
|
|
|
this.assetPageObj.pageNo = currentPage;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.assetPageObj.pageNo = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$get('asset', this.assetPageObj).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.assetList = response.data.list;
|
|
|
|
|
|
this.assetPageObj.total = response.data.total;
|
2019-12-18 17:00:44 +08:00
|
|
|
|
}
|
2019-12-19 17:22:18 +08:00
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//endpoint弹框中的asset子弹框搜索
|
|
|
|
|
|
searchAsset() {
|
|
|
|
|
|
if (this.assetSearch.label == 'IP') {
|
|
|
|
|
|
this.assetSearch.host = this.assetSearch.text;
|
|
|
|
|
|
this.assetSearch.sn = '';
|
|
|
|
|
|
} else if (this.assetSearch.label == 'SN') {
|
|
|
|
|
|
this.assetSearch.sn = this.assetSearch.text;
|
|
|
|
|
|
this.assetSearch.host = '';
|
|
|
|
|
|
}
|
|
|
|
|
|
this.assetPageObj = Object.assign({}, this.assetPageObj, this.assetSearch);
|
|
|
|
|
|
this.getAssetList(false);
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// endpoint弹框中的asset子弹框里asset选择事件
|
|
|
|
|
|
selectAsset(obj) {
|
|
|
|
|
|
this.selectedAsset = obj;
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.editEndpoint.host = obj.host;
|
|
|
|
|
|
this.editEndpoint.assetId = obj.id;
|
|
|
|
|
|
this.$refs.endpointForm.validate();
|
2020-04-17 21:00:35 +08:00
|
|
|
|
},
|
|
|
|
|
|
inputAsset(e) {
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.editEndpoint.assetId = "";
|
2020-04-17 21:00:35 +08:00
|
|
|
|
let host = e.target.value;
|
|
|
|
|
|
if (host) {
|
|
|
|
|
|
for (let i = 0; i < this.assetList.length; i++) {
|
|
|
|
|
|
if (host == this.assetList[i].host) {
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.editEndpoint.assetId = this.assetList[i].id;
|
2020-04-17 21:00:35 +08:00
|
|
|
|
this.selectedAsset = this.assetList[i];
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.editEndpoint.host = host;
|
2020-04-17 21:00:35 +08:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2019-12-19 17:22:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 获取endpoint弹框中module下拉框数据
|
2020-07-28 19:42:25 +08:00
|
|
|
|
getModuleList(projectId, setCurModule = false) {
|
2019-12-19 17:22:18 +08:00
|
|
|
|
this.$get('module', {projectId: projectId}).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
for (let i = 0; i < response.data.list.length; i++) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
let tempObj = JSON.parse(response.data.list[i].param);
|
|
|
|
|
|
response.data.list[i].paramObj = [];
|
|
|
|
|
|
for (let k in tempObj) {
|
|
|
|
|
|
response.data.list[i].paramObj.push({key: k, value: tempObj[k]})
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch(err) {
|
2020-03-03 20:50:50 +08:00
|
|
|
|
//console.info(response.data.list[i], err);
|
2019-12-19 17:22:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.moduleList = response.data.list;
|
2020-05-09 16:54:41 +08:00
|
|
|
|
if(setCurModule){
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.editEndpoint.moduleId = this.moduleList.find(item => {return item.id == this.editEndpoint.moduleId}).id;
|
2020-05-09 16:54:41 +08:00
|
|
|
|
}
|
2019-12-19 17:22:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//保存endpoint
|
|
|
|
|
|
save() {
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.$refs.endpointForm.validate((valide=>{
|
2020-01-07 17:41:46 +08:00
|
|
|
|
if(valide){
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.editEndpoint.param = this.paramToJson(this.editEndpoint.paramObj);
|
2020-01-07 17:41:46 +08:00
|
|
|
|
let requestData = [];
|
2020-07-28 19:42:25 +08:00
|
|
|
|
requestData.push(this.editEndpoint);
|
2020-01-07 17:41:46 +08:00
|
|
|
|
this.$put('endpoint', requestData).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")});
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.esc(true);
|
2020-01-07 17:41:46 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}else{
|
|
|
|
|
|
return false;
|
2019-12-18 17:00:44 +08:00
|
|
|
|
}
|
2020-01-07 17:41:46 +08:00
|
|
|
|
}))
|
2019-12-19 17:22:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//删除endpoint
|
|
|
|
|
|
del() {
|
|
|
|
|
|
this.$confirm(this.$t("tip.confirmDelete"), {
|
|
|
|
|
|
confirmButtonText: this.$t("tip.yes"),
|
|
|
|
|
|
cancelButtonText: this.$t("tip.no"),
|
|
|
|
|
|
type: 'warning'
|
|
|
|
|
|
}).then(() => {
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.$delete("endpoint?ids=" + this.editEndpoint.id).then(response => {
|
2019-12-19 17:22:18 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.$message({duration: 1000, type: 'success', message: this.$t("tip.deleteSuccess")});
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.esc(true);
|
2019-12-19 17:22:18 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
// endpoint弹框的asset子弹框顶部搜索条件选中事件
|
|
|
|
|
|
dropdownSelect(label) {
|
|
|
|
|
|
this.assetSearch.label = label;
|
|
|
|
|
|
this.assetSearch.dropdownShow = false;
|
|
|
|
|
|
},
|
2020-04-17 21:00:35 +08:00
|
|
|
|
/*asset搜索建议*/
|
|
|
|
|
|
assetSuggestion(queryString, callback) {
|
|
|
|
|
|
let data = [];
|
|
|
|
|
|
if (!queryString) {
|
|
|
|
|
|
data = this.assetList;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
for (let i = 0; i < this.assetList.length; i++) {
|
|
|
|
|
|
if (this.assetList[i].host.indexOf(queryString.toLowerCase()) != -1) {
|
|
|
|
|
|
data.push(this.assetList[i]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
callback(data);
|
|
|
|
|
|
},
|
2019-12-19 17:22:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
mounted() {
|
2020-07-28 19:42:25 +08:00
|
|
|
|
this.getProjectList().then(response => {
|
|
|
|
|
|
this.getModuleList(this.editEndpoint.projectId);
|
|
|
|
|
|
});
|
|
|
|
|
|
this.getAssetList();
|
2019-12-19 17:22:18 +08:00
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
2020-07-28 19:42:25 +08:00
|
|
|
|
endpoint:{
|
|
|
|
|
|
immediate: true,
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
handler(n, o) {
|
|
|
|
|
|
console.info(n)
|
|
|
|
|
|
this.editEndpoint = JSON.parse(JSON.stringify(n));
|
2020-05-09 16:54:41 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
2019-12-18 17:00:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2020-01-15 20:55:24 +08:00
|
|
|
|
.nz-btn-edit-ok{
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
right:0;
|
|
|
|
|
|
}
|
|
|
|
|
|
.nz-btn-edit-esc{
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
bottom: 0;
|
|
|
|
|
|
left:0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-01-19 17:03:16 +08:00
|
|
|
|
/* begin--搜索框*/
|
|
|
|
|
|
.endpoint-asset-search {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
margin-top: -16px;
|
|
|
|
|
|
}
|
2020-02-20 11:38:23 +08:00
|
|
|
|
.endpoint-asset-search button {
|
|
|
|
|
|
height: 22px !important;
|
|
|
|
|
|
}
|
2020-01-19 17:03:16 +08:00
|
|
|
|
.endpoint-asset-search-dropdown {
|
|
|
|
|
|
position: absolute;
|
2020-02-20 18:14:38 +08:00
|
|
|
|
top: 25px;
|
2020-01-19 17:03:16 +08:00
|
|
|
|
background-color: #444;
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
width: 44px;
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-asset-search-dropdown-item {
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
line-height: 22px;
|
|
|
|
|
|
height: 22px;
|
|
|
|
|
|
cursor: default;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-asset-label-txt {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
width: 19px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-asset-search-dropdown-item:first-of-type {
|
|
|
|
|
|
border-radius: 4px 4px 0 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-asset-search-dropdown-item:last-of-type {
|
|
|
|
|
|
border-radius: 0 0 4px 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-asset-search-dropdown-item:hover {
|
|
|
|
|
|
background-color: #222;
|
|
|
|
|
|
color: #ff9900;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-asset-search-input {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
width: 150px;
|
|
|
|
|
|
vertical-align: top;
|
|
|
|
|
|
}
|
|
|
|
|
|
/* end--搜索框*/
|
|
|
|
|
|
|
|
|
|
|
|
/* begin--table*/
|
|
|
|
|
|
.endpoint-sub-table {
|
|
|
|
|
|
padding-top: 30px;
|
|
|
|
|
|
height: 440px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.line-100 {
|
|
|
|
|
|
margin-bottom: 3px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-sub-table-head {
|
|
|
|
|
|
line-height: 28px;
|
|
|
|
|
|
height: 30px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-sub-table-row, .endpoint-sub-table-row-disabled {
|
|
|
|
|
|
line-height: 28px;
|
|
|
|
|
|
height: 30px;
|
|
|
|
|
|
color: #656565;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-sub-table-row:hover {
|
|
|
|
|
|
background-color: #dadada;
|
|
|
|
|
|
cursor: default;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-sub-table-row-active {
|
|
|
|
|
|
background-color: #dadada;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-sub-table-row-selected {
|
|
|
|
|
|
background-color: #656565;
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-sub-table-col {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
width: calc(50% - 15px);
|
|
|
|
|
|
padding-left: 10px;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-sub-table-paginate-all {
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
left: 10px;
|
|
|
|
|
|
bottom: 17px;
|
|
|
|
|
|
color: #5a5a5a;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-sub-table-body {
|
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
overflow: auto;
|
|
|
|
|
|
height: calc(100% - 34px);
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-sub-table-body-dialog {
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
background-color: #e9ebec;
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
opacity: 0.2;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoints-clear-btn {
|
|
|
|
|
|
margin: 6px 0 0 7px;
|
|
|
|
|
|
}
|
|
|
|
|
|
/* end--table*/
|
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
2020-03-09 18:05:43 +08:00
|
|
|
|
.right-box-edit-endpoint .el-pagination__total {
|
2020-01-19 17:03:16 +08:00
|
|
|
|
float: left;
|
|
|
|
|
|
}
|
2020-03-09 18:05:43 +08:00
|
|
|
|
right-box-edit-endpoint .pagination {
|
2020-01-19 17:03:16 +08:00
|
|
|
|
padding-top: 12px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.endpoint-sub-table-paginate .el-pager li, .endpoint-sub-table-paginate .el-pagination .btn-next, .endpoint-sub-table-paginate .el-pagination .btn-prev {
|
|
|
|
|
|
font-size: 13px;
|
2020-02-14 18:01:48 +08:00
|
|
|
|
min-width: 20px !important;
|
2020-01-19 17:03:16 +08:00
|
|
|
|
-webkit-box-sizing: border-box;
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
border: 1px solid rgba(154,154,154,0.20);
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
}
|
2020-02-14 18:01:48 +08:00
|
|
|
|
.endpoint-sub-table-paginate .el-pagination.is-background .el-pager li:not(.disabled).active {
|
|
|
|
|
|
color: white !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
.endpoint-sub-table-paginate .el-pagination.is-background .el-pager li:not(.disabled):hover {
|
|
|
|
|
|
color: #666;
|
|
|
|
|
|
}
|
2020-03-09 18:05:43 +08:00
|
|
|
|
.right-box-edit-endpoint .el-pagination .el-pager li.btn-quicknext, .right-box-edit-endpoint .el-pager li.btn-quickprev {
|
2020-01-19 17:03:16 +08:00
|
|
|
|
line-height: 20px;
|
|
|
|
|
|
}
|
2020-03-09 18:05:43 +08:00
|
|
|
|
.right-box-edit-endpoint .el-pagination .el-pager .more::before {
|
2020-01-19 17:03:16 +08:00
|
|
|
|
line-height: 20px;
|
|
|
|
|
|
}
|
2020-03-09 18:05:43 +08:00
|
|
|
|
.right-box-edit-endpoint .el-pager li.number{
|
2020-01-19 17:03:16 +08:00
|
|
|
|
font-family: NotoSansSC-Regular;
|
|
|
|
|
|
color: #666666;
|
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
|
font-weight:normal;
|
|
|
|
|
|
}
|
2020-03-09 18:05:43 +08:00
|
|
|
|
.right-box-edit-endpoint .el-pager li.number.active{
|
2020-01-19 17:03:16 +08:00
|
|
|
|
font-family: NotoSansSC-Regular;
|
|
|
|
|
|
color: #FFFFFF;
|
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.endpoint-sub-table-paginate .el-pagination.is-background .el-pager li:not(.disabled).active {
|
|
|
|
|
|
background-color: $global-text-color-active;
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
}
|
2020-03-09 18:05:43 +08:00
|
|
|
|
.right-box-edit-endpoint .el-pager li:hover, .right-box-edit-endpoint .el-pagination .btn-next:hover, .right-box-edit-endpoint .el-pagination .btn-prev:hover {
|
2020-01-19 17:03:16 +08:00
|
|
|
|
font-family: NotoSansSC-Regular;
|
|
|
|
|
|
color: #666666;
|
|
|
|
|
|
letter-spacing: 0;
|
|
|
|
|
|
font-weight:normal;
|
|
|
|
|
|
}
|
2020-03-09 18:05:43 +08:00
|
|
|
|
.right-box-edit-endpoint .el-pagination__sizes .el-input .el-input__inner, .right-box-edit-endpoint .el-pagination__editor.el-input .el-input__inner{
|
2020-01-19 17:03:16 +08:00
|
|
|
|
height: 20px;
|
|
|
|
|
|
border-color: rgba(154,154,154,0.20);
|
|
|
|
|
|
}
|
2020-03-09 18:05:43 +08:00
|
|
|
|
.right-box-edit-endpoint .el-pagination__sizes .el-input .el-input__inner:hover{
|
2020-01-19 17:03:16 +08:00
|
|
|
|
border-color: rgba(154,154,154,0.20);
|
|
|
|
|
|
}
|
2019-12-18 17:00:44 +08:00
|
|
|
|
</style>
|