Commit ccd943a1 by qianmo

update:优化协议界面

parent 58301397
No preview for this file type
<template> <template>
<div class="common-layout"> <div class="common-layout">
<el-container> <el-container style="height: 100vh">
<el-header> <el-header>
<el-menu :default-active="activeIndex" class="el-menu-demo pl-20" mode="horizontal"> <el-menu :default-active="activeIndex" class="el-menu-demo pl-20" mode="horizontal">
<el-menu-item index="index"> <el-menu-item index="index">
...@@ -61,4 +61,8 @@ onMounted(async () => { ...@@ -61,4 +61,8 @@ onMounted(async () => {
.el-header { .el-header {
--el-header-padding: 0 !important; --el-header-padding: 0 !important;
} }
.el-main{
align-items: stretch;
background-color: #f4f4f4;
}
</style> </style>
<template> <template>
<div class="demo-collapse"> <div class="demo-collapse">
<div class="container"> <div class="containers">
<div class="left"> <div class="left">
<div class="mr-4">协议版本</div> <div class="mr-4">协议版本</div>
<el-select v-model="currentVersion" @change="changeProtocolVersion"> <el-select v-model="currentVersion" @change="changeProtocolVersion">
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<el-button @click="newVersionDialog = true" icon="plus" ml-4>新增版本</el-button>
</div> </div>
<div class="right"> <div class="right">
<el-upload <el-upload
...@@ -25,25 +26,28 @@ ...@@ -25,25 +26,28 @@
:on-success="uploadFileSuccess" :on-success="uploadFileSuccess"
:on-error="uploadFileFail" :on-error="uploadFileFail"
mr-4> mr-4>
<el-button>上传原始文件</el-button> <el-button icon="upload">上传原始文件</el-button>
</el-upload> </el-upload>
<el-button v-else @click="downloadFile"> 下载原始文件 </el-button> <el-button v-else @click="downloadFile" icon="download"> 下载原始文件 </el-button>
<el-button @click="newVersionDialog = true">新增版本</el-button>
<el-button @click="addCmdDialog = true">新增指令</el-button> <el-button @click="addCmdDialog = true" icon="plus">新增指令</el-button>
<!-- <el-button @click="deleteProtocol">删除该版本协议</el-button> --> <!-- <el-button @click="deleteProtocol">删除该版本协议</el-button> -->
</div> </div>
</div> </div>
<div class="my-4">协议规范</div>
<el-collapse class="mt-4"> <el-collapse class="mt-4 collapse1" accordion>
<el-collapse-item <el-collapse-item
v-for="cmd in cmdInfos"> v-for="cmd in cmdInfos">
<template #title> <template #title>
<div>{{ cmd.cmd_name + ' ' + cmd.cmd_explain + ' ' + cmd.cmd_type }}</div> <div style="width:100%; display: flex; justify-content: space-between">
<div ml-4>{{cmd.cmd_name + ' ' + cmd.cmd_explain + ' ' + cmd.cmd_type }}</div>
<div> <div>
<el-button type="danger" text @click="removeCmd(cmd.id)">删除</el-button> <el-button text type="danger" icon="delete" ml-4 @click="removeCmd(cmd.id)">删除指令</el-button>
</div> </div>
</div>
</template> </template>
<protocol-table <protocol-table
v-if="fieldInfos !== undefined" v-if="fieldInfos !== undefined"
...@@ -405,7 +409,8 @@ const addNewVersion = () => { ...@@ -405,7 +409,8 @@ const addNewVersion = () => {
</script> </script>
<style> <style>
.container { .containers {
width: 100%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
/* 使内部元素平均分布 */ /* 使内部元素平均分布 */
...@@ -424,4 +429,18 @@ const addNewVersion = () => { ...@@ -424,4 +429,18 @@ const addNewVersion = () => {
display: flex; display: flex;
align-items: center; align-items: center;
/* 垂直居中 */ /* 垂直居中 */
}</style> }
.collapse1 .el-collapse-item__header {
background-color: white; /* 设置展开区域的头部颜色 */
}
.collapse1 .el-collapse-item__wrap {
border: 1px solid;
padding: 10px;
}
/*.collapse1 .el-collapse-item__wrap {*/
/* background-color: white; !* 设置展开区域的背景颜色 *!*/
/*}*/
/*.collapse1 .el-collapse-item:nth-child(even) .el-collapse-item__header {*/
/* background-color: red; !* 奇数项的背景颜色 *!*/
/*}*/
</style>
<template> <template>
<div class="demo-collapse"> <div class="demo-collapse">
<el-collapse> <el-collapse accordion class="collapse2">
<el-collapse-item v-for="item in protocolNames"> <el-collapse-item v-for="item in protocolNames">
<template #title> <template #title>
<div> {{ item }} </div> <div style="display: flex;width: 100%;justify-content: space-between">
<div> <div style="padding-left: 40px"> {{ item }} </div>
<el-button type="danger" text @click="removeProtocol(item)">删除</el-button> <div >
<el-button text type="danger" icon="delete" @click="removeProtocol(item)">删除协议</el-button>
</div> </div>
</div>
</template> </template>
<div style="margin: auto; width: 90%"> <div style="margin: auto; width: 90%">
<collapse-table <collapse-table
...@@ -56,8 +59,7 @@ const removeProtocol = (protocolName: string) => { ...@@ -56,8 +59,7 @@ const removeProtocol = (protocolName: string) => {
</script> </script>
<style> <style>
.el-collapse-item__header { .collapse2 .el-collapse-item__wrap {
padding-left: 40px; /*background-color: #f9f9f9; !* 设置展开区域的背景颜色 *!*/
/* 调整合适的左边距值 */
} }
</style> </style>
<template> <template>
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData"
:header-cell-style="{backgroundColor:'#eff3f8', 'text-align':'center',color: 'black'}"
border
:cell-style="{'text-align':'center'}"
>
<el-table-column fixed prop="fieldname" label="字段名" style="width: 25%" /> <el-table-column fixed prop="fieldname" label="字段名" style="width: 25%" />
<el-table-column prop="fieldsize" label="字段长度" style="width: 25%" /> <el-table-column prop="fieldsize" label="字段长度" style="width: 25%" />
<el-table-column prop="value" label="默认值" style="width: 25%" /> <el-table-column prop="value" label="默认值" style="width: 25%" />
<el-table-column fixed="right" style="width: 25%"> <el-table-column fixed="right" label="操作" style="width: 25%">
<template #default="{ row }"> <template #default="{ row }">
<div style="display: flex;"> <div style="display: flex;justify-content: center">
<el-button type="primary" @click="open('delete', row)">删除字段</el-button> <el-button icon="delete" @click="open('delete', row)">删除字段</el-button>
<el-button type="primary" @click="editField(row)">修改字段</el-button> <el-button icon="edit" @click="editField(row)">修改字段</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -338,4 +342,17 @@ const dialogSubmit = (flag: boolean, data: CmdInfo) => { ...@@ -338,4 +342,17 @@ const dialogSubmit = (flag: boolean, data: CmdInfo) => {
margin-bottom: 10px; margin-bottom: 10px;
/* 添加间距 */ /* 添加间距 */
} }
.el-table {
border-collapse: collapse;
}
/*.el-table th, .el-table td {*/
/* border: 1px solid #ccc;*/
/*}*/
/*.el-table td.is-hover, .el-table td:hover {*/
/* border: 1px solid #409EFF;*/
/*}*/
</style> </style>
\ No newline at end of file
<template> <template>
<div class="button-container"> <div class="button-container">
<el-button class="ml-10" @click="isShow = true">新增协议</el-button> <el-button @click="isShow = true">新增协议</el-button>
<!-- <div> <!-- <div>
<el-button>导出数据库</el-button> <el-button>导出数据库</el-button>
</div> --> </div> -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment