openf12
yujialong 2 years ago
parent a502f4bfcc
commit 8c33484fbf
  1. BIN
      src/assets/images/wechat-code.jpeg
  2. 4
      src/components/TestPanel.vue
  3. 2
      src/config/index.js
  4. 4
      src/styles/common.scss
  5. 94
      src/views/Data.vue

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

@ -557,6 +557,7 @@ export default {
judgmentName: e.name, judgmentName: e.name,
answer: e.code, answer: e.code,
score: e.examScore, score: e.examScore,
quesScore: e.score
}) })
// //
this.$get(this.api.queryBcJudgmentPointByBcId, { this.$get(this.api.queryBcJudgmentPointByBcId, {
@ -796,6 +797,9 @@ export default {
th.is-leaf { th.is-leaf {
border-bottom: 0 !important; border-bottom: 0 !important;
} }
.el-table__cell {
padding: 6px 0;
}
} }
.goal { .goal {
padding: 10px 0; padding: 10px 0;

@ -10,7 +10,7 @@ let bankPath = `${location.origin}/banksystem` // 银行系统
// 121.37.12.51 | 192.168.31.151 // 121.37.12.51 | 192.168.31.151
if (isDev) { if (isDev) {
host = 'http://192.168.31.151:9000/' host = 'http://192.168.31.151:9000/'
// host = 'http://121.37.12.51:9000/' host = 'http://121.37.12.51:9000/'
bankPath = `http://${location.hostname}:8093` bankPath = `http://${location.hostname}:8093`
} else if (isPro) { } else if (isPro) {
host = 'https://occupationlab.com/' host = 'https://occupationlab.com/'

@ -39,7 +39,6 @@ body .cus-table.el-table {
background-color: #E8F0FF !important; background-color: #E8F0FF !important;
.cell{ .cell{
color: #222326; color: #222326;
font-size: 12px;
font-weight: normal; font-weight: normal;
.el-checkbox{ .el-checkbox{
&:before{ &:before{
@ -51,6 +50,9 @@ body .cus-table.el-table {
th, td{ th, td{
padding: 10px 0; padding: 10px 0;
border-bottom-color: #E1E6F2; border-bottom-color: #E1E6F2;
.cell {
font-size: 12px;
}
} }
&.el-table--striped .el-table__body tr.el-table__row--striped td{ &.el-table--striped .el-table__body tr.el-table__row--striped td{
background-color: #FAFBFF !important; background-color: #FAFBFF !important;

@ -17,7 +17,7 @@
<el-table-column prop="createTime" label="导入时间" align="center"></el-table-column> <el-table-column prop="createTime" label="导入时间" align="center"></el-table-column>
<el-table-column prop="fileSize" label="文件大小" width="120" align="center"> <el-table-column prop="fileSize" label="文件大小" width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ (scope.row.fileSize / 1024 / 1024).toFixed(2) }}MB {{ (scope.row.fileSize / 1024 / 1024).toFixed(3) }}MB
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="fileFormat" label="格式" width="100" align="center"></el-table-column> <el-table-column prop="fileFormat" label="格式" width="100" align="center"></el-table-column>
@ -66,13 +66,13 @@
:props="{ :props="{
label: 'categoryName' label: 'categoryName'
}" }"
@node-click="getTable" @node-click="typeClick"
> >
</el-tree> </el-tree>
</div> </div>
<el-main style="padding-top: 0;padding-bottom: 0;"> <el-main style="padding-top: 0;padding-bottom: 0;">
<el-card shadow="hover"> <el-card shadow="hover">
<el-input style="width: 250px;margin-bottom: 15px;" placeholder="请输入表名称" v-model="keyword" suffix-icon="el-icon-search" clearable size="small"></el-input> <el-input style="width: 250px;margin-bottom: 15px;" placeholder="请输入表名称" v-model="keywordTable" suffix-icon="el-icon-search" clearable size="small"></el-input>
<el-table :data="tables" class="cus-table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> <el-table :data="tables" class="cus-table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column width="40" align="center"> <el-table-column width="40" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -108,15 +108,22 @@
</el-container> </el-container>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false"> </el-button> <el-button @click="importVisible = false"> </el-button>
<el-button type="primary" :loading="submited" @click="confirmImport"> </el-button> <el-button class="cus-btn" type="primary" :loading="submited" @click="confirmImport"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="预览" :visible.sync="previewVisible" width="60%" center :close-on-click-modal="false"> <el-dialog title="预览" :visible.sync="previewVisible" width="60%" center :close-on-click-modal="false">
<el-table :data="previewData" class="table" stripe header-align="center" row-key="id"> <el-table :data="previewData" class="cus-table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column v-for="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.comment" align="center"></el-table-column> <el-table-column v-for="(item,index) in previewHead" :prop="item.field" :key="index" :label="item.comment" align="center"></el-table-column>
</el-table> </el-table>
</el-dialog> </el-dialog>
<!-- 购买弹框 -->
<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="">
</div>
</el-dialog>
</div> </div>
</div> </div>
</template> </template>
@ -160,6 +167,7 @@ export default {
previewVisible: false, previewVisible: false,
previewHead: [], previewHead: [],
previewData: [], previewData: [],
buyVisible: false
}; };
}, },
components: { components: {
@ -171,6 +179,12 @@ export default {
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData() this.initData()
},500) },500)
},
keywordTable: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initTable()
},500)
} }
}, },
created() { created() {
@ -282,17 +296,27 @@ export default {
this.curTable = '' this.curTable = ''
this.tables = [] this.tables = []
this.importLoading = true this.importLoading = true
this.importVisible = true
this.$post(this.api.getDataProductBoughtByOurSchool).then(({ data }) => { this.$post(this.api.getDataProductBoughtByOurSchool).then(({ data }) => {
this.importTypeList = data this.importTypeList = data
this.importLoading = false this.importLoading = false
if (data.length) {
this.importVisible = true
} else {
this.buyVisible = true
// this.$message.error('')
}
}).catch(res => { }).catch(res => {
this.importLoading = false this.importLoading = false
}) })
}, },
//
typeClick() {
this.keywordTable = ''
this.getTable()
},
// //
getTable(){ getTable(){
this.$post(`${this.api.getPurchasedTableByCategory}?categoryId=${this.$refs.typeTree.getCurrentKey()}&pageNum=${this.pageTable}&pageSize=${this.pageSizeTable}`).then(({ data }) => { this.$post(`${this.api.getPurchasedTableByCategory}?categoryId=${this.$refs.typeTree.getCurrentKey()}&pageNum=${this.pageTable}&pageSize=${this.pageSizeTable}&name=${this.keywordTable}`).then(({ data }) => {
const list = data.records const list = data.records
list.map(e => { list.map(e => {
// //
@ -310,27 +334,24 @@ export default {
this.totalTable = data.total this.totalTable = data.total
}).catch(res => {}) }).catch(res => {})
}, },
//
initTable() {
this.pageTable = 1
this.getTable()
},
handleCurrentChangeTable(val) { handleCurrentChangeTable(val) {
this.pageTable = val this.pageTable = val
this.getTable() this.getTable()
}, },
// //
preview(row){ preview(row){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(({ comment, data }) => {
let comment = res.comment
let previewHead = [] let previewHead = []
this.curComment = comment //
comment.map(n => { comment.map(n => {
// id // id
n.field != 'id' && n.field != 'operation_time' && previewHead.push(n) n.field != 'id' && n.field != 'operation_time' && previewHead.push(n)
}) })
this.previewHead = previewHead this.previewHead = previewHead
let data = res.data
// custom
isEdit && data.unshift({
custom: true
})
data.map(n => { data.map(n => {
for(let i in n){ for(let i in n){
// +0000,, // +0000,,
@ -338,14 +359,14 @@ export default {
} }
}) })
this.previewData = data this.previewData = data
this.previewVisible = true // this.previewVisible = true
}).catch(res => {}) }).catch(res => {})
}, },
// python // python
importData(file) { importData(file, row) {
this.$post(this.api.importData, { this.$post(this.api.importData, {
fileFormat: file.fileType || file.fileFormat, fileFormat: file.fileType || file.fileFormat,
fileName: file.originalFileName || file.fileName, fileName: row.tableComment || file.fileName,
filePath: file.fileUrl || file.filePath, filePath: file.fileUrl || file.filePath,
fileSize: file.fileSize, fileSize: file.fileSize,
ossFileName: file.ossFileName ossFileName: file.ossFileName
@ -371,7 +392,7 @@ export default {
const { name } = row const { name } = row
this.submited = true this.submited = true
// Excel // Excel
this.$post(`${this.api.lookupTableFile}?tableName=${name}`).then(({ data }) => { this.$post(`${this.api.lookupTableFile}?tableName=${row.tableComment}`).then(({ data }) => {
// //
if (!data) { if (!data) {
// //
@ -387,7 +408,7 @@ export default {
// //
const form = new FormData() const form = new FormData()
form.append('file', new Blob([res.data], {type: 'application/vnd.ms-excel'})) form.append('file', new Blob([res.data], {type: 'application/vnd.ms-excel'}))
form.append('tableName', name) form.append('tableName', row.name.replace(/(\r|\n)+/, ''))
form.append('token', this.token) form.append('token', this.token)
axios({ axios({
method: 'post', method: 'post',
@ -398,7 +419,7 @@ export default {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
}, },
}).then(({ data }) => { }).then(({ data }) => {
this.importData(data.filesResult) this.importData(data.filesResult, row)
}).catch(res => { }).catch(res => {
this.submited = false this.submited = false
}) })
@ -410,7 +431,7 @@ export default {
}) })
} else { } else {
// //
this.importData(data) this.importData(data, {})
} }
}).catch(res => { }).catch(res => {
this.submited = false this.submited = false
@ -456,9 +477,12 @@ export default {
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100px; height: 80px;
border: 1px solid #ccc; font-size: 16px;
color: #333;
border-radius: 8px; border-radius: 8px;
background-color: #F6F8FA;
border: 1px solid transparent;
cursor: pointer; cursor: pointer;
img { img {
width: 90%; width: 90%;
@ -477,9 +501,29 @@ export default {
} }
} }
} }
.buy {
text-align: center;
.tips {
margin-bottom: 10px;
font-size: 14px;
}
img {
width: 85%;
}
}
/deep/.check-table { /deep/.check-table {
.el-radio__label { .el-radio__label {
display: none; display: none;
} }
} }
/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 {
border-color: #007eff;
background: #007eff;
}
/deep/.el-radio__inner:hover {
border-color: #007eff;
}
</style> </style>
Loading…
Cancel
Save