@ -1,59 +1,124 @@
< template >
< div class = "wrap" v-loading ="loading" >
< div class = "wrap"
v - loading = "loading" >
< breadcrumb data = "返回实验/我的数据" > < / breadcrumb >
< div class = "inner" >
< div class = "tool" >
< el -input style = "width: 250px" placeholder = "请输入文件名称" v-model ="keyword" suffix-icon="el-icon-search" clearable size="small" > < / el -input >
< el -input style = "width: 250px"
placeholder = "请输入文件名称"
v - model = "keyword"
suffix - icon = "el-icon-search"
clearable
size = "small" > < / e l - i n p u t >
< div class = "action" >
< el -button class = "cus-btn" type = "primary" size = "small" @ click = "sourceVisible = true" > 导入数据 < / e l - b u t t o n >
< el -button class = "cus-btn" style = "margin-left: 10px;" type = "primary" size = "small" @click ="delAll" > 批量删除 < / el -button >
< el -button class = "cus-btn"
type = "primary"
size = "small"
@ click = "sourceVisible = true" > 导入数据 < / e l - b u t t o n >
< el -button class = "cus-btn"
style = "margin-left: 10px;"
type = "primary"
size = "small"
@ click = "delAll" > 批量删除 < / e l - b u t t o n >
< / div >
< / div >
< el -table :data ="list" class = "cus-table" ref = "table" stripe header -align = " center " empty -text = " 暂无数据 , 支持导入xlsx 、 csv 、 txt等格式的文件 " @selection-change ="handleSelectionChange" >
< el -table -column type = "selection" width = "80" align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column type = "index" label = "序号" width = "55" align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "fileName" label = "文件名称" align = "center" show -overflow -tooltip > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "createTime" label = "导入时间" align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "fileSize" label = "文件大小" width = "120" align = "center" >
< el -table :data ="list"
class = "cus-table"
ref = "table"
stripe
header - align = "center"
empty - text = "暂无数据,支持导入xlsx 、csv 、txt等格式的文件"
@ selection - change = "handleSelectionChange" >
< el -table -column type = "selection"
width = "80"
align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column type = "index"
label = "序号"
width = "55"
align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "fileName"
label = "文件名称"
align = "center"
show - overflow - tooltip > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "createTime"
label = "导入时间"
align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "fileSize"
label = "文件大小"
width = "120"
align = "center" >
< template slot -scope = " scope " >
{ { ( scope . row . fileSize / 1024 / 1024 ) . toFixed ( 3 ) } } MB
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "fileFormat" label = "格式" width = "100" align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column label = "文件路径" align = "center" >
< el -table -column prop = "fileFormat"
label = "格式"
width = "100"
align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column label = "文件路径"
align = "center" >
< template slot -scope = " scope " >
{ { scope . row . ossFileName } }
< i class = "el-icon-document-copy copy" @ click = "copy($event, scope.row)" > < / i >
< i class = "el-icon-document-copy copy"
@ click = "copy($event, scope.row)" > < / i >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column width = "300" label = "操作" align = "center" >
< el -table -column width = "300"
label = "操作"
align = "center" >
< template slot -scope = " scope " >
< el -button type = "text" @click ="show(scope.row)" > 查看 < / el -button >
< el -button type = "text" @click ="download(scope.row)" > 下载 < / el -button >
< el -button type = "text" @click ="del(scope.row)" > 删除 < / el -button >
< el -button type = "text"
@ click = "show(scope.row)" > 查看 < / e l - b u t t o n >
< el -button type = "text"
@ click = "download(scope.row)" > 下载 < / e l - b u t t o n >
< el -button type = "text"
@ click = "del(scope.row)" > 删除 < / e l - b u t t o n >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
< div class = "pagination" >
< el -pagination background layout = "total,prev, pager, next" :current-page ="page" @current-change ="handleCurrentChange" :total ="total" > < / e l - p a g i n a t i o n >
< el -pagination background
layout = "total,prev, pager, next"
: current - page = "page"
@ current - change = "handleCurrentChange"
: total = "total" > < / e l - p a g i n a t i o n >
< / div >
< el -dialog title = "请选择数据源" :visible.sync ="sourceVisible" width = "400px" :close-on-click-modal ="false" >
< el -dialog title = "请选择数据源"
: visible . sync = "sourceVisible"
width = "400px"
: close - on - click - modal = "false" >
< ul class = "source-list" >
< li style = "width: 48%" @click ="showData" >
< img src = "@/assets/images/dataforward.png" alt = "" >
< li style = "width: 48%"
@ click = "showData" >
< img src = "@/assets/images/dataforward.png"
alt = "" >
< / li >
< el -upload class = "upload" :headers ="{token}" :action ="api.fileUpload" name = "file" :limit ="1000" :show-file-list ="false" :before-upload ="beforeImport" :on-success ="successImport" >
< el -upload class = "upload"
drag
: headers = "{token}"
: action = "api.fileUpload"
name = "file"
: limit = "1000"
: show - file - list = "false"
: before - upload = "beforeImport"
: on - success = "successImport" >
< li style = "width: 100%;" > 本地上传 < / li >
< / e l - u p l o a d >
< / ul >
< / e l - d i a l o g >
<!-- 导入数据 -- >
< el -dialog title = "导入" :visible.sync ="importVisible" width = "80%" center class = "dialog" :close-on-click-modal ="false" >
< el -dialog title = "导入"
: visible . sync = "importVisible"
width = "80%"
center
class = "dialog"
: close - on - click - modal = "false" >
< el -container style = "padding: 20px 0 20px 20px;background-color: #f0f0f0;" >
< div style = "overflow:auto;height: 558px;width:330px;padding:15px;background:#fff" ref = "typeTreeWrap" >
< div style = "overflow:auto;height: 558px;width:330px;padding:15px;background:#fff"
ref = "typeTreeWrap" >
< el -tree v -loading = " importLoading "
ref = "typeTree"
: data = "importTypeList"
@ -66,62 +131,123 @@
: props = " {
label : 'categoryName'
} "
@ node - click = "typeClick"
>
@ node - click = "typeClick" >
< / e l - t r e e >
< / div >
< el -main style = "padding-top: 0;padding-bottom: 0;" >
< el -card shadow = "hover" >
< el -input style = "width: 250px;margin-bottom: 15px;" placeholder = "请输入表名称" v-model ="keywordTable" suffix-icon="el-icon-search" clearable size="small" > < / el -input >
< el -table v-loading ="tableLoading" :data="tables" class="cus-table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" >
< el -table -column width = "40" align = "center" >
< el -input style = "width: 250px;margin-bottom: 15px;"
placeholder = "请输入表名称"
v - model = "keywordTable"
suffix - icon = "el-icon-search"
clearable
size = "small" > < / e l - i n p u t >
< el -table v -loading = " tableLoading "
: data = "tables"
class = "cus-table"
ref = "table"
stripe
header - align = "center"
@ selection - change = "handleSelectionChange" >
< el -table -column width = "40"
align = "center" >
< template slot -scope = " scope " >
< el -radio class = "check-table" v-model ="curTable" :label="scope.row.id" > < / el -radio >
< el -radio class = "check-table"
v - model = "curTable"
: label = "scope.row.id" > < / e l - r a d i o >
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column type = "index" width = "50" label = "序号" align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "tableComment" label = "数据表名称" align = "center" >
< el -table -column type = "index"
width = "50"
label = "序号"
align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "tableComment"
label = "数据表名称"
align = "center" >
< template slot -scope = " scope " >
{ { scope . row . tableComment ? scope . row . tableComment : scope . row . showName } }
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "dataTotal" label = "数据总量" width = "80" align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "timeRange" label = "起止日期" width = "200" align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "dataSize" label = "数据大小" width = "80" align = "center" >
< el -table -column prop = "dataTotal"
label = "数据总量"
width = "80"
align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "timeRange"
label = "起止日期"
width = "200"
align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column prop = "dataSize"
label = "数据大小"
width = "80"
align = "center" >
< template slot -scope = " scope " >
{ { scope . row . dataSize } } M
< / template >
< / e l - t a b l e - c o l u m n >
< el -table -column prop = "updateTime" label = "更新时间" width = "160" align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column label = "操作" width = "80" align = "center" >
< el -table -column prop = "updateTime"
label = "更新时间"
width = "160"
align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column label = "操作"
width = "80"
align = "center" >
< template slot -scope = " scope " >
< el -button type = "text" @click ="preview(scope.row)" > 预览 < / el -button >
< el -button type = "text"
@ click = "preview(scope.row)" > 预览 < / e l - b u t t o n >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
< div class = "pagination" >
< el -pagination background layout = "total, prev, pager, next" :current-page ="pageTable" @current-change ="handleCurrentChangeTable" :total ="totalTable" >
< el -pagination background
layout = "total, prev, pager, next"
: current - page = "pageTable"
@ current - change = "handleCurrentChangeTable"
: total = "totalTable" >
< / e l - p a g i n a t i o n >
< / div >
< / e l - c a r d >
< / e l - m a i n >
< / e l - c o n t a i n e r >
< span slot = "footer" class = "dialog-footer" >
< span slot = "footer"
class = "dialog-footer" >
< el -button @ click = "importVisible = false" > 取 消 < / e l - b u t t o n >
< el -button class = "cus-btn" type = "primary" :loading ="submited" @click ="confirmImport" > 确 定 < / el -button >
< el -button class = "cus-btn"
type = "primary"
: loading = "submited"
@ click = "confirmImport" > 确 定 < / e l - b u t t o n >
< / span >
< / e l - d i a l o g >
< el -dialog title = "预览" :visible.sync ="previewVisible" width = "60%" center :close-on-click-modal ="false" >
< el -table :data ="previewData" class = "cus-table" stripe header -align = " center " row -key = " id " >
< el -table -column type = "index" width = "100" label = "序号" align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column v-for ="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.comment" align="center" > < / el -table -column >
< el -dialog title = "预览"
: visible . sync = "previewVisible"
width = "60%"
center
: close - on - click - modal = "false" >
< el -table :data ="previewData"
class = "cus-table"
stripe
header - align = "center"
row - key = "id" >
< el -table -column type = "index"
width = "100"
label = "序号"
align = "center" > < / e l - t a b l e - c o l u m n >
< el -table -column v -for = " ( item , index ) in previewHead "
: prop = "item.field"
: key = "index"
: label = "item.comment"
align = "center" > < / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
< / e l - d i a l o g >
<!-- 购买弹框 -- >
< el -dialog title = "温馨提示" :visible.sync ="buyVisible" width = "400px" center :close-on-click-modal ="false" >
< el -dialog title = "温馨提示"
: visible . sync = "buyVisible"
width = "400px"
center
: close - on - click - modal = "false" >
< div class = "buy" >
< p class = "tips" > 当前院校暂未购买该数据库 , 请扫码咨询购买 < / p >
< img src = "@/assets/images/wechat-code.jpeg" alt = "" >
< img src = "@/assets/images/wechat-code.jpeg"
alt = "" >
< / div >
< / e l - d i a l o g >
< / div >
@ -504,7 +630,7 @@ export default {
font - size : 16 px ;
color : # 333 ;
border - radius : 8 px ;
background - color : # F6F8FA ;
background - color : # f6f8fa ;
border : 1 px solid transparent ;
cursor : pointer ;
img {
@ -521,6 +647,11 @@ export default {
& : focus {
color : # 007 eff ;
}
. el - upload - dragger {
width : auto ;
height : auto ;
border : 0 ;
}
}
}
}
@ -539,7 +670,9 @@ export default {
display : none ;
}
}
/deep/ . el - tree -- highlight - current . el - tree - node . is - current > . el - tree - node _ _content {
/deep/ . el - tree -- highlight - current
. el - tree - node . is - current
> . el - tree - node _ _content {
background - color : # e8f0ff ;
}
/deep/ . el - radio _ _input . is - checked . el - radio _ _inner {