|
|
@@ -169,6 +169,14 @@
|
|
|
v-hasPermi="['course:userCourse:remove']"
|
|
|
>删除
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ v-if="scope.row.isPrivate === 1"
|
|
|
+ v-has-permi="['course:userCourse:editConfig']"
|
|
|
+ @click="configCourse(scope.row)"
|
|
|
+ >过程页配置
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -275,6 +283,69 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 过程页配置 -->
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="configDialog.dialogVisible"
|
|
|
+ title="过程页配置"
|
|
|
+ append-to-body
|
|
|
+ width="1200px"
|
|
|
+ >
|
|
|
+ <el-form :model="configDialog.form" :rules="configDialog.rules" ref="configForm" label-width="110px">
|
|
|
+ <el-form-item label="过程页图片" prop="coverImg">
|
|
|
+ <ImageUpload v-model="configDialog.form.coverImg" :height="150" :limit="1" :width="150" type="image"/>
|
|
|
+ <i class="el-icon-warning"/>
|
|
|
+ <span style="color: rgb(153, 169, 191)"> 不配置将使用课程默认图片</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="首播电视台" prop="tvEnable">
|
|
|
+ <el-switch v-model="configDialog.form.tvEnable" active-color="#13ce66"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="tv" v-if="configDialog.form.tvEnable">
|
|
|
+ <el-input v-model="configDialog.form.tv" clearable></el-input>
|
|
|
+ <i class="el-icon-warning"/>
|
|
|
+ <span style="color: rgb(153, 169, 191)"> 多个首播电视台,请用英文逗号隔开</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="网络播放平台" prop="networkEnable">
|
|
|
+ <el-switch v-model="configDialog.form.networkEnable" active-color="#13ce66"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="network" v-if="configDialog.form.networkEnable">
|
|
|
+ <el-input v-model="configDialog.form.network" clearable></el-input>
|
|
|
+ <i class="el-icon-warning"/>
|
|
|
+ <span style="color: rgb(153, 169, 191)"> 多个网络播放平台,请用英文逗号隔开</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="制作单位" prop="unitEnable">
|
|
|
+ <el-switch v-model="configDialog.form.unitEnable" active-color="#13ce66"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="unit" v-if="configDialog.form.unitEnable">
|
|
|
+ <el-input v-model="configDialog.form.unit" clearable></el-input>
|
|
|
+ <i class="el-icon-warning"/>
|
|
|
+ <span style="color: rgb(153, 169, 191)"> 多个制作单位,请用英文逗号隔开</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="专家顾问团队" prop="teamEnable">
|
|
|
+ <el-switch v-model="configDialog.form.teamEnable" active-color="#13ce66"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="team" v-if="configDialog.form.teamEnable">
|
|
|
+ <el-input v-model="configDialog.form.team" clearable></el-input>
|
|
|
+ <i class="el-icon-warning"/>
|
|
|
+ <span style="color: rgb(153, 169, 191)"> 多个专家顾问,请用英文逗号隔开</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="支持单位" prop="supportEnable">
|
|
|
+ <el-switch v-model="configDialog.form.supportEnable" active-color="#13ce66"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="support" v-if="configDialog.form.supportEnable">
|
|
|
+ <el-input v-model="configDialog.form.support" clearable></el-input>
|
|
|
+ <i class="el-icon-warning"/>
|
|
|
+ <span style="color: rgb(153, 169, 191)"> 多个支持单位,请用英文逗号隔开</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary"
|
|
|
+ :loading="configDialog.updating"
|
|
|
+ :disabled="configDialog.updating"
|
|
|
+ @click="submitConfigForm">确 定</el-button>
|
|
|
+ <el-button @click="cancelConfig">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<el-drawer
|
|
|
:with-header="false"
|
|
|
size="75%"
|
|
|
@@ -295,7 +366,8 @@ import {
|
|
|
updateIsShow,
|
|
|
copyUserCourse,
|
|
|
putOn,
|
|
|
- pullOff, updateUserCourseRedPage
|
|
|
+ pullOff, updateUserCourseRedPage,
|
|
|
+ editConfig
|
|
|
} from '@/api/course/userCourse'
|
|
|
|
|
|
import {getSelectableRange} from "@/api/qw/sopTemp";
|
|
|
@@ -445,6 +517,41 @@ export default {
|
|
|
redPacketMoney: [
|
|
|
{required: true, message: "红包金额不能为空", trigger: "blur"}
|
|
|
],
|
|
|
+ },
|
|
|
+ configDialog: {
|
|
|
+ dialogVisible: false,
|
|
|
+ updating: false,
|
|
|
+ form: {
|
|
|
+ id: null,
|
|
|
+ coverImg: null,
|
|
|
+ tvEnable: 0,
|
|
|
+ tv: null,
|
|
|
+ networkEnable: 0,
|
|
|
+ network: null,
|
|
|
+ unitEnable: 0,
|
|
|
+ unit: null,
|
|
|
+ teamEnable: 0,
|
|
|
+ team: null,
|
|
|
+ supportEnable: 0,
|
|
|
+ support: null
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ tv: [
|
|
|
+ { required: true, message: '首播电视台不能为空', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ network: [
|
|
|
+ { required: true, message: '网络播放平台不能为空', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ unit: [
|
|
|
+ { required: true, message: '制作单位不能为空', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ team: [
|
|
|
+ { required: true, message: '专家顾问团队不能为空', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ support: [
|
|
|
+ { required: true, message: '支持单位不能为空', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
@@ -802,7 +909,82 @@ export default {
|
|
|
this.msgSuccess("下架成功");
|
|
|
}).catch(function () {
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ configCourse(row) {
|
|
|
+ if (row.configJson) {
|
|
|
+ this.configDialog.form = {
|
|
|
+ tvEnable: 0,
|
|
|
+ networkEnable: 0,
|
|
|
+ unitEnable: 0,
|
|
|
+ teamEnable: 0,
|
|
|
+ supportEnable: 0,
|
|
|
+ ...JSON.parse(row.configJson)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.configDialog.form.id = row.courseId
|
|
|
+ this.configDialog.dialogVisible = true;
|
|
|
+ this.configDialog.updating = false
|
|
|
+ },
|
|
|
+ submitConfigForm() {
|
|
|
+ this.$refs['configForm'].validate(valid => {
|
|
|
+ if (!valid) {
|
|
|
+ this.msgError('请完善配置内容')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.configDialog.updating) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.configDialog.updating = true
|
|
|
+
|
|
|
+ const content = {
|
|
|
+ coverImg: this.configDialog.form.coverImg,
|
|
|
+ tvEnable: this.configDialog.form.tvEnable,
|
|
|
+ tv: this.configDialog.form.tv?.replace(",",","),
|
|
|
+ networkEnable: this.configDialog.form.networkEnable,
|
|
|
+ network: this.configDialog.form.network?.replace(",",","),
|
|
|
+ unitEnable: this.configDialog.form.unitEnable,
|
|
|
+ unit: this.configDialog.form.unit?.replace(",",","),
|
|
|
+ teamEnable: this.configDialog.form.teamEnable,
|
|
|
+ team: this.configDialog.form.team?.replace(",",","),
|
|
|
+ supportEnable: this.configDialog.form.supportEnable,
|
|
|
+ support: this.configDialog.form.support?.replace(",",","),
|
|
|
+ }
|
|
|
+
|
|
|
+ const params = {
|
|
|
+ id: this.configDialog.form.id,
|
|
|
+ configJson: JSON.stringify(content)
|
|
|
+ }
|
|
|
+
|
|
|
+ editConfig(params).then(() => {
|
|
|
+ this.msgSuccess('修改成功')
|
|
|
+ this.configDialog.dialogVisible = false;
|
|
|
+ this.getList()
|
|
|
+ }).finally(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.configDialog.updating = false
|
|
|
+ }, 500)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancelConfig() {
|
|
|
+ this.configDialog.form = {
|
|
|
+ id: null,
|
|
|
+ coverImg: null,
|
|
|
+ tvEnable: 0,
|
|
|
+ tv: null,
|
|
|
+ networkEnable: 0,
|
|
|
+ network: null,
|
|
|
+ unitEnable: 0,
|
|
|
+ unit: null,
|
|
|
+ teamEnable: 0,
|
|
|
+ team: null,
|
|
|
+ supportEnable: 0,
|
|
|
+ support: null
|
|
|
+ }
|
|
|
+ this.resetForm('configForm')
|
|
|
+ this.configDialog.dialogVisible = false;
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|