Commit dac432f4 authored by Liu Peng's avatar Liu Peng

完成课程添加/修改回显

parent ad5bff7c
......@@ -245,10 +245,29 @@
<a-radio value="SPECIFY">
指定企业
</a-radio>
</a-radio-group>
</a-form-model-item>
<a-form-model-item
v-if="step1FormModel.allow === 'SPECIFY'"
label="指定企业"
>
<a-select
mode="multiple"
placeholder="选择企业"
v-model="step1FormModel.allowOrgIds"
@change="handleEnterpriseChange"
>
<a-select-option
v-for="(t) in this.enterprise"
:key="t.id"
:value="t.id"
>
{{ t.name }}
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-item :wrapper-col="{ span: 24 }">
<div class="btn-div">
<a-button
......@@ -296,14 +315,6 @@
<a-icon type="upload" />选择视频文件</a-button>
</a-upload>
</a-form-item>
<a-form-item>
<a-button
type="primary"
@click="authUpload"
>开始上传</a-button>
</a-form-item>
</a-form>
</a-modal>
</template>
......@@ -329,6 +340,8 @@ import {
import { fetchList as fetchTagList } from "@/api/biz/courseTag";
import { fetchList as fetchEnterprise } from "@/api/biz/enterprise";
//系列待选列表表格列定义
let seriesColumns = [
{
......@@ -388,6 +401,13 @@ export default {
}
});
fetchEnterprise({
pageIndex: 1,
pageSize: 1000,
}).then((res) => {
this.enterprise = res.data;
});
fetchTagList({
pageIndex: 1,
pageSize: 1000,
......@@ -493,6 +513,7 @@ export default {
}
};
return {
enterpriese: [],
currentSeries: {},
tags: [],
videoSeries: [],
......@@ -604,6 +625,9 @@ export default {
};
},
methods: {
handleEnterpriseChange(value) {
this.step1FormModel.allowOrgIds = value;
},
handleSeriesSearch(value) {
this.fetchSeriesData(value, (data) => {
const _items = [];
......@@ -701,7 +725,9 @@ export default {
};
if (this.currentSeries) {
course.seriesId = this.currentSeries.key;
course.seriesName = this.currentSeries.label.trim();
course.seriesName = this.currentSeries.label
? this.currentSeries.label.trim()
: this.currentSeries.label;
}
saveCourse(course).then((res) => {
......@@ -718,12 +744,18 @@ export default {
.then((res) => {
if (res.resp_code == 200) {
this.step1FormModel = { ...res.datas };
console.log(this.step1FormModel);
const _ctags = [];
this.step1FormModel.tagList.forEach((t) => {
_ctags.push(t.tagId);
});
this.step1FormModel.tags = _ctags;
const _enterprise = [];
this.step1FormModel.allowOrgList.forEach((t) => {
_enterprise.push(t.orgId);
});
this.step1FormModel.allowOrgIds = _enterprise;
this.currentSeries = {
key: this.step1FormModel.seriesId,
label: this.step1FormModel.seriesName,
......@@ -862,6 +894,7 @@ export default {
this.uploadDisabled = false;
this.pauseDisabled = true;
this.resumeDisabled = true;
this.authUpload();
},
authUpload() {
// 然后调用 startUpload 方法, 开始上传
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment