|
@@ -0,0 +1,133 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="algorithmManage">
|
|
|
|
+ <el-popover placement="top-start" width="300" trigger="hover" content="可以选择算法任务及标注结果或者评分结果,进行有监督训练">
|
|
|
|
+ <i slot="reference" class="el-icon-question" />
|
|
|
|
+ </el-popover>
|
|
|
|
+ <div>
|
|
|
|
+ <span>选择算法:</span>
|
|
|
|
+ <el-select v-model="algorithmValue" placeholder="请选择算法" @change="selectAlgorithm">
|
|
|
|
+ <el-option v-for="item in algorithmOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="result">
|
|
|
|
+ <span>选择要训练的数据:</span>
|
|
|
|
+ <el-select v-model="resultValue" placeholder="请选择数据" @change="selectResult">
|
|
|
|
+ <el-option v-for="item in resultOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <el-button type="primary" :disabled="algorithmValue===''&&resultValue===''" @click="begin">开始训练</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <el-dialog title="数据训练" :visible.sync="dialog" width="400px" :close-on-click-modal="false" :show-close="false">
|
|
|
|
+ <div class="ProgressBar">
|
|
|
|
+ <el-progress type="circle" :percentage="percentage" :color="colors" />
|
|
|
|
+ <p>{{ tipText }}</p>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+export default {
|
|
|
|
+ name: 'AlgorithmManage',
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ algorithmOptions: [{
|
|
|
|
+ value: 'one',
|
|
|
|
+ label: '算法1'
|
|
|
|
+ }, {
|
|
|
|
+ value: 'two',
|
|
|
|
+ label: '算法2'
|
|
|
|
+ }, {
|
|
|
|
+ value: 'three',
|
|
|
|
+ label: '算法3'
|
|
|
|
+ }, {
|
|
|
|
+ value: 'four',
|
|
|
|
+ label: '算法4'
|
|
|
|
+ }],
|
|
|
|
+ resultOptions: [{
|
|
|
|
+ value: 'score',
|
|
|
|
+ label: '评分结果数据'
|
|
|
|
+ }, {
|
|
|
|
+ value: 'annotations',
|
|
|
|
+ label: '标注结果数据'
|
|
|
|
+ }],
|
|
|
|
+ algorithmValue: '',
|
|
|
|
+ resultValue: '',
|
|
|
|
+ // 进度条
|
|
|
|
+ percentage: 0,
|
|
|
|
+ colors: [
|
|
|
|
+ { color: '#f56c6c', percentage: 20 },
|
|
|
|
+ { color: '#e6a23c', percentage: 40 },
|
|
|
|
+ { color: '#5cb87a', percentage: 60 },
|
|
|
|
+ { color: '#1989fa', percentage: 80 },
|
|
|
|
+ { color: '#6f7ad3', percentage: 100 }
|
|
|
|
+ ],
|
|
|
|
+ // 进度条弹出框
|
|
|
|
+ dialog: false,
|
|
|
|
+ // 进度条显示
|
|
|
|
+ isShow: false,
|
|
|
|
+ // 进度条提示信息
|
|
|
|
+ tipText: '算法准备中...',
|
|
|
|
+ // 定时器
|
|
|
|
+ timer: null
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ selectAlgorithm(val) {
|
|
|
|
+ console.log(val)
|
|
|
|
+ },
|
|
|
|
+ selectResult(val) {
|
|
|
|
+ console.log(val)
|
|
|
|
+ },
|
|
|
|
+ begin() {
|
|
|
|
+ this.dialog = true
|
|
|
|
+ if (!this.timer) {
|
|
|
|
+ this.timer = setInterval(() => {
|
|
|
|
+ this.percentage += 1
|
|
|
|
+ if (this.percentage === 25) {
|
|
|
|
+ this.tipText = '数据准备中...'
|
|
|
|
+ } else if (this.percentage === 45) {
|
|
|
|
+ this.tipText = '数据训练中...'
|
|
|
|
+ } else if (this.percentage === 100) {
|
|
|
|
+ this.tipText = '处理完成'
|
|
|
|
+ clearInterval(this.timer)
|
|
|
|
+ this.timer = null
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.dialog = false
|
|
|
|
+ this.percentage = 0
|
|
|
|
+ this.tipText = '算法准备中...'
|
|
|
|
+ this.algorithmValue = ''
|
|
|
|
+ this.resultValue = ''
|
|
|
|
+ this.$message.success('数据处理成功')
|
|
|
|
+ }, 1500)
|
|
|
|
+ }
|
|
|
|
+ }, 50)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped>
|
|
|
|
+.algorithmManage{
|
|
|
|
+ padding: 50px 0px 0px 70px;
|
|
|
|
+}
|
|
|
|
+.result{
|
|
|
|
+ margin: 30px 0px;
|
|
|
|
+}
|
|
|
|
+.ProgressBar {
|
|
|
|
+ width: 350px;
|
|
|
|
+ height: 200px;
|
|
|
|
+ margin-top: 40px;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+}
|
|
|
|
+.el-icon-question{
|
|
|
|
+ font-size: 24px;
|
|
|
|
+ color: #5cb6ff;
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 50px;
|
|
|
|
+}
|
|
|
|
+</style>
|