修改样式

This commit is contained in:
王振 2020-05-11 23:40:19 +08:00
parent 96b8c89071
commit 833050a9ef
18 changed files with 198 additions and 153 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="container" v-loading="result.loading"> <div class="container" v-loading="result.loading">
<div class="main-content"> <div class="main-content">
<el-card> <el-card class="table-card">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="search" :title="$t('commons.test')" <ms-table-header :condition.sync="condition" @search="search" :title="$t('commons.test')"
:show-create="false"/> :show-create="false"/>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="container" v-loading="result.loading"> <div class="container" v-loading="result.loading">
<div class="main-content"> <div class="main-content">
<el-card> <el-card class="table-card">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="search" :title="$t('commons.test')" <ms-table-header :condition.sync="condition" @search="search" :title="$t('commons.test')"
@create="create" :createTip="$t('load_test.create')"/> @create="create" :createTip="$t('load_test.create')"/>

View File

@ -2,7 +2,7 @@
<div class="container" v-loading="result.loading"> <div class="container" v-loading="result.loading">
<div class="main-content"> <div class="main-content">
<el-card> <el-card class="table-card">
<template v-slot:header> <template v-slot:header>
<div> <div>
<el-row type="flex" justify="space-between" align="middle"> <el-row type="flex" justify="space-between" align="middle">

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="container" v-loading="result.loading"> <div class="container" v-loading="result.loading">
<div class="main-content"> <div class="main-content">
<el-card> <el-card class="table-card">
<template v-slot:header> <template v-slot:header>
<div> <div>
<el-row type="flex" justify="space-between" align="middle"> <el-row type="flex" justify="space-between" align="middle">

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="container"> <div class="container">
<div class="main-content"> <div class="main-content">
<el-card v-loading="result.loading"> <el-card class="table-card" v-loading="result.loading">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="search" @create="create" <ms-table-header :condition.sync="condition" @search="search" @create="create"
:create-tip="btnTips" :title="title"/> :create-tip="btnTips" :title="title"/>

View File

@ -1,6 +1,6 @@
<template> <template>
<div v-loading="result.loading"> <div v-loading="result.loading">
<el-card> <el-card class="table-card">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="initTableData" @create="create" <ms-table-header :condition.sync="condition" @search="initTableData" @create="create"
:create-tip="btnTips" :title="$t('commons.member')"/> :create-tip="btnTips" :title="$t('commons.member')"/>

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-card v-loading="result.loading"> <el-card class="table-card" v-loading="result.loading">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="list" @create="create" <ms-table-header :condition.sync="condition" @search="list" @create="create"
:create-tip="btnTips" :title="$t('commons.workspace')"/> :create-tip="btnTips" :title="$t('commons.workspace')"/>

View File

@ -1,6 +1,6 @@
<template> <template>
<div v-loading="result.loading"> <div v-loading="result.loading">
<el-card> <el-card class="table-card">
<template v-slot:header> <template v-slot:header>
<div> <div>
<el-row type="flex" just ify="space-between" align="middle"> <el-row type="flex" just ify="space-between" align="middle">

View File

@ -1,7 +1,7 @@
<template> <template>
<div v-loading="result.loading"> <div v-loading="result.loading">
<el-card> <el-card class="table-card">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="initTableData" @create="create" <ms-table-header :condition.sync="condition" @search="initTableData" @create="create"
:create-tip="btnTips" :title="$t('commons.organization')"/> :create-tip="btnTips" :title="$t('commons.organization')"/>

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-card v-loading="result.loading"> <el-card class="table-card" v-loading="result.loading">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="list" @create="create" <ms-table-header :condition.sync="condition" @search="list" @create="create"
:create-tip="btnTips" :title="$t('commons.workspace')"/> :create-tip="btnTips" :title="$t('commons.workspace')"/>

View File

@ -1,7 +1,7 @@
<template> <template>
<div v-loading="result.loading"> <div v-loading="result.loading">
<el-card> <el-card class="table-card">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="search" @create="create" <ms-table-header :condition.sync="condition" @search="search" @create="create"
:create-tip="btnTips" :title="$t('commons.test_resource_pool')"/> :create-tip="btnTips" :title="$t('commons.test_resource_pool')"/>

View File

@ -1,7 +1,7 @@
<template> <template>
<div v-loading="result.loading"> <div v-loading="result.loading">
<el-card> <el-card class="table-card">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="search" @create="create" <ms-table-header :condition.sync="condition" @search="search" @create="create"
:create-tip="btnTips" :title="$t('commons.member')"/> :create-tip="btnTips" :title="$t('commons.member')"/>

View File

@ -1,6 +1,6 @@
<template> <template>
<div v-loading="result.loading"> <div v-loading="result.loading">
<el-card> <el-card class="table-card">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="initTableData" @create="create" <ms-table-header :condition.sync="condition" @search="initTableData" @create="create"
:create-tip="btnTips" :title="$t('commons.member')"/> :create-tip="btnTips" :title="$t('commons.member')"/>

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<el-card v-loading="result.loading"> <el-card class="table-card" v-loading="result.loading">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="initTableData" <ms-table-header :condition.sync="condition" @search="initTableData"

View File

@ -1,8 +1,6 @@
<template> <template>
<div v-loading="result.loading"> <div v-loading="result.loading">
<el-input :placeholder="$t('test_track.module.search')" v-model="filterText" <el-input :placeholder="$t('test_track.module.search')" v-model="filterText" size="small">
size="small">
<template v-if="type == 'edit'" v-slot:append> <template v-if="type == 'edit'" v-slot:append>
<el-button icon="el-icon-folder-add" @click="openEditNodeDialog('add')"></el-button> <el-button icon="el-icon-folder-add" @click="openEditNodeDialog('add')"></el-button>
</template> </template>
@ -17,15 +15,42 @@
:expand-on-click-node="false" :expand-on-click-node="false"
highlight-current highlight-current
draggable draggable
ref="tree"> ref="tree"
>
<template v-slot:default="{node,data}"> <template v-slot:default="{node,data}">
<span class="custom-tree-node father" @click="handleNodeSelect(node)"> <span class="custom-tree-node father" @click="handleNodeSelect(node)">
<span class="node-icon">
<i class="el-icon-folder"></i>
</span>
<span>{{node.label}}</span> <span class="node-title">{{node.label}}</span>
<el-dropdown v-if="type == 'edit'" class="node-dropdown child"> <span v-if="type == 'edit'" class="node-operate child">
<el-tooltip
class="item"
effect="dark"
open-delay="200"
:content="$t('test_track.module.rename')"
placement="top"
>
<i @click="openEditNodeDialog('edit', data)" class="el-icon-edit"></i>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
open-delay="200"
:content="$t('test_track.module.add_submodule')"
placement="top"
>
<i @click="openEditNodeDialog('add', data)" class="el-icon-circle-plus-outline"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark"
open-delay="200" :content="$t('commons.delete')" placement="top">
<i @click="remove(node, data)" class="el-icon-delete"></i>
</el-tooltip>
</span>
<!-- <el-dropdown v-if="type == 'edit'" class="node-dropdown child">
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<i class="el-icon-folder-add"></i> <i class="el-icon-folder-add"></i>
</span> </span>
@ -34,28 +59,25 @@
<div @click="openEditNodeDialog('edit', data)">{{$t('test_track.module.rename')}}</div> <div @click="openEditNodeDialog('edit', data)">{{$t('test_track.module.rename')}}</div>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item> <el-dropdown-item>
<div @click="openEditNodeDialog('add', data)">{{$t('test_track.module.add_submodule')}}</div> <div
@click="openEditNodeDialog('add', data)"
>{{$t('test_track.module.add_submodule')}}</div>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item> <el-dropdown-item>
<div @click="remove(node, data)">{{$t('commons.delete')}}</div> <div @click="remove(node, data)">{{$t('commons.delete')}}</div>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>-->
</span> </span>
</template> </template>
</el-tree> </el-tree>
<node-edit ref="nodeEdit" :tree-nodes="treeNodes" @refresh="refreshNode" /> <node-edit ref="nodeEdit" :tree-nodes="treeNodes" @refresh="refreshNode" />
</div> </div>
</template> </template>
<script> <script>
import NodeEdit from "./NodeEdit";
import NodeEdit from './NodeEdit';
export default { export default {
name: "NodeTree", name: "NodeTree",
@ -63,17 +85,17 @@
data() { data() {
return { return {
result: {}, result: {},
filterText: '', filterText: "",
defaultProps: { defaultProps: {
children: 'children', children: "children",
label: 'label' label: "label"
} }
}; };
}, },
props: { props: {
type: { type: {
type: String, type: String,
default: 'view' default: "view"
}, },
treeNodes: { treeNodes: {
type: Array type: Array
@ -91,7 +113,7 @@
handleDragEnd(draggingNode, dropNode, dropType, ev) { handleDragEnd(draggingNode, dropNode, dropType, ev) {
let param = {}; let param = {};
param.id = draggingNode.data.id; param.id = draggingNode.data.id;
if (dropType === 'inner') { if (dropType === "inner") {
param.parentId = dropNode.data.id; param.parentId = dropNode.data.id;
param.level = dropNode.data.level + 1; param.level = dropNode.data.level + 1;
} else { } else {
@ -103,14 +125,20 @@
param.level = dropNode.parent.data.level + 1; param.level = dropNode.parent.data.level + 1;
} }
} }
this.$post('/case/node/edit', param); this.$post("/case/node/edit", param);
}, },
remove(node, data) { remove(node, data) {
this.$alert(this.$t('test_track.module.delete_confirm') + data.label + "" + this.$alert(
this.$t('test_track.module.delete_all_resource') + "", '', { this.$t("test_track.module.delete_confirm") +
confirmButtonText: this.$t('commons.confirm'), data.label +
callback: (action) => { "" +
if (action === 'confirm') { this.$t("test_track.module.delete_all_resource") +
"",
"",
{
confirmButtonText: this.$t("commons.confirm"),
callback: action => {
if (action === "confirm") {
let nodeIds = []; let nodeIds = [];
this.getChildNodeId(node, nodeIds); this.getChildNodeId(node, nodeIds);
this.$post("/case/node/delete", nodeIds, () => { this.$post("/case/node/delete", nodeIds, () => {
@ -118,12 +146,13 @@
const children = parent.data.children || parent.data; const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id); const index = children.findIndex(d => d.id === data.id);
children.splice(index, 1); children.splice(index, 1);
this.$success(this.$t('commons.delete_success')); this.$success(this.$t("commons.delete_success"));
this.$emit("refresh"); this.$emit("refresh");
}); });
} }
} }
}); }
);
}, },
handleNodeSelect(node) { handleNodeSelect(node) {
let nodeIds = []; let nodeIds = [];
@ -142,9 +171,9 @@
}, },
getParentNodeName(rootNode, nodeNames) { getParentNodeName(rootNode, nodeNames) {
if (rootNode.parent && rootNode.parent.id != 0) { if (rootNode.parent && rootNode.parent.id != 0) {
this.getParentNodeName(rootNode.parent, nodeNames) this.getParentNodeName(rootNode.parent, nodeNames);
} }
if (rootNode.data.name && rootNode.data.name != '') { if (rootNode.data.name && rootNode.data.name != "") {
nodeNames.push(rootNode.data.name); nodeNames.push(rootNode.data.name);
} }
}, },
@ -156,17 +185,16 @@
this.$refs.nodeEdit.open(type, data); this.$refs.nodeEdit.open(type, data);
}, },
refreshNode() { refreshNode() {
this.$emit('refresh'); this.$emit("refresh");
}
} }
} }
};
</script> </script>
<style scoped> <style scoped>
.el-dropdown-link { .el-dropdown-link {
cursor: pointer; cursor: pointer;
color: #409EFF; color: #409eff;
} }
.el-icon-arrow-down { .el-icon-arrow-down {
@ -174,7 +202,7 @@
} }
.custom-tree-node { .custom-tree-node {
flex: 1; flex: 1 1 auto;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
@ -195,4 +223,17 @@
display: block; display: block;
} }
.node-title {
width: 0px;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1 1 auto;
padding: 0px 5px;
overflow: hidden;
}
.node-operate > i {
color: #409eff;
margin: 0px 5px;
}
</style> </style>

View File

@ -2,7 +2,7 @@
<div class="container"> <div class="container">
<el-main class="main-content"> <el-main class="main-content">
<el-card v-loading="result.loading"> <el-card class="table-card" v-loading="result.loading">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="initTableData" @create="testPlanCreate" <ms-table-header :condition.sync="condition" @search="initTableData" @create="testPlanCreate"
:create-tip="$t('test_track.plan.create_plan')" :title="$t('test_track.plan.test_plan')"/> :create-tip="$t('test_track.plan.create_plan')" :title="$t('test_track.plan.test_plan')"/>

View File

@ -1,5 +1,5 @@
<template> <template>
<el-card v-loading="result.loading"> <el-card class="table-card" v-loading="result.loading">
<template v-slot:header> <template v-slot:header>
<ms-table-header :condition.sync="condition" @search="initTableData" :show-create="false"> <ms-table-header :condition.sync="condition" @search="initTableData" :show-create="false">
<template v-slot:title> <template v-slot:title>

View File

@ -32,3 +32,7 @@ body {
display: table; display: table;
clear: both; clear: both;
} }
.table-card > .el-card__body {
padding-top: 0;
}