openf12
yujialong 1 year ago
parent 498b724f6e
commit b8cfa4b26d
  1. 158
      src/components/codemirror.vue
  2. 8
      src/styles/theme/theme9.scss

@ -9,6 +9,9 @@
<div v-if="isSubmit"
class="code-mask"></div>
<div class="btns">
<el-button class="btn"
type="danger"
@click="myCode">我的代码</el-button>
<span class="el-icon-delete del"
@click="clearCode"></span>
<el-button v-if="modelIsShow"
@ -130,6 +133,90 @@
@click="submit">导入</el-button>
</span>
</el-dialog>
<el-dialog title="我的代码"
:visible.sync="codeVisible"
width="1000px"
:close-on-click-modal="false"
custom-class="code-dia">
<el-table :data="codeList"
class="cus-table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="60"
align="center"></el-table-column>
<el-table-column type="index"
label="序号"
width="55"
align="center"></el-table-column>
<el-table-column prop="fileName"
label="项目名称"
min-width="150"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="fileSize"
label="判分点"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="createTime"
label="提交时间"
width="140"
align="center"></el-table-column>
<el-table-column prop="fileFormat"
label="是否得分"
width="100"
align="center"></el-table-column>
<el-table-column width="200"
label="操作"
align="center">
<template slot-scope="scope">
<el-button type="text"
@click="showCode(scope.row)">查看代码</el-button>
<el-button type="text"
@click="download(scope.row)">导入代码</el-button>
<el-button type="text"
@click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total,prev, pager, next"
:current-page="page"
@current-change="handleCurrentChange"
:total="total"></el-pagination>
</div>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="codeVisible = false">关闭</el-button>
</span>
</el-dialog>
<el-dialog title="查看代码"
:visible.sync="showVisible"
width="500px"
:close-on-click-modal="false"
custom-class="code-dia">
<el-tabs v-model="showActive">
<el-tab-pane label="代码"
name="code">
</el-tab-pane>
<el-tab-pane label="结果"
name="result"></el-tab-pane>
</el-tabs>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="showSubmit">导入代码</el-button>
</span>
</el-dialog>
</div>
</template>
@ -246,7 +333,18 @@ export default {
id: 1,
name: '内置模型'
},
]
],
codeVisible: false,
codeList: [],
multipleSelection: [],
keyword: '',
page: 1,
pageSize: 10,
total: 0,
showVisible: false,
showActive: 'code',
};
},
components: {
@ -612,7 +710,56 @@ export default {
document.onmouseup = null
}
}
}
},
//
myCode () {
this.codeVisible = true
},
//
delAll () {
if (this.multipleSelection.length) {
const newArr = this.multipleSelection
const delList = newArr.map(item => {
return `ids=${item.id}`
})
this.$confirm(`此批量删除操作不可逆,是否确认删除?`, '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletion}?${delList.join('&')}`).then(res => {
this.$refs.table.clearSelection()
this.$message.success('删除成功')
this.getData()
}).catch(res => { })
}).catch(() => { })
} else {
this.$message.error('请先选择数据 !')
}
},
//
del (row) {
this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletion}?ids=${row.id}`).then(res => {
this.$message.success('删除成功')
this.getData()
}).catch(res => { })
}).catch(() => { })
},
handleCurrentChange (val) {
this.page = val
this.getData()
},
handleSelectionChange (val) {
this.multipleSelection = val
},
//
showSubmit () {
},
}
};
</script>
@ -690,7 +837,7 @@ export default {
}
.del {
width: 40px;
margin-right: 10px;
margin: 0 10px;
line-height: 40px;
color: #fff;
text-align: center;
@ -829,4 +976,9 @@ export default {
max-height: 400px;
overflow: auto;
}
/deep/.code-dia {
.el-dialog__body {
padding: 0 20px;
}
}
</style>

@ -16,10 +16,10 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts';
background: url(../../assets/images/system/9/header.png) 0 0/100% 100%
no-repeat;
}
.el-tabs__item.is-active {
color: #fff !important;
background-color: $--color-primary;
}
// .el-tabs__item.is-active {
// color: #fff !important;
// background-color: $--color-primary;
// }
.select .el-select__caret:before {
background-color: $--color-primary;
}

Loading…
Cancel
Save