提交代码

This commit is contained in:
jiang 2024-11-24 12:57:47 +08:00
parent be5454d8f6
commit 897a8bed1c
15 changed files with 1486 additions and 2 deletions

View File

@ -0,0 +1,20 @@
import request from '@/utils/request'
//查询数据集
export function list(query) {
return request({
url: '/ai/version/list',
method: 'get',
params: query
})
}
//创建数据集
export function add(data) {
return request({
url: '/ai/annotationTask/create',
method: 'post',
data: data
})
}

View File

@ -0,0 +1,27 @@
import request from '@/utils/request'
//查询数据集
export function list(query) {
return request({
url: '/ai/dataset/list',
method: 'get',
params: query
})
}
//创建数据集
export function add(data) {
return request({
url: '/ai/dataset/create',
method: 'post',
data: data
})
}
//删除数据集
export function del(dataSetIds) {
return request({
url: '/ai/dataset/delete/'+dataSetIds,
method: 'post'
})
}

View File

@ -0,0 +1,20 @@
import request from '@/utils/request'
//查询数据集
export function list(query) {
return request({
url: '/ai/version/list',
method: 'get',
params: query
})
}
//创建数据集
export function add(data) {
return request({
url: '/ai/version/release',
method: 'post',
data: data
})
}

View File

@ -8,6 +8,13 @@ export function list(query) {
params: query
})
}
export function getAllList() {
return request({
url: '/ai/teamMember/getAllList',
method: 'get'
})
}
// 查询标注人员和角色关联详细
export function getTeamMember(memberId) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,191 @@
<template>
<div>
<el-dialog title="创建数据集" :visible.sync="isOpen" width="700px" append-to-body @close="cancel" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="名称" prop="datasetName">
<el-input v-model="form.datasetName" maxlength="20" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="描述" prop="datasetDesc">
<el-input
type="textarea"
placeholder="请输入描述"
v-model="form.datasetDesc"
maxlength="200"
show-word-limit
>
</el-input>
</el-form-item>
<el-form-item label="数据类型" prop="dataType">
<el-radio-group v-model="form.dataType">
<el-radio :label="0" border>图片</el-radio>
<el-radio :label="1" border>视频</el-radio>
<el-radio :label="2" border>音频</el-radio>
<el-radio :label="3" border>自由格式</el-radio>
</el-radio-group>
<div>
<span style="color: #8a8e99;font-size: 14px" v-show="form.dataType ===0">支持格式: .jpg.png.jpeg.bmp</span>
<span style="color: #8a8e99;font-size: 14px" v-show="form.dataType ===2"> 支持格式: .wav</span>
<span style="color: #8a8e99;font-size: 14px" v-show="form.dataType ===1">支持格式: .mp4</span>
</div>
</el-form-item>
<el-form-item label="数据来源" prop="dataSource" >
<el-radio-group v-model="form.dataSource" @change="dataSourceChange">
<el-radio :label="0" border>系统选择</el-radio>
<el-radio :label="1" border>本地上传</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="导入路径" prop="inputPath">
<el-input placeholder="请选择导入路径" readonly :disabled="true" v-model="form.inputPath" class="input-with-select">
<el-button slot="append" icon="el-icon-folder-opened" @click="selectFolder(0)"></el-button>
</el-input>
</el-form-item>
<div v-show="form.dataSource ===1">
<el-form-item label="上传文件" prop="dataSource">
<uploadFiles :get-list="getList" :parent-id="form.inputPath" :fileUrl="form.inputPath"/>
</el-form-item>
<el-form-item label="数据来源" prop="isAnnotated">
<el-radio-group v-model="form.isAnnotated">
<el-radio :label="0" border>未标注</el-radio>
<el-radio :label="1" border>已标注</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-show="form.isAnnotated === 1">
<div style="display: flex;flex-direction: column;">
<span>文件存放方式满足YOLO格式</span>
<img style="width: 50%" :src="ObjectDetection_YOLO" alt="Weibo">
</div>
</el-form-item>
</div>
<el-form-item label="输出路径" prop="outputPath">
<el-input placeholder="请选择数据集输出路径" readonly :disabled="true" v-model="form.outputPath" class="input-with-select">
<el-button slot="append" icon="el-icon-folder-opened" @click="selectFolder(1)"></el-button>
</el-input>
</el-form-item>
</el-form>
<template #footer>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</template>
</el-dialog>
<selectFolderDialog :open="folderOpen" :folder-type="folderType" @dialog-cancel="handleCancel" @update-data ="updateData" />
</div>
</template>
<script>
import ObjectDetection_YOLO from '@/assets/images/ObjectDetection_YOLO.png'
import selectFolderDialog from './selectFolderDialog.vue'
import uploadFiles from '../../library/child/uploadFiles.vue'
import { add } from '@/api/dataCenter/dataSet'
export default {
components: { uploadFiles, selectFolderDialog},
props: {
open: {
type: Boolean,
default: false,
},
getList: {
type: Function,
required: true,
},
},
computed: {
isOpen: {
get() {
return this.open;
},
set(value) {
this.$emit('update:open', value);
},
},
},
data() {
return {
ObjectDetection_YOLO:ObjectDetection_YOLO,
folderOpen: false,
folderType:0,
form: {
dataType:0,
dataSource:0,
inputId:0,
outputId:0
}, //
rules:{
datasetName:[
{ required: true, message: '名称不能为空', trigger: 'blur' },
],
datasetDesc:[
{ required: true, message: '描述不能为空', trigger: 'blur' },
],
dataType:[
{ required: true, message: '数据类型不能为空', trigger: 'blur' },
],
dataSource:[
{ required: true, message: '数据来源不能为空', trigger: 'blur' },
],
inputPath:[
{ required: true, message: '导入路径不能为空', trigger: 'blur' },
],
outputPath:[
{ required: true, message: '输出路径不能为空', trigger: 'blur' },
],
}
};
},
methods: {
//
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
add(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.cancel();
this.getList();
})
}
})
//
},
//
cancel() {
this.isOpen = false;
this.reset();
this.$emit('dialog-cancel'); //
},
//
reset() {
this.form = {
dataType:0,
dataSource:0,
inputId:0,
outputId:0}; //
this.$refs.form.resetFields(); // Element UI
},
//
selectFolder(folderType){
this.folderType = folderType;
this.folderOpen = true;
},
handleCancel(){
this.folderOpen = false;
},
updateData(data){
if (data.folderType === 0) {
console.log(0)
this.form.inputPath = data.folder;
this.form.inputId = data.fileId
}else {
console.log(1)
this.form.outputPath = data.folder;
this.form.outputId = data.fileId
}
console.log()
}
},
};
</script>
<style scoped lang="scss">
/* 样式按需定义 */
</style>

View File

@ -0,0 +1,145 @@
<template>
<div>
<el-dialog title="创建标注任务" :visible.sync="isOpen" width="500px" append-to-body @close="cancel" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="70px">
<el-form-item label="名称" prop="taskName">
<el-input v-model="form.taskName" maxlength="20" placeholder="请输入版本名称" />
</el-form-item>
<el-form-item label="描述" prop="taskDesc">
<el-input
type="textarea"
placeholder="请输入描述"
v-model="form.taskDesc"
maxlength="200"
show-word-limit
>
</el-input>
</el-form-item>
<el-form-item label="标注类型" prop="annotateType">
<el-select v-model="form.annotateType" placeholder="请选择标注类型" clearable style="width: 100%">
<el-option v-for="dict in dict.type.ai_annotate_type" :key="dict.value" :label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否启用标注团队" prop="isStartTeam" label-width="130px">
<el-switch
v-model="form.isStartTeam">
</el-switch>
</el-form-item>
<div v-show="form.isStartTeam">
<el-form-item label="选择标注人员" prop="isStartTeam" label-width="100px">
<el-button type="primary" @click="selectOpen=true">选择标注人员</el-button>
</el-form-item>
<el-form-item label="分配数量" prop="isStartTeam" label-width="100px">
<el-table
size="mini"
:data="tableData">
<el-table-column
prop="date"
label="姓名"
max-width="180">
</el-table-column>
<el-table-column
prop="name"
label="角色"
max-width="180">
</el-table-column>
<el-table-column
prop="address"
label="数量">
</el-table-column>
</el-table>
</el-form-item>
</div>
</el-form>
<template #footer>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</template>
</el-dialog>
<select-personnel-dialog dataset-id="" :open="selectOpen" @dialog-cancel="handleCancel" @update-data ="updateData"/>
</div>
</template>
<script>
import selectPersonnelDialog from '../child/selectPersonnelDialog.vue'
import { add } from '@/api/dataCenter/releaseVersion'
export default {
dicts: ['ai_annotate_type'],
components: {selectPersonnelDialog},
props: {
open: {
type: Boolean,
default: false,
required: true,
},
datasetId:{
type: Number,
default: 0,
required: true,
}
},
computed: {
isOpen: {
get() {
return this.open;
},
set(value) {
this.$emit('update:open', value);
},
},
},
data() {
return {
selectOpen:false,
form: {}, //
rules:{
versionName:[
{ required: true, message: '版本名称不能为空', trigger: 'blur' },
]
}
};
},
methods: {
//
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.datasetId = this.datasetId;
add(this.form).then(response => {
this.$modal.msgSuccess("发布成功");
this.cancel();
})
}
})
},
updateData(data){
console.log(data)
},
//
cancel() {
this.isOpen = false;
this.reset();
this.$emit('dialog-cancel'); //
},
//
reset() {
this.form = {}; //
this.$refs.form.resetFields(); // Element UI
},
//
handleCancel() {
this.selectOpen = false;
},
},
};
</script>
<style scoped lang="scss">
/* 样式按需定义 */
</style>

View File

@ -0,0 +1,96 @@
<template>
<div>
<el-dialog title="发布版本" :visible.sync="isOpen" width="500px" append-to-body @close="cancel" :close-on-click-modal="false">
<el-form ref="form" label-position="top" :model="form" :rules="rules" >
<el-form-item label="版本名称" prop="versionName">
<el-input v-model="form.versionName" maxlength="20" placeholder="请输入版本名称" />
</el-form-item>
<el-form-item label="描述" prop="versionDesc">
<el-input
type="textarea"
placeholder="请输入描述"
v-model="form.versionDesc"
maxlength="200"
show-word-limit
>
</el-input>
</el-form-item>
</el-form>
<template #footer>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</template>
</el-dialog>
</div>
</template>
<script>
import { add } from '@/api/dataCenter/releaseVersion'
export default {
props: {
open: {
type: Boolean,
default: false,
required: true,
},
datasetId:{
type: Number,
default: 0,
required: true,
}
},
computed: {
isOpen: {
get() {
return this.open;
},
set(value) {
this.$emit('update:open', value);
},
},
},
data() {
return {
form: {}, //
rules:{
versionName:[
{ required: true, message: '版本名称不能为空', trigger: 'blur' },
]
}
};
},
methods: {
//
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.datasetId = this.datasetId;
add(this.form).then(response => {
this.$modal.msgSuccess("发布成功");
this.cancel();
})
}
})
},
//
cancel() {
this.isOpen = false;
this.reset();
this.$emit('dialog-cancel'); //
},
//
reset() {
this.form = {}; //
this.$refs.form.resetFields(); // Element UI
},
},
};
</script>
<style scoped lang="scss">
/* 样式按需定义 */
</style>

View File

@ -0,0 +1,299 @@
<template>
<div>
<el-dialog title="目录位置" :visible.sync="open" width="40%" append-to-body @close="cancel" :close-on-click-modal="false">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-folder-add"
size="small"
@click="handleAdd"
v-hasPermi="['dataCenter:dataSetBasicFile:add']"
>新建文件夹</el-button>
</el-col>
<el-col :span="20">
<el-input placeholder="请输入内容" readonly :disabled="true" v-model="folder">
<el-button slot="prepend" type="success" icon="el-icon-arrow-left" @click="popFromStack"></el-button>
</el-input>
</el-col>
</el-row>
<el-table ref="table" v-loading="loading" size="small" :data="fileList" :height="tableHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="名称" prop="fileName" min-width="100">
<template slot-scope="scope">
<!-- 根据条件生成点击事件 -->
<span
:class="{ 'link-type': scope.row.isDirectory === '1' }"
@click="scope.row.isDirectory === '1' ? pushToStack(scope.row) : null"
>
{{ scope.row.fileName }}
</span>
</template>
</el-table-column>
<el-table-column label="类型" align="center" prop="fileUrl" min-width="100">
<template slot-scope="scope">
<span>
{{scope.row.isDirectory === '1'?'文件夹':scope.row.fileName.split('.').pop()}}
</span>
</template>
</el-table-column>
<el-table-column label="文件大小" align="center" prop="fileSize" min-width="100">
<template slot-scope="scope">
<span>{{scope.row.isDirectory === '1'?'-':scope.row.fileSize < 1024 * 1024?(scope.row.fileSize/1024).toFixed(2)+'KB':(scope.row.fileSize/1024/1024).toFixed(2)+'MB'}}</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" min-width="100" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
</el-table>
<pagination
style="background-color: transparent"
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改标注人员和角色关联对话框 -->
<el-dialog title="创建文件夹" :visible.sync="addOpen" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="位置" prop="fileUrl">
<el-input v-model="folder" :disabled="true" readonly />
</el-form-item>
<el-form-item label="名称" prop="fileName">
<el-input v-model="form.fileName" maxlength="20" placeholder="请输入名称" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="addSubmitForm"> </el-button>
<el-button @click="addCancel"> </el-button>
</div>
</el-dialog>
<template #footer>
<el-button type="primary" :disabled="multiple" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</template>
</el-dialog>
</div>
</template>
<script>
import { listFile,addFile } from '@/api/dataCenter/basicFile'
export default {
props: {
open: {
type: Boolean,
default: false,
required: true,
},
folderType:{
type: Number,
default: 0,
required: true,
}
},
computed: {
isOpen: {
get() {
return this.open;
},
set(value) {
this.$emit('update:open', value);
},
},
},
data() {
return {
folder:"我的样本库/",
folderName:[],
total:0,
parentId:0,
loading:true,
fileList:[],
//
ids: [],
//
single: true,
tableHeight: 0,
//
multiple: true,
addOpen:false,
queryParams:{
pageNum: 1,
pageSize: 10,
},
form:{},
rules:{}
};
},
created() {
this.getList();
this.updateTableHeight()
//
window.addEventListener("resize", this.updateTableHeight);
},
method(){
this.getList();
},
watch:{
folderName(newVal, oldVal){
this.parentId = newVal.length > 0 ? newVal[newVal.length - 1].fileId : 0;
this.fileUrl = newVal.map(item => item.fileName).join("/");
this.folder = "我的样本库/" + this.fileUrl+(this.fileUrl?"/":"")
this.getList();
},
open(newVal, oldVal){
if (newVal){
this.getList()
this.updateTableHeight()
//
window.addEventListener("resize", this.updateTableHeight);
}
}
},
methods: {
getList() {
this.loading = true;
this.queryParams.parentId=this.parentId;
listFile(this.queryParams).then(response => {
this.fileList = response.rows;
this.total = response.total;
this.loading = false;
//
this.$refs.table.clearSelection();
//
const defaultSelection = []; //
this.handleSelectionChange(defaultSelection);
});
},
//
pushToStack(item) {
if (item) { //
this.folderName.push(item); //
}
},
//
popFromStack() {
if (this.folderName.length > 0) {
this.folderName.pop();
}
},
//
handleSelectionChange(selection) {
if (selection.length > 1) {
//
this.$nextTick(() => {
//
this.$refs.table.clearSelection();
//
this.$refs.table.toggleRowSelection(selection[1], true);
});
}
this.ids = selection.map(item => item.fileId)
const isDirectory = selection.map(item => item.isDirectory)
this.single = selection.length===1
// multiple
if (this.parentId === 0 && selection.length !== 1) {
// parentId 0 multiple true
this.multiple = true;
} else if (this.parentId !== 0 && selection.length !== 1) {
// parentId 0 multiple false
this.multiple = false;
} else {
// isDirectory '0'
this.multiple = isDirectory.includes('0');
}
},
updateTableHeight() {
//
const headerHeight = 400; //
const footerHeight = 90; //
this.tableHeight = window.innerHeight - headerHeight - footerHeight;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.addOpen = true;
this.title = "创建文件夹";
},
addSubmitForm(){
this.form.fileUrl = this.folder;
this.form.parentId = this.parentId;
this.$refs["form"].validate(valid => {
if (valid) {
addFile(this.form).then(response => {
this.$modal.msgSuccess("创建成功成功");
this.addOpen = false;
this.getList();
});
}
})
},
//
submitForm() {
let result = null;
//
if (this.ids && this.ids.length > 0) {
result = this.fileList.find(item => item.fileId === this.ids[0]);
}
const data = {
folder: result ? this.folder + result.fileName : this.folder,
fileId: result ? result.fileId : this.parentId,
folderType: this.folderType,
};
this.$emit('update-data', data); //
this.cancel(); //
},
addCancel(){
this.addOpen = false;
},
//
cancel() {
this.addOpen=false;
this.reset();
this.$emit('dialog-cancel'); //
},
//
reset() {
this.folder ="我的样本库/";
this.folderName=[];
this.total=0;
this.parentId=0;
this.loading=true;
this.fileList=[];
//
this.ids=[];
//
this.single=true;
//
this.multiple=true;
this.queryParams={
pageNum:1,
pageSize:10,
};
this.form={};
this.rules={}
},
},
};
</script>
<style scoped lang="scss">
/* 样式按需定义 */
/* 隐藏el-table的全选框 */
.el-table .el-checkbox__original {
display: none;
}
.el-dialog {
transition: opacity 0.3s ease;
}
</style>

View File

@ -0,0 +1,150 @@
<template>
<div>
<el-dialog
title="选择人员"
:visible.sync="isOpen"
width="500px"
append-to-body
@close="cancel"
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" label-position="top" :rules="rules">
<el-form-item label="审核人员" prop="selectReviewer">
<el-select v-model="form.selectReviewer" multiple placeholder="请选择审核人员" clearable style="width: 100%">
<el-option
v-for="item in reviewer"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="标注人员" prop="selectLabeling">
<el-select v-model="form.selectLabeling" multiple placeholder="请选择标注人员" clearable style="width: 100%">
<el-option
v-for="item in labeling"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</template>
</el-dialog>
</div>
</template>
<script>
import { getAllList } from "@/api/dataCenter/teamMember";
export default {
props: {
open: {
type: Boolean,
default: false,
required: true,
},
},
computed: {
isOpen: {
get() {
return this.open;
},
set(value) {
this.$emit("update:open", value);
},
},
},
watch: {
open(newVal) {
if (newVal) {
this.getList();
}
},
},
data() {
return {
list:[],
reviewer: [], //
labeling: [], //
form:{
selectLabeling: [], //
selectReviewer: [], //
},
rules: {
selectReviewer: [
{ required: true, message: "请选择审核人员", trigger: "blur", type: 'array'},
],
selectLabeling: [
{ required: true, message: "请选择标注人员", trigger: "blur" ,type: 'array'},
],
},
};
},
methods: {
//
getList() {
getAllList().then((res) => {
//
this.reviewer = [];
this.labeling = [];
this.list =[];
this.list =res.data;
//
res.data.forEach((item) => {
const roleIds = item.roleId.split(",");
if (roleIds.includes("0")) {
//
this.labeling.push({ id: item.memberId, name: item.userName });
}
if (roleIds.includes("1")) {
//
this.reviewer.push({ id: item.memberId, name: item.userName });
}
});
});
},
//
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
const data = {
selectReviewer:[],
selectLabeling:[],
};
this.form.selectReviewer.forEach((id) => {
const result = this.reviewer.find(item => item.id === id);
data.selectReviewer.push(result);
})
this.form.selectLabeling.forEach((id) => {
const result = this.labeling.find(item => item.id === id);
data.selectLabeling.push(result);
})
this.$emit('update-data', data); //
this.cancel();
}
});
},
//
cancel() {
this.isOpen = false; //
this.reset(); //
this.$emit("dialog-cancel"); //
},
//
reset() {
this.selectReviewer = []; //
this.selectLabeling = []; //
this.$refs.form.resetFields(); //
},
},
};
</script>
<style scoped>
/* 样式按需定义 */
</style>

View File

@ -0,0 +1,274 @@
<template>
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="85px">
<el-form-item label="数据集名称" prop="datasetName">
<el-input
v-model="queryParams.datasetName"
placeholder="请输入数据集名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['dataCenter:dataSet:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['dataCenter:dataSet:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['dataCenter:dataSet:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table style="width: 100%" v-loading="loading" :data="list" :height="tableHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column type="index" label="序号" min-width="50" />
<el-table-column label="名称" align="center" show-overflow-tooltip prop="datasetName" />
<el-table-column label="版本名称" align="center" show-overflow-tooltip prop="sampleFormat" />
<el-table-column label="标注进度" align="center" show-overflow-tooltip prop="createBy">
<template slot-scope="scope">
<el-progress color="#13ce66" :percentage="50"></el-progress>
</template>
</el-table-column>
<el-table-column label="创建时间" show-overflow-tooltip align="center" prop="createTime" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="描述" show-overflow-tooltip align="center" prop="datasetDesc" />
<el-table-column label="是否公开" show-overflow-tooltip align="center" prop="createBy" >
<template slot-scope="scope">
<el-switch v-model="scope.row.isPublic" active-value="1" inactive-value="0"
@change="change(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="140" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['dataCenter:sample:edit']"
>导入</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleAnnotation(scope.row)"
v-hasPermi="['dataCenter:sample:edit']"
>标注</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['dataCenter:sample:edit']"
>导出</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleRelease(scope.row)"
v-hasPermi="['dataCenter:sample:edit']"
>发布</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['dataCenter:sample:edit']"
>版本查看</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['dataCenter:sample:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加对话框 -->
<add-data-set-dialog :get-list="getList" :open="addOpen" @dialog-cancel="handleCancel"/>
<!--版本发布-->
<release-version-dialog :dataset-id="datasetId" :open="releaseOpen" @dialog-cancel="handleCancel"/>
<!--创建标注任务-->
<annotation-task-dialog :dataset-id="datasetId" :open="annotationOpen" @dialog-cancel="handleCancel"/>
<
</div>
</template>
<script>
import addDataSetDialog from '../child/addDataSetDialog.vue'
import releaseVersionDialog from '../child/releaseVersionDialog.vue'
import annotationTaskDialog from '../child/annotationTaskDialog.vue'
import { list,del} from '@/api/dataCenter/dataSet'
export default {
components: { addDataSetDialog,releaseVersionDialog,annotationTaskDialog},
name: "DataSet",
data() {
return {
datasetId: 0,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
tableHeight: 0,
//
showSearch: true,
//
total: 0,
//
list: [],
//
addOpen: false,
releaseOpen: false,
annotationOpen:false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
datasetName: null,
},
};
},
created() {
this.getList();
//
this.updateTableHeight();
//
window.addEventListener("resize", this.updateTableHeight);
},
methods: {
updateTableHeight() {
//
const headerHeight = 300; //
const footerHeight = 80; //
this.tableHeight = window.innerHeight - headerHeight - footerHeight;
},
/**获取数据 **/
getList(){
this.loading =true
list(this.queryParams).then(response => {
console.log(response);
this.list = response.rows;
this.total = response.total;
this.loading =false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
handleAdd(){
this.addOpen = true;
},
handleRelease(row){
this.releaseOpen = true;
this.datasetId = row.datasetId;
},
handleAnnotation(row){
this.annotationOpen = true;
this.datasetId = row.datasetId;
},
handleUpdate(){
},
handleDelete(row){
const ids = row.datasetId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() {
return del(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
change(){
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.datasetId)
this.single = selection.length!==1
this.multiple = !selection.length
},
//
handleCancel() {
this.addOpen = false;
this.releaseOpen= false;
this.annotationOpen = false;
},
}
}
</script>
<style scoped>
.demo-table-expand {
font-size: 0;
}
.demo-table-expand label {
width: 90px;
color: #99a9bf;
}
.demo-table-expand .el-form-item {
margin-right: 0;
margin-bottom: 0;
width: 50%;
}
</style>

View File

@ -0,0 +1,197 @@
<template>
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="85px">
<el-form-item label="数据集名称" prop="datasetName">
<el-input
v-model="queryParams.datasetName"
placeholder="请输入数据集名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['dataCenter:dataSet:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['dataCenter:dataSet:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['dataCenter:dataSet:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="list" :height="tableHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="80" />
<el-table-column label="名称" align="center" prop="sampleName" />
<el-table-column label="版本名称" align="center" prop="sampleFormat" />
<el-table-column label="标注进度" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="描述" align="center" prop="createBy" />
<el-table-column label="是否公开" align="center" prop="createBy" >
<template slot-scope="scope">
<el-switch v-model="scope.row.isPublic" active-value="1" inactive-value="0"
@change="change(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['dataCenter:sample:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['dataCenter:sample:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
export default {
name: "Sample",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
tableHeight: 0,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
datasetName: null,
},
//
form: {},
//
rules: {
sampleName: [
{ required: true, message: '样本类型名称不能为空', trigger: 'blur' },
{ min: 2, max: 20, message: '样本类型名称长度必须介于 2 和 20 之间', trigger: 'blur' }
],
sampleFormat: [
{ required: true, message: '格式不能为空', trigger: 'blur' },
{ min: 1, max: 20, message: '格式长度必须介于 1 和 20 之间', trigger: 'blur' }
],
}
};
},
created() {
this.getList();
//
this.updateTableHeight();
//
window.addEventListener("resize", this.updateTableHeight);
},
methods: {
updateTableHeight() {
//
const headerHeight = 300; //
const footerHeight = 80; //
this.tableHeight = window.innerHeight - headerHeight - footerHeight;
},
/**获取数据 **/
getList(){
this.loading =false
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
handleAdd(){
},
handleUpdate(){
},
handleDelete(){
},
change(){
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
}
}
</script>

View File

@ -0,0 +1,58 @@
<template>
<div class="app-container ">
<el-tabs type="border-card" @tab-click="handleClick">
<!-- 我的文件 -->
<el-tab-pane label="我的数据集">
<div v-if="activeTab === 'dataSet'">
<dataSet v-if="activeTab === 'dataSet'" />
</div>
</el-tab-pane>
<!-- 我共享的 -->
<el-tab-pane label="共享数据集">
<div v-if="activeTab === 'sharedDataSet'">
<sharedDataSet v-if="activeTab === 'sharedDataSet'" />
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import dataSet from './components/dataSet.vue'
import sharedDataSet from './components/sharedDataSet.vue'
export default {
components: { dataSet,sharedDataSet},
data() {
return {
activeTab: 'dataSet' // ""
}
},
methods: {
handleClick(tab, event) {
// activeTab
if (tab.label === '我的数据集') {
this.activeTab = 'dataSet';
} else if (tab.label === '共享数据集') {
this.activeTab = 'sharedDataSet';
}
}
}
}
</script>
<style scoped lang="scss">
.app-container {
.el-tabs {
margin-bottom: 10px;
height: calc(100vh - 140px);
}
.el-tab-pane {
padding: 20px;
background-color: #f9f9f9;
border-radius: 4px;
}
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
<el-form-item label="文件名" prop="fileName">
<el-input

View File

@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
<el-form-item label="文件名" prop="fileName">
<el-input