Merge branch 'dev' of 192.168.0.100:smart_bench/cmvr-iot-ui into dev
This commit is contained in:
commit
9cf201eb98
@ -1,77 +1,77 @@
|
|||||||
import request from '@/utils/request'
|
import request from "@/utils/request";
|
||||||
import { method } from 'lodash'
|
import { method } from "lodash";
|
||||||
|
|
||||||
// 查询语料库列表
|
// 查询语料库列表
|
||||||
export function listCorpus(query) {
|
export function listCorpus(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/vi/corpus/single/list',
|
url: "/vi/corpus/single/list",
|
||||||
method: 'get',
|
method: "post",
|
||||||
params: query
|
data: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询语料库详细
|
// 查询语料库详细
|
||||||
export function getCorpus(corpusId) {
|
export function getCorpus(corpusId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/vi/corpus/' + corpusId,
|
url: "/vi/corpus/" + corpusId,
|
||||||
method: 'get'
|
method: "get",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增语料库
|
// 新增语料库
|
||||||
export function addCorpus(data) {
|
export function addCorpus(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/vi/corpus',
|
url: "/vi/corpus",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改语料库
|
// 修改语料库
|
||||||
export function updateCorpus(data) {
|
export function updateCorpus(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/vi/corpus',
|
url: "/vi/corpus",
|
||||||
method: 'put',
|
method: "put",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除语料库
|
// 删除语料库
|
||||||
export function delCorpus(corpusId) {
|
export function delCorpus(corpusId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/vi/corpus/' + corpusId,
|
url: "/vi/corpus/" + corpusId,
|
||||||
method: 'delete'
|
method: "delete",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function batchAddCorpus(data) {
|
export function batchAddCorpus(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/vi/corpus/continuous/insert',
|
url: "/vi/corpus/continuous/insert",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function batchUpdateCorpus(data) {
|
export function batchUpdateCorpus(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/vi/corpus/continuous/update',
|
url: "/vi/corpus/continuous/update",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data: data
|
data: data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getBatchCorpus(query) {
|
export function getBatchCorpus(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/vi/corpus/continuous/list',
|
url: "/vi/corpus/continuous/list",
|
||||||
method: 'get',
|
method: "post",
|
||||||
params: query
|
data: query,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deleteBatchCorpus(corpusIds) {
|
export function deleteBatchCorpus(corpusIds) {
|
||||||
return request({
|
return request({
|
||||||
url: `/vi/corpus/continuous`,
|
url: `/vi/corpus/continuous`,
|
||||||
method: 'delete',
|
method: "delete",
|
||||||
data: corpusIds
|
data: corpusIds,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
44
src/api/vi/plan.js
Normal file
44
src/api/vi/plan.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询语音交互-方案列表
|
||||||
|
export function listScheme(query) {
|
||||||
|
return request({
|
||||||
|
url: '/vi/scheme/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询语音交互-方案详细
|
||||||
|
export function getScheme(schemeId) {
|
||||||
|
return request({
|
||||||
|
url: '/vi/scheme/' + schemeId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增语音交互-方案
|
||||||
|
export function addScheme(data) {
|
||||||
|
return request({
|
||||||
|
url: '/vi/scheme',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改语音交互-方案
|
||||||
|
export function updateScheme(data) {
|
||||||
|
return request({
|
||||||
|
url: '/vi/scheme',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除语音交互-方案
|
||||||
|
export function delScheme(schemeId) {
|
||||||
|
return request({
|
||||||
|
url: '/vi/scheme/' + schemeId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
44
src/api/vi/project.js
Normal file
44
src/api/vi/project.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询语音交互-项目列表
|
||||||
|
export function listProject(query) {
|
||||||
|
return request({
|
||||||
|
url: '/vi/project/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询语音交互-项目详细
|
||||||
|
export function getProject(projectId) {
|
||||||
|
return request({
|
||||||
|
url: '/vi/project/' + projectId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增语音交互-项目
|
||||||
|
export function addProject(data) {
|
||||||
|
return request({
|
||||||
|
url: '/vi/project',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改语音交互-项目
|
||||||
|
export function updateProject(data) {
|
||||||
|
return request({
|
||||||
|
url: '/vi/project',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除语音交互-项目
|
||||||
|
export function delProject(projectId) {
|
||||||
|
return request({
|
||||||
|
url: '/vi/project/' + projectId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -46,6 +46,7 @@ const resetQuery = () => {
|
|||||||
>
|
>
|
||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<slot name="one"></slot>
|
<slot name="one"></slot>
|
||||||
|
<slot name="other" v-if="formData.search"></slot>
|
||||||
<el-col :xs="24" :sm="24" :md="12" :lg="6" :xl="6" :xxl="6" style="padding-bottom: 10px;">
|
<el-col :xs="24" :sm="24" :md="12" :lg="6" :xl="6" :xxl="6" style="padding-bottom: 10px;">
|
||||||
<el-space>
|
<el-space>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
@ -60,12 +61,6 @@ const resetQuery = () => {
|
|||||||
</el-space>
|
</el-space>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="16">
|
|
||||||
<TransitionGroup name="other-search">
|
|
||||||
<slot name="other" v-if="formData.search"></slot>
|
|
||||||
</TransitionGroup>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
21
src/hooks/tableHeight.ts
Normal file
21
src/hooks/tableHeight.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { useElementSize } from '@vueuse/core'
|
||||||
|
import { computed } from 'vue'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监听容器高度变化的hook
|
||||||
|
* @param {Ref<HTMLElement | null>} containerRef - 容器的ref引用
|
||||||
|
* @param {boolean} [immediate=true] - 是否立即执行一次
|
||||||
|
* @returns {Ref<number>} 容器的高度
|
||||||
|
*/
|
||||||
|
export function useContainerHeight(containerRef, immediate = true) {
|
||||||
|
// 存储容器高度的响应式变量
|
||||||
|
|
||||||
|
const { height } = useElementSize(containerRef)
|
||||||
|
const containerHeight = computed(() => {
|
||||||
|
let offset = height.value + 84
|
||||||
|
return { height: `calc(100% - ${offset}px)` }
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
return containerHeight;
|
||||||
|
}
|
||||||
@ -192,6 +192,20 @@ export const dynamicRoutes = [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/vi/plan",
|
||||||
|
component: Layout,
|
||||||
|
hidden: true,
|
||||||
|
permissions: ["vi:testProject:list"],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "index/:id",
|
||||||
|
component: () => import("@/views/vi/testProject/plan/index"),
|
||||||
|
name: "Data",
|
||||||
|
meta: { title: "方案管理", activeMenu: "/vi/testProject" },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/monitor/job-log",
|
path: "/monitor/job-log",
|
||||||
component: Layout,
|
component: Layout,
|
||||||
@ -221,7 +235,7 @@ export const dynamicRoutes = [
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
console.log("constantRoutes", constantRoutes);
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(),
|
||||||
routes: constantRoutes,
|
routes: constantRoutes,
|
||||||
|
|||||||
@ -1,94 +1,209 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<TableSearch :queryParams="queryParams" :showSearch="showSearch" queryRef="queryRef" @refresh="resetQuery"
|
<div ref="topContainerRef">
|
||||||
@search="handleQuery">
|
<TableSearch
|
||||||
<template #one>
|
:queryParams="queryParams"
|
||||||
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
:showSearch="showSearch"
|
||||||
<el-form-item label="任务名称" prop="taskName">
|
queryRef="queryRef"
|
||||||
<el-input v-model="queryParams.taskName" clearable placeholder="请输入任务名称" style="width:100%"
|
@refresh="resetQuery"
|
||||||
@keyup.enter="handleQuery"/>
|
@search="handleQuery"
|
||||||
</el-form-item>
|
>
|
||||||
</el-col>
|
<template #one>
|
||||||
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
<el-form-item label="任务描述" prop="taskDesc">
|
<el-form-item label="任务名称" prop="taskName">
|
||||||
<el-input v-model="queryParams.taskDesc" clearable placeholder="请输入任务描述" style="width:100%"
|
<el-input
|
||||||
@keyup.enter="handleQuery"/>
|
v-model="queryParams.taskName"
|
||||||
</el-form-item>
|
clearable
|
||||||
</el-col>
|
placeholder="请输入任务名称"
|
||||||
</template>
|
style="width: 100%"
|
||||||
</TableSearch>
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
<el-row :gutter="10" class="mb8">
|
</el-form-item>
|
||||||
<el-col :span="1.5">
|
</el-col>
|
||||||
<el-button v-hasPermi="['test:config:add']" icon="Plus" plain type="primary" @click="handleAdd">新增
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
</el-button>
|
<el-form-item label="任务描述" prop="taskDesc">
|
||||||
</el-col>
|
<el-input
|
||||||
<el-col :span="1.5">
|
v-model="queryParams.taskDesc"
|
||||||
<el-button v-hasPermi="['test:config:edit']" :disabled="single" icon="Edit" plain type="success"
|
clearable
|
||||||
@click="handleUpdate">修改
|
placeholder="请输入任务描述"
|
||||||
</el-button>
|
style="width: 100%"
|
||||||
</el-col>
|
@keyup.enter="handleQuery"
|
||||||
<el-col :span="1.5">
|
/>
|
||||||
<el-button v-hasPermi="['test:config:remove']" :disabled="multiple" icon="Delete" plain type="danger"
|
</el-form-item>
|
||||||
@click="handleDelete">删除
|
</el-col>
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection" width="55"/>
|
|
||||||
<el-table-column align="center" label="id" prop="id" show-overflow-tooltip/>
|
|
||||||
<el-table-column align="center" label="任务名称" prop="taskName" show-overflow-tooltip/>
|
|
||||||
<el-table-column align="center" label="分组名称" prop="groupName" show-overflow-tooltip/>
|
|
||||||
<el-table-column align="center" label="任务描述" prop="taskDesc" show-overflow-tooltip/>
|
|
||||||
<el-table-column align="center" label="备注" prop="remark" show-overflow-tooltip/>
|
|
||||||
<el-table-column align="center" label="状态" prop="status">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-switch v-model="scope.row.status" active-text="启用" active-value="0" inactive-text="停用"
|
|
||||||
inactive-value="1"
|
|
||||||
inline-prompt @change="handleChange(scope.row)"/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</TableSearch>
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="280">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button v-hasPermi="['test:config:edit']" icon="Edit" link type="primary" @click="handleUpdate(scope.row)">
|
|
||||||
修改
|
|
||||||
</el-button>
|
|
||||||
<el-button v-hasPermi="['test:config:config']" icon="Finished" link type="primary"
|
|
||||||
@click="handleTaskConfig(scope.row)">编排
|
|
||||||
</el-button>
|
|
||||||
<el-button v-hasPermi="['test:config:execute']" icon="Cpu" link type="primary"
|
|
||||||
@click="handleTaskExecuteOpen(scope.row)">执行
|
|
||||||
</el-button>
|
|
||||||
<el-button v-hasPermi="['test:config:remove']" icon="Delete" link type="primary"
|
|
||||||
@click="handleDelete(scope.row)">删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination v-show="total > 0" v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNum"
|
<el-row :gutter="10" class="mb8">
|
||||||
:total="total"
|
<el-col :span="1.5">
|
||||||
@pagination="getList"/>
|
<el-button
|
||||||
|
v-hasPermi="['test:config:add']"
|
||||||
|
icon="Plus"
|
||||||
|
plain
|
||||||
|
type="primary"
|
||||||
|
@click="handleAdd"
|
||||||
|
>新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['test:config:edit']"
|
||||||
|
:disabled="single"
|
||||||
|
icon="Edit"
|
||||||
|
plain
|
||||||
|
type="success"
|
||||||
|
@click="handleUpdate"
|
||||||
|
>修改
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['test:config:remove']"
|
||||||
|
:disabled="multiple"
|
||||||
|
icon="Delete"
|
||||||
|
plain
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div :style="containerHeight">
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
height="100%"
|
||||||
|
:data="configList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column align="center" type="selection" width="55" />
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="id"
|
||||||
|
prop="id"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="任务名称"
|
||||||
|
prop="taskName"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="分组名称"
|
||||||
|
prop="groupName"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="任务描述"
|
||||||
|
prop="taskDesc"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="备注"
|
||||||
|
prop="remark"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column align="center" label="状态" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-switch
|
||||||
|
v-model="scope.row.status"
|
||||||
|
active-text="启用"
|
||||||
|
active-value="0"
|
||||||
|
inactive-text="停用"
|
||||||
|
inactive-value="1"
|
||||||
|
inline-prompt
|
||||||
|
@change="handleChange(scope.row)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
label="操作"
|
||||||
|
width="280"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['test:config:edit']"
|
||||||
|
icon="Edit"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['test:config:config']"
|
||||||
|
icon="Finished"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleTaskConfig(scope.row)"
|
||||||
|
>编排
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['test:config:execute']"
|
||||||
|
icon="Cpu"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleTaskExecuteOpen(scope.row)"
|
||||||
|
>执行
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['test:config:remove']"
|
||||||
|
icon="Delete"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
:total="total"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 添加或修改任务流程编排对话框 -->
|
<!-- 添加或修改任务流程编排对话框 -->
|
||||||
<el-dialog v-model="open" :title="title" append-to-body width="500px">
|
<el-dialog v-model="open" :title="title" append-to-body width="500px">
|
||||||
<el-form ref="configRef" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="configRef" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="任务名称" prop="taskName">
|
<el-form-item label="任务名称" prop="taskName">
|
||||||
<el-input v-model="form.taskName" placeholder="请输入任务名称"/>
|
<el-input v-model="form.taskName" placeholder="请输入任务名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务描述" prop="taskDesc">
|
<el-form-item label="任务描述" prop="taskDesc">
|
||||||
<el-input v-model="form.taskDesc" placeholder="请输入任务描述"/>
|
<el-input v-model="form.taskDesc" placeholder="请输入任务描述" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属分组">
|
<el-form-item label="所属分组">
|
||||||
<el-select v-model="form.groupId" placeholder="请选择所属分组">
|
<el-select v-model="form.groupId" placeholder="请选择所属分组">
|
||||||
<el-option v-for="group in groupList" :key="group.value" :label="group.label"
|
<el-option
|
||||||
:value="group.value"></el-option>
|
v-for="group in groupList"
|
||||||
|
:key="group.value"
|
||||||
|
:label="group.label"
|
||||||
|
:value="group.value"
|
||||||
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" :rows="2" placeholder="请输入备注" type="textarea"/>
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
:rows="2"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -100,19 +215,31 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 自定义任务流程编排对话框 -->
|
<!-- 自定义任务流程编排对话框 -->
|
||||||
<el-dialog v-model="taskConfigOpen" :title="title" append-to-body width="700px" @closed="resetTaskList"
|
<el-dialog
|
||||||
@open="handleTaskConfigOpen">
|
v-model="taskConfigOpen"
|
||||||
|
:title="title"
|
||||||
|
append-to-body
|
||||||
|
width="700px"
|
||||||
|
@closed="resetTaskList"
|
||||||
|
@open="handleTaskConfigOpen"
|
||||||
|
>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<div style="height: 55vh">
|
<div style="height: 55vh">
|
||||||
<div class="task-title">待检测项</div>
|
<div class="task-title">待检测项</div>
|
||||||
<draggable :animation="340" :forceFallback="true" :list="taskLeftList" class="draggable-group"
|
<draggable
|
||||||
ghostClass="dragClass"
|
:animation="340"
|
||||||
group="people" itemKey="name">
|
:forceFallback="true"
|
||||||
|
:list="taskLeftList"
|
||||||
|
class="draggable-group"
|
||||||
|
ghostClass="dragClass"
|
||||||
|
group="people"
|
||||||
|
itemKey="name"
|
||||||
|
>
|
||||||
<template #item="{ element, index }">
|
<template #item="{ element, index }">
|
||||||
<div class="list-group-item">
|
<div class="list-group-item">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<Tools/>
|
<Tools />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
{{ element.name }}
|
{{ element.name }}
|
||||||
</div>
|
</div>
|
||||||
@ -123,11 +250,19 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<div style="height: 55vh">
|
<div style="height: 55vh">
|
||||||
<div class="task-title">流程编排</div>
|
<div class="task-title">流程编排</div>
|
||||||
<draggable :animation="340" :forceFallback="true" :list="taskRightList" class="draggable-group"
|
<draggable
|
||||||
ghostClass="dragClass"
|
:animation="340"
|
||||||
group="people" itemKey="name">
|
:forceFallback="true"
|
||||||
|
:list="taskRightList"
|
||||||
|
class="draggable-group"
|
||||||
|
ghostClass="dragClass"
|
||||||
|
group="people"
|
||||||
|
itemKey="name"
|
||||||
|
>
|
||||||
<template #item="{ element, index }">
|
<template #item="{ element, index }">
|
||||||
<div class="list-group-item">{{ index + 1 }} 、{{ element.name }}</div>
|
<div class="list-group-item">
|
||||||
|
{{ index + 1 }} 、{{ element.name }}
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</draggable>
|
</draggable>
|
||||||
</div>
|
</div>
|
||||||
@ -146,20 +281,31 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 任务参数填写对话框 -->
|
<!-- 任务参数填写对话框 -->
|
||||||
<el-drawer v-model="taskExecuteOpen" :title="title" append-to-body destroy-on-close modal-class="test-config"
|
<el-drawer
|
||||||
size="600"
|
v-model="taskExecuteOpen"
|
||||||
@closed="resetTaskList" @open="paramsOpen">
|
:title="title"
|
||||||
|
append-to-body
|
||||||
|
destroy-on-close
|
||||||
|
modal-class="test-config"
|
||||||
|
size="600"
|
||||||
|
@closed="resetTaskList"
|
||||||
|
@open="paramsOpen"
|
||||||
|
>
|
||||||
<el-form ref="dynamicFormRef" :model="fModel">
|
<el-form ref="dynamicFormRef" :model="fModel">
|
||||||
<el-card v-for="(item,idx) in fModel.list" :header="`${item.itemName}的参数`"
|
<el-card
|
||||||
style="margin-bottom: 20px;">
|
v-for="(item, idx) in fModel.list"
|
||||||
<template v-for="(paramItem,paramItemIdx) in item.params">
|
:header="`${item.itemName}的参数`"
|
||||||
<el-form-item :label="paramItem['paramCnName']"
|
style="margin-bottom: 20px"
|
||||||
:prop="'list.'+idx+'.params.'+paramItemIdx+'.sourceValue'"
|
>
|
||||||
:rules="{
|
<template v-for="(paramItem, paramItemIdx) in item.params">
|
||||||
required: paramItem['required'],
|
<el-form-item
|
||||||
message: '此项为必填',
|
:label="paramItem['paramCnName']"
|
||||||
trigger: 'blur',
|
:prop="'list.' + idx + '.params.' + paramItemIdx + '.sourceValue'"
|
||||||
}"
|
:rules="{
|
||||||
|
required: paramItem['required'],
|
||||||
|
message: '此项为必填',
|
||||||
|
trigger: 'blur',
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<el-input v-model="paramItem['sourceValue']"></el-input>
|
<el-input v-model="paramItem['sourceValue']"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -168,26 +314,19 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button type="primary" @click="()=>(executeOpen = true)">执 行</el-button>
|
<el-button type="primary" @click="() => (executeOpen = true)"
|
||||||
|
>执 行</el-button
|
||||||
|
>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
<!-- 添加或修改任务流程编排对话框 -->
|
<Run
|
||||||
<!-- <el-dialog v-model="executeOpen" :align-center="true" title="选择执行终端" width="500px"
|
:drawer="executeOpen"
|
||||||
@open="handleGetTerminalGroup">
|
@close="executeOpen = false"
|
||||||
<el-select v-model="selectedTerminal" placeholder="请选择终端列表">
|
:currentRow="currentRow"
|
||||||
<el-option v-for="item in terminalGroup" :label="item.label" :value="item.value"></el-option>
|
/>
|
||||||
</el-select>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="handleTaskExecute">执 行</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog> -->
|
|
||||||
<Run :drawer="executeOpen" @close="executeOpen = false" :currentRow="currentRow" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -201,36 +340,41 @@ import {
|
|||||||
listConfig,
|
listConfig,
|
||||||
taskConfig,
|
taskConfig,
|
||||||
taskExecute,
|
taskExecute,
|
||||||
updateConfig
|
updateConfig,
|
||||||
} from "@/api/test/config"
|
} from "@/api/test/config";
|
||||||
|
|
||||||
import { flowExecute } from '@/api/device/flow'
|
import { flowExecute } from "@/api/device/flow";
|
||||||
import TableSearch from "@/components/TableSearch/index.vue"
|
import TableSearch from "@/components/TableSearch/index.vue";
|
||||||
import draggable from 'vuedraggable'
|
import draggable from "vuedraggable";
|
||||||
import {listDetect} from "@/api/test/detect.js";
|
import { listDetect } from "@/api/test/detect.js";
|
||||||
import {Tools} from "@element-plus/icons-vue";
|
import { Tools } from "@element-plus/icons-vue";
|
||||||
import {listGroup} from "@/api/system/group.js";
|
import { listGroup } from "@/api/system/group.js";
|
||||||
import {listTerminal} from "@/api/device/terminal.js";
|
import { listTerminal } from "@/api/device/terminal.js";
|
||||||
import Run from "./Run.vue";
|
import Run from "./Run.vue";
|
||||||
import { ref, reactive, toRefs, onMounted } from 'vue'
|
import { ref, reactive, toRefs, onMounted } from "vue";
|
||||||
|
|
||||||
const {proxy} = getCurrentInstance()
|
import { useContainerHeight } from "@/hooks/tableHeight";
|
||||||
|
|
||||||
const configList = ref([])
|
const topContainerRef = ref();
|
||||||
const open = ref(false)
|
const containerHeight = useContainerHeight(topContainerRef);
|
||||||
const loading = ref(true)
|
|
||||||
const showSearch = ref(true)
|
|
||||||
const ids = ref([])
|
|
||||||
const single = ref(true)
|
|
||||||
const multiple = ref(true)
|
|
||||||
const total = ref(0)
|
|
||||||
const title = ref("")
|
|
||||||
const taskConfigOpen = ref(false)
|
|
||||||
const taskExecuteOpen = ref(false)
|
|
||||||
const executeOpen = ref(false)
|
|
||||||
const currentRow = ref(undefined)
|
|
||||||
|
|
||||||
const dynamicFormRef = ref()
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
|
const configList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
const taskConfigOpen = ref(false);
|
||||||
|
const taskExecuteOpen = ref(false);
|
||||||
|
const executeOpen = ref(false);
|
||||||
|
const currentRow = ref(undefined);
|
||||||
|
|
||||||
|
const dynamicFormRef = ref();
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {},
|
form: {},
|
||||||
@ -242,199 +386,207 @@ const data = reactive({
|
|||||||
taskDesc: null,
|
taskDesc: null,
|
||||||
status: null,
|
status: null,
|
||||||
versionNo: null,
|
versionNo: null,
|
||||||
groupCode: null
|
groupCode: null,
|
||||||
},
|
},
|
||||||
paramsFormList: [],
|
paramsFormList: [],
|
||||||
rules: {}
|
rules: {},
|
||||||
})
|
});
|
||||||
|
|
||||||
const {queryParams, form, rules, paramsFormList} = toRefs(data)
|
const { queryParams, form, rules, paramsFormList } = toRefs(data);
|
||||||
|
|
||||||
const taskLeftList = ref([])
|
const taskLeftList = ref([]);
|
||||||
const taskRightList = ref([])
|
const taskRightList = ref([]);
|
||||||
|
|
||||||
/** 查询任务流程编排列表 */
|
/** 查询任务流程编排列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
listConfig(queryParams.value).then(response => {
|
listConfig(queryParams.value).then((response) => {
|
||||||
configList.value = response.rows
|
configList.value = response.rows;
|
||||||
total.value = response.total
|
total.value = response.total;
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false
|
open.value = false;
|
||||||
taskExecuteOpen.value = false
|
taskExecuteOpen.value = false;
|
||||||
taskConfigOpen.value = false
|
taskConfigOpen.value = false;
|
||||||
executeOpen.value = false
|
executeOpen.value = false;
|
||||||
selectedTerminal.value = ""
|
selectedTerminal.value = "";
|
||||||
reset()
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
// id: null,
|
// id: null,
|
||||||
// createBy: null,
|
// createBy: null,
|
||||||
// createTime: null,
|
// createTime: null,
|
||||||
// updateBy: null,
|
// updateBy: null,
|
||||||
// updateTime: null,
|
// updateTime: null,
|
||||||
// remark: null,
|
// remark: null,
|
||||||
// taskCode: null,
|
// taskCode: null,
|
||||||
// taskName: null,
|
// taskName: null,
|
||||||
// taskDesc: null,
|
// taskDesc: null,
|
||||||
// status: null,
|
// status: null,
|
||||||
// versionNo: null,
|
// versionNo: null,
|
||||||
// groupCode: null
|
// groupCode: null
|
||||||
}
|
};
|
||||||
proxy.resetForm("configRef")
|
proxy.resetForm("configRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1
|
queryParams.value.pageNum = 1;
|
||||||
getList()
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
handleQuery()
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.id)
|
ids.value = selection.map((item) => item.id);
|
||||||
single.value = selection.length != 1
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset()
|
reset();
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "添加任务流程编排"
|
title.value = "添加任务流程编排";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset()
|
reset();
|
||||||
const _id = row.id || ids.value
|
const _id = row.id || ids.value;
|
||||||
getConfig(_id).then(response => {
|
getConfig(_id).then((response) => {
|
||||||
form.value = response.data
|
form.value = response.data;
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "修改任务流程编排"
|
title.value = "修改任务流程编排";
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["configRef"].validate(valid => {
|
proxy.$refs["configRef"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (form.value.id != null) {
|
if (form.value.id != null) {
|
||||||
updateConfig(form.value).then(response => {
|
updateConfig(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("修改成功")
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
open.value = false
|
open.value = false;
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
addConfig(form.value).then(response => {
|
addConfig(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("新增成功")
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
open.value = false
|
open.value = false;
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const _ids = row.id || ids.value
|
const _ids = row.id || ids.value;
|
||||||
proxy.$modal.confirm('是否确认删除任务流程编排编号为"' + _ids + '"的数据项?').then(function () {
|
proxy.$modal
|
||||||
return delConfig(_ids)
|
.confirm('是否确认删除任务流程编排编号为"' + _ids + '"的数据项?')
|
||||||
}).then(() => {
|
.then(function () {
|
||||||
getList()
|
return delConfig(_ids);
|
||||||
proxy.$modal.msgSuccess("删除成功")
|
})
|
||||||
}).catch(() => {
|
.then(() => {
|
||||||
})
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('test/config/export', {
|
proxy.download(
|
||||||
...queryParams.value
|
"test/config/export",
|
||||||
}, `config_${new Date().getTime()}.xlsx`)
|
{
|
||||||
|
...queryParams.value,
|
||||||
|
},
|
||||||
|
`config_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleChange(row) {
|
function handleChange(row) {
|
||||||
updateConfig({status: row.status, id: row.id}).then(response => {
|
updateConfig({ status: row.status, id: row.id }).then((response) => {
|
||||||
proxy.$modal.msgSuccess("修改成功")
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleTaskConfig(row) {
|
function handleTaskConfig(row) {
|
||||||
taskConfigOpen.value = true
|
taskConfigOpen.value = true;
|
||||||
currentRow.value = row
|
currentRow.value = row;
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取左侧待检测项数据
|
//获取左侧待检测项数据
|
||||||
const getLiftTaskList = () => {
|
const getLiftTaskList = () => {
|
||||||
listDetect({isDeploy: '0'}).then(response => {
|
listDetect({ isDeploy: "0" }).then((response) => {
|
||||||
let tempLeftData = response.rows?.map((item) => {
|
let tempLeftData =
|
||||||
return {
|
response.rows?.map((item) => {
|
||||||
name: item.detectName,
|
return {
|
||||||
id: item.id
|
name: item.detectName,
|
||||||
}
|
id: item.id,
|
||||||
}) || []
|
};
|
||||||
|
}) || [];
|
||||||
if (taskRightList.value.length === 0) {
|
if (taskRightList.value.length === 0) {
|
||||||
taskLeftList.value = tempLeftData
|
taskLeftList.value = tempLeftData;
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
taskLeftList.value = tempLeftData.filter((item) => {
|
taskLeftList.value = tempLeftData.filter((item) => {
|
||||||
return !taskRightList.value.some((item2) => {
|
return !taskRightList.value.some((item2) => {
|
||||||
return item.id === item2.id
|
return item.id === item2.id;
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
//获取右侧编排数据
|
//获取右侧编排数据
|
||||||
const getRightTaskList = () => {
|
const getRightTaskList = () => {
|
||||||
getTaskConfig({taskId: currentRow.value.id}
|
getTaskConfig({ taskId: currentRow.value.id }).then((response) => {
|
||||||
).then(response => {
|
taskRightList.value =
|
||||||
taskRightList.value = response.rows?.map((item) => {
|
response.rows?.map((item) => {
|
||||||
return {
|
return {
|
||||||
name: item.itemName,
|
name: item.itemName,
|
||||||
id: item.itemId
|
id: item.itemId,
|
||||||
}
|
};
|
||||||
}) || []
|
}) || [];
|
||||||
getLiftTaskList()
|
getLiftTaskList();
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
const handleTaskConfigOpen = (v) => {
|
const handleTaskConfigOpen = (v) => {
|
||||||
getRightTaskList()
|
getRightTaskList();
|
||||||
}
|
};
|
||||||
|
|
||||||
const resetTaskList = () => {
|
const resetTaskList = () => {
|
||||||
taskLeftList.value = []
|
taskLeftList.value = [];
|
||||||
taskRightList.value = []
|
taskRightList.value = [];
|
||||||
currentRow.value = undefined
|
currentRow.value = undefined;
|
||||||
}
|
};
|
||||||
|
|
||||||
const submitTaskForm = () => {
|
const submitTaskForm = () => {
|
||||||
const taskId = currentRow.value.id
|
const taskId = currentRow.value.id;
|
||||||
const taskIds = taskRightList.value.map((item) => item.id)
|
const taskIds = taskRightList.value.map((item) => item.id);
|
||||||
const data = Object.assign({}, {taskId, itemIds: taskIds})
|
const data = Object.assign({}, { taskId, itemIds: taskIds });
|
||||||
taskConfig(data).then((res) => {
|
taskConfig(data).then((res) => {
|
||||||
proxy.$modal.msgSuccess("操作成功")
|
proxy.$modal.msgSuccess("操作成功");
|
||||||
taskConfigOpen.value = false
|
taskConfigOpen.value = false;
|
||||||
resetTaskList()
|
resetTaskList();
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
const formatCode = (arr) => {
|
const formatCode = (arr) => {
|
||||||
return arr.map((item) => ({
|
return arr.map((item) => ({
|
||||||
@ -442,17 +594,20 @@ const formatCode = (arr) => {
|
|||||||
params: item.params.reduce((acc, param) => {
|
params: item.params.reduce((acc, param) => {
|
||||||
acc[param.paramEnName] = param.sourceValue;
|
acc[param.paramEnName] = param.sourceValue;
|
||||||
return acc;
|
return acc;
|
||||||
}, {})
|
}, {}),
|
||||||
}));
|
}));
|
||||||
|
};
|
||||||
}
|
|
||||||
|
|
||||||
const handleTaskExecute = (formEl) => {
|
const handleTaskExecute = (formEl) => {
|
||||||
if (!selectedTerminal.value) {
|
if (!selectedTerminal.value) {
|
||||||
proxy.$modal.msgError("请选择执行终端")
|
proxy.$modal.msgError("请选择执行终端");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
const data = Object.assign({}, {runParams: {terminalId: selectedTerminal.value}}, {taskId: currentRow.value.id})
|
const data = Object.assign(
|
||||||
|
{},
|
||||||
|
{ runParams: { terminalId: selectedTerminal.value } },
|
||||||
|
{ taskId: currentRow.value.id }
|
||||||
|
);
|
||||||
// taskExecute(data).then((res) => {
|
// taskExecute(data).then((res) => {
|
||||||
// proxy.$modal.msgSuccess("下发成功")
|
// proxy.$modal.msgSuccess("下发成功")
|
||||||
// resetTaskList()
|
// resetTaskList()
|
||||||
@ -463,69 +618,69 @@ const handleTaskExecute = (formEl) => {
|
|||||||
// })
|
// })
|
||||||
|
|
||||||
flowExecute(data).then((res) => {
|
flowExecute(data).then((res) => {
|
||||||
console.log('res', res)
|
console.log("res", res);
|
||||||
proxy.$modal.msgSuccess("下发成功")
|
proxy.$modal.msgSuccess("下发成功");
|
||||||
resetTaskList()
|
resetTaskList();
|
||||||
executeOpen.value = false
|
executeOpen.value = false;
|
||||||
taskExecuteOpen.value = false
|
taskExecuteOpen.value = false;
|
||||||
currentRow.value = undefined
|
currentRow.value = undefined;
|
||||||
selectedTerminal.value = ""
|
selectedTerminal.value = "";
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
const handleTaskExecuteOpen = (row) => {
|
const handleTaskExecuteOpen = (row) => {
|
||||||
currentRow.value = row
|
currentRow.value = row;
|
||||||
executeOpen.value = true
|
executeOpen.value = true;
|
||||||
title.value = "任务执行"
|
title.value = "任务执行";
|
||||||
}
|
};
|
||||||
|
|
||||||
const fModel = reactive({
|
const fModel = reactive({
|
||||||
list: []
|
list: [],
|
||||||
})
|
});
|
||||||
|
|
||||||
const paramsOpen = () => {
|
const paramsOpen = () => {
|
||||||
getTaskParamsById(currentRow.value.id).then((response) => {
|
getTaskParamsById(currentRow.value.id).then((response) => {
|
||||||
paramsFormList.value = response.data
|
paramsFormList.value = response.data;
|
||||||
fModel.list = response.data
|
fModel.list = response.data;
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
const groupList = ref([])
|
const groupList = ref([]);
|
||||||
|
|
||||||
/** 获取系统分组列表(默认传1查询检测项列表) */
|
/** 获取系统分组列表(默认传1查询检测项列表) */
|
||||||
function handleGetSystemGroup(row) {
|
function handleGetSystemGroup(row) {
|
||||||
listGroup({type: 2}).then(response => {
|
listGroup({ type: 2 }).then((response) => {
|
||||||
groupList.value = response.rows?.map((item) => {
|
groupList.value = response.rows?.map((item) => {
|
||||||
return {
|
return {
|
||||||
label: item.groupName,
|
label: item.groupName,
|
||||||
value: String(item.groupId)
|
value: String(item.groupId),
|
||||||
}
|
};
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const terminalGroup = ref([])
|
const terminalGroup = ref([]);
|
||||||
const selectedTerminal = ref("")
|
const selectedTerminal = ref("");
|
||||||
|
|
||||||
/** 获取设备终端列表 */
|
/** 获取设备终端列表 */
|
||||||
function handleGetTerminalGroup(row) {
|
function handleGetTerminalGroup(row) {
|
||||||
listTerminal({
|
listTerminal({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 1000,
|
pageSize: 1000,
|
||||||
}).then(response => {
|
}).then((response) => {
|
||||||
terminalGroup.value = response.rows?.map((item) => {
|
terminalGroup.value = response.rows?.map((item) => {
|
||||||
return {
|
return {
|
||||||
label: `${item.name}(${item.host}:${item.port})`,
|
label: `${item.name}(${item.host}:${item.port})`,
|
||||||
value: item.id
|
value: item.id,
|
||||||
}
|
};
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList();
|
||||||
handleGetSystemGroup()
|
handleGetSystemGroup();
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@ -1,100 +1,134 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<TableSearch
|
<div ref="topContainerRef">
|
||||||
|
<TableSearch
|
||||||
:queryParams="queryParams"
|
:queryParams="queryParams"
|
||||||
:showSearch="showSearch"
|
:showSearch="showSearch"
|
||||||
label-width="90px"
|
label-width="90px"
|
||||||
queryRef="queryRef"
|
queryRef="queryRef"
|
||||||
@refresh="resetQuery"
|
@refresh="resetQuery"
|
||||||
@search="handleQuery"
|
@search="handleQuery"
|
||||||
>
|
>
|
||||||
<template #one>
|
<template #one>
|
||||||
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
<el-form-item label="检测项名称" prop="detectName">
|
<el-form-item label="检测项名称" prop="detectName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.detectName"
|
v-model="queryParams.detectName"
|
||||||
clearable
|
clearable
|
||||||
placeholder="请输入检测项名称"
|
placeholder="请输入检测项名称"
|
||||||
style="width:100%"
|
style="width: 100%"
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
<el-form-item label="检测项描述" prop="detectDesc">
|
<el-form-item label="检测项描述" prop="detectDesc">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.detectDesc"
|
v-model="queryParams.detectDesc"
|
||||||
clearable
|
clearable
|
||||||
placeholder="请输入检测项描述"
|
placeholder="请输入检测项描述"
|
||||||
style="width:100%"
|
style="width: 100%"
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</template>
|
||||||
|
</TableSearch>
|
||||||
|
|
||||||
</TableSearch>
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-button
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
v-hasPermi="['test:detect:add']"
|
v-hasPermi="['test:detect:add']"
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
plain
|
plain
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
>新增
|
>新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['test:detect:edit']"
|
v-hasPermi="['test:detect:edit']"
|
||||||
:disabled="single"
|
:disabled="single"
|
||||||
icon="Edit"
|
icon="Edit"
|
||||||
plain
|
plain
|
||||||
type="success"
|
type="success"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
>修改
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
v-hasPermi="['test:detect:remove']"
|
v-hasPermi="['test:detect:remove']"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
plain
|
plain
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
>删除
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="1.5">-->
|
<!-- <el-col :span="1.5">-->
|
||||||
<!-- <el-button-->
|
<!-- <el-button-->
|
||||||
<!-- type="warning"-->
|
<!-- type="warning"-->
|
||||||
<!-- plain-->
|
<!-- plain-->
|
||||||
<!-- icon="Download"-->
|
<!-- icon="Download"-->
|
||||||
<!-- @click="handleExport"-->
|
<!-- @click="handleExport"-->
|
||||||
<!-- v-hasPermi="['test:detect:export']"-->
|
<!-- v-hasPermi="['test:detect:export']"-->
|
||||||
<!-- >导出-->
|
<!-- >导出-->
|
||||||
<!-- </el-button>-->
|
<!-- </el-button>-->
|
||||||
<!-- </el-col>-->
|
<!-- </el-col>-->
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
</el-row>
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="detectList" @selection-change="handleSelectionChange">
|
<div :style="containerHeight">
|
||||||
<el-table-column align="center" type="selection" width="55"/>
|
<el-table
|
||||||
<el-table-column align="center" label="id" prop="id" show-overflow-tooltip/>
|
v-loading="loading"
|
||||||
<el-table-column align="center" label="检测项名称" prop="detectName" show-overflow-tooltip/>
|
height="100%"
|
||||||
<el-table-column align="center" label="检测项描述" prop="detectDesc" show-overflow-tooltip/>
|
:data="detectList"
|
||||||
<el-table-column align="center" label="所属分组" prop="groupId" >
|
@selection-change="handleSelectionChange"
|
||||||
<template #default="scope">
|
>
|
||||||
{{ groupList?.find(item => item.value === scope.row.groupId)["label"] }}
|
<el-table-column align="center" type="selection" width="55" />
|
||||||
</template>
|
<el-table-column
|
||||||
</el-table-column>
|
align="center"
|
||||||
<el-table-column align="center" label="备注" prop="remark" show-overflow-tooltip/>
|
label="id"
|
||||||
<el-table-column align="center" label="启用状态" prop="status">
|
prop="id"
|
||||||
<template #default="scope">
|
show-overflow-tooltip
|
||||||
<el-switch
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="检测项名称"
|
||||||
|
prop="detectName"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="检测项描述"
|
||||||
|
prop="detectDesc"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column align="center" label="所属分组" prop="groupId">
|
||||||
|
<template #default="scope">
|
||||||
|
{{
|
||||||
|
groupList?.find((item) => item.value === scope.row.groupId)[
|
||||||
|
"label"
|
||||||
|
]
|
||||||
|
}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="备注"
|
||||||
|
prop="remark"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column align="center" label="启用状态" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-switch
|
||||||
v-model="scope.row.status"
|
v-model="scope.row.status"
|
||||||
active-text="启用"
|
active-text="启用"
|
||||||
active-value="0"
|
active-value="0"
|
||||||
@ -102,69 +136,102 @@
|
|||||||
inactive-value="1"
|
inactive-value="1"
|
||||||
inline-prompt
|
inline-prompt
|
||||||
@change="handleChange(scope.row)"
|
@change="handleChange(scope.row)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="配置状态" prop="isDeploy">
|
<el-table-column align="center" label="配置状态" prop="isDeploy">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<TableTags :options="[
|
<TableTags
|
||||||
{
|
:options="[
|
||||||
label: '已配置',
|
{
|
||||||
value:'0',
|
label: '已配置',
|
||||||
type:'success'
|
value: '0',
|
||||||
},
|
type: 'success',
|
||||||
{
|
},
|
||||||
label: '未配置',
|
{
|
||||||
value:'1',
|
label: '未配置',
|
||||||
type:'warning'
|
value: '1',
|
||||||
}
|
type: 'warning',
|
||||||
]" :value="scope.row.isDeploy"></TableTags>
|
},
|
||||||
</template>
|
]"
|
||||||
</el-table-column>
|
:value="scope.row.isDeploy"
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="200">
|
></TableTags>
|
||||||
<template #default="scope">
|
</template>
|
||||||
<el-button v-hasPermi="['test:detect:edit']" icon="Edit" link type="primary" @click="handleUpdate(scope.row)">
|
</el-table-column>
|
||||||
修改
|
<el-table-column
|
||||||
</el-button>
|
align="center"
|
||||||
<el-button v-hasPermi="['device:terminal:deploy']" icon="Cpu" link type="primary"
|
class-name="small-padding fixed-width"
|
||||||
@click="handleDeploy(scope.row)">配置
|
label="操作"
|
||||||
</el-button>
|
width="200"
|
||||||
<!-- <el-button v-hasPermi="['device:terminal:deploy']" icon="Cpu" link type="primary"-->
|
>
|
||||||
<!-- @click="()=>dialogVisible=true">配置参数-->
|
<template #default="scope">
|
||||||
<!-- </el-button>-->
|
<el-button
|
||||||
<el-button v-hasPermi="['test:detect:remove']" icon="Delete" link type="primary"
|
v-hasPermi="['test:detect:edit']"
|
||||||
@click="handleDelete(scope.row)">删除
|
icon="Edit"
|
||||||
</el-button>
|
link
|
||||||
</template>
|
type="primary"
|
||||||
</el-table-column>
|
@click="handleUpdate(scope.row)"
|
||||||
</el-table>
|
>
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['device:terminal:deploy']"
|
||||||
|
icon="Cpu"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleDeploy(scope.row)"
|
||||||
|
>配置
|
||||||
|
</el-button>
|
||||||
|
<!-- <el-button v-hasPermi="['device:terminal:deploy']" icon="Cpu" link type="primary"-->
|
||||||
|
<!-- @click="()=>dialogVisible=true">配置参数-->
|
||||||
|
<!-- </el-button>-->
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['test:detect:remove']"
|
||||||
|
icon="Delete"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
>删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
v-model:limit="queryParams.pageSize"
|
v-model:limit="queryParams.pageSize"
|
||||||
v-model:page="queryParams.pageNum"
|
v-model:page="queryParams.pageNum"
|
||||||
:total="total"
|
:total="total"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 添加或修改检测项配置对话框 -->
|
<!-- 添加或修改检测项配置对话框 -->
|
||||||
<el-dialog v-model="open" :title="title" append-to-body width="500px">
|
<el-dialog v-model="open" :title="title" append-to-body width="500px">
|
||||||
<el-form ref="detectRef" :model="form" :rules="rules" label-width="100px">
|
<el-form ref="detectRef" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-form-item label="检测项名称" prop="detectName">
|
<el-form-item label="检测项名称" prop="detectName">
|
||||||
<el-input v-model="form.detectName" placeholder="请输入检测项名称"/>
|
<el-input v-model="form.detectName" placeholder="请输入检测项名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="检测项描述" prop="detectDesc">
|
<el-form-item label="检测项描述" prop="detectDesc">
|
||||||
<el-input v-model="form.detectDesc" placeholder="请输入检测项描述"/>
|
<el-input v-model="form.detectDesc" placeholder="请输入检测项描述" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属分组">
|
<el-form-item label="所属分组">
|
||||||
<el-select v-model="form.groupId" placeholder="请选择所属分组">
|
<el-select v-model="form.groupId" placeholder="请选择所属分组">
|
||||||
<el-option v-for="group in groupList" :key="group.value" :label="group.label"
|
<el-option
|
||||||
:value="group.value"></el-option>
|
v-for="group in groupList"
|
||||||
|
:key="group.value"
|
||||||
|
:label="group.label"
|
||||||
|
:value="group.value"
|
||||||
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark"
|
<el-input
|
||||||
:rows="2" placeholder="请输入备注" type="textarea"/>
|
v-model="form.remark"
|
||||||
|
:rows="2"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -177,31 +244,41 @@
|
|||||||
|
|
||||||
<el-dialog v-model="dialogVisible" title="参数配置" width="1080px">
|
<el-dialog v-model="dialogVisible" title="参数配置" width="1080px">
|
||||||
<EditTable></EditTable>
|
<EditTable></EditTable>
|
||||||
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script name="Detect" setup>
|
<script name="Detect" setup>
|
||||||
import {addDetect, delDetect, getDetect, listDetect, updateDetect} from "@/api/test/detect"
|
import {
|
||||||
import TableSearch from "@/components/TableSearch/index.vue"
|
addDetect,
|
||||||
import {listGroup} from "@/api/system/group.js";
|
delDetect,
|
||||||
import {appendParamsToPath} from "@/utils/fn.js";
|
getDetect,
|
||||||
|
listDetect,
|
||||||
|
updateDetect,
|
||||||
|
} from "@/api/test/detect";
|
||||||
|
import TableSearch from "@/components/TableSearch/index.vue";
|
||||||
|
import { listGroup } from "@/api/system/group.js";
|
||||||
|
import { appendParamsToPath } from "@/utils/fn.js";
|
||||||
import TableTags from "@/components/TableTags/index.vue";
|
import TableTags from "@/components/TableTags/index.vue";
|
||||||
import EditTable from "@/components/EditTable/index.vue"
|
import EditTable from "@/components/EditTable/index.vue";
|
||||||
|
|
||||||
const {proxy} = getCurrentInstance()
|
import { useContainerHeight } from "@/hooks/tableHeight";
|
||||||
|
|
||||||
const detectList = ref([])
|
const topContainerRef = ref();
|
||||||
const open = ref(false)
|
const containerHeight = useContainerHeight(topContainerRef);
|
||||||
const dialogVisible = ref(false)
|
|
||||||
const loading = ref(true)
|
const { proxy } = getCurrentInstance();
|
||||||
const showSearch = ref(true)
|
|
||||||
const ids = ref([])
|
const detectList = ref([]);
|
||||||
const single = ref(true)
|
const open = ref(false);
|
||||||
const multiple = ref(true)
|
const dialogVisible = ref(false);
|
||||||
const total = ref(0)
|
const loading = ref(true);
|
||||||
const title = ref("")
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {},
|
form: {},
|
||||||
@ -211,116 +288,116 @@ const data = reactive({
|
|||||||
detectName: null,
|
detectName: null,
|
||||||
detectDesc: null,
|
detectDesc: null,
|
||||||
status: null,
|
status: null,
|
||||||
detectVersion: null
|
detectVersion: null,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
detectName: [
|
detectName: [
|
||||||
{required: true, message: "检测项名称不能为空", trigger: "blur"}
|
{ required: true, message: "检测项名称不能为空", trigger: "blur" },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
const {queryParams, form, rules} = toRefs(data)
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
/** 查询检测项配置列表 */
|
/** 查询检测项配置列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
listDetect(queryParams.value).then(response => {
|
listDetect(queryParams.value).then((response) => {
|
||||||
detectList.value = response.rows
|
detectList.value = response.rows;
|
||||||
total.value = response.total
|
total.value = response.total;
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false
|
open.value = false;
|
||||||
reset()
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {}
|
form.value = {};
|
||||||
proxy.resetForm("detectRef")
|
proxy.resetForm("detectRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1
|
queryParams.value.pageNum = 1;
|
||||||
getList()
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
handleQuery()
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.id)
|
ids.value = selection.map((item) => item.id);
|
||||||
single.value = selection.length != 1
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset()
|
reset();
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "添加检测项配置"
|
title.value = "添加检测项配置";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset()
|
reset();
|
||||||
const _id = row.id || ids.value
|
const _id = row.id || ids.value;
|
||||||
getDetect(_id).then(response => {
|
getDetect(_id).then((response) => {
|
||||||
form.value = response.data
|
form.value = response.data;
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "修改检测项配置"
|
title.value = "修改检测项配置";
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["detectRef"].validate(valid => {
|
proxy.$refs["detectRef"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (form.value.id != null) {
|
if (form.value.id != null) {
|
||||||
updateDetect(form.value).then(response => {
|
updateDetect(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("修改成功")
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
open.value = false
|
open.value = false;
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
addDetect(form.value).then(response => {
|
addDetect(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("新增成功")
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
open.value = false
|
open.value = false;
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const _ids = row.id || ids.value
|
const _ids = row.id || ids.value;
|
||||||
proxy.$modal.confirm('是否确认删除检测项配置编号为"' + _ids + '"的数据项?').then(function () {
|
proxy.$modal
|
||||||
return delDetect(_ids)
|
.confirm('是否确认删除检测项配置编号为"' + _ids + '"的数据项?')
|
||||||
}).then(() => {
|
.then(function () {
|
||||||
getList()
|
return delDetect(_ids);
|
||||||
proxy.$modal.msgSuccess("删除成功")
|
})
|
||||||
}).catch(() => {
|
.then(() => {
|
||||||
})
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 配置按钮操作 */
|
/** 配置按钮操作 */
|
||||||
function handleDeploy(row) {
|
function handleDeploy(row) {
|
||||||
const params = {itemId: row.id, name: row.detectName, state: row.status};
|
const params = { itemId: row.id, name: row.detectName, state: row.status };
|
||||||
const fullPath = appendParamsToPath('/flow', params);
|
const fullPath = appendParamsToPath("/flow", params);
|
||||||
const p = window.open(
|
const p = window.open(fullPath, "_blank");
|
||||||
fullPath,
|
|
||||||
"_blank",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 监听 visibilitychange 事件
|
// 监听 visibilitychange 事件
|
||||||
@ -331,41 +408,38 @@ function handleDeploy(row) {
|
|||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
const isMount = ref(false);
|
||||||
const isMount = ref(false)
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
handleGetSystemGroup()
|
handleGetSystemGroup();
|
||||||
getList()
|
getList();
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
isMount.value = true
|
isMount.value = true;
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
/** 状态开关操作 */
|
/** 状态开关操作 */
|
||||||
function handleChange(row) {
|
function handleChange(row) {
|
||||||
if (isMount.value) {
|
if (isMount.value) {
|
||||||
updateDetect({status: row.status, id: row.id}).then(response => {
|
updateDetect({ status: row.status, id: row.id }).then((response) => {
|
||||||
proxy.$modal.msgSuccess("修改成功")
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const groupList = ref([])
|
const groupList = ref([]);
|
||||||
|
|
||||||
/** 获取系统分组列表(默认传1查询检测项列表) */
|
/** 获取系统分组列表(默认传1查询检测项列表) */
|
||||||
function handleGetSystemGroup(row) {
|
function handleGetSystemGroup(row) {
|
||||||
listGroup({type: 1}).then(response => {
|
listGroup({ type: 1 }).then((response) => {
|
||||||
groupList.value = response.rows?.map((item) => {
|
groupList.value = response.rows?.map((item) => {
|
||||||
return {
|
return {
|
||||||
label: item.groupName,
|
label: item.groupName,
|
||||||
value: item.groupId
|
value: item.groupId,
|
||||||
}
|
};
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,181 +1,216 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<TableSearch
|
<div ref="topContainerRef">
|
||||||
|
<TableSearch
|
||||||
:queryParams="queryParams"
|
:queryParams="queryParams"
|
||||||
:showSearch="showSearch"
|
:showSearch="showSearch"
|
||||||
queryRef="queryRef"
|
queryRef="queryRef"
|
||||||
@refresh="resetQuery"
|
@refresh="resetQuery"
|
||||||
@search="handleQuery"
|
@search="handleQuery"
|
||||||
|
>
|
||||||
>
|
<template #one>
|
||||||
<template #one>
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
<el-form-item label="实例名称" prop="taskName">
|
||||||
<el-form-item label="实例名称" prop="taskName">
|
<el-input
|
||||||
<el-input
|
|
||||||
v-model="queryParams.taskName"
|
v-model="queryParams.taskName"
|
||||||
clearable
|
clearable
|
||||||
placeholder="请输入任务名称"
|
placeholder="请输入任务名称"
|
||||||
style="width:100%"
|
style="width: 100%"
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
<el-form-item label="创建时间" prop="createTime">
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="queryParams.createTime"
|
v-model="queryParams.createTime"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
:disabledDate="(time) => {
|
:disabledDate="
|
||||||
// 设置最大日期为今天
|
(time) => {
|
||||||
return time.getTime() > Date.now();
|
// 设置最大日期为今天
|
||||||
}"
|
return time.getTime() > Date.now();
|
||||||
|
}
|
||||||
|
"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
|
||||||
</TableSearch>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getInstList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
<el-table v-loading="loading" :data="instList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" label="id" prop="id" show-overflow-tooltip/>
|
|
||||||
<el-table-column align="center" label="任务名称" prop="taskName" show-overflow-tooltip/>
|
|
||||||
<el-table-column align="center" label="创建时间" prop="createTime" width="180">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</TableSearch>
|
||||||
<el-table-column align="center" label="备注" prop="remark" show-overflow-tooltip/>
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-table-column align="center" label="实例状态" prop="status" width="180">
|
<right-toolbar
|
||||||
<template #default="scope">
|
v-model:showSearch="showSearch"
|
||||||
<TableTags :options="[
|
@queryTable="getInstList"
|
||||||
{
|
></right-toolbar>
|
||||||
label: '已完成',
|
</el-row>
|
||||||
value:'0',
|
</div>
|
||||||
type:'success'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '执行中',
|
|
||||||
value:'1',
|
|
||||||
type:'warning'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '失败',
|
|
||||||
value: '2',
|
|
||||||
type:'danger'
|
|
||||||
}
|
|
||||||
]" :value="scope.row.status"></TableTags>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="180">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button icon="Notebook" link type="primary"
|
|
||||||
@click="handleOpenLogDialog(scope.row)">日志
|
|
||||||
</el-button>
|
|
||||||
<el-button icon="DataLine" link type="primary"
|
|
||||||
@click="handleOpenDashboard(scope.row)">流程可视化
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
<div :style="containerHeight">
|
||||||
v-show="instTotal>0"
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
height="100%"
|
||||||
|
:data="instList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="id"
|
||||||
|
prop="id"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="任务名称"
|
||||||
|
prop="taskName"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="创建时间"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="备注"
|
||||||
|
prop="remark"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="实例状态"
|
||||||
|
prop="status"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<TableTags
|
||||||
|
:options="[
|
||||||
|
{
|
||||||
|
label: '已完成',
|
||||||
|
value: '0',
|
||||||
|
type: 'success',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '执行中',
|
||||||
|
value: '1',
|
||||||
|
type: 'warning',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '失败',
|
||||||
|
value: '2',
|
||||||
|
type: 'danger',
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
:value="scope.row.status"
|
||||||
|
></TableTags>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
label="操作"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
icon="Notebook"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleOpenLogDialog(scope.row)"
|
||||||
|
>日志
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
icon="DataLine"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleOpenDashboard(scope.row)"
|
||||||
|
>流程可视化
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="instTotal > 0"
|
||||||
v-model:limit="queryParams.pageSize"
|
v-model:limit="queryParams.pageSize"
|
||||||
v-model:page="queryParams.pageNum"
|
v-model:page="queryParams.pageNum"
|
||||||
:total="instTotal"
|
:total="instTotal"
|
||||||
@pagination="getInstList"
|
@pagination="getInstList"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 添加或修改检测项日志对话框 -->
|
<!-- 添加或修改检测项日志对话框 -->
|
||||||
<el-drawer v-model="open" :destroy-on-close="true" :size="580" :title="title" append-to-body modal-class="test-log"
|
<el-drawer
|
||||||
@close="cancel" @open="getLogList">
|
v-model="open"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
:size="580"
|
||||||
|
:title="title"
|
||||||
|
append-to-body
|
||||||
|
modal-class="test-log"
|
||||||
|
@close="cancel"
|
||||||
|
@open="getLogList"
|
||||||
|
>
|
||||||
<el-timeline>
|
<el-timeline>
|
||||||
<el-timeline-item
|
<el-timeline-item
|
||||||
v-for="(item, index) in logList"
|
v-for="(item, index) in logList"
|
||||||
:key="index.id"
|
:key="index.id"
|
||||||
:hollow="true"
|
:hollow="true"
|
||||||
:timestamp="item.createTime"
|
:timestamp="item.createTime"
|
||||||
placement="top"
|
placement="top"
|
||||||
type="primary"
|
type="primary"
|
||||||
>
|
>
|
||||||
<el-descriptions
|
<el-descriptions
|
||||||
:column="1"
|
:column="1"
|
||||||
:title="item.taskName"
|
:title="item.taskName"
|
||||||
border
|
border
|
||||||
direction="vertical"
|
direction="vertical"
|
||||||
>
|
>
|
||||||
<!-- <template #title>-->
|
<el-descriptions-item label="日志等级">{{
|
||||||
<!-- <div class="flex align-center" style="cursor: pointer" @click="handleLogicFlow(item)">-->
|
item.logLevel
|
||||||
<!-- <div>{{ item.taskName }}</div>-->
|
}}</el-descriptions-item>
|
||||||
<!-- <div class="flex align-center" style="margin-left: 10px;">-->
|
<el-descriptions-item label="节点类型">{{
|
||||||
<!-- <el-icon>-->
|
item.nodeType
|
||||||
<!-- <View/>-->
|
}}</el-descriptions-item>
|
||||||
<!-- </el-icon>-->
|
<el-descriptions-item label="消息">{{
|
||||||
<!-- </div>-->
|
item.message
|
||||||
<!-- </div>-->
|
}}</el-descriptions-item>
|
||||||
<!-- </template>-->
|
|
||||||
<el-descriptions-item label="日志等级">{{ item.logLevel }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="节点类型">{{ item.nodeType }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="消息">{{ item.message }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="执行参数">
|
<el-descriptions-item label="执行参数">
|
||||||
<pre>{{ JSON.parse(item.params) }}</pre>
|
<pre>{{ JSON.parse(item.params) }}</pre>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<!-- <el-card>-->
|
|
||||||
<!-- {{ item.message }}-->
|
|
||||||
<!-- </el-card>-->
|
|
||||||
|
|
||||||
</el-timeline-item>
|
</el-timeline-item>
|
||||||
</el-timeline>
|
</el-timeline>
|
||||||
<!-- <el-table style="margin-top: 20px;" v-loading="logLoading" :data="logList" :preserve-expanded-content="true">-->
|
|
||||||
<!-- <el-table-column type="index" width="50" align="center" label="序号"/>-->
|
|
||||||
<!-- <el-table-column show-overflow-tooltip label="任务名称" align="center" prop="taskName"/>-->
|
|
||||||
<!-- <el-table-column show-overflow-tooltip label="检测项名称" align="center" prop="detectName"/>-->
|
|
||||||
<!-- <el-table-column show-overflow-tooltip label="节点类型" align="center" prop="nodeType"/>-->
|
|
||||||
<!-- <el-table-column show-overflow-tooltip label="日志等级" align="center" prop="logLevel">-->
|
|
||||||
<!-- <template #default="scope">-->
|
|
||||||
<!-- <el-tag type="info">{{ scope.row.logLevel }}</el-tag>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
<!-- <el-table-column show-overflow-tooltip label="消息" align="center" prop="message"/>-->
|
|
||||||
<!-- <el-table-column type="expand" width="100" label="执行参数">-->
|
|
||||||
<!-- <template #default="props">-->
|
|
||||||
<!-- <pre>-->
|
|
||||||
<!-- {{ JSON.parse(props.row.params) }}-->
|
|
||||||
<!-- </pre>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">-->
|
|
||||||
<!-- <template #default="scope">-->
|
|
||||||
<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
<!-- </el-table>-->
|
|
||||||
<!-- <div class="flex justify-content-center" style="margin: 20px 0 10px;">-->
|
|
||||||
<!-- <pagination-->
|
|
||||||
<!-- v-show="logTotal>0"-->
|
|
||||||
<!-- :total="logTotal"-->
|
|
||||||
<!-- v-model:page="logQueryParams.pageNum"-->
|
|
||||||
<!-- v-model:limit="logQueryParams.pageSize"-->
|
|
||||||
<!-- @pagination="getLogList"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </div>-->
|
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
<!-- 添加或修改检测项日志对话框 -->
|
<!-- 添加或修改检测项日志对话框 -->
|
||||||
<el-drawer v-model="openDashboard" :destroy-on-close="true" :size="580" :title="currentLog.taskName + '的流程'"
|
<el-drawer
|
||||||
append-to-body
|
v-model="openDashboard"
|
||||||
modal-class="rdashboad-log"
|
:destroy-on-close="true"
|
||||||
@close="cancel">
|
:size="580"
|
||||||
<el-card v-for="item in taskRightList" shadow="hover" style="width: 100%;margin-bottom: 10px;">
|
:title="currentLog.taskName + '的流程'"
|
||||||
<div class="flex align-center" style="cursor: pointer" @click="handleLogicFlow(item)">
|
append-to-body
|
||||||
|
modal-class="rdashboad-log"
|
||||||
|
@close="cancel"
|
||||||
|
>
|
||||||
|
<el-card
|
||||||
|
v-for="item in taskRightList"
|
||||||
|
shadow="hover"
|
||||||
|
style="width: 100%; margin-bottom: 10px"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="flex align-center"
|
||||||
|
style="cursor: pointer"
|
||||||
|
@click="handleLogicFlow(item)"
|
||||||
|
>
|
||||||
<div>{{ item.name }}</div>
|
<div>{{ item.name }}</div>
|
||||||
<div class="flex align-center" style="margin-left: 10px;">
|
<div class="flex align-center" style="margin-left: 10px">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<View/>
|
<View />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -185,29 +220,41 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script name="Log" setup>
|
<script name="Log" setup>
|
||||||
import {addLog, delLog, getInst, getLog, listInst, updateLog} from "@/api/test/log"
|
import {
|
||||||
import TableSearch from "@/components/TableSearch/index.vue"
|
addLog,
|
||||||
import {View} from "@element-plus/icons-vue";
|
delLog,
|
||||||
|
getInst,
|
||||||
|
getLog,
|
||||||
|
listInst,
|
||||||
|
updateLog,
|
||||||
|
} from "@/api/test/log";
|
||||||
|
import TableSearch from "@/components/TableSearch/index.vue";
|
||||||
|
import { View } from "@element-plus/icons-vue";
|
||||||
import TableTags from "@/components/TableTags/index.vue";
|
import TableTags from "@/components/TableTags/index.vue";
|
||||||
import {appendParamsToPath} from "@/utils/fn.js";
|
import { appendParamsToPath } from "@/utils/fn.js";
|
||||||
import {getTaskConfig} from "@/api/test/config.js";
|
import { getTaskConfig } from "@/api/test/config.js";
|
||||||
import { onMounted } from "vue";
|
import { onMounted } from "vue";
|
||||||
|
|
||||||
const {proxy} = getCurrentInstance()
|
import { useContainerHeight } from "@/hooks/tableHeight";
|
||||||
|
|
||||||
const instList = ref([])
|
const topContainerRef = ref();
|
||||||
const logList = ref([])
|
const containerHeight = useContainerHeight(topContainerRef);
|
||||||
const open = ref(false)
|
|
||||||
const openDashboard = ref(false)
|
const { proxy } = getCurrentInstance();
|
||||||
const loading = ref(true)
|
|
||||||
const logLoading = ref(true)
|
const instList = ref([]);
|
||||||
const showSearch = ref(true)
|
const logList = ref([]);
|
||||||
const ids = ref([])
|
const open = ref(false);
|
||||||
const single = ref(true)
|
const openDashboard = ref(false);
|
||||||
const multiple = ref(true)
|
const loading = ref(true);
|
||||||
const instTotal = ref(0)
|
const logLoading = ref(true);
|
||||||
const logTotal = ref(0)
|
const showSearch = ref(true);
|
||||||
const title = ref("")
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const instTotal = ref(0);
|
||||||
|
const logTotal = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {},
|
form: {},
|
||||||
@ -223,27 +270,33 @@ const data = reactive({
|
|||||||
pageSize: 100000,
|
pageSize: 100000,
|
||||||
instId: null,
|
instId: null,
|
||||||
},
|
},
|
||||||
rules: {}
|
rules: {},
|
||||||
})
|
});
|
||||||
|
|
||||||
const {queryParams, form, rules, logQueryParams} = toRefs(data)
|
const { queryParams, form, rules, logQueryParams } = toRefs(data);
|
||||||
const startOn = computed(() => queryParams.value.createTime[0] + " 00:00:00" || undefined)
|
const startOn = computed(
|
||||||
const endOn = computed(() => queryParams.value.createTime[1] + " 23:59:59" || undefined)
|
() => queryParams.value.createTime[0] + " 00:00:00" || undefined
|
||||||
|
);
|
||||||
|
const endOn = computed(
|
||||||
|
() => queryParams.value.createTime[1] + " 23:59:59" || undefined
|
||||||
|
);
|
||||||
|
|
||||||
/** 查询任务实例列表 */
|
/** 查询任务实例列表 */
|
||||||
function getInstList() {
|
function getInstList() {
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
listInst(Object.assign(queryParams.value, {startOn, endOn})).then(response => {
|
listInst(Object.assign(queryParams.value, { startOn, endOn })).then(
|
||||||
instList.value = response.rows
|
(response) => {
|
||||||
instTotal.value = response.total
|
instList.value = response.rows;
|
||||||
loading.value = false
|
instTotal.value = response.total;
|
||||||
})
|
loading.value = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false
|
open.value = false;
|
||||||
reset()
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
@ -252,137 +305,146 @@ function reset() {
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
instId: null,
|
instId: null,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1
|
queryParams.value.pageNum = 1;
|
||||||
getInstList()
|
getInstList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
console.log('11')
|
console.log("11");
|
||||||
proxy.resetForm("queryRef")
|
proxy.resetForm("queryRef");
|
||||||
handleQuery()
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.id)
|
ids.value = selection.map((item) => item.id);
|
||||||
single.value = selection.length != 1
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset()
|
reset();
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "添加检测项日志"
|
title.value = "添加检测项日志";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset()
|
reset();
|
||||||
const _id = row.id || ids.value
|
const _id = row.id || ids.value;
|
||||||
getLog(_id).then(response => {
|
getLog(_id).then((response) => {
|
||||||
form.value = response.data
|
form.value = response.data;
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "修改检测项日志"
|
title.value = "修改检测项日志";
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["logRef"].validate(valid => {
|
proxy.$refs["logRef"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (form.value.id != null) {
|
if (form.value.id != null) {
|
||||||
updateLog(form.value).then(response => {
|
updateLog(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("修改成功")
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
open.value = false
|
open.value = false;
|
||||||
getInstList()
|
getInstList();
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
addLog(form.value).then(response => {
|
addLog(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("新增成功")
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
open.value = false
|
open.value = false;
|
||||||
getInstList()
|
getInstList();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const _ids = row.id || ids.value
|
const _ids = row.id || ids.value;
|
||||||
proxy.$modal.confirm('是否确认删除检测项日志编号为"' + _ids + '"的数据项?').then(function () {
|
proxy.$modal
|
||||||
return delLog(_ids)
|
.confirm('是否确认删除检测项日志编号为"' + _ids + '"的数据项?')
|
||||||
}).then(() => {
|
.then(function () {
|
||||||
getInstList()
|
return delLog(_ids);
|
||||||
proxy.$modal.msgSuccess("删除成功")
|
})
|
||||||
}).catch(() => {
|
.then(() => {
|
||||||
})
|
getInstList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('test/log/export', {
|
proxy.download(
|
||||||
...queryParams.value
|
"test/log/export",
|
||||||
}, `log_${new Date().getTime()}.xlsx`)
|
{
|
||||||
|
...queryParams.value,
|
||||||
|
},
|
||||||
|
`log_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询实例日志列表 */
|
/** 查询实例日志列表 */
|
||||||
function getLogList() {
|
function getLogList() {
|
||||||
logLoading.value = true
|
logLoading.value = true;
|
||||||
getInst(logQueryParams.value).then(response => {
|
getInst(logQueryParams.value).then((response) => {
|
||||||
logList.value = response.rows
|
logList.value = response.rows;
|
||||||
logTotal.value = response.total
|
logTotal.value = response.total;
|
||||||
logLoading.value = false
|
logLoading.value = false;
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleOpenLogDialog(row) {
|
function handleOpenLogDialog(row) {
|
||||||
logQueryParams.value.instId = row.id
|
logQueryParams.value.instId = row.id;
|
||||||
open.value = true
|
open.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentLog = ref({})
|
const currentLog = ref({});
|
||||||
|
|
||||||
const handleLogicFlow = (item) => {
|
const handleLogicFlow = (item) => {
|
||||||
const params = {instId: currentLog.value.id, taskId: currentLog.value.taskId, itemId: item.id, name: item.name, state: '0', isLog: true};
|
const params = {
|
||||||
|
instId: currentLog.value.id,
|
||||||
const fullPath = appendParamsToPath('/flow', params);
|
taskId: currentLog.value.taskId,
|
||||||
const p = window.open(
|
itemId: item.id,
|
||||||
fullPath,
|
name: item.name,
|
||||||
"_blank",
|
state: "0",
|
||||||
);
|
isLog: true,
|
||||||
}
|
};
|
||||||
|
|
||||||
|
const fullPath = appendParamsToPath("/flow", params);
|
||||||
|
const p = window.open(fullPath, "_blank");
|
||||||
|
};
|
||||||
|
|
||||||
const handleOpenDashboard = (row) => {
|
const handleOpenDashboard = (row) => {
|
||||||
openDashboard.value = true
|
openDashboard.value = true;
|
||||||
currentLog.value = row
|
currentLog.value = row;
|
||||||
getRightTaskList(row.taskId)
|
getRightTaskList(row.taskId);
|
||||||
}
|
};
|
||||||
|
|
||||||
const taskRightList = ref([])
|
const taskRightList = ref([]);
|
||||||
//获取右侧编排数据
|
//获取右侧编排数据
|
||||||
const getRightTaskList = (taskId) => {
|
const getRightTaskList = (taskId) => {
|
||||||
getTaskConfig({taskId: taskId}
|
getTaskConfig({ taskId: taskId }).then((response) => {
|
||||||
).then(response => {
|
taskRightList.value =
|
||||||
taskRightList.value = response.rows?.map((item) => {
|
response.rows?.map((item) => {
|
||||||
return {
|
return {
|
||||||
name: item.itemName,
|
name: item.itemName,
|
||||||
id: item.itemId
|
id: item.itemId,
|
||||||
}
|
};
|
||||||
}) || []
|
}) || [];
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getInstList()
|
getInstList();
|
||||||
})
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,133 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
<div ref="topContainerRef">
|
||||||
<el-form-item label="语料名称" prop="corpusName">
|
<el-form
|
||||||
<el-input
|
:model="queryParams"
|
||||||
v-model="queryParams.corpusName"
|
ref="queryRef"
|
||||||
placeholder="请输入语料名称"
|
:inline="true"
|
||||||
clearable
|
v-show="showSearch"
|
||||||
@keyup.enter="handleQuery"
|
label-width="68px"
|
||||||
/>
|
>
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="音色" prop="voiceType">
|
|
||||||
<el-select v-model="queryParams.voiceType" placeholder="请选择音色" clearable style="width: 200px">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in vi_voice_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="语种" prop="dialect">
|
|
||||||
<el-select v-model="queryParams.dialect" placeholder="请选择语种" clearable style="width: 200px">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in vi_dialect_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="预期结果" prop="expectedResult">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.expectedResult"
|
|
||||||
placeholder="请输入预期结果"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="Refresh" @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="Plus"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['vi:corpus:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="Edit"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['vi:corpus:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="Delete"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['vi:corpus:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="Download"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['vi:corpus:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="corpusList" table-layout="auto" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="语料名称" align="center" prop="corpusName" />
|
|
||||||
<el-table-column label="语音文本" align="center" prop="textContent" min-width="200" show-overflow-tooltip />
|
|
||||||
<el-table-column label="语音文件路径" align="center" prop="audioPath" min-width="150" show-overflow-tooltip />
|
|
||||||
<el-table-column label="音色" align="center" prop="voiceType" />
|
|
||||||
<el-table-column label="语种" align="center" prop="dialect" />
|
|
||||||
<el-table-column label="预期结果" align="center" prop="expectedResult" min-width="150" show-overflow-tooltip />
|
|
||||||
<el-table-column label="顺序" align="center" prop="sortOrder" />
|
|
||||||
<el-table-column label="状态" align="center" prop="status" />
|
|
||||||
<el-table-column label="备注" align="center" prop="remark" min-width="150" show-overflow-tooltip />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280" fixed="right">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['vi:corpus:edit']">修改</el-button>
|
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['vi:corpus:remove']">删除</el-button>
|
|
||||||
<el-button link type="primary" icon="Upload" @click="handleUpload(scope.row)" v-hasPermi="['vi:corpus:upload']">上传</el-button>
|
|
||||||
<el-button link type="primary" icon="VideoPlay" @click="handlePlay(scope.row)" v-hasPermi="['vi:corpus:play']">试听</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
v-model:page="queryParams.pageNum"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改语料库对话框 -->
|
|
||||||
<el-dialog :title="title" v-model="open" width="580px" append-to-body>
|
|
||||||
<el-form ref="corpusRef" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="语料名称" prop="corpusName">
|
<el-form-item label="语料名称" prop="corpusName">
|
||||||
<el-input v-model="form.corpusName" placeholder="请输入语料名称" />
|
<el-input
|
||||||
</el-form-item>
|
v-model="queryParams.corpusName"
|
||||||
<el-form-item label="语音文本" prop="textContent">
|
placeholder="请输入语料名称"
|
||||||
<el-input v-model="form.textContent" type="textarea" placeholder="请输入内容" />
|
clearable
|
||||||
</el-form-item>
|
@keyup.enter="handleQuery"
|
||||||
<el-form-item label="文件路径" prop="audioPath">
|
/>
|
||||||
<el-input v-model="form.audioPath" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="音色" prop="voiceType">
|
<el-form-item label="音色" prop="voiceType">
|
||||||
<el-select v-model="form.voiceType" placeholder="请选择音色" clearable style="width: 100%">
|
<el-select
|
||||||
|
v-model="queryParams.voiceType"
|
||||||
|
placeholder="请选择音色"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in vi_voice_type"
|
v-for="dict in vi_voice_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -137,7 +32,12 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="语种" prop="dialect">
|
<el-form-item label="语种" prop="dialect">
|
||||||
<el-select v-model="form.dialect" placeholder="请选择语种" clearable style="width: 100%">
|
<el-select
|
||||||
|
v-model="queryParams.dialect"
|
||||||
|
placeholder="请选择语种"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in vi_dialect_type"
|
v-for="dict in vi_dialect_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -147,10 +47,229 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预期结果" prop="expectedResult">
|
<el-form-item label="预期结果" prop="expectedResult">
|
||||||
<el-input v-model="form.expectedResult" type="textarea" placeholder="请输入预期结果" />
|
<el-input
|
||||||
|
v-model="queryParams.expectedResult"
|
||||||
|
placeholder="请输入预期结果"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @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="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['vi:corpus:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['vi:corpus:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['vi:corpus:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['vi:corpus:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div :style="containerHeight">
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
height="100%"
|
||||||
|
:data="corpusList"
|
||||||
|
table-layout="auto"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="语料名称" align="center" prop="corpusName" />
|
||||||
|
<el-table-column
|
||||||
|
label="语音文本"
|
||||||
|
align="center"
|
||||||
|
prop="textContent"
|
||||||
|
min-width="200"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="语音文件路径"
|
||||||
|
align="center"
|
||||||
|
prop="audioPath"
|
||||||
|
min-width="150"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column label="音色" align="center" prop="voiceType" />
|
||||||
|
<el-table-column label="语种" align="center" prop="dialect" />
|
||||||
|
<el-table-column
|
||||||
|
label="预期结果"
|
||||||
|
align="center"
|
||||||
|
prop="expectedResult"
|
||||||
|
min-width="150"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column label="顺序" align="center" prop="sortOrder" />
|
||||||
|
<el-table-column label="状态" align="center" prop="status" />
|
||||||
|
<el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remark"
|
||||||
|
min-width="150"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
width="280"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['vi:corpus:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['vi:corpus:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Upload"
|
||||||
|
@click="handleUpload(scope.row)"
|
||||||
|
v-hasPermi="['vi:corpus:upload']"
|
||||||
|
>上传</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="VideoPlay"
|
||||||
|
@click="handlePlay(scope.row)"
|
||||||
|
v-hasPermi="['vi:corpus:play']"
|
||||||
|
>试听</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 添加或修改语料库对话框 -->
|
||||||
|
<el-dialog :title="title" v-model="open" width="580px" append-to-body>
|
||||||
|
<el-form ref="corpusRef" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="语料名称" prop="corpusName">
|
||||||
|
<el-input v-model="form.corpusName" placeholder="请输入语料名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语音文本" prop="textContent">
|
||||||
|
<el-input
|
||||||
|
v-model="form.textContent"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="文件路径" prop="audioPath">
|
||||||
|
<el-input
|
||||||
|
v-model="form.audioPath"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="音色" prop="voiceType">
|
||||||
|
<el-select
|
||||||
|
v-model="form.voiceType"
|
||||||
|
placeholder="请选择音色"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in vi_voice_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语种" prop="dialect">
|
||||||
|
<el-select
|
||||||
|
v-model="form.dialect"
|
||||||
|
placeholder="请选择语种"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in vi_dialect_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预期结果" prop="expectedResult">
|
||||||
|
<el-input
|
||||||
|
v-model="form.expectedResult"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入预期结果"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="顺序" prop="sortOrder">
|
<el-form-item label="顺序" prop="sortOrder">
|
||||||
<el-inputNumber v-model="form.sortOrder" placeholder="请输入顺序" style="width: 200px;" />
|
<el-inputNumber
|
||||||
|
v-model="form.sortOrder"
|
||||||
|
placeholder="请输入顺序"
|
||||||
|
style="width: 200px"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||||
@ -167,29 +286,42 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Corpus">
|
<script setup name="Corpus">
|
||||||
import { listCorpus, getCorpus, delCorpus, addCorpus, updateCorpus } from "@/api/vi/corpus"
|
import {
|
||||||
|
listCorpus,
|
||||||
|
getCorpus,
|
||||||
|
delCorpus,
|
||||||
|
addCorpus,
|
||||||
|
updateCorpus,
|
||||||
|
} from "@/api/vi/corpus";
|
||||||
|
import { useContainerHeight } from "@/hooks/tableHeight";
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const topContainerRef = ref();
|
||||||
const { vi_voice_type, vi_dialect_type } = proxy.useDict("vi_voice_type", "vi_dialect_type")
|
const containerHeight = useContainerHeight(topContainerRef);
|
||||||
const corpusList = ref([])
|
|
||||||
const open = ref(false)
|
const { proxy } = getCurrentInstance();
|
||||||
const loading = ref(true)
|
const { vi_voice_type, vi_dialect_type } = proxy.useDict(
|
||||||
const showSearch = ref(true)
|
"vi_voice_type",
|
||||||
const ids = ref([])
|
"vi_dialect_type"
|
||||||
const single = ref(true)
|
);
|
||||||
const multiple = ref(true)
|
const corpusList = ref([]);
|
||||||
const total = ref(0)
|
const open = ref(false);
|
||||||
const title = ref("")
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {
|
form: {
|
||||||
type: 'WAKEUP'
|
type: "WAKEUP",
|
||||||
},
|
},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
corpusName: null,
|
corpusName: null,
|
||||||
type: 'WAKEUP',
|
type: "WAKEUP",
|
||||||
continuous: 1,
|
continuous: 1,
|
||||||
textContent: null,
|
textContent: null,
|
||||||
voiceType: null,
|
voiceType: null,
|
||||||
@ -198,38 +330,36 @@ const data = reactive({
|
|||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
corpusName: [
|
corpusName: [
|
||||||
{ required: true, message: "请输入语料名称", trigger: "change" }
|
{ required: true, message: "请输入语料名称", trigger: "change" },
|
||||||
],
|
],
|
||||||
textContent: [
|
textContent: [
|
||||||
{ required: true, message: "请输入语音文本", trigger: "blur" }
|
{ required: true, message: "请输入语音文本", trigger: "blur" },
|
||||||
],
|
],
|
||||||
voiceType: [
|
voiceType: [{ required: true, message: "请选择音色", trigger: "blur" }],
|
||||||
{ required: true, message: "请选择音色", trigger: "blur" }
|
dialect: [{ required: true, message: "请选择语种", trigger: "blur" }],
|
||||||
],
|
},
|
||||||
dialect: [
|
});
|
||||||
{ required: true, message: "请选择语种", trigger: "blur" }
|
|
||||||
],
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data)
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
/** 查询语料库列表 */
|
/** 查询语料库列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
listCorpus(queryParams.value).then(response => {
|
listCorpus(queryParams.value)
|
||||||
corpusList.value = response.rows
|
.then((response) => {
|
||||||
total.value = response.total
|
corpusList.value = response.rows;
|
||||||
loading.value = false
|
total.value = response.total;
|
||||||
}).catch(err => {
|
loading.value = false;
|
||||||
loading.value = false
|
})
|
||||||
})
|
.catch((err) => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false
|
open.value = false;
|
||||||
reset()
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
@ -237,7 +367,7 @@ function reset() {
|
|||||||
form.value = {
|
form.value = {
|
||||||
corpusId: null,
|
corpusId: null,
|
||||||
corpusName: null,
|
corpusName: null,
|
||||||
type: 'WAKEUP',
|
type: "WAKEUP",
|
||||||
textContent: null,
|
textContent: null,
|
||||||
audioPath: null,
|
audioPath: null,
|
||||||
voiceType: null,
|
voiceType: null,
|
||||||
@ -248,95 +378,103 @@ function reset() {
|
|||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null
|
updateTime: null,
|
||||||
}
|
};
|
||||||
proxy.resetForm("corpusRef")
|
proxy.resetForm("corpusRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1
|
queryParams.value.pageNum = 1;
|
||||||
getList()
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef")
|
proxy.resetForm("queryRef");
|
||||||
handleQuery()
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.corpusId)
|
ids.value = selection.map((item) => item.corpusId);
|
||||||
single.value = selection.length != 1
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset()
|
reset();
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "添加语料库"
|
title.value = "添加语料库";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset()
|
reset();
|
||||||
const _corpusId = row.corpusId || ids.value
|
const _corpusId = row.corpusId || ids.value;
|
||||||
getCorpus(_corpusId).then(response => {
|
getCorpus(_corpusId).then((response) => {
|
||||||
form.value = response.data
|
form.value = response.data;
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "修改语料库"
|
title.value = "修改语料库";
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["corpusRef"].validate(valid => {
|
proxy.$refs["corpusRef"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log('f', form.value)
|
console.log("f", form.value);
|
||||||
if (form.value.corpusId != null) {
|
if (form.value.corpusId != null) {
|
||||||
updateCorpus(form.value).then(response => {
|
updateCorpus(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("修改成功")
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
open.value = false
|
open.value = false;
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
addCorpus(form.value).then(response => {
|
addCorpus(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("新增成功")
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
open.value = false
|
open.value = false;
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const _corpusIds = row.corpusId || ids.value
|
const _corpusIds = row.corpusId || ids.value;
|
||||||
proxy.$modal.confirm('是否确认删除语料库编号为"' + _corpusIds + '"的数据项?').then(function() {
|
proxy.$modal
|
||||||
return delCorpus(_corpusIds)
|
.confirm('是否确认删除语料库编号为"' + _corpusIds + '"的数据项?')
|
||||||
}).then(() => {
|
.then(function () {
|
||||||
getList()
|
return delCorpus(_corpusIds);
|
||||||
proxy.$modal.msgSuccess("删除成功")
|
})
|
||||||
}).catch(() => {})
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleUpload = (row) => {
|
const handleUpload = (row) => {
|
||||||
console.log('上传')
|
console.log("上传");
|
||||||
}
|
};
|
||||||
|
|
||||||
const handlePlay = () => {
|
const handlePlay = () => {
|
||||||
console.log('播放')
|
console.log("播放");
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('vi/corpus/export', {
|
proxy.download(
|
||||||
...queryParams.value
|
"vi/corpus/export",
|
||||||
}, `corpus_${new Date().getTime()}.xlsx`)
|
{
|
||||||
|
...queryParams.value,
|
||||||
|
},
|
||||||
|
`corpus_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getList()
|
getList();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,168 +1,173 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form
|
<div ref="topContainerRef">
|
||||||
:model="queryParams"
|
<el-form
|
||||||
ref="queryRef"
|
:model="queryParams"
|
||||||
:inline="true"
|
ref="queryRef"
|
||||||
v-show="showSearch"
|
:inline="true"
|
||||||
label-width="68px"
|
v-show="showSearch"
|
||||||
>
|
label-width="68px"
|
||||||
<el-form-item label="语料名称" prop="corpusName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.corpusName"
|
|
||||||
placeholder="请输入语料名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="音色" prop="voiceType">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.voiceType"
|
|
||||||
placeholder="请选择音色"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in vi_voice_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="语种" prop="dialect">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.dialect"
|
|
||||||
placeholder="请选择语种"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in vi_dialect_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="预期结果" prop="expectedResult">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.expectedResult"
|
|
||||||
placeholder="请输入预期结果"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
|
||||||
>搜索</el-button
|
|
||||||
>
|
|
||||||
<el-button icon="Refresh" @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="Plus"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['vi:corpus:add']"
|
|
||||||
>新增</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="Edit"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['vi:corpus:edit']"
|
|
||||||
>修改</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="Delete"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['vi:corpus:remove']"
|
|
||||||
>删除</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="Download"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['vi:corpus:export']"
|
|
||||||
>导出</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar
|
|
||||||
v-model:showSearch="showSearch"
|
|
||||||
@queryTable="getList"
|
|
||||||
></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table
|
|
||||||
v-loading="loading"
|
|
||||||
:data="corpusList"
|
|
||||||
table-layout="auto"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="语料名称" align="center" prop="corpusName" />
|
|
||||||
<el-table-column label="音色" align="center" prop="voiceType" />
|
|
||||||
<el-table-column label="语种" align="center" prop="dialect" />
|
|
||||||
<el-table-column
|
|
||||||
label="操作"
|
|
||||||
align="center"
|
|
||||||
class-name="small-padding fixed-width"
|
|
||||||
width="280"
|
|
||||||
fixed="right"
|
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<el-form-item label="语料名称" prop="corpusName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.corpusName"
|
||||||
|
placeholder="请输入语料名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="音色" prop="voiceType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.voiceType"
|
||||||
|
placeholder="请选择音色"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in vi_voice_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语种" prop="dialect">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.dialect"
|
||||||
|
placeholder="请选择语种"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in vi_dialect_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预期结果" prop="expectedResult">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.expectedResult"
|
||||||
|
placeholder="请输入预期结果"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
link
|
|
||||||
type="primary"
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['vi:corpus:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
icon="Edit"
|
icon="Edit"
|
||||||
@click="handleUpdate(row)"
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
v-hasPermi="['vi:corpus:edit']"
|
v-hasPermi="['vi:corpus:edit']"
|
||||||
>修改</el-button
|
>修改</el-button
|
||||||
>
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
link
|
type="danger"
|
||||||
type="primary"
|
plain
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
@click="handleDelete(row)"
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
v-hasPermi="['vi:corpus:remove']"
|
v-hasPermi="['vi:corpus:remove']"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
link
|
type="warning"
|
||||||
type="primary"
|
plain
|
||||||
icon="VideoPlay"
|
icon="Download"
|
||||||
@click="handlePlay(row)"
|
@click="handleExport"
|
||||||
v-hasPermi="['vi:corpus:play']"
|
v-hasPermi="['vi:corpus:export']"
|
||||||
>试听</el-button
|
>导出</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</el-col>
|
||||||
</el-table-column>
|
<right-toolbar
|
||||||
</el-table>
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
<pagination
|
<div :style="containerHeight">
|
||||||
v-show="total > 0"
|
<el-table
|
||||||
:total="total"
|
v-loading="loading"
|
||||||
v-model:page="queryParams.pageNum"
|
:data="corpusList"
|
||||||
v-model:limit="queryParams.pageSize"
|
table-layout="auto"
|
||||||
@pagination="getList"
|
height="100%"
|
||||||
/>
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="语料名称" align="center" prop="corpusName" />
|
||||||
|
<el-table-column label="音色" align="center" prop="voiceType" />
|
||||||
|
<el-table-column label="语种" align="center" prop="dialect" />
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
width="280"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(row)"
|
||||||
|
v-hasPermi="['vi:corpus:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(row)"
|
||||||
|
v-hasPermi="['vi:corpus:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="VideoPlay"
|
||||||
|
@click="handlePlay(row)"
|
||||||
|
v-hasPermi="['vi:corpus:play']"
|
||||||
|
>试听</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 添加或修改语料库对话框 -->
|
<!-- 添加或修改语料库对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="740px" append-to-body>
|
<el-dialog :title="title" v-model="open" width="740px" append-to-body>
|
||||||
@ -279,6 +284,10 @@ import {
|
|||||||
batchAddCorpus,
|
batchAddCorpus,
|
||||||
batchUpdateCorpus,
|
batchUpdateCorpus,
|
||||||
} from "@/api/vi/corpus";
|
} from "@/api/vi/corpus";
|
||||||
|
import { useContainerHeight } from "@/hooks/tableHeight";
|
||||||
|
|
||||||
|
const topContainerRef = ref();
|
||||||
|
const containerHeight = useContainerHeight(topContainerRef);
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const { vi_voice_type, vi_dialect_type } = proxy.useDict(
|
const { vi_voice_type, vi_dialect_type } = proxy.useDict(
|
||||||
|
|||||||
@ -1,131 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
<div ref="topContainerRef">
|
||||||
<el-form-item label="语料名称" prop="corpusName">
|
<el-form
|
||||||
<el-input
|
:model="queryParams"
|
||||||
v-model="queryParams.corpusName"
|
ref="queryRef"
|
||||||
placeholder="请输入语料名称"
|
:inline="true"
|
||||||
clearable
|
v-show="showSearch"
|
||||||
@keyup.enter="handleQuery"
|
label-width="68px"
|
||||||
/>
|
>
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="音色" prop="voiceType">
|
|
||||||
<el-select v-model="queryParams.voiceType" placeholder="请选择音色" clearable style="width: 200px">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in vi_voice_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="语种" prop="dialect">
|
|
||||||
<el-select v-model="queryParams.dialect" placeholder="请选择语种" clearable style="width: 200px">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in vi_dialect_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="预期结果" prop="expectedResult">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.expectedResult"
|
|
||||||
placeholder="请输入预期结果"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="Refresh" @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="Plus"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['vi:corpus:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="Edit"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['vi:corpus:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="Delete"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['vi:corpus:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="Download"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['vi:corpus:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="corpusList" table-layout="auto" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="语料名称" align="center" prop="corpusName" />
|
|
||||||
<el-table-column label="语音文本" align="center" prop="textContent" min-width="200" show-overflow-tooltip />
|
|
||||||
<el-table-column label="语音文件路径" align="center" prop="audioPath" min-width="150" show-overflow-tooltip />
|
|
||||||
<el-table-column label="音色" align="center" prop="voiceType" />
|
|
||||||
<el-table-column label="语种" align="center" prop="dialect" />
|
|
||||||
<el-table-column label="预期结果" align="center" prop="expectedResult" min-width="150" show-overflow-tooltip />
|
|
||||||
<el-table-column label="状态" align="center" prop="status" />
|
|
||||||
<el-table-column label="备注" align="center" prop="remark" min-width="150" show-overflow-tooltip />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280" fixed="right">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['vi:corpus:edit']">修改</el-button>
|
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['vi:corpus:remove']">删除</el-button>
|
|
||||||
<el-button link type="primary" icon="VideoPlay" @click="handlePlay(scope.row)" v-hasPermi="['vi:corpus:play']">试听</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
v-model:page="queryParams.pageNum"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改语料库对话框 -->
|
|
||||||
<el-dialog :title="title" v-model="open" width="580px" append-to-body>
|
|
||||||
<el-form ref="corpusRef" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="语料名称" prop="corpusName">
|
<el-form-item label="语料名称" prop="corpusName">
|
||||||
<el-input v-model="form.corpusName" placeholder="请输入语料名称" />
|
<el-input
|
||||||
</el-form-item>
|
v-model="queryParams.corpusName"
|
||||||
<el-form-item label="语音文本" prop="textContent">
|
placeholder="请输入语料名称"
|
||||||
<el-input v-model="form.textContent" type="textarea" placeholder="请输入内容" />
|
clearable
|
||||||
</el-form-item>
|
@keyup.enter="handleQuery"
|
||||||
<el-form-item label="文件路径" prop="audioPath">
|
/>
|
||||||
<el-input v-model="form.audioPath" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="音色" prop="voiceType">
|
<el-form-item label="音色" prop="voiceType">
|
||||||
<el-select v-model="form.voiceType" placeholder="请选择音色" clearable style="width: 100%">
|
<el-select
|
||||||
|
v-model="queryParams.voiceType"
|
||||||
|
placeholder="请选择音色"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in vi_voice_type"
|
v-for="dict in vi_voice_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -135,7 +32,12 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="语种" prop="dialect">
|
<el-form-item label="语种" prop="dialect">
|
||||||
<el-select v-model="form.dialect" placeholder="请选择语种" clearable style="width: 100%">
|
<el-select
|
||||||
|
v-model="queryParams.dialect"
|
||||||
|
placeholder="请选择语种"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in vi_dialect_type"
|
v-for="dict in vi_dialect_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@ -145,10 +47,220 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="预期结果" prop="expectedResult">
|
<el-form-item label="预期结果" prop="expectedResult">
|
||||||
<el-input v-model="form.expectedResult" type="textarea" placeholder="请输入预期结果" />
|
<el-input
|
||||||
|
v-model="queryParams.expectedResult"
|
||||||
|
placeholder="请输入预期结果"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @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="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['vi:corpus:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['vi:corpus:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['vi:corpus:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['vi:corpus:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div :style="containerHeight">
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
height="100%"
|
||||||
|
:data="corpusList"
|
||||||
|
table-layout="auto"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="语料名称" align="center" prop="corpusName" />
|
||||||
|
<el-table-column
|
||||||
|
label="语音文本"
|
||||||
|
align="center"
|
||||||
|
prop="textContent"
|
||||||
|
min-width="200"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="语音文件路径"
|
||||||
|
align="center"
|
||||||
|
prop="audioPath"
|
||||||
|
min-width="150"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column label="音色" align="center" prop="voiceType" />
|
||||||
|
<el-table-column label="语种" align="center" prop="dialect" />
|
||||||
|
<el-table-column
|
||||||
|
label="预期结果"
|
||||||
|
align="center"
|
||||||
|
prop="expectedResult"
|
||||||
|
min-width="150"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column label="状态" align="center" prop="status" />
|
||||||
|
<el-table-column
|
||||||
|
label="备注"
|
||||||
|
align="center"
|
||||||
|
prop="remark"
|
||||||
|
min-width="150"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
width="280"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['vi:corpus:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['vi:corpus:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="VideoPlay"
|
||||||
|
@click="handlePlay(scope.row)"
|
||||||
|
v-hasPermi="['vi:corpus:play']"
|
||||||
|
>试听</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 添加或修改语料库对话框 -->
|
||||||
|
<el-dialog :title="title" v-model="open" width="580px" append-to-body>
|
||||||
|
<el-form ref="corpusRef" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="语料名称" prop="corpusName">
|
||||||
|
<el-input v-model="form.corpusName" placeholder="请输入语料名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语音文本" prop="textContent">
|
||||||
|
<el-input
|
||||||
|
v-model="form.textContent"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="文件路径" prop="audioPath">
|
||||||
|
<el-input
|
||||||
|
v-model="form.audioPath"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="音色" prop="voiceType">
|
||||||
|
<el-select
|
||||||
|
v-model="form.voiceType"
|
||||||
|
placeholder="请选择音色"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in vi_voice_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语种" prop="dialect">
|
||||||
|
<el-select
|
||||||
|
v-model="form.dialect"
|
||||||
|
placeholder="请选择语种"
|
||||||
|
clearable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in vi_dialect_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预期结果" prop="expectedResult">
|
||||||
|
<el-input
|
||||||
|
v-model="form.expectedResult"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入预期结果"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="顺序" prop="sortOrder">
|
<el-form-item label="顺序" prop="sortOrder">
|
||||||
<el-inputNumber v-model="form.sortOrder" placeholder="请输入顺序" style="width: 200px;" />
|
<el-inputNumber
|
||||||
|
v-model="form.sortOrder"
|
||||||
|
placeholder="请输入顺序"
|
||||||
|
style="width: 200px"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||||
@ -165,29 +277,42 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Corpus">
|
<script setup name="Corpus">
|
||||||
import { listCorpus, getCorpus, delCorpus, addCorpus, updateCorpus } from "@/api/vi/corpus"
|
import {
|
||||||
|
listCorpus,
|
||||||
|
getCorpus,
|
||||||
|
delCorpus,
|
||||||
|
addCorpus,
|
||||||
|
updateCorpus,
|
||||||
|
} from "@/api/vi/corpus";
|
||||||
|
import { useContainerHeight } from "@/hooks/tableHeight";
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const topContainerRef = ref();
|
||||||
const { vi_voice_type, vi_dialect_type } = proxy.useDict("vi_voice_type", "vi_dialect_type")
|
const containerHeight = useContainerHeight(topContainerRef);
|
||||||
const corpusList = ref([])
|
|
||||||
const open = ref(false)
|
const { proxy } = getCurrentInstance();
|
||||||
const loading = ref(true)
|
const { vi_voice_type, vi_dialect_type } = proxy.useDict(
|
||||||
const showSearch = ref(true)
|
"vi_voice_type",
|
||||||
const ids = ref([])
|
"vi_dialect_type"
|
||||||
const single = ref(true)
|
);
|
||||||
const multiple = ref(true)
|
const corpusList = ref([]);
|
||||||
const total = ref(0)
|
const open = ref(false);
|
||||||
const title = ref("")
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {
|
form: {
|
||||||
type: 'TEST'
|
type: "TEST",
|
||||||
},
|
},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
corpusName: null,
|
corpusName: null,
|
||||||
type: 'TEST',
|
type: "TEST",
|
||||||
continuous: 1,
|
continuous: 1,
|
||||||
textContent: null,
|
textContent: null,
|
||||||
audioPath: null,
|
audioPath: null,
|
||||||
@ -199,38 +324,36 @@ const data = reactive({
|
|||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
corpusName: [
|
corpusName: [
|
||||||
{ required: true, message: "请输入语料名称", trigger: "change" }
|
{ required: true, message: "请输入语料名称", trigger: "change" },
|
||||||
],
|
],
|
||||||
textContent: [
|
textContent: [
|
||||||
{ required: true, message: "请输入语音文本", trigger: "blur" }
|
{ required: true, message: "请输入语音文本", trigger: "blur" },
|
||||||
],
|
],
|
||||||
voiceType: [
|
voiceType: [{ required: true, message: "请选择音色", trigger: "blur" }],
|
||||||
{ required: true, message: "请选择音色", trigger: "blur" }
|
dialect: [{ required: true, message: "请选择语种", trigger: "blur" }],
|
||||||
],
|
},
|
||||||
dialect: [
|
});
|
||||||
{ required: true, message: "请选择语种", trigger: "blur" }
|
|
||||||
],
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data)
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
/** 查询语料库列表 */
|
/** 查询语料库列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
listCorpus(queryParams.value).then(response => {
|
listCorpus(queryParams.value)
|
||||||
corpusList.value = response.rows
|
.then((response) => {
|
||||||
total.value = response.total
|
corpusList.value = response.rows;
|
||||||
loading.value = false
|
total.value = response.total;
|
||||||
}).catch(err => {
|
loading.value = false;
|
||||||
loading.value = false
|
})
|
||||||
})
|
.catch((err) => {
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false
|
open.value = false;
|
||||||
reset()
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
@ -238,7 +361,7 @@ function reset() {
|
|||||||
form.value = {
|
form.value = {
|
||||||
corpusId: null,
|
corpusId: null,
|
||||||
corpusName: null,
|
corpusName: null,
|
||||||
type: 'TEST',
|
type: "TEST",
|
||||||
textContent: null,
|
textContent: null,
|
||||||
audioPath: null,
|
audioPath: null,
|
||||||
voiceType: null,
|
voiceType: null,
|
||||||
@ -249,97 +372,105 @@ function reset() {
|
|||||||
createBy: null,
|
createBy: null,
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null
|
updateTime: null,
|
||||||
}
|
};
|
||||||
proxy.resetForm("corpusRef")
|
proxy.resetForm("corpusRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1
|
queryParams.value.pageNum = 1;
|
||||||
getList()
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef")
|
proxy.resetForm("queryRef");
|
||||||
handleQuery()
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.corpusId)
|
ids.value = selection.map((item) => item.corpusId);
|
||||||
single.value = selection.length != 1
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset()
|
reset();
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "添加语料库"
|
title.value = "添加语料库";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset()
|
reset();
|
||||||
const _corpusId = row.corpusId || ids.value
|
const _corpusId = row.corpusId || ids.value;
|
||||||
getCorpus(_corpusId).then(response => {
|
getCorpus(_corpusId).then((response) => {
|
||||||
form.value = response.data
|
form.value = response.data;
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "修改语料库"
|
title.value = "修改语料库";
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["corpusRef"].validate(valid => {
|
proxy.$refs["corpusRef"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log('f', form.value)
|
console.log("f", form.value);
|
||||||
if (form.value.corpusId != null) {
|
if (form.value.corpusId != null) {
|
||||||
updateCorpus(form.value).then(response => {
|
updateCorpus(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("修改成功")
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
open.value = false
|
open.value = false;
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
addCorpus(form.value).then(response => {
|
addCorpus(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("新增成功")
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
open.value = false
|
open.value = false;
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const _corpusIds = row.corpusId || ids.value
|
const _corpusIds = row.corpusId || ids.value;
|
||||||
proxy.$modal.confirm('是否确认删除语料库编号为"' + _corpusIds + '"的数据项?').then(function() {
|
proxy.$modal
|
||||||
return delCorpus(_corpusIds)
|
.confirm('是否确认删除语料库编号为"' + _corpusIds + '"的数据项?')
|
||||||
}).then(() => {
|
.then(function () {
|
||||||
getList()
|
return delCorpus(_corpusIds);
|
||||||
proxy.$modal.msgSuccess("删除成功")
|
})
|
||||||
}).catch(() => {})
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlePlay = () => {
|
const handlePlay = () => {
|
||||||
console.log('播放')
|
console.log("播放");
|
||||||
}
|
};
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('vi/corpus/export', {
|
proxy.download(
|
||||||
...queryParams.value
|
"vi/corpus/export",
|
||||||
}, `corpus_${new Date().getTime()}.xlsx`)
|
{
|
||||||
|
...queryParams.value,
|
||||||
|
},
|
||||||
|
`corpus_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
getList
|
getList,
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,19 +1,93 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
<div ref="topContainerRef">
|
||||||
<el-form-item label="项目名称" prop="corpusName">
|
<TableSearch
|
||||||
<el-input
|
:queryParams="queryParams"
|
||||||
v-model="queryParams.corpusName"
|
:showSearch="showSearch"
|
||||||
placeholder="请输入项目名称"
|
label-width="100px"
|
||||||
clearable
|
queryRef="queryRef"
|
||||||
@keyup.enter="handleQuery"
|
@refresh="resetQuery"
|
||||||
/>
|
@search="handleQuery"
|
||||||
</el-form-item>
|
>
|
||||||
<el-form-item>
|
<template #one>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-form-item label="项目名称" prop="projectName">
|
||||||
</el-form-item>
|
<el-input
|
||||||
</el-form>
|
v-model="queryParams.projectName"
|
||||||
|
placeholder="请输入项目名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
|
<el-form-item label="测试人员" prop="tester">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.tester"
|
||||||
|
placeholder="请输入测试人员"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
|
<el-form-item label="样品名称" prop="sampleName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.sampleName"
|
||||||
|
placeholder="请输入样品名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<template #other>
|
||||||
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
|
<el-form-item label="计划开始时间" prop="planStart">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
v-model="queryParams.planStart"
|
||||||
|
type="date"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="请选择计划开始时间"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
|
<el-form-item label="计划结束时间" prop="planEnd">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
v-model="queryParams.planEnd"
|
||||||
|
type="date"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
placeholder="请选择计划结束时间"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
|
<el-form-item label="商标" prop="trademark">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.trademark"
|
||||||
|
placeholder="请输入商标"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="6" :md="12" :sm="24" :xl="6" :xs="24" :xxl="6">
|
||||||
|
<el-form-item label="型号规格" prop="modelSpec">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.modelSpec"
|
||||||
|
placeholder="请输入型号规格"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
</TableSearch>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@ -21,108 +95,233 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['vi:corpus:add']"
|
v-hasPermi="['system:project:add']"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
plain
|
plain
|
||||||
icon="Edit"
|
icon="Edit"
|
||||||
|
size="mini"
|
||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['vi:corpus:edit']"
|
v-hasPermi="['system:project:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
plain
|
plain
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
|
size="mini"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['vi:corpus:remove']"
|
v-hasPermi="['system:project:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['system:project:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="corpusList" table-layout="auto" @selection-change="handleSelectionChange">
|
<div :style="containerHeight">
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
height="100%"
|
||||||
|
:data="projectList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="项目名称" align="center" prop="corpusName" />
|
<el-table-column label="项目ID" align="center" prop="projectId" />
|
||||||
<el-table-column label="项目编号" align="center" prop="textContent" min-width="200" show-overflow-tooltip />
|
<el-table-column label="项目名称" align="center" prop="projectName" width="150" show-overflow-tooltip />
|
||||||
<el-table-column label="测试人员" align="center" prop="audioPath" min-width="150" show-overflow-tooltip />
|
<el-table-column label="测试人员" align="center" prop="tester" />
|
||||||
<el-table-column label="计划测试时间" align="center" prop="voiceType" />
|
<el-table-column
|
||||||
<el-table-column label="项目描述" align="center" prop="dialect" show-overflow-tooltip />
|
label="计划测试开始时间"
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280">
|
align="center"
|
||||||
<template #default="scope">
|
prop="planStart"
|
||||||
<el-button link type="primary" icon="Upload" @click="handleUpload(scope.row)">详情</el-button>
|
width="180"
|
||||||
<el-button link type="primary" icon="Upload" @click="handleUpload(scope.row)">下载</el-button>
|
>
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>
|
<template #default="{ row }">
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>
|
<span>{{ parseTime(row.planStart) }}</span>
|
||||||
<el-button link type="primary" icon="VideoPlay" @click="handlePlay(scope.row)">执行</el-button>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="计划测试结束时间" align="center" prop="planEnd" width="180">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span>{{ parseTime(row.planEnd) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="项目描述" width="200" show-overflow-tooltip align="center" prop="description" />
|
||||||
|
<el-table-column label="样品名称" align="center" prop="sampleName" width="150" show-overflow-tooltip />
|
||||||
|
<el-table-column label="商标" align="center" prop="trademark" width="150" show-overflow-tooltip />
|
||||||
|
<el-table-column label="型号规格" align="center" prop="modelSpec" width="150" show-overflow-tooltip />
|
||||||
|
<el-table-column label="数量" align="center" prop="quantity" />
|
||||||
|
<el-table-column label="操作" align="center" width="220px" class-name="small-padding fixed-width" fixed="right">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleSetting(row)"
|
||||||
|
>配置
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleUpdate(row)"
|
||||||
|
v-hasPermi="['system:project:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleDelete(row)"
|
||||||
|
v-hasPermi="['system:project:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
v-model:page="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
v-model:limit="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 添加或修改语料库对话框 -->
|
<!-- 添加或修改语料库对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="740px" append-to-body>
|
<el-dialog
|
||||||
<el-form ref="corpusRef" :inline="true" :model="form" :rules="rules" label-width="100px">
|
:title="title"
|
||||||
|
v-model="open"
|
||||||
|
width="740px"
|
||||||
|
:append-to-body="false"
|
||||||
|
body-class="testProject_dialog"
|
||||||
|
>
|
||||||
|
<el-form ref="projectRef" :model="form" :rules="rules" label-width="120px">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="form-title">项目信息</div>
|
<div class="form-title">项目信息</div>
|
||||||
<el-form-item label="项目名称" prop="corpusName">
|
<el-row :gutter="20">
|
||||||
<el-input v-model="form.corpusName" placeholder="请输入语料名称" />
|
<el-col :span="12">
|
||||||
</el-form-item>
|
<el-form-item label="项目名称" prop="projectName">
|
||||||
<el-form-item label="项目编号" prop="textContent">
|
<el-input v-model="form.projectName" placeholder="请输入语料名称" />
|
||||||
<el-input v-model="form.textContent" placeholder="请输入内容" />
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
<el-form-item label="测试人员" prop="audioPath">
|
<el-col :span="12">
|
||||||
<el-input v-model="form.audioPath" placeholder="请输入内容" />
|
<el-form-item label="测试人员" prop="tester">
|
||||||
</el-form-item>
|
<el-input v-model="form.tester" placeholder="请输入测试人员" />
|
||||||
<el-form-item label="计划测试时间" prop="voiceType">
|
</el-form-item>
|
||||||
<el-date-picker
|
</el-col>
|
||||||
v-model="form.voiceType"
|
<el-col :span="12">
|
||||||
type="date"
|
<el-form-item label="计划开始时间" prop="planStart">
|
||||||
placeholder="Pick a date"
|
<el-date-picker
|
||||||
/>
|
clearable
|
||||||
</el-form-item>
|
v-model="form.planStart"
|
||||||
<el-form-item label="项目描述" prop="dialect">
|
type="datetime"
|
||||||
<el-input v-model="form.expectedResult" type="textarea" placeholder="请输入项目描述" />
|
placeholder="请选择计划测试开始时间"
|
||||||
</el-form-item>
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="计划结束时间" prop="planEnd">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
v-model="form.planEnd"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="请选择计划测试结束时间"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="项目描述" prop="description">
|
||||||
|
<el-input
|
||||||
|
v-model="form.description"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入项目描述"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="form-title">样品信息</div>
|
<div class="form-title">样品信息</div>
|
||||||
<el-form-item label="样品名称" prop="corpusName">
|
<el-row :gutter="20">
|
||||||
<el-input v-model="form.corpusName" placeholder="请输入语料名称" />
|
<el-col :span="12">
|
||||||
</el-form-item>
|
<el-form-item label="样品名称" prop="sampleName">
|
||||||
<el-form-item label="商标" prop="textContent">
|
<el-input v-model="form.sampleName" placeholder="请输入语料名称" />
|
||||||
<el-input v-model="form.textContent" placeholder="请输入内容" />
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
<el-form-item label="型号规格" prop="audioPath">
|
<el-col :span="12">
|
||||||
<el-input v-model="form.audioPath" placeholder="请输入内容" />
|
<el-form-item label="商标" prop="trademark">
|
||||||
</el-form-item>
|
<el-input v-model="form.trademark" placeholder="请输入内容" />
|
||||||
<el-form-item label="样品数量" prop="voiceType">
|
</el-form-item>
|
||||||
<el-date-picker
|
</el-col>
|
||||||
v-model="form.voiceType"
|
<el-col :span="12">
|
||||||
type="date"
|
<el-form-item label="型号规格" prop="modelSpec">
|
||||||
placeholder="Pick a date"
|
<el-input v-model="form.modelSpec" placeholder="请输入内容" />
|
||||||
/>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
<el-form-item label="生产单位" prop="dialect">
|
<el-col :span="12">
|
||||||
<el-input v-model="form.expectedResult" placeholder="请输入项目描述" />
|
<el-form-item label="样品数量" prop="quantity">
|
||||||
</el-form-item>
|
<el-input-number
|
||||||
<el-form-item label="委托单位" prop="dialect">
|
v-model="form.quantity"
|
||||||
<el-input v-model="form.expectedResult" placeholder="请输入项目描述" />
|
:min="1"
|
||||||
</el-form-item>
|
:step="1"
|
||||||
|
:step-strictly="true"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="委托单位" prop="entrustUnit">
|
||||||
|
<el-input v-model="form.entrustUnit" placeholder="请输入项目描述" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="生产单位" prop="productionUnit">
|
||||||
|
<el-input v-model="form.productionUnit" placeholder="请输入项目描述" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="送样日期" prop="sampleDate">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
v-model="form.sampleDate"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="请选择送样日期"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="生产日期" prop="productionDate">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
v-model="form.productionDate"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="请选择生产日期"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -135,175 +334,236 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Corpus">
|
<script setup>
|
||||||
import { listCorpus, getCorpus, delCorpus, addCorpus, updateCorpus } from "@/api/vi/corpus"
|
import {
|
||||||
|
listProject,
|
||||||
|
getProject,
|
||||||
|
delProject,
|
||||||
|
addProject,
|
||||||
|
updateProject,
|
||||||
|
} from "@/api/vi/project";
|
||||||
|
import TableSearch from "@/components/TableSearch/index.vue";
|
||||||
|
import { useContainerHeight } from "@/hooks/tableHeight";
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const topContainerRef = ref();
|
||||||
const { vi_voice_type, vi_dialect_type } = proxy.useDict("vi_voice_type", "vi_dialect_type")
|
const containerHeight = useContainerHeight(topContainerRef);
|
||||||
const corpusList = ref([])
|
|
||||||
const open = ref(false)
|
const { proxy } = getCurrentInstance();
|
||||||
const loading = ref(true)
|
|
||||||
const showSearch = ref(true)
|
const projectList = ref([]);
|
||||||
const ids = ref([])
|
const open = ref(false);
|
||||||
const single = ref(true)
|
const loading = ref(false);
|
||||||
const multiple = ref(true)
|
const showSearch = ref(true);
|
||||||
const total = ref(0)
|
const ids = ref([]);
|
||||||
const title = ref("")
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {
|
form: {},
|
||||||
},
|
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
corpusName: null
|
projectName: null,
|
||||||
|
tester: null,
|
||||||
|
planStart: null,
|
||||||
|
planEnd: null,
|
||||||
|
description: null,
|
||||||
|
sampleName: null,
|
||||||
|
trademark: null,
|
||||||
|
modelSpec: null,
|
||||||
|
quantity: null,
|
||||||
|
status: null,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
projectName: [{ required: true, message: "项目名称不能为空", trigger: "blur" }],
|
||||||
|
tester: [{ required: true, message: "请输入测试人员", trigger: "blur" }],
|
||||||
|
planStart: [{ required: true, message: "请输入计划测试开始时间", trigger: "blur" }],
|
||||||
|
planEnd: [{ required: true, message: "请输入计划测试结束时间", trigger: "blur" }],
|
||||||
|
sampleName: [{ required: true, message: "请输入样品名称", trigger: "blur" }],
|
||||||
|
trademark: [{ required: true, message: "请输入样品商标", trigger: "blur" }],
|
||||||
|
modelSpec: [{ required: true, message: "请输入样品型号规格", trigger: "blur" }],
|
||||||
|
entrustUnit: [{ required: true, message: "请输入样品委托单位", trigger: "blur" }],
|
||||||
|
productionUnit: [{ required: true, message: "请输入样品生产单位", trigger: "blur" }],
|
||||||
|
quantity: [
|
||||||
|
{ required: true, message: "请输入样品数量" },
|
||||||
|
{ type: 'number', message: '请输入样品数量' },],
|
||||||
|
sampleDate: [{ required: true, message: "请输入样品送达日期", trigger: "blur" }],
|
||||||
|
productionDate: [{ required: true, message: "请输入样品生产日期", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
}
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
})
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data)
|
/** 查询语音交互-项目列表 */
|
||||||
|
|
||||||
/** 查询语料库列表 */
|
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
listCorpus(queryParams.value).then(response => {
|
listProject(queryParams.value).then((response) => {
|
||||||
corpusList.value = response.rows
|
projectList.value = response.rows;
|
||||||
total.value = response.total
|
total.value = response.total;
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
}).catch(err => {
|
});
|
||||||
loading.value = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false
|
open.value = false;
|
||||||
reset()
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单重置
|
// 表单重置
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
corpusName: null,
|
projectId: null,
|
||||||
}
|
projectName: null,
|
||||||
proxy.resetForm("corpusRef")
|
tester: null,
|
||||||
|
planStart: null,
|
||||||
|
planEnd: null,
|
||||||
|
description: null,
|
||||||
|
sampleName: null,
|
||||||
|
trademark: null,
|
||||||
|
modelSpec: null,
|
||||||
|
quantity: null,
|
||||||
|
status: null,
|
||||||
|
remark: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
};
|
||||||
|
proxy.resetForm("projectRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1
|
queryParams.value.pageNum = 1;
|
||||||
getList()
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef")
|
proxy.resetForm("queryRef");
|
||||||
handleQuery()
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.corpusId)
|
ids.value = selection.map((item) => item.projectId);
|
||||||
single.value = selection.length != 1
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset()
|
reset();
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "添加测试项目"
|
title.value = "添加测试项目";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset()
|
reset();
|
||||||
const _corpusId = row.corpusId || ids.value
|
const _projectId = row.projectId || ids.value;
|
||||||
getCorpus(_corpusId).then(response => {
|
getProject(_projectId).then((response) => {
|
||||||
form.value = response.data
|
form.value = response.data;
|
||||||
open.value = true
|
open.value = true;
|
||||||
title.value = "修改测试项目"
|
title.value = "修改测试项目";
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["corpusRef"].validate(valid => {
|
proxy.$refs["projectRef"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log('f', form.value)
|
if (form.value.projectId != null) {
|
||||||
if (form.value.corpusId != null) {
|
updateProject(form.value).then((response) => {
|
||||||
updateCorpus(form.value).then(response => {
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
proxy.$modal.msgSuccess("修改成功")
|
open.value = false;
|
||||||
open.value = false
|
getList();
|
||||||
getList()
|
});
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
addCorpus(form.value).then(response => {
|
addProject(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("新增成功")
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
open.value = false
|
open.value = false;
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const _corpusIds = row.corpusId || ids.value
|
const _projectIds = row.projectId || ids.value;
|
||||||
proxy.$modal.confirm('是否确认删除语料库编号为"' + _corpusIds + '"的数据项?').then(function() {
|
proxy.$modal
|
||||||
return delCorpus(_corpusIds)
|
.confirm('是否确认删除语音交互-项目编号为"' + _projectIds + '"的数据项?')
|
||||||
}).then(() => {
|
.then(function () {
|
||||||
getList()
|
return delProject(_projectIds);
|
||||||
proxy.$modal.msgSuccess("删除成功")
|
})
|
||||||
}).catch(() => {})
|
.then(() => {
|
||||||
}
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
const handleUpload = (row) => {
|
})
|
||||||
console.log('上传')
|
.catch(() => {});
|
||||||
}
|
|
||||||
|
|
||||||
const handlePlay = () => {
|
|
||||||
console.log('播放')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download('vi/corpus/export', {
|
proxy.download(
|
||||||
...queryParams.value
|
"system/project/export",
|
||||||
}, `corpus_${new Date().getTime()}.xlsx`)
|
{
|
||||||
|
...queryParams.value,
|
||||||
|
},
|
||||||
|
`project_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const router = useRouter()
|
||||||
|
const handleSetting = (row) => {
|
||||||
|
router.push('/vi/plan/index/' + row.projectId)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList();
|
||||||
})
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.card {
|
:deep() {
|
||||||
padding: 12px;
|
.testProject_dialog {
|
||||||
border: 1px solid #e4e7ed;
|
.el-date-editor {
|
||||||
border-radius: 8px;
|
--el-date-editor-width: 100%;
|
||||||
margin-bottom: 20px;
|
}
|
||||||
|
|
||||||
&:hover {
|
.el-input-number {
|
||||||
box-shadow: 0px 0px 12px rgba(0, 0, 0, .12);
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-title {
|
.card {
|
||||||
display: flex;
|
padding: 12px;
|
||||||
align-items: center;
|
border: 1px solid #e4e7ed;
|
||||||
font-size: 16px;
|
border-radius: 8px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 20px;
|
||||||
|
|
||||||
&::before {
|
&:hover {
|
||||||
content: '';
|
box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.12);
|
||||||
width: 4px;
|
}
|
||||||
height: 16px;
|
|
||||||
background: blue;
|
.form-title {
|
||||||
display: inline-block;
|
display: flex;
|
||||||
margin-right: 8px;
|
align-items: center;
|
||||||
|
font-size: 16px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: "";
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
background: blue;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
428
src/views/vi/testProject/plan/index.vue
Normal file
428
src/views/vi/testProject/plan/index.vue
Normal file
@ -0,0 +1,428 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div ref="topContainerRef">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryRef"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-form-item label="所属项目ID" prop="projectId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.projectId"
|
||||||
|
placeholder="请输入所属项目ID"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="方案名称" prop="schemeName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.schemeName"
|
||||||
|
placeholder="请输入方案名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
|
<el-button icon="Refresh" @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="Plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['system:scheme:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="Edit"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['system:scheme:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="Delete"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['system:scheme:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="Download"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['system:scheme:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
v-model:showSearch="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div :style="containerHeight">
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="schemeList"
|
||||||
|
height="100%"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="方案ID" align="center" prop="schemeId" />
|
||||||
|
<el-table-column label="所属项目ID" align="center" prop="projectId" />
|
||||||
|
<el-table-column label="方案名称" align="center" prop="schemeName" />
|
||||||
|
<el-table-column
|
||||||
|
label="语料ID列表"
|
||||||
|
align="center"
|
||||||
|
prop="corpusIds"
|
||||||
|
width="300"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['system:scheme:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
icon="Delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:scheme:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 添加或修改语音交互-方案对话框 -->
|
||||||
|
<el-dialog
|
||||||
|
:title="title"
|
||||||
|
v-model="open"
|
||||||
|
width="700px"
|
||||||
|
:append-to-body="false"
|
||||||
|
body-class="plan_dialog"
|
||||||
|
>
|
||||||
|
<el-form ref="schemeRef" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="方案名称" prop="schemeName">
|
||||||
|
<el-input v-model="form.schemeName" placeholder="请输入方案名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="播放配置" prop="sceneType">
|
||||||
|
<el-select
|
||||||
|
v-model="form.sceneType"
|
||||||
|
placeholder="Select"
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in settingOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="唤醒语料列表" prop="wakeId">
|
||||||
|
<el-select
|
||||||
|
v-model="form.wakeId"
|
||||||
|
placeholder="Select"
|
||||||
|
style="width: 240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in corpusIdsOptions"
|
||||||
|
:key="item.parentId"
|
||||||
|
:label="item.corpusName"
|
||||||
|
:value="item.parentId"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
v-model="form.remark"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div v-if="form.sceneType && form.sceneType != 1">
|
||||||
|
<div>语料配置({{ form.sceneType == 2 ? "单次" : "连续" }})</div>
|
||||||
|
<Setting
|
||||||
|
type="1"
|
||||||
|
v-if="form.sceneType == 2"
|
||||||
|
:corpusIds="selectCorpusIds"
|
||||||
|
@updateSelectRows="getSelectRows"
|
||||||
|
/>
|
||||||
|
<Setting
|
||||||
|
type="0"
|
||||||
|
v-if="form.sceneType == 3"
|
||||||
|
:corpusIds="selectCorpusIds"
|
||||||
|
@updateSelectRows="getSelectRows"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
listScheme,
|
||||||
|
getScheme,
|
||||||
|
delScheme,
|
||||||
|
addScheme,
|
||||||
|
updateScheme,
|
||||||
|
} from "@/api/vi/plan";
|
||||||
|
import { listCorpus } from "@/api/vi/corpus";
|
||||||
|
import Setting from "./setting.vue";
|
||||||
|
import { onMounted } from "vue";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import { useContainerHeight } from "@/hooks/tableHeight";
|
||||||
|
|
||||||
|
const topContainerRef = ref();
|
||||||
|
const containerHeight = useContainerHeight(topContainerRef);
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
|
||||||
|
const schemeList = ref([]);
|
||||||
|
const open = ref(false);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const ids = ref([]);
|
||||||
|
const single = ref(true);
|
||||||
|
const multiple = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const title = ref("");
|
||||||
|
const selectCorpusIds = ref("");
|
||||||
|
|
||||||
|
const data = reactive({
|
||||||
|
form: {
|
||||||
|
corpusIds: null,
|
||||||
|
},
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
schemeName: null,
|
||||||
|
corpusIds: null,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
projectId: [
|
||||||
|
{ required: true, message: "所属项目ID不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
schemeName: [
|
||||||
|
{ required: true, message: "方案名称不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询语音交互-方案列表 */
|
||||||
|
function getList() {
|
||||||
|
loading.value = true;
|
||||||
|
listScheme(queryParams.value).then((response) => {
|
||||||
|
schemeList.value = response.rows;
|
||||||
|
total.value = response.total;
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消按钮
|
||||||
|
function cancel() {
|
||||||
|
open.value = false;
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单重置
|
||||||
|
function reset() {
|
||||||
|
form.value = {
|
||||||
|
schemeId: null,
|
||||||
|
schemeName: null,
|
||||||
|
corpusIds: null,
|
||||||
|
remark: null,
|
||||||
|
};
|
||||||
|
proxy.resetForm("schemeRef");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
proxy.resetForm("queryRef");
|
||||||
|
handleQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多选框选中数据
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.schemeId);
|
||||||
|
single.value = selection.length != 1;
|
||||||
|
multiple.value = !selection.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
const settingOptions = [
|
||||||
|
{ value: 1, label: "唤醒场景" },
|
||||||
|
{ value: 2, label: "单次对话场景" },
|
||||||
|
{ value: 3, label: "连续对话场景" },
|
||||||
|
];
|
||||||
|
|
||||||
|
const corpusIdsOptions = ref([]);
|
||||||
|
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
function handleAdd() {
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加方案";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
reset();
|
||||||
|
const _schemeId = row.schemeId || ids.value;
|
||||||
|
getScheme(_schemeId).then((response) => {
|
||||||
|
form.value = response.data;
|
||||||
|
selectCorpusIds.value = response.data.corpusIds;
|
||||||
|
title.value = "修改方案";
|
||||||
|
open.value = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["schemeRef"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (form.value.sceneType === "1") {
|
||||||
|
form.value.corpusIds = null;
|
||||||
|
} else {
|
||||||
|
if (!form.value?.corpusIds || form.value?.corpusIds?.length === 0) {
|
||||||
|
ElMessage.error("请先添加语料");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (form.value.schemeId != null) {
|
||||||
|
updateScheme(form.value).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addScheme({
|
||||||
|
...form.value,
|
||||||
|
projectId: route.params.id,
|
||||||
|
}).then((response) => {
|
||||||
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const _schemeIds = row.schemeId || ids.value;
|
||||||
|
proxy.$modal
|
||||||
|
.confirm('是否确认删除语音交互-方案编号为"' + _schemeIds + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delScheme(_schemeIds);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {
|
||||||
|
proxy.download(
|
||||||
|
"system/scheme/export",
|
||||||
|
{
|
||||||
|
...queryParams.value,
|
||||||
|
},
|
||||||
|
`scheme_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const getWakeList = () => {
|
||||||
|
listCorpus({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 100000,
|
||||||
|
type: "WAKEUP",
|
||||||
|
continuous: 1,
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
corpusIdsOptions.value = response.rows;
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getSelectRows = (arr) => {
|
||||||
|
const corpusIds = arr.map((item) => item.parentId);
|
||||||
|
form.value.corpusIds = corpusIds.toString();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
getWakeList();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep() {
|
||||||
|
.plan_dialog {
|
||||||
|
.el-select {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
191
src/views/vi/testProject/plan/setting.vue
Normal file
191
src/views/vi/testProject/plan/setting.vue
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="btn-container">
|
||||||
|
<el-button type="primary" @click="openDialog">配置语料</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table :data="selectList">
|
||||||
|
<el-table-column label="语料名称" align="center" prop="corpusName" />
|
||||||
|
<el-table-column
|
||||||
|
label="语音文本"
|
||||||
|
align="center"
|
||||||
|
prop="textContent"
|
||||||
|
min-width="200"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column label="音色" align="center" prop="voiceType" />
|
||||||
|
<el-table-column label="语种" align="center" prop="dialect" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<el-dialog title="选择语料" v-model="open" width="700px">
|
||||||
|
<el-table
|
||||||
|
ref="tableRef"
|
||||||
|
:data="corpusList"
|
||||||
|
:tree-props="{ checkStrictly: true }"
|
||||||
|
:row-key="rowKey"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
type="selection"
|
||||||
|
width="55"
|
||||||
|
align="center"
|
||||||
|
v-show="false"
|
||||||
|
:selectable="selectable"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="语料名称"
|
||||||
|
align="center"
|
||||||
|
prop="corpusName"
|
||||||
|
min-width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="语音文本"
|
||||||
|
align="center"
|
||||||
|
prop="textContent"
|
||||||
|
min-width="200"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column label="音色" align="center" prop="voiceType" />
|
||||||
|
<el-table-column label="语种" align="center" prop="dialect" />
|
||||||
|
</el-table>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { onMounted } from "vue";
|
||||||
|
import { listCorpus, getBatchCorpus } from "@/api/vi/corpus";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: "1",
|
||||||
|
},
|
||||||
|
corpusIds: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const emits = defineEmits(["updateSelectRows"]);
|
||||||
|
|
||||||
|
const selectList = ref([]);
|
||||||
|
const corpusList = ref([]);
|
||||||
|
|
||||||
|
const open = ref(false);
|
||||||
|
const openDialog = () => {
|
||||||
|
open.value = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
toggleRowSelection();
|
||||||
|
}, 100);
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleRowSelection = () => {
|
||||||
|
if (selectList.value.length > 0) {
|
||||||
|
corpusList.value.forEach((row) => {
|
||||||
|
selectList.value.forEach((item) => {
|
||||||
|
if (
|
||||||
|
item.parentId + (item?.corpusId || "") ===
|
||||||
|
row.parentId + (row?.corpusId || "")
|
||||||
|
) {
|
||||||
|
tableRef.value.toggleRowSelection(row, true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const rowKey = (row) => {
|
||||||
|
return row.parentId + (row?.corpusId || "");
|
||||||
|
};
|
||||||
|
|
||||||
|
const selectable = (row) => {
|
||||||
|
if (row.continuous + "" === "0") {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getList = () => {
|
||||||
|
if (props.type === "1") {
|
||||||
|
listCorpus({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 100000,
|
||||||
|
type: "TEST",
|
||||||
|
continuous: 1,
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
corpusList.value = response.rows;
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
} else {
|
||||||
|
getBatchCorpus({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 100000,
|
||||||
|
type: "TEST",
|
||||||
|
continuous: 0,
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
corpusList.value = response.rows;
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const tableRef = ref();
|
||||||
|
const submitForm = () => {
|
||||||
|
const rows = tableRef.value.getSelectionRows();
|
||||||
|
selectList.value = rows;
|
||||||
|
open.value = false;
|
||||||
|
emits("updateSelectRows", rows);
|
||||||
|
};
|
||||||
|
|
||||||
|
const cancel = () => {
|
||||||
|
open.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getSelectList = (corpusIds) => {
|
||||||
|
if (props.type === "1") {
|
||||||
|
listCorpus({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 100000,
|
||||||
|
type: "TEST",
|
||||||
|
continuous: 1,
|
||||||
|
parentIds: corpusIds,
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
selectList.value = response.rows;
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
} else {
|
||||||
|
getBatchCorpus({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 100000,
|
||||||
|
type: "TEST",
|
||||||
|
continuous: 0,
|
||||||
|
parentIds: corpusIds,
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
selectList.value = response.rows;
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
if (props.corpusIds) {
|
||||||
|
getSelectList(props.corpusIds.split(","));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.btn-container {
|
||||||
|
text-align: right;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user