This commit is contained in:
闫晓茹 2023-04-25 09:24:48 +08:00
parent 5330c1af40
commit c87c2967f9

View File

@ -16,7 +16,7 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="培训项目日期" prop="trainingItemDate"> <!-- <el-form-item label="培训项目日期" prop="trainingItemDate">
<el-date-picker <el-date-picker
clearable clearable
v-model="queryParams.trainingItemDate" v-model="queryParams.trainingItemDate"
@ -25,7 +25,7 @@
placeholder="请选择培训项目日期" placeholder="请选择培训项目日期"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item> -->
<el-form-item> <el-form-item>
<el-button <el-button
type="primary" type="primary"
@ -135,8 +135,18 @@
}} }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上架状态" align="center" prop="trainingShelfFlag">
<el-table-column <template slot-scope="scope">
<el-switch
v-model="scope.row.trainingShelfFlag"
active-color="#13ce66"
inactive-color="#ff4949"
@change="uptrainingShelfFlag(scope.row)"
>
</el-switch>
</template>
</el-table-column>
<!-- <el-table-column
label="培训项目日期" label="培训项目日期"
align="center" align="center"
prop="trainingItemDate" prop="trainingItemDate"
@ -161,7 +171,7 @@
prop="trainingItemEndTime" prop="trainingItemEndTime"
width="180" width="180"
> >
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
label="培训项目排序" label="培训项目排序"
align="center" align="center"
@ -678,13 +688,7 @@
<el-form-item <el-form-item
label="培训项目排序" label="培训项目排序"
prop="trainingItemSort" prop="trainingItemSort"
v-if="
form.trainingItemType == 'VIDEO_LEARNING' ||
form.trainingItemType == 'LIVE_COURSES' ||
form.trainingItemType == 'GRAPHIC_LEARNING' ||
form.trainingItemType == 'OFFLINE_TRAINING' ||
!form.trainingItemType
"
> >
<el-input <el-input
style="width: 250px" style="width: 250px"
@ -780,6 +784,7 @@ import {
delTrainingItem, delTrainingItem,
addTrainingItem, addTrainingItem,
updateTrainingItem, updateTrainingItem,
updateTrainingShelfFlag,
} from "@/api/system/trainingItem"; } from "@/api/system/trainingItem";
import stationAcatar from "../stationAvatar/index.vue"; import stationAcatar from "../stationAvatar/index.vue";
import editor from "@/components/Editor"; import editor from "@/components/Editor";
@ -1095,11 +1100,40 @@ export default {
console.log(imgUrl); console.log(imgUrl);
this.form.trainingItemPosterUrl = imgUrl; this.form.trainingItemPosterUrl = imgUrl;
}, },
uptrainingShelfFlag(row) {
console.log(row);
if (row.trainingShelfFlag == false) {
var obj = {
id: row.id,
trainingShelfFlag: 0,
};
} else if (row.trainingShelfFlag == true) {
var obj = {
id: row.id,
trainingShelfFlag: 1,
};
}
updateTrainingShelfFlag(obj).then((res) => {
if (obj.trainingShelfFlag == 0) {
this.$modal.msgSuccess("已修改上架状态为未上架");
} else {
this.$modal.msgSuccess("已修改上架状态为上架");
}
this.getList();
});
},
/** 查询学习培训项目信息列表 */ /** 查询学习培训项目信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listTrainingItem(this.queryParams).then((response) => { listTrainingItem(this.queryParams).then((response) => {
this.trainingItemList = response.rows; this.trainingItemList = response.rows;
response.rows.forEach((e) => {
if (e.trainingShelfFlag == 1) {
e.trainingShelfFlag = true;
} else if (e.trainingShelfFlag == 0) {
e.trainingShelfFlag = false;
}
});
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
@ -1117,7 +1151,7 @@ export default {
updatePicture(obj).then((res) => {}); updatePicture(obj).then((res) => {});
} }
// if (this.imgsurl.pictureUrlList.length > 0) { // if (this.imgsurl.pictureUrlList.length > 0) {
updatePicture(this.imgsurl).then((res) => {}); updatePicture(this.imgsurl).then((res) => {});
// } // }
this.imgsurl = { pictureUrlList: [] }; this.imgsurl = { pictureUrlList: [] };