Commit dac432f4 authored by Liu Peng's avatar Liu Peng

完成课程添加/修改回显

parent ad5bff7c
...@@ -245,10 +245,29 @@ ...@@ -245,10 +245,29 @@
<a-radio value="SPECIFY"> <a-radio value="SPECIFY">
指定企业 指定企业
</a-radio> </a-radio>
</a-radio-group> </a-radio-group>
</a-form-model-item> </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 }"> <a-form-item :wrapper-col="{ span: 24 }">
<div class="btn-div"> <div class="btn-div">
<a-button <a-button
...@@ -296,14 +315,6 @@ ...@@ -296,14 +315,6 @@
<a-icon type="upload" />选择视频文件</a-button> <a-icon type="upload" />选择视频文件</a-button>
</a-upload> </a-upload>
</a-form-item> </a-form-item>
<a-form-item>
<a-button
type="primary"
@click="authUpload"
>开始上传</a-button>
</a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
</template> </template>
...@@ -329,6 +340,8 @@ import { ...@@ -329,6 +340,8 @@ import {
import { fetchList as fetchTagList } from "@/api/biz/courseTag"; import { fetchList as fetchTagList } from "@/api/biz/courseTag";
import { fetchList as fetchEnterprise } from "@/api/biz/enterprise";
//系列待选列表表格列定义 //系列待选列表表格列定义
let seriesColumns = [ let seriesColumns = [
{ {
...@@ -388,6 +401,13 @@ export default { ...@@ -388,6 +401,13 @@ export default {
} }
}); });
fetchEnterprise({
pageIndex: 1,
pageSize: 1000,
}).then((res) => {
this.enterprise = res.data;
});
fetchTagList({ fetchTagList({
pageIndex: 1, pageIndex: 1,
pageSize: 1000, pageSize: 1000,
...@@ -493,6 +513,7 @@ export default { ...@@ -493,6 +513,7 @@ export default {
} }
}; };
return { return {
enterpriese: [],
currentSeries: {}, currentSeries: {},
tags: [], tags: [],
videoSeries: [], videoSeries: [],
...@@ -604,6 +625,9 @@ export default { ...@@ -604,6 +625,9 @@ export default {
}; };
}, },
methods: { methods: {
handleEnterpriseChange(value) {
this.step1FormModel.allowOrgIds = value;
},
handleSeriesSearch(value) { handleSeriesSearch(value) {
this.fetchSeriesData(value, (data) => { this.fetchSeriesData(value, (data) => {
const _items = []; const _items = [];
...@@ -701,7 +725,9 @@ export default { ...@@ -701,7 +725,9 @@ export default {
}; };
if (this.currentSeries) { if (this.currentSeries) {
course.seriesId = this.currentSeries.key; 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) => { saveCourse(course).then((res) => {
...@@ -718,12 +744,18 @@ export default { ...@@ -718,12 +744,18 @@ export default {
.then((res) => { .then((res) => {
if (res.resp_code == 200) { if (res.resp_code == 200) {
this.step1FormModel = { ...res.datas }; this.step1FormModel = { ...res.datas };
console.log(this.step1FormModel);
const _ctags = []; const _ctags = [];
this.step1FormModel.tagList.forEach((t) => { this.step1FormModel.tagList.forEach((t) => {
_ctags.push(t.tagId); _ctags.push(t.tagId);
}); });
this.step1FormModel.tags = _ctags; this.step1FormModel.tags = _ctags;
const _enterprise = [];
this.step1FormModel.allowOrgList.forEach((t) => {
_enterprise.push(t.orgId);
});
this.step1FormModel.allowOrgIds = _enterprise;
this.currentSeries = { this.currentSeries = {
key: this.step1FormModel.seriesId, key: this.step1FormModel.seriesId,
label: this.step1FormModel.seriesName, label: this.step1FormModel.seriesName,
...@@ -862,6 +894,7 @@ export default { ...@@ -862,6 +894,7 @@ export default {
this.uploadDisabled = false; this.uploadDisabled = false;
this.pauseDisabled = true; this.pauseDisabled = true;
this.resumeDisabled = true; this.resumeDisabled = true;
this.authUpload();
}, },
authUpload() { authUpload() {
// 然后调用 startUpload 方法, 开始上传 // 然后调用 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