diff --git a/src/assets/images/wechat-code.jpeg b/src/assets/images/wechat-code.jpeg new file mode 100644 index 0000000..07a86ee Binary files /dev/null and b/src/assets/images/wechat-code.jpeg differ diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index fd0ac2e..1a56169 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -557,6 +557,7 @@ export default { judgmentName: e.name, answer: e.code, score: e.examScore, + quesScore: e.score }) // 获取参考答案 this.$get(this.api.queryBcJudgmentPointByBcId, { @@ -796,6 +797,9 @@ export default { th.is-leaf { border-bottom: 0 !important; } + .el-table__cell { + padding: 6px 0; + } } .goal { padding: 10px 0; diff --git a/src/config/index.js b/src/config/index.js index 13e6c75..34a7f57 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -10,7 +10,7 @@ let bankPath = `${location.origin}/banksystem` // 银行系统 // 121.37.12.51 | 192.168.31.151 if (isDev) { 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` } else if (isPro) { host = 'https://occupationlab.com/' diff --git a/src/styles/common.scss b/src/styles/common.scss index 9d5f9e0..d5cadad 100644 --- a/src/styles/common.scss +++ b/src/styles/common.scss @@ -39,7 +39,6 @@ body .cus-table.el-table { background-color: #E8F0FF !important; .cell{ color: #222326; - font-size: 12px; font-weight: normal; .el-checkbox{ &:before{ @@ -51,6 +50,9 @@ body .cus-table.el-table { th, td{ padding: 10px 0; border-bottom-color: #E1E6F2; + .cell { + font-size: 12px; + } } &.el-table--striped .el-table__body tr.el-table__row--striped td{ background-color: #FAFBFF !important; diff --git a/src/views/Data.vue b/src/views/Data.vue index 216886e..7c47709 100644 --- a/src/views/Data.vue +++ b/src/views/Data.vue @@ -17,7 +17,7 @@ @@ -66,13 +66,13 @@ :props="{ label: 'categoryName' }" - @node-click="getTable" + @node-click="typeClick" > - + @@ -160,18 +167,25 @@ export default { previewVisible: false, previewHead: [], previewData: [], + buyVisible: false }; }, components: { breadcrumb }, watch: { - keyword: function(val) { - clearTimeout(this.searchTimer) - this.searchTimer = setTimeout(() => { - this.initData() - },500) - } + keyword: function(val) { + clearTimeout(this.searchTimer) + this.searchTimer = setTimeout(() => { + this.initData() + },500) + }, + keywordTable: function(val) { + clearTimeout(this.searchTimer) + this.searchTimer = setTimeout(() => { + this.initTable() + },500) + } }, created() { this.loading = true @@ -282,17 +296,27 @@ export default { this.curTable = '' this.tables = [] this.importLoading = true - this.importVisible = true this.$post(this.api.getDataProductBoughtByOurSchool).then(({ data }) => { this.importTypeList = data this.importLoading = false + if (data.length) { + this.importVisible = true + } else { + this.buyVisible = true + // this.$message.error('当前院校暂未购买该数据库,请购买后再尝试') + } }).catch(res => { this.importLoading = false }) }, + // 分类点击回调 + typeClick() { + this.keywordTable = '' + this.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 list.map(e => { // 开始结束日期不用显示时间,所以只需要截取日期 @@ -310,42 +334,39 @@ export default { this.totalTable = data.total }).catch(res => {}) }, + // 重置表分页 + initTable() { + this.pageTable = 1 + this.getTable() + }, handleCurrentChangeTable(val) { this.pageTable = val this.getTable() }, // 预览 preview(row){ - this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { - let comment = res.comment - let previewHead = [] - this.curComment = comment // 用来修改表头的,先保存完整的表头,修改表头的时候需要传给后端 - comment.map(n => { - // 表格上不用展示id和操作时间 - n.field != 'id' && n.field != 'operation_time' && previewHead.push(n) - }) - this.previewHead = previewHead - - let data = res.data - // 如果是自定义表头,则在数据最前面加个custom的行,用来修改表头 - isEdit && data.unshift({ - custom: true - }) - data.map(n => { - for(let i in n){ - // 如果是以+0000结尾的,就表明这个是时间,则转化为正常的时间格式 - if(typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n[i])) - } - }) - this.previewData = data - this.previewVisible = true // 非自定义表头进来的,才需要显示预览弹框 - }).catch(res => {}) + this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(({ comment, data }) => { + let previewHead = [] + comment.map(n => { + // 表格上不用展示id和操作时间 + n.field != 'id' && n.field != 'operation_time' && previewHead.push(n) + }) + this.previewHead = previewHead + data.map(n => { + for(let i in n){ + // 如果是以+0000结尾的,就表明这个是时间,则转化为正常的时间格式 + if(typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n[i])) + } + }) + this.previewData = data + this.previewVisible = true + }).catch(res => {}) }, // 上传到python数据列表 - importData(file) { + importData(file, row) { this.$post(this.api.importData, { fileFormat: file.fileType || file.fileFormat, - fileName: file.originalFileName || file.fileName, + fileName: row.tableComment || file.fileName, filePath: file.fileUrl || file.filePath, fileSize: file.fileSize, ossFileName: file.ossFileName @@ -371,7 +392,7 @@ export default { const { name } = row this.submited = true // 查询某表的Excel文件是否存在 - this.$post(`${this.api.lookupTableFile}?tableName=${name}`).then(({ data }) => { + this.$post(`${this.api.lookupTableFile}?tableName=${row.tableComment}`).then(({ data }) => { // 如果不存在,则下载该表并上传到阿里云 if (!data) { // 通过预览接口获取字段 @@ -387,7 +408,7 @@ export default { // 把该表上传到阿里云 const form = new FormData() 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) axios({ method: 'post', @@ -398,7 +419,7 @@ export default { 'Content-Type': 'multipart/form-data' }, }).then(({ data }) => { - this.importData(data.filesResult) + this.importData(data.filesResult, row) }).catch(res => { this.submited = false }) @@ -410,7 +431,7 @@ export default { }) } else { // 如果数据库里已经有这个表,则直接调导入数据的接口 - this.importData(data) + this.importData(data, {}) } }).catch(res => { this.submited = false @@ -456,9 +477,12 @@ export default { display: inline-flex; justify-content: center; align-items: center; - height: 100px; - border: 1px solid #ccc; + height: 80px; + font-size: 16px; + color: #333; border-radius: 8px; + background-color: #F6F8FA; + border: 1px solid transparent; cursor: pointer; img { 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 { .el-radio__label { 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; +} \ No newline at end of file