|
|
@@ -1,113 +1,113 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
|
|
|
-<!-- <el-form-item label="销售用户ID" prop="companyUserId">-->
|
|
|
-<!-- <el-input-->
|
|
|
-<!-- v-model="queryParams.companyUserId"-->
|
|
|
-<!-- placeholder="请输入销售用户ID"-->
|
|
|
-<!-- clearable-->
|
|
|
-<!-- size="small"-->
|
|
|
-<!-- @keyup.enter.native="handleQuery"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-
|
|
|
- <el-form-item label="语音文本" prop="voiceTxt">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.voiceTxt"
|
|
|
- placeholder="请输入语音文本"
|
|
|
- clearable
|
|
|
- size="small"
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
-<!-- <el-form-item label="是否录制完成" prop="recordType">-->
|
|
|
-<!-- <el-select v-model="queryParams.recordType" placeholder="请选择是否录制完成" clearable size="small">-->
|
|
|
-<!-- <el-option-->
|
|
|
-<!-- v-for="dict in recordTypeOptions"-->
|
|
|
-<!-- :key="dict.dictValue"-->
|
|
|
-<!-- :label="dict.dictLabel"-->
|
|
|
-<!-- :value="parseInt(dict.dictValue)"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-select>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
-
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- @click="handleAdd"
|
|
|
- v-hasPermi="['qw:QwSopTempVoice:add']"
|
|
|
- >新增</el-button>
|
|
|
- </el-col>
|
|
|
-<!-- <el-col :span="1.5">-->
|
|
|
-<!-- <el-button-->
|
|
|
-<!-- type="success"-->
|
|
|
-<!-- plain-->
|
|
|
-<!-- icon="el-icon-edit"-->
|
|
|
-<!-- size="mini"-->
|
|
|
-<!-- :disabled="single"-->
|
|
|
-<!-- @click="handleUpdate"-->
|
|
|
-<!-- v-hasPermi="['qw:QwSopTempVoice:edit']"-->
|
|
|
-<!-- >修改</el-button>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <el-col :span="1.5">-->
|
|
|
-<!-- <el-button-->
|
|
|
-<!-- type="danger"-->
|
|
|
-<!-- plain-->
|
|
|
-<!-- icon="el-icon-delete"-->
|
|
|
-<!-- size="mini"-->
|
|
|
-<!-- :disabled="multiple"-->
|
|
|
-<!-- @click="handleDelete"-->
|
|
|
-<!-- v-hasPermi="['qw:QwSopTempVoice:remove']"-->
|
|
|
-<!-- >删除</el-button>-->
|
|
|
-<!-- </el-col>-->
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-table border v-loading="loading" :data="QwSopTempVoiceList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="语音文本" align="center" prop="voiceTxt" />
|
|
|
- <el-table-column label="秒" align="center" prop="duration" />
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
-<!-- <el-button-->
|
|
|
-<!-- size="mini"-->
|
|
|
-<!-- type="text"-->
|
|
|
-<!-- icon="el-icon-edit"-->
|
|
|
-<!-- @click="handleUpdate(scope.row)"-->
|
|
|
-<!-- v-hasPermi="['qw:QwSopTempVoice:edit']"-->
|
|
|
-<!-- >修改</el-button>-->
|
|
|
+ <div class="voice-layout">
|
|
|
+ <!-- 左侧分组列表 -->
|
|
|
+ <div class="voice-left-panel">
|
|
|
+ <div class="group-title">
|
|
|
+ <span>语音分组</span>
|
|
|
<el-button
|
|
|
+ type="primary"
|
|
|
size="mini"
|
|
|
- type="text"
|
|
|
- icon="el-icon-delete"
|
|
|
- @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['qw:QwSopTempVoice:remove']"
|
|
|
- >删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ icon="el-icon-plus"
|
|
|
+ circle
|
|
|
+ @click="handleAddGroup"
|
|
|
+ ></el-button>
|
|
|
+ </div>
|
|
|
+ <div class="group-list">
|
|
|
+ <div
|
|
|
+ class="group-item"
|
|
|
+ :class="{ active: currentGroupId === null }"
|
|
|
+ @click="selectGroup(null)"
|
|
|
+ >全部</div>
|
|
|
+ <div
|
|
|
+ v-for="item in groupList"
|
|
|
+ :key="item.id"
|
|
|
+ class="group-item"
|
|
|
+ :class="{ active: currentGroupId === item.id }"
|
|
|
+ @click="selectGroup(item.id)"
|
|
|
+ >
|
|
|
+ <span class="group-item-name">{{ item.voiceGroupName }}</span>
|
|
|
+ <i class="el-icon-edit group-item-edit" @click.stop="handleEditGroup(item)"></i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 右侧内容区 -->
|
|
|
+ <div class="voice-right-panel">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
|
|
|
+ <el-form-item label="语音文本" prop="voiceTxt">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.voiceTxt"
|
|
|
+ placeholder="请输入语音文本"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['qw:QwSopTempVoice:add']"
|
|
|
+ >新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table border v-loading="loading" :data="QwSopTempVoiceList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="语音文本" align="center" prop="voiceTxt" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['qw:QwSopTempVoice:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
<!-- 添加或修改模板对应的销售语音文件对话框 -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="语音分组" prop="groupId">
|
|
|
+ <el-select
|
|
|
+ v-model="form.groupId"
|
|
|
+ placeholder="请选择语音分组"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in groupList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.voiceGroupName"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="语音文本" prop="voiceTxt">
|
|
|
<el-input type="textarea" :rows="6" v-model="form.voiceTxt" placeholder="请输入语音文本" />
|
|
|
</el-form-item>
|
|
|
@@ -117,17 +117,23 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { listQwSopTempVoice, getQwSopTempVoice, delQwSopTempVoice, addQwSopTempVoice, updateQwSopTempVoice, exportQwSopTempVoice } from "@/api/qw/QwSopTempVoice";
|
|
|
-import {removeSidebar} from "../../../api/qw/QwSopTempVoice";
|
|
|
+import { removeSidebar } from "@/api/qw/QwSopTempVoice";
|
|
|
+import { listQwSopTempVoiceGroup, addQwSopTempVoiceGroup, updateQwSopTempVoiceGroup } from "@/api/qw/QwSopTempVoiceGroup";
|
|
|
|
|
|
export default {
|
|
|
name: "QwSopTempVoice",
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 分组列表
|
|
|
+ groupList: [],
|
|
|
+ // 当前选中的分组ID,null表示全部
|
|
|
+ currentGroupId: null,
|
|
|
|
|
|
// 是否录制完成字典
|
|
|
recordTypeOptions: [
|
|
|
@@ -166,6 +172,7 @@ export default {
|
|
|
ruleId: null,
|
|
|
dayId: null,
|
|
|
contentId: null,
|
|
|
+ groupId: null,
|
|
|
voiceTxt: null,
|
|
|
voiceUrl: null,
|
|
|
userVoiceUrl: null,
|
|
|
@@ -177,13 +184,60 @@ export default {
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
+ groupId: [
|
|
|
+ { required: true, message: "请选择语音分组", trigger: "change" }
|
|
|
+ ]
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ this.getGroupList();
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ /** 获取语音分组列表 */
|
|
|
+ getGroupList() {
|
|
|
+ listQwSopTempVoiceGroup({ pageNum: 1, pageSize: 999 }).then(response => {
|
|
|
+ this.groupList = response.rows;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 选择分组 */
|
|
|
+ selectGroup(groupId) {
|
|
|
+ this.currentGroupId = groupId;
|
|
|
+ this.queryParams.groupId = groupId;
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 新增分组 */
|
|
|
+ handleAddGroup() {
|
|
|
+ this.$prompt('请输入语音分组名称', '新增分组', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ inputPattern: /\S/,
|
|
|
+ inputErrorMessage: '分组名称不能为空'
|
|
|
+ }).then(({ value }) => {
|
|
|
+ addQwSopTempVoiceGroup({ voiceGroupName: value }).then(() => {
|
|
|
+ this.msgSuccess('新增成功');
|
|
|
+ this.getGroupList();
|
|
|
+ });
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ /** 修改分组名称 */
|
|
|
+ handleEditGroup(item) {
|
|
|
+ if (!item) return;
|
|
|
+ this.$prompt('请输入新的分组名称', '修改分组', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ inputPattern: /\S/,
|
|
|
+ inputErrorMessage: '分组名称不能为空',
|
|
|
+ inputValue: item.voiceGroupName
|
|
|
+ }).then(({ value }) => {
|
|
|
+ updateQwSopTempVoiceGroup({ id: item.id, voiceGroupName: value }).then(() => {
|
|
|
+ this.msgSuccess('修改成功');
|
|
|
+ this.getGroupList();
|
|
|
+ });
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
/** 查询模板对应的销售语音文件列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
@@ -209,6 +263,7 @@ export default {
|
|
|
ruleId: null,
|
|
|
dayId: null,
|
|
|
contentId: null,
|
|
|
+ groupId: null,
|
|
|
voiceTxt: null,
|
|
|
voiceUrl: null,
|
|
|
userVoiceUrl: null,
|
|
|
@@ -274,7 +329,6 @@ export default {
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
-
|
|
|
this.$confirm('是否确认删除模板对应的销售语音文本---"' + row.voiceTxt + '"---的数据项?', "警告", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
@@ -304,3 +358,84 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.app-container {
|
|
|
+ position: relative;
|
|
|
+ height: calc(100vh - 150px);
|
|
|
+ overflow: hidden;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+.voice-layout {
|
|
|
+ position: absolute;
|
|
|
+ top: 20px;
|
|
|
+ left: 20px;
|
|
|
+ right: 20px;
|
|
|
+ bottom: 20px;
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+.voice-left-panel {
|
|
|
+ width: 200px;
|
|
|
+ min-width: 200px;
|
|
|
+ background: #fff;
|
|
|
+ border-right: 1px solid #e8e8e8;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
+.group-title {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ padding: 16px 16px 12px;
|
|
|
+ border-bottom: 1px solid #e8e8e8;
|
|
|
+ flex-shrink: 0;
|
|
|
+}
|
|
|
+.group-list {
|
|
|
+ padding: 8px 8px 0;
|
|
|
+ overflow-y: auto;
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+.group-item {
|
|
|
+ padding: 10px 12px;
|
|
|
+ cursor: pointer;
|
|
|
+ border-radius: 4px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #333;
|
|
|
+ transition: all 0.2s;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+.group-item-name {
|
|
|
+ flex: 1;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+}
|
|
|
+.group-item-edit {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #999;
|
|
|
+ flex-shrink: 0;
|
|
|
+ margin-left: 6px;
|
|
|
+}
|
|
|
+.group-item-edit:hover {
|
|
|
+ color: #1890ff;
|
|
|
+}
|
|
|
+.group-item:hover {
|
|
|
+ background: #f0f2f5;
|
|
|
+}
|
|
|
+.group-item.active {
|
|
|
+ background: #e6f7ff;
|
|
|
+ color: #1890ff;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+.voice-right-panel {
|
|
|
+ flex: 1;
|
|
|
+ padding-left: 16px;
|
|
|
+ min-width: 0;
|
|
|
+ overflow-y: auto;
|
|
|
+ overflow-x: hidden;
|
|
|
+}
|
|
|
+</style>
|