|
@@ -53,7 +53,8 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['courseFinishTemp:course:add']"
|
|
|
- >新增</el-button>
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -64,7 +65,8 @@
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
v-hasPermi="['courseFinishTemp:course:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -75,7 +77,8 @@
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['courseFinishTemp:course:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -86,24 +89,30 @@
|
|
|
:loading="exportLoading"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['courseFinishTemp:course:export']"
|
|
|
- >导出</el-button>
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
<el-table border v-loading="loading" :data="courseFinishTempList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="模板ID" align="center" prop="id" />
|
|
|
- <el-table-column label="模板名称" align="center" prop="name" />
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column label="模板ID" align="center" prop="id"/>
|
|
|
+ <el-table-column label="模板名称" align="center" prop="name"/>
|
|
|
<el-table-column label="状态" align="center" prop="status">
|
|
|
<template slot-scope="scope">
|
|
|
<dict-tag :options="statusOptions" :value="scope.row.status"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="课程名称" align="center" prop="courseName" />
|
|
|
- <el-table-column label="小节名称" align="center" prop="videoName" />
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" />
|
|
|
- <el-table-column label="修改时间" align="center" prop="updateTime" />
|
|
|
+ <el-table-column label="课程名称" align="center" prop="courseName"/>
|
|
|
+ <el-table-column label="小节名称" align="center" prop="videoName"/>
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime"/>
|
|
|
+ <el-table-column label="修改时间" align="center" prop="updateTime"/>
|
|
|
+ <el-table-column label="全选销售" align="center" prop="isAllCompanyUser">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="allowSelect" :value="scope.row.isAllCompanyUser"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
@@ -112,21 +121,24 @@
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['courseFinishTemp:course:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-s-promotion"
|
|
|
@click="handleSelectDetails(scope.row)"
|
|
|
v-hasPermi="['courseFinishTemp:course:query']"
|
|
|
- >详情</el-button>
|
|
|
+ >详情
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['courseFinishTemp:course:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -143,7 +155,7 @@
|
|
|
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="模板名称" prop="name">
|
|
|
- <el-input v-model="form.name" placeholder="请输入模板名称" />
|
|
|
+ <el-input v-model="form.name" placeholder="请输入模板名称"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态">
|
|
|
<el-radio-group v-model="form.status">
|
|
@@ -151,11 +163,13 @@
|
|
|
v-for="dict in statusOptions"
|
|
|
:key="dict.dictValue"
|
|
|
:label="parseInt(dict.dictValue)"
|
|
|
- >{{dict.dictLabel}}</el-radio>
|
|
|
+ >{{ dict.dictLabel }}
|
|
|
+ </el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="选择课程">
|
|
|
- <el-select v-model="form.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" @change="courseChange()">
|
|
|
+ <el-select v-model="form.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini"
|
|
|
+ @change="courseChange()">
|
|
|
<el-option
|
|
|
v-for="dict in courseList"
|
|
|
:key="dict.dictValue"
|
|
@@ -163,7 +177,7 @@
|
|
|
:value="parseInt(dict.dictValue)"
|
|
|
/>
|
|
|
</el-select>
|
|
|
- <el-select v-model="form.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" >
|
|
|
+ <el-select v-model="form.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;">
|
|
|
<el-option
|
|
|
v-for="dict in videoList"
|
|
|
:key="dict.dictValue"
|
|
@@ -172,100 +186,219 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="规则" prop="setting" >
|
|
|
- <div v-for="(item, index) in setting" :key="index" style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
|
|
|
- <el-row>
|
|
|
- <el-col :span="22">
|
|
|
- <el-form :model="item" label-width="70px">
|
|
|
- <el-form-item label="内容类别" style="margin: 2%">
|
|
|
- <el-radio-group v-model="item.contentType">
|
|
|
- <el-radio :label="item.dictValue" v-for="item in sysQwSopAiContentType">{{item.dictLabel}}</el-radio>
|
|
|
+ <el-form-item label="规则" prop="setting">
|
|
|
+ <div v-for="(item, index) in setting" :key="index"
|
|
|
+ style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="22">
|
|
|
+ <el-form :model="item" label-width="70px">
|
|
|
+ <el-form-item label="内容类别" style="margin: 2%">
|
|
|
+ <el-radio-group v-model="item.contentType">
|
|
|
+ <el-radio :label="item.dictValue" v-for="item in sysQwSopAiContentType">{{ item.dictLabel }}
|
|
|
+ </el-radio>
|
|
|
</el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="内容" style="margin-bottom: 2%" >
|
|
|
- <el-input v-if="item.contentType == 1 " v-model="item.value" type="textarea" :rows="3" placeholder="内容" style="width: 90%;margin-top: 10px;"/>
|
|
|
-
|
|
|
- <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1" :width="150" :height="150" />
|
|
|
-
|
|
|
- <div v-if="item.contentType == 3 ">
|
|
|
- <el-card class="box-card">
|
|
|
- <el-form-item label="链接标题:" label-width="100px">
|
|
|
- <el-input v-model="item.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="内容" style="margin-bottom: 2%">
|
|
|
+ <el-input v-if="item.contentType == 1 " v-model="item.value" type="textarea" :rows="3"
|
|
|
+ placeholder="内容" style="width: 90%;margin-top: 10px;"/>
|
|
|
+
|
|
|
+ <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1" :width="150"
|
|
|
+ :height="150"/>
|
|
|
+
|
|
|
+ <div v-if="item.contentType == 3 ">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <el-form-item label="链接标题:" label-width="100px">
|
|
|
+ <el-input v-model="item.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="链接描述:" label-width="100px">
|
|
|
+ <el-input type="textarea" :rows="3" v-model="item.linkDescribe" placeholder="请输入链接描述"
|
|
|
+ style="width: 90%;margin-top: 1%;"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="链接封面:" label-width="100px">
|
|
|
+ <ImageUpload v-model="item.linkImageUrl" type="image" :num="1" :file-size="2" :width="150"
|
|
|
+ :height="150" style="margin-top: 1%;"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="链接地址:" label-width="100px">
|
|
|
+ <el-input v-model="item.linkUrl" placeholder="请输入链接地址" style="width: 90%;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.contentType == 4">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div v-if="item.contentType == 5 ">
|
|
|
+
|
|
|
+ <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
|
|
|
+ <el-upload
|
|
|
+ v-model="item.fileUrl"
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="uploadUrl"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="(res, file) => handleAvatarSuccessFile(res, file, item)"
|
|
|
+ :before-upload="beforeAvatarUploadFile">
|
|
|
+ <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
+ <el-link v-if="item.fileUrl" type="primary" :href="downloadUrl(item.fileUrl)" download>
|
|
|
+ {{ item.fileUrl }}
|
|
|
+ </el-link>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="链接描述:" label-width="100px" >
|
|
|
- <el-input type="textarea" :rows="3" v-model="item.linkDescribe" placeholder="请输入链接描述" style="width: 90%;margin-top: 1%;"/>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="item.contentType == 6 ">
|
|
|
+ <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
|
|
|
+ <el-upload
|
|
|
+ v-model="item.videoUrl"
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="uploadUrl"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="(res, file) => handleAvatarSuccessVideo(res, file, item)"
|
|
|
+ :before-upload="beforeAvatarUploadVideo">
|
|
|
+ <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
+ <video v-if="item.videoUrl"
|
|
|
+ :src="item.videoUrl"
|
|
|
+ controls style="width: 200px;height: 100px">
|
|
|
+ </video>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="链接封面:" label-width="100px">
|
|
|
- <ImageUpload v-model="item.linkImageUrl" type="image" :num="1" :file-size="2" :width="150" :height="150" style="margin-top: 1%;" />
|
|
|
+ </div>
|
|
|
+ <div v-if="item.contentType == 7 ">
|
|
|
+ <el-input
|
|
|
+ v-model="item.value"
|
|
|
+ type="textarea" :rows="3" maxlength="66" show-word-limit
|
|
|
+ placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
|
|
|
+ @input="handleInputVideoText(item.value,item)"/>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.contentType == 8">
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1" :offset="1">
|
|
|
+ <i class="el-icon-delete" @click="delSetList(index, 0)" style="margin-top: 20px;"
|
|
|
+ v-if="setting.length>1 && formType==1"></i>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetList(0)' v-if="formType==1">
|
|
|
+ 添加内容
|
|
|
+ </el-link>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="群聊恭喜规则" prop="setting">
|
|
|
+ <div v-for="(item, index) in chatSetting" :key="index"
|
|
|
+ style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="22">
|
|
|
+ <el-form :model="item" label-width="70px">
|
|
|
+ <el-form-item label="内容类别" style="margin: 2%">
|
|
|
+ <el-radio-group v-model="item.contentType">
|
|
|
+ <el-radio :label="item.dictValue" v-for="item in sysQwSopAiContentType">{{ item.dictLabel }}
|
|
|
+ </el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="内容" style="margin-bottom: 2%">
|
|
|
+ <el-input v-if="item.contentType == 1 " v-model="item.value" type="textarea" :rows="3"
|
|
|
+ placeholder="内容" style="width: 90%;margin-top: 10px;"/>
|
|
|
+
|
|
|
+ <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1" :width="150"
|
|
|
+ :height="150"/>
|
|
|
+
|
|
|
+ <div v-if="item.contentType == 3 ">
|
|
|
+ <el-card class="box-card">
|
|
|
+ <el-form-item label="链接标题:" label-width="100px">
|
|
|
+ <el-input v-model="item.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="链接描述:" label-width="100px">
|
|
|
+ <el-input type="textarea" :rows="3" v-model="item.linkDescribe" placeholder="请输入链接描述"
|
|
|
+ style="width: 90%;margin-top: 1%;"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="链接封面:" label-width="100px">
|
|
|
+ <ImageUpload v-model="item.linkImageUrl" type="image" :num="1" :file-size="2" :width="150"
|
|
|
+ :height="150" style="margin-top: 1%;"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="链接地址:" label-width="100px">
|
|
|
+ <el-input v-model="item.linkUrl" placeholder="请输入链接地址" style="width: 90%;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.contentType == 4">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div v-if="item.contentType == 5 ">
|
|
|
+
|
|
|
+ <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
|
|
|
+ <el-upload
|
|
|
+ v-model="item.fileUrl"
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="uploadUrl"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="(res, file) => handleAvatarSuccessFile(res, file, item)"
|
|
|
+ :before-upload="beforeAvatarUploadFile">
|
|
|
+ <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
+ <el-link v-if="item.fileUrl" type="primary" :href="downloadUrl(item.fileUrl)" download>
|
|
|
+ {{ item.fileUrl }}
|
|
|
+ </el-link>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="链接地址:" label-width="100px" >
|
|
|
- <el-input v-model="item.linkUrl" placeholder="请输入链接地址" style="width: 90%;"/>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="item.contentType == 6 ">
|
|
|
+ <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
|
|
|
+ <el-upload
|
|
|
+ v-model="item.videoUrl"
|
|
|
+ class="avatar-uploader"
|
|
|
+ :action="uploadUrl"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="(res, file) => handleAvatarSuccessVideo(res, file, item)"
|
|
|
+ :before-upload="beforeAvatarUploadVideo">
|
|
|
+ <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
+ <video v-if="item.videoUrl"
|
|
|
+ :src="item.videoUrl"
|
|
|
+ controls style="width: 200px;height: 100px">
|
|
|
+ </video>
|
|
|
</el-form-item>
|
|
|
- </el-card>
|
|
|
- </div>
|
|
|
- <div v-if="item.contentType == 4">
|
|
|
-
|
|
|
- </div>
|
|
|
- <div v-if="item.contentType == 5 ">
|
|
|
-
|
|
|
- <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
|
|
|
- <el-upload
|
|
|
- v-model="item.fileUrl"
|
|
|
- class="avatar-uploader"
|
|
|
- :action="uploadUrl"
|
|
|
- :show-file-list="false"
|
|
|
- :on-success="(res, file) => handleAvatarSuccessFile(res, file, item)"
|
|
|
- :before-upload="beforeAvatarUploadFile">
|
|
|
- <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
- </el-upload>
|
|
|
- <el-link v-if="item.fileUrl" type="primary" :href="downloadUrl(item.fileUrl)" download>
|
|
|
- {{item.fileUrl}}
|
|
|
- </el-link>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
- </div>
|
|
|
-
|
|
|
- <div v-if="item.contentType == 6 ">
|
|
|
- <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
|
|
|
- <el-upload
|
|
|
- v-model="item.videoUrl"
|
|
|
- class="avatar-uploader"
|
|
|
- :action="uploadUrl"
|
|
|
- :show-file-list="false"
|
|
|
- :on-success="(res, file) => handleAvatarSuccessVideo(res, file, item)"
|
|
|
- :before-upload="beforeAvatarUploadVideo">
|
|
|
- <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
- </el-upload>
|
|
|
- <video v-if="item.videoUrl"
|
|
|
- :src="item.videoUrl"
|
|
|
- controls style="width: 200px;height: 100px">
|
|
|
- </video>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- <div v-if="item.contentType == 7 ">
|
|
|
+ </div>
|
|
|
+ <div v-if="item.contentType == 7 ">
|
|
|
<el-input
|
|
|
v-model="item.value"
|
|
|
type="textarea" :rows="3" maxlength="66" show-word-limit
|
|
|
placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
|
|
|
@input="handleInputVideoText(item.value,item)"/>
|
|
|
- </div>
|
|
|
- <div v-if="item.contentType == 8">
|
|
|
-
|
|
|
- </div>
|
|
|
-
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </el-col>
|
|
|
- <el-col :span="1" :offset="1">
|
|
|
- <i class="el-icon-delete" @click="delSetList(index)" style="margin-top: 20px;" v-if="setting.length>1 && formType==1"></i>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ </div>
|
|
|
+ <div v-if="item.contentType == 8">
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1" :offset="1">
|
|
|
+ <i class="el-icon-delete" @click="delSetList(index,1)" style="margin-top: 20px;"
|
|
|
+ v-if="setting.length>1 && formType==1"></i>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
- <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetList()' v-if="formType==1" >添加内容</el-link>
|
|
|
-
|
|
|
+ <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetList(1)' v-if="formType==1">
|
|
|
+ 添加内容
|
|
|
+ </el-link>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="全选销售" prop="isAllCompanyUser">
|
|
|
+ <el-switch
|
|
|
+ v-model="form.isAllCompanyUser"
|
|
|
+ active-color="#13ce66"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ :active-value="1"
|
|
|
+ :inactive-value="2">
|
|
|
+ </el-switch>
|
|
|
+ <span v-if="form.isAllCompanyUser == '1'" style="margin-left: 10px;color: #13ce66">是</span>
|
|
|
+ <span v-else style="margin-left: 10px;color: #ff4949">否</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="所属销售" prop="companyUserIds">
|
|
|
- <el-select v-model="companyUserIds" remote multiple placeholder="请选择" filterable style="width: 100%;">
|
|
|
+ <el-select v-model="companyUserIds" remote multiple placeholder="请选择" filterable style="width: 100%;">
|
|
|
<el-option
|
|
|
v-for="dict in userList"
|
|
|
:key="dict.userId"
|
|
@@ -284,10 +417,17 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listCourseFinishTemp, getCourseFinishTemp, addCourseFinishTemp, updateCourseFinishTemp, delCourseFinishTemp, exportCourseFinishTemp } from "@/api/course/courseFinishTemp";
|
|
|
+import {
|
|
|
+ addCourseFinishTemp,
|
|
|
+ delCourseFinishTemp,
|
|
|
+ exportCourseFinishTemp,
|
|
|
+ getCourseFinishTemp,
|
|
|
+ listCourseFinishTemp,
|
|
|
+ updateCourseFinishTemp
|
|
|
+} from '@/api/course/courseFinishTemp'
|
|
|
import { getUserList } from '@/api/company/companyUser'
|
|
|
-import {courseList, videoList} from '@/api/qw/sop'
|
|
|
-import ImageUpload from "@/views/qw/sop/ImageUpload.vue";
|
|
|
+import { courseList, videoList } from '@/api/qw/sop'
|
|
|
+import ImageUpload from '@/views/qw/sop/ImageUpload.vue'
|
|
|
|
|
|
export default {
|
|
|
name: "CourseFinishTemp",
|
|
@@ -295,15 +435,16 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
//上传语音的遮罩层
|
|
|
- voiceLoading :false,
|
|
|
- uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS2",
|
|
|
- uploadUrlByVoice:process.env.VUE_APP_BASE_API+"/common/uploadOSSByHOOKVoice",
|
|
|
- companyUserIds:[],
|
|
|
- userList:[],
|
|
|
+ voiceLoading: false,
|
|
|
+ uploadUrl: process.env.VUE_APP_BASE_API + "/common/uploadOSS2",
|
|
|
+ uploadUrlByVoice: process.env.VUE_APP_BASE_API + "/common/uploadOSSByHOOKVoice",
|
|
|
+ companyUserIds: [],
|
|
|
+ userList: [],
|
|
|
// 状态字典
|
|
|
statusOptions: [],
|
|
|
- courseList:[],
|
|
|
- videoList:[],
|
|
|
+ allowSelect: [],
|
|
|
+ courseList: [],
|
|
|
+ videoList: [],
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 导出遮罩层
|
|
@@ -316,13 +457,13 @@ export default {
|
|
|
multiple: true,
|
|
|
// 显示搜索条件
|
|
|
showSearch: true,
|
|
|
- formType:1,
|
|
|
+ formType: 1,
|
|
|
// 总条数
|
|
|
total: 0,
|
|
|
// 完课模板表格数据
|
|
|
courseFinishTempList: [],
|
|
|
//插件版
|
|
|
- sysQwSopAiContentType:[],
|
|
|
+ sysQwSopAiContentType: [],
|
|
|
|
|
|
sysFsSopWatchStatus: [],
|
|
|
|
|
@@ -337,6 +478,7 @@ export default {
|
|
|
name: null,
|
|
|
status: null,
|
|
|
setting: null,
|
|
|
+ chatSetting: null,
|
|
|
companyId: null,
|
|
|
courseId: null,
|
|
|
videoId: null,
|
|
@@ -345,43 +487,50 @@ export default {
|
|
|
},
|
|
|
// 模板表格数据
|
|
|
setting: [],
|
|
|
+ chatSetting: [],
|
|
|
// 表单参数
|
|
|
form: {
|
|
|
- setting:null,
|
|
|
- videoIdSet:null,
|
|
|
- courseIdSet:null,
|
|
|
+ setting: null,
|
|
|
+ chatSetting: null,
|
|
|
+ videoIdSet: null,
|
|
|
+ courseIdSet: null,
|
|
|
},
|
|
|
// 表单校验
|
|
|
- rules: {
|
|
|
- }
|
|
|
+ rules: {}
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.getList();
|
|
|
+ this.queryParams.parentId = this.$route.params && this.$route.params.parentId;
|
|
|
getUserList().then(response => {
|
|
|
- this.userList = response.data;
|
|
|
- console.log("this.userList",this.userList)
|
|
|
+ this.userList = response.data;
|
|
|
+ console.log("this.userList", this.userList)
|
|
|
});
|
|
|
this.getDicts("sys_company_status").then(response => {
|
|
|
this.statusOptions = response.data;
|
|
|
});
|
|
|
|
|
|
+ //复用一下
|
|
|
+ this.getDicts("sys_qw_allow_select").then(response => {
|
|
|
+ this.allowSelect = response.data;
|
|
|
+ });
|
|
|
+
|
|
|
this.getDicts("sys_fs_sop_watch_status").then(response => {
|
|
|
this.sysFsSopWatchStatus = response.data;
|
|
|
});
|
|
|
|
|
|
- this.getDicts("sys_qwSopCourse_contentType").then(response => {
|
|
|
+ this.getDicts("sys_qwSopAi_contentType").then(response => {
|
|
|
this.sysQwSopAiContentType = response.data;
|
|
|
});
|
|
|
courseList().then(response => {
|
|
|
this.courseList = response.list;
|
|
|
});
|
|
|
+ this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
courseChange() {
|
|
|
|
|
|
videoList(this.form.courseId).then(response => {
|
|
|
- this.videoList=response.list;
|
|
|
+ this.videoList = response.list;
|
|
|
});
|
|
|
},
|
|
|
/** 查询完课模板列表 */
|
|
@@ -407,7 +556,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- beforeAvatarUploadFile(file){
|
|
|
+ beforeAvatarUploadFile(file) {
|
|
|
const isLt1M = file.size / 1024 / 1024 < 10;
|
|
|
if (!isLt1M) {
|
|
|
this.$message.error('上传大小不能超过 10MB!');
|
|
@@ -419,7 +568,7 @@ export default {
|
|
|
// 直接返回文件 URL
|
|
|
return materialUrl;
|
|
|
},
|
|
|
- handleInputVideoText(value,content){
|
|
|
+ handleInputVideoText(value, content) {
|
|
|
// 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
|
|
|
const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
|
|
|
|
|
@@ -430,16 +579,15 @@ export default {
|
|
|
|
|
|
},
|
|
|
handleAvatarSuccessVideo(res, file, item) {
|
|
|
- if(res.code==200){
|
|
|
+ if (res.code == 200) {
|
|
|
// 使用 $set 确保响应式更新
|
|
|
this.$set(item, 'videoUrl', res.url);
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
this.msgError(res.msg);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- beforeAvatarUploadVideo(file){
|
|
|
+ beforeAvatarUploadVideo(file) {
|
|
|
const isLt30M = file.size / 1024 / 1024 < 10;
|
|
|
const isMP4 = file.type === 'video/mp4';
|
|
|
|
|
@@ -456,82 +604,34 @@ export default {
|
|
|
return true;
|
|
|
},
|
|
|
|
|
|
- handleAvatarSuccessVoice(res, file, item){
|
|
|
- if(res.code==200){
|
|
|
-
|
|
|
- // 创建 Audio 对象加载音频
|
|
|
- const audio = new Audio(res.mp3Url);
|
|
|
- audio.addEventListener('loadedmetadata', () => {
|
|
|
- // 获取音频时长
|
|
|
- this.$set(item, 'voiceDuration', Math.ceil(audio.duration));
|
|
|
- });
|
|
|
- // 使用 $set 确保响应式更新
|
|
|
- this.$set(item, 'voiceUrl', res.silkUrl);
|
|
|
- this.$set(item, 'mp3Url', res.mp3Url);
|
|
|
- }
|
|
|
- else{
|
|
|
- this.msgError(res.msg);
|
|
|
+ delSetList(index, type) {
|
|
|
+ if (type == 0) {
|
|
|
+ this.setting.splice(index, 1)
|
|
|
+ } else {
|
|
|
+ this.chatSetting.splice(index, 1)
|
|
|
}
|
|
|
- this.voiceLoading=false;
|
|
|
- },
|
|
|
- beforeAvatarUploadVoice(file) {
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- const isLt10M = file.size / 1024 / 1024 < 10; // 假设语音文件大小限制为10MB
|
|
|
- const isVoiceType = ['audio/mp3', 'audio/mpeg', 'audio/wav', 'audio/x-wav'].includes(file.type);
|
|
|
-
|
|
|
- if (!isVoiceType) {
|
|
|
- this.$message.error('仅支持上传 MP3, WAV, X-WAV 格式的语音文件!');
|
|
|
- return reject(false); // 不允许继续上传
|
|
|
- }
|
|
|
-
|
|
|
- if (!isLt10M) {
|
|
|
- this.$message.error('上传大小不能超过 10MB!');
|
|
|
- return reject(false); // 不允许继续上传
|
|
|
- }
|
|
|
-
|
|
|
- // 使用 FileReader 读取文件
|
|
|
- const reader = new FileReader();
|
|
|
- reader.onload = (event) => {
|
|
|
- const audio = new Audio(event.target.result);
|
|
|
- audio.addEventListener('loadedmetadata', () => {
|
|
|
- // 获取时长并保存
|
|
|
- if (Math.ceil(audio.duration) > 30) {
|
|
|
- this.$message.error('音频时长不能超过30秒!');
|
|
|
- this.voiceLoading=false;
|
|
|
- return reject(false); // 不允许继续上传
|
|
|
- }
|
|
|
- resolve(true); // 允许上传
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
- reader.onerror = () => {
|
|
|
- this.$message.error('无法读取音频文件!请上传正确的音频文件');
|
|
|
- reject(false); // 不允许继续上传
|
|
|
- };
|
|
|
- this.voiceLoading=true;
|
|
|
- reader.readAsDataURL(file); // 开始读取文件
|
|
|
- });
|
|
|
},
|
|
|
- delSetList(index){
|
|
|
- this.setting.splice(index,1)
|
|
|
- },
|
|
|
-
|
|
|
- addSetList(){
|
|
|
- const newSetting = {
|
|
|
- contentType:'1',
|
|
|
- value: '',
|
|
|
- };
|
|
|
- // 将新设置项添加到 content.setting 数组中
|
|
|
+ addSetList(type) {
|
|
|
+ const newSetting = {
|
|
|
+ contentType: '1',
|
|
|
+ value: '',
|
|
|
+ };
|
|
|
+ // 将新设置项添加到 content.setting 数组中
|
|
|
+ if (type == 0) {
|
|
|
this.setting.push(newSetting);
|
|
|
-
|
|
|
+ } else {
|
|
|
+ this.chatSetting.push(newSetting);
|
|
|
+ }
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
id: null,
|
|
|
name: null,
|
|
|
+ type: 1,
|
|
|
status: 1,
|
|
|
setting: [],
|
|
|
+ chatSetting: [],
|
|
|
companyId: null,
|
|
|
createBy: null,
|
|
|
createTime: null,
|
|
@@ -539,10 +639,12 @@ export default {
|
|
|
videoId: null,
|
|
|
companyUserIds: null,
|
|
|
updateTime: null,
|
|
|
- isDel: null
|
|
|
+ isDel: null,
|
|
|
+ isAllCompanyUser: null,
|
|
|
};
|
|
|
- this.companyUserIds=[]
|
|
|
- this.setting=[]
|
|
|
+ this.companyUserIds = []
|
|
|
+ this.setting = []
|
|
|
+ this.chatSetting = []
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
@@ -558,7 +660,7 @@ export default {
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
+ this.single = selection.length !== 1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
@@ -569,26 +671,29 @@ export default {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
- * 查看完课模板
|
|
|
- */
|
|
|
- handleSelectDetails(row){
|
|
|
+ * 查看完课模板
|
|
|
+ */
|
|
|
+ handleSelectDetails(row) {
|
|
|
|
|
|
this.reset();
|
|
|
const id = row.id || this.ids
|
|
|
getCourseFinishTemp(id).then(response => {
|
|
|
+ console.log("this.form222 ", response.data)
|
|
|
this.form = response.data;
|
|
|
- this.setting=JSON.parse(this.form.setting)
|
|
|
- if (response.data.companyUserIds!=null){
|
|
|
+
|
|
|
+ this.setting = JSON.parse(this.form.setting)
|
|
|
+ this.chatSetting = JSON.parse(this.form.chatSetting)
|
|
|
+ if (response.data.companyUserIds != null) {
|
|
|
this.companyUserIds = this.form.companyUserIds.split(",");
|
|
|
}
|
|
|
|
|
|
videoList(this.form.courseId).then(response => {
|
|
|
- this.videoList=response.list;
|
|
|
+ this.videoList = response.list;
|
|
|
});
|
|
|
|
|
|
this.open = true;
|
|
|
this.title = "查看完课模板";
|
|
|
- this.formType=2;
|
|
|
+ this.formType = 2;
|
|
|
|
|
|
});
|
|
|
},
|
|
@@ -597,16 +702,20 @@ export default {
|
|
|
this.reset();
|
|
|
const id = row.id || this.ids
|
|
|
getCourseFinishTemp(id).then(response => {
|
|
|
+ console.log("this.response.data", response.data)
|
|
|
this.form = response.data;
|
|
|
- this.setting=JSON.parse(this.form.setting)
|
|
|
- if (response.data.companyUserIds!=null){
|
|
|
+
|
|
|
+ this.setting = JSON.parse(this.form.setting)
|
|
|
+ this.chatSetting = JSON.parse(this.form.chatSetting)
|
|
|
+ if (response.data.companyUserIds != null) {
|
|
|
this.companyUserIds = this.form.companyUserIds.split(",");
|
|
|
}
|
|
|
|
|
|
videoList(this.form.courseId).then(response => {
|
|
|
- this.videoList=response.list;
|
|
|
+ this.videoList = response.list;
|
|
|
});
|
|
|
|
|
|
+
|
|
|
this.open = true;
|
|
|
this.title = "修改完课模板";
|
|
|
|
|
@@ -616,40 +725,45 @@ export default {
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
+
|
|
|
+ if (this.form.isAllCompanyUser == null) {
|
|
|
+ this.form.isAllCompanyUser = 2;
|
|
|
+ }
|
|
|
this.form.companyUserIds = this.companyUserIds.toString()
|
|
|
|
|
|
- this.form.setting=JSON.stringify(this.setting)
|
|
|
+ this.form.setting = JSON.stringify(this.setting)
|
|
|
+ this.form.chatSetting = JSON.stringify(this.chatSetting)
|
|
|
|
|
|
if (this.setting.length <= 0) {
|
|
|
return this.$message("请添加规则")
|
|
|
}
|
|
|
for (let i = 0; i < this.setting.length; i++) {
|
|
|
- if (this.setting[i].contentType == 1 && (this.setting[i].value == null || this.setting[i].value == "")) {
|
|
|
- return this.$message.error("内容不能为空")
|
|
|
- }
|
|
|
- if (this.setting[i].contentType == 2 && (this.setting[i].imgUrl == null || this.setting[i].imgUrl == "")) {
|
|
|
- return this.$message.error("图片不能为空")
|
|
|
- }
|
|
|
- if (this.setting[i].contentType == 3 && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
|
|
|
- return this.$message.error("链接标题不能为空")
|
|
|
- }
|
|
|
- if (this.setting[i].contentType == 3 && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
|
|
|
- return this.$message.error("链接描述不能为空")
|
|
|
- }
|
|
|
- if (this.setting[i].contentType == 3 && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
|
|
|
- return this.$message.error("链接图片不能为空")
|
|
|
- }
|
|
|
- if (this.setting[i].contentType == 3 && this.setting[i].type == 1 && (this.setting[i].linkUrl == null || this.setting[i].linkUrl == "")) {
|
|
|
- return this.$message.error("链接地址不能为空")
|
|
|
- }
|
|
|
- if (this.setting[i].contentType == 5 && (this.setting[i].fileUrl == null || this.setting[i].fileUrl == "")) {
|
|
|
- return this.$message.error("文件不能为空")
|
|
|
- }
|
|
|
- if (this.setting[i].contentType == 6 && (this.setting[i].videoUrl == null || this.setting[i].videoUrl == "")) {
|
|
|
- return this.$message.error("视频不能为空")
|
|
|
- }
|
|
|
- if (this.setting[i].contentType == 7 && (this.setting[i].value == null || this.setting[i].value == "")) {
|
|
|
- return this.$message.error("语音不能为空")
|
|
|
+ if (this.setting[i].contentType == 1 && (this.setting[i].value == null || this.setting[i].value == "")) {
|
|
|
+ return this.$message.error("内容不能为空")
|
|
|
+ }
|
|
|
+ if (this.setting[i].contentType == 2 && (this.setting[i].imgUrl == null || this.setting[i].imgUrl == "")) {
|
|
|
+ return this.$message.error("图片不能为空")
|
|
|
+ }
|
|
|
+ if (this.setting[i].contentType == 3 && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
|
|
|
+ return this.$message.error("链接标题不能为空")
|
|
|
+ }
|
|
|
+ if (this.setting[i].contentType == 3 && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
|
|
|
+ return this.$message.error("链接描述不能为空")
|
|
|
+ }
|
|
|
+ if (this.setting[i].contentType == 3 && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
|
|
|
+ return this.$message.error("链接图片不能为空")
|
|
|
+ }
|
|
|
+ if (this.setting[i].contentType == 3 && this.setting[i].type == 1 && (this.setting[i].linkUrl == null || this.setting[i].linkUrl == "")) {
|
|
|
+ return this.$message.error("链接地址不能为空")
|
|
|
+ }
|
|
|
+ if (this.setting[i].contentType == 5 && (this.setting[i].fileUrl == null || this.setting[i].fileUrl == "")) {
|
|
|
+ return this.$message.error("文件不能为空")
|
|
|
+ }
|
|
|
+ if (this.setting[i].contentType == 6 && (this.setting[i].videoUrl == null || this.setting[i].videoUrl == "")) {
|
|
|
+ return this.$message.error("视频不能为空")
|
|
|
+ }
|
|
|
+ if (this.setting[i].contentType == 7 && (this.setting[i].value == null || this.setting[i].value == "")) {
|
|
|
+ return this.$message.error("语音不能为空")
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -658,13 +772,15 @@ export default {
|
|
|
this.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
- this.setting=[];
|
|
|
+ this.setting = [];
|
|
|
+ this.chatSetting = [];
|
|
|
});
|
|
|
} else {
|
|
|
addCourseFinishTemp(this.form).then(response => {
|
|
|
this.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
- this.setting=[];
|
|
|
+ this.setting = [];
|
|
|
+ this.chatSetting = [];
|
|
|
this.getList();
|
|
|
});
|
|
|
}
|
|
@@ -675,30 +791,32 @@ export default {
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
this.$confirm('是否确认删除完课模板编号为"' + ids + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delCourseFinishTemp(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function () {
|
|
|
+ return delCourseFinishTemp(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
const queryParams = this.queryParams;
|
|
|
this.$confirm('是否确认导出所有完课模板数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- this.exportLoading = true;
|
|
|
- return exportCourseFinishTemp(queryParams);
|
|
|
- }).then(response => {
|
|
|
- this.download(response.msg);
|
|
|
- this.exportLoading = false;
|
|
|
- }).catch(() => {});
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.exportLoading = true;
|
|
|
+ return exportCourseFinishTemp(queryParams);
|
|
|
+ }).then(response => {
|
|
|
+ this.download(response.msg);
|
|
|
+ this.exportLoading = false;
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|