提交 f16572db 编写于 作者: guangjun.yang's avatar guangjun.yang

完整添加项目

上级 5af7db42
...@@ -134,6 +134,8 @@ export default { ...@@ -134,6 +134,8 @@ export default {
}) })
this.cartList.splice(delItemIndex, 1); this.cartList.splice(delItemIndex, 1);
} }
this.setCartList(this.cartList);
this.$forceUpdate();
}, },
} }
......
...@@ -21,6 +21,11 @@ ...@@ -21,6 +21,11 @@
></el-input> ></el-input>
<span class="word-num">{{(formData.projectName).replace(/\s+/g,"").length}}/24</span> <span class="word-num">{{(formData.projectName).replace(/\s+/g,"").length}}/24</span>
</el-col> </el-col>
<el-col :span="10" class="curt-position-wrapper">
<div class="curt-position">
<ShoppingCart ></ShoppingCart>
</div>
</el-col>
</el-form-item> </el-form-item>
<el-form-item label="发起机构名称:"> <el-form-item label="发起机构名称:">
...@@ -89,7 +94,30 @@ ...@@ -89,7 +94,30 @@
<p class="time-message"><i class="el-icon-warning-outline"></i>项目有效期为{{formData.expireDay}}天,选择项目起止时间须在有效期内</p> <p class="time-message"><i class="el-icon-warning-outline"></i>项目有效期为{{formData.expireDay}}天,选择项目起止时间须在有效期内</p>
</div> </div>
<div class="basic-item-icon"> <el-form-item label="列表图片:" style="margin-bottom: 10px">
<el-col :span="13" style="height:95px">
<div class="url1-selected">
<img :src="formData.attachmentUrl1" alt="">
</div>
</el-col>
<el-col :span="13" style="height:95px">
<div style="color:#666666;font-size:14px;">从模版中选择其他列表图片</div>
<ul class="url1-list">
<li
class="img-wrapper"
v-for="(item, index) in attachMap[1]"
:key="index"
@click="selectedAttachUrl(item, 1)"
>
<img class="selected-icon" :src="item.attachmentUrl" alt="">
<img class="status-icon" v-show="item.checked" src="../../../assets/custom/icon/icon-select.png" alt />
<img class="status-icon" v-show="!item.checked" src="../../../assets/custom/icon/icon-select-no.png" alt />
</li>
</ul>
</el-col>
</el-form-item>
<!-- <div class="basic-item-icon">
<span class="require">*</span> <span class="require">*</span>
<el-form-item label="列表图片:"> <el-form-item label="列表图片:">
<el-upload <el-upload
...@@ -115,21 +143,21 @@ ...@@ -115,21 +143,21 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<p class="upload-message" v-if="uploadImgMessage">请选择列表图片</p> <p class="upload-message" v-if="uploadImgMessage">请选择列表图片</p>
</div> </div> -->
<!-- @change="changeCover" -->
<el-form-item label="封面类型:"> <el-form-item label="封面类型:">
<el-radio-group <el-radio-group
size="small" size="small"
v-model="formData.type" v-model="formData.type"
@change="changeCover"
disabled disabled
> >
<el-radio :label="1">图片</el-radio> <el-radio :label="1">图片</el-radio>
<el-radio :label="2">视频</el-radio> <!-- <el-radio :label="2">视频</el-radio> -->
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<div class="basic-item-icon"> <!-- <div class="basic-item-icon">
<span class="require">*</span> <span class="require">*</span>
<el-form-item label="封面文件:"> <el-form-item label="封面文件:">
<el-upload <el-upload
...@@ -174,7 +202,30 @@ ...@@ -174,7 +202,30 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<p class="upload-message" v-if="uploadImgMessage2">请选择封面</p> <p class="upload-message" v-if="uploadImgMessage2">请选择封面</p>
</div> -->
<el-form-item label="封面文件:" style="margin-bottom: 10px">
<el-col :span="13" style="height: 95px">
<div class="url2-selected">
<img :src="formData.attachmentUrl2" alt="">
</div> </div>
</el-col>
<el-col :span="13" style="height:95px">
<div style="color:#666666;font-size:14px;">从模版中选择其他封面图片</div>
<ul class="url2-list">
<li
class="img-wrapper"
v-for="(item, index) in attachMap[2]"
:key="index"
@click="selectedAttachUrl(item, 2)"
>
<img class="selected-icon" :src="item.attachmentUrl" alt="">
<img class="status-icon" v-show="item.checked" src="../../../assets/custom/icon/icon-select.png" alt />
<img class="status-icon" v-show="!item.checked" src="../../../assets/custom/icon/icon-select-no.png" alt />
</li>
</ul>
</el-col>
</el-form-item>
<el-form-item label="项目简介:" prop="projectIntro"> <el-form-item label="项目简介:" prop="projectIntro">
<el-col :span="13"> <el-col :span="13">
...@@ -199,8 +250,10 @@ ...@@ -199,8 +250,10 @@
<script> <script>
import { doUpload, getFilePath } from "../../../utils/qiniu-util"; import { doUpload, getFilePath } from "../../../utils/qiniu-util";
import { openLoading, closeLoading } from "../../../utils/utils"; import { openLoading, closeLoading } from "../../../utils/utils";
import ShoppingCart from '@/components/education/custom/sorted-cart'
import { convertTime } from "../../../utils"; import { convertTime } from "../../../utils";
import dialog from "./dialog"; import dialog from "./dialog";
import { mapGetters } from 'vuex';
let vm = null; let vm = null;
export default { export default {
props: { props: {
...@@ -245,14 +298,13 @@ export default { ...@@ -245,14 +298,13 @@ export default {
projectBegintime: "", //模板开始时间 projectBegintime: "", //模板开始时间
projectEndtime: "", //模板结束时间 projectEndtime: "", //模板结束时间
projectIntro: "", //开放模板简介 projectIntro: "", //开放模板简介
projectType: 3, //类型 projectType: 4, //类型
type: 1, //封面类型 1图片2视频 type: 1, //封面类型 1图片2视频
projectStatus: 1, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架 projectStatus: 1, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
expireDay: 1, //模板有效期(天) expireDay: 90, //模板有效期(天)
status4Flag: 0, //0表示没有上过架,1表示上过架 status4Flag: 0, //0表示没有上过架,1表示上过架
attachmentUrl1: "", attachmentUrl1: "",
attachmentUrl2: "", attachmentUrl2: "",
attachmentUrl3: "",
attachmentMore1: { attachmentMore1: {
attachmentExt: "", attachmentExt: "",
attachmentName: "", attachmentName: "",
...@@ -351,11 +403,19 @@ export default { ...@@ -351,11 +403,19 @@ export default {
confirmMsg: '取消', confirmMsg: '取消',
hideMsg: '重新选择' hideMsg: '重新选择'
}, },
isPreview: 0 isPreview: 0,
attachMap: {
1: [],
2: []
},
} }
}, },
computed: {
...mapGetters(['cartList']),
},
components: { components: {
dialogComponet:dialog dialogComponet:dialog,
ShoppingCart
}, },
created() { created() {
vm = this; vm = this;
...@@ -371,36 +431,88 @@ export default { ...@@ -371,36 +431,88 @@ export default {
} }
}, },
methods: { methods: {
// 选择列表或封面图片
selectedAttachUrl(item, index) {
this.attachMap[index].forEach( attach => {
if(item.attachmentUrl == attach.attachmentUrl) {
attach.checked = true;
} else {
attach.checked = false;
}
})
vm.formData['attachmentUrl' + index] = item.attachmentUrl;
vm.$forceUpdate();
console.log(this.attachMap);
},
// 设置已有的基本信息 // 设置已有的基本信息
setBaseMessage(data) { setBaseMessage(data) {
data.projectData.projectBegintime = convertTime(data.projectData.projectBegintime); // data.projectData.projectBegintime = convertTime(data.projectData.projectBegintime);
data.projectData.projectEndtime = convertTime(data.projectData.projectEndtime); // data.projectData.projectEndtime = convertTime(data.projectData.projectEndtime);
vm.formData = Object.assign(vm.formData, data.projectData); // vm.formData = Object.assign(vm.formData, data.projectData);
vm.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl; // vm.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl;
vm.formData.attachmentMore1 = Object.assign(vm.formData.attachmentMore1, data.attachmentData[0]); // vm.formData.attachmentMore1 = Object.assign(vm.formData.attachmentMore1, data.attachmentData[0]);
// 暂存为1 下一步为3 // 暂存为1 下一步为3
vm.formData.projectType = vm.formData.projectType == 0 ? 3 : vm.formData.projectType; vm.formData.projectType = vm.formData.projectType == 0 ? 4 : vm.formData.projectType;
vm.formData.projectBegintime = vm.formData.projectBegintime ? new Date(vm.formData.projectBegintime) : ''; vm.formData.projectBegintime = vm.formData.projectBegintime ? new Date(vm.formData.projectBegintime) : '';
vm.formData.projectEndtime = vm.formData.projectBegintime ? new Date(vm.formData.projectEndtime) : ''; vm.formData.projectEndtime = vm.formData.projectBegintime ? new Date(vm.formData.projectEndtime) : '';
if (data.attachmentData[1]) { // if (data.attachmentData[1]) {
vm.formData.attachmentUrl2 = data.attachmentData[1].attachmentUrl; // vm.formData.attachmentUrl2 = data.attachmentData[1].attachmentUrl;
vm.formData.type = data.attachmentData[1].attachmentType; // vm.formData.type = data.attachmentData[1].attachmentType;
vm.formData.attachmentMore2 = Object.assign(vm.formData.attachmentMore2, data.attachmentData[1]); // vm.formData.attachmentMore2 = Object.assign(vm.formData.attachmentMore2, data.attachmentData[1]);
} // }
vm.$emit('setStatus4Flag',data.projectData.status4Flag)
// 不知道是否要使用
// vm.$emit('setStatus4Flag',data.projectData.status4Flag)
}, },
// 获取选择模板后的基本信息
// // 设置已有的基本信息
// setBaseMessage(data) {
// data.projectData.projectBegintime = convertTime(data.projectData.projectBegintime);
// data.projectData.projectEndtime = convertTime(data.projectData.projectEndtime);
// vm.formData = Object.assign(vm.formData, data.projectData);
// vm.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl;
// vm.formData.attachmentMore1 = Object.assign(vm.formData.attachmentMore1, data.attachmentData[0]);
// // 暂存为1 下一步为3
// vm.formData.projectType = vm.formData.projectType == 0 ? 3 : vm.formData.projectType;
// vm.formData.projectBegintime = vm.formData.projectBegintime ? new Date(vm.formData.projectBegintime) : '';
// vm.formData.projectEndtime = vm.formData.projectBegintime ? new Date(vm.formData.projectEndtime) : '';
// if (data.attachmentData[1]) {
// vm.formData.attachmentUrl2 = data.attachmentData[1].attachmentUrl;
// vm.formData.type = data.attachmentData[1].attachmentType;
// vm.formData.attachmentMore2 = Object.assign(vm.formData.attachmentMore2, data.attachmentData[1]);
// }
// vm.$emit('setStatus4Flag',data.projectData.status4Flag)
// },
// 创建时,获取机构信息、列表图片等
getMessage() { getMessage() {
openLoading(vm); openLoading(vm);
vm.GET(`portal/openTemplateProject/getOpenTemplateInfoForCreate/${vm.openTemplateId}`) vm.GET(`portal/portalInfo/sass/attach`, {typeList: [1,2]})
.then(res => { .then(res => {
closeLoading(vm); closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
let data = res.data;
data.projectData.organizationNameList = [data.projectData.creatorOrganizationName] this.attachMap = res.data.attachMap;
this.$emit('hideSave',res.data.projectData.projectStatus) this.attachMap[1].forEach(item => {
vm.setBaseMessage(res.data); item.checked = false;
});
this.attachMap[2].forEach(item => {
item.checked = false;
});
this.formData.attachmentUrl1 = this.attachMap[1][0].attachmentUrl;
this.formData.attachmentUrl2 = this.attachMap[2][0].attachmentUrl;
this.formData.creatorOrganizationName = res.data.creatorOrganizationName || '';
this.attachMap[1][0].checked = true;
this.attachMap[2][0].checked = true;
console.log('this.attachMap', this.attachMap);
// let data = res.data;
// data.projectData.organizationNameList = [data.projectData.creatorOrganizationName]
// this.$emit('hideSave',res.data.projectData.projectStatus)
// vm.setBaseMessage(res.data);
} else { } else {
vm.$message.info(res.message); vm.$message.info(res.message);
} }
...@@ -410,14 +522,37 @@ export default { ...@@ -410,14 +522,37 @@ export default {
vm.$message.warning('请稍后重试'); vm.$message.warning('请稍后重试');
}); });
}, },
// 获取选择模板后的基本信息
// getMessage() {
// openLoading(vm);
// vm.GET(`portal/openTemplateProject/getOpenTemplateInfoForCreate/${vm.openTemplateId}`)
// .then(res => {
// closeLoading(vm);
// if (res.code == "000000") {
// let data = res.data;
// data.projectData.organizationNameList = [data.projectData.creatorOrganizationName]
// this.$emit('hideSave',res.data.projectData.projectStatus)
// vm.setBaseMessage(res.data);
// } else {
// vm.$message.info(res.message);
// }
// })
// .catch((err) => {
// closeLoading(vm);
// vm.$message.warning('请稍后重试');
// });
// },
// 获取编辑时的信息 // 获取编辑时的信息
getEditorMessage() { getEditorMessage() {
openLoading(vm); openLoading(vm);
vm.GET(`portal/portalInfo/getProjectInfo/${vm.projectId}`) // vm.GET(`portal/portalInfo/getProjectInfo/${vm.projectId}`)
vm.GET(`portal/portalCustom/getInfo/${vm.projectId}`)
.then(res => { .then(res => {
closeLoading(vm); closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
this.$emit('hideSave',res.data.projectData.projectStatus) // this.$emit('hideSave',res.data.projectData.projectStatus)
vm.setBaseMessage(res.data) vm.setBaseMessage(res.data)
} else { } else {
vm.$message.info(res.message); vm.$message.info(res.message);
...@@ -428,20 +563,24 @@ export default { ...@@ -428,20 +563,24 @@ export default {
vm.$message.warning('请稍后重试'); vm.$message.warning('请稍后重试');
}); });
}, },
// 增加发起机构 // 增加发起机构
plusOrg(index) { plusOrg(index) {
vm.formData.organizationNameList.splice(index + 1, 0, ''); vm.formData.organizationNameList.splice(index + 1, 0, '');
}, },
// 删除发起机构 // 删除发起机构
deleteOrg(index) { deleteOrg(index) {
vm.formData.organizationNameList.splice(index, 1); vm.formData.organizationNameList.splice(index, 1);
}, },
// 机构名称输入 // 机构名称输入
changeOrganizationName() { changeOrganizationName() {
let textLength = vm.formData.organizationName.length; let textLength = vm.formData.organizationName.length;
// 机构输入提示显示与否 // 机构输入提示显示与否
vm.visibleName = textLength == 0; vm.visibleName = textLength == 0;
}, },
// 离开机构名称焦点 // 离开机构名称焦点
blurName() { blurName() {
vm.visibleName = false; vm.visibleName = false;
...@@ -449,6 +588,7 @@ export default { ...@@ -449,6 +588,7 @@ export default {
vm.submitForm("formData"); vm.submitForm("formData");
}, 200); }, 200);
}, },
// 机构名称聚焦 // 机构名称聚焦
focusName(index) { focusName(index) {
let textLength = vm.formData.organizationNameList[index].length; let textLength = vm.formData.organizationNameList[index].length;
...@@ -459,140 +599,148 @@ export default { ...@@ -459,140 +599,148 @@ export default {
vm.visibleName = false; vm.visibleName = false;
} }
}, },
// 机构选择默认值 // 机构选择默认值
checkDefault() { checkDefault() {
vm.organizationContent = vm.formData.creatorOrganizationName; vm.organizationContent = vm.formData.creatorOrganizationName;
vm.formData.organizationNameList.splice(vm.orgListIndex-1, 1, vm.organizationContent); vm.formData.organizationNameList.splice(vm.orgListIndex-1, 1, vm.organizationContent);
vm.visibleName = false; vm.visibleName = false;
}, },
//上传列表图片 //上传列表图片
beforeUploadListPic(file) { // beforeUploadListPic(file) {
let fileLimit = { // let fileLimit = {
width: 230, // width: 230,
height: 172, // height: 172,
size: 0.5, // size: 0.5,
sizeText: "500K", // sizeText: "500K",
key: "attachmentUrl1", // key: "attachmentUrl1",
more: "attachmentMore1", // more: "attachmentMore1",
show: "uploadImgMessage" // show: "uploadImgMessage"
}; // };
vm.beforeAvatarUpload(file, fileLimit); // vm.beforeAvatarUpload(file, fileLimit);
}, // },
//上传图片校验 //上传图片校验
beforeAvatarUpload(file, fileLimit) { // beforeAvatarUpload(file, fileLimit) {
const isJPG = file.type === "image/jpeg"; // const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png"; // const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size; // const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (!isJPG && !isPNG) { // if (!isJPG && !isPNG) {
vm.$message.error("图片不符合规范,请根据规范上传图片"); // vm.$message.error("图片不符合规范,请根据规范上传图片");
return; // return;
} // }
if (!isLt2M) { // if (!isLt2M) {
vm.$message.error("图片不符合规范,请根据规范上传图片 "); // vm.$message.error("图片不符合规范,请根据规范上传图片 ");
return; // return;
} // }
let _img = new FileReader(); // let _img = new FileReader();
_img.readAsDataURL(file); // _img.readAsDataURL(file);
_img.onload = function(theFile) { // _img.onload = function(theFile) {
let image = new Image(); // let image = new Image();
image.src = theFile.target.result; // image.src = theFile.target.result;
image.onload = function() { // image.onload = function() {
let _vm = this; // let _vm = this;
if ( // if (
_vm.width != fileLimit.width || // _vm.width != fileLimit.width ||
_vm.height != fileLimit.height // _vm.height != fileLimit.height
) { // ) {
vm.$message.error("图片不符合规范,请根据规范上传图片"); // vm.$message.error("图片不符合规范,请根据规范上传图片");
} else { // } else {
openLoading(vm); // openLoading(vm);
doUpload( // doUpload(
vm, // vm,
file, // file,
getFilePath(file, null), // getFilePath(file, null),
"preview4", // "preview4",
"progress1", // "progress1",
1 // 1
).then(function(path) { // ).then(function(path) {
closeLoading(vm); // closeLoading(vm);
console.log(path); // console.log(path);
if (fileLimit.show == "uploadImgMessage") { // if (fileLimit.show == "uploadImgMessage") {
vm.uploadImgMessage = false; // vm.uploadImgMessage = false;
} else if (fileLimit.show == "uploadImgMessage2") { // } else if (fileLimit.show == "uploadImgMessage2") {
vm.uploadImgMessage2 = false; // vm.uploadImgMessage2 = false;
} // }
vm.formData[fileLimit.key] = path.fullPath; // vm.formData[fileLimit.key] = path.fullPath;
vm.formData[fileLimit.more] = { // vm.formData[fileLimit.more] = {
attachmentName: path.name, // attachmentName: path.name,
attachmentExt: path.ext, // attachmentExt: path.ext,
attachmentSize: path.size // attachmentSize: path.size
}; // };
vm.$message.success("上传成功"); // vm.$message.success("上传成功");
}); // });
} // }
}; // };
}; // };
return isJPG && isLt2M; // return isJPG && isLt2M;
}, // },
// 删除图片
deleteImg(type) { // // 删除图片
if (type == 1) { // deleteImg(type) {
vm.formData.attachmentUrl1 = ""; // if (type == 1) {
vm.imgMouseOver = false; // vm.formData.attachmentUrl1 = "";
} else { // vm.imgMouseOver = false;
vm.formData.attachmentUrl2 = ""; // } else {
vm.imgMouseOver2 = false; // vm.formData.attachmentUrl2 = "";
} // vm.imgMouseOver2 = false;
}, // }
//改变封面类型 // },
changeCover(radio) {
vm.formData.attachmentUrl2 = ""; // //改变封面类型
}, // changeCover(radio) {
//上传封面图片 // vm.formData.attachmentUrl2 = "";
beforeUploadCoverPic(file) { // },
let fileLimit = {
width: 750, // //上传封面图片
height: 420, // beforeUploadCoverPic(file) {
size: 2, // let fileLimit = {
sizeText: "2.0M", // width: 750,
key: "attachmentUrl2", // height: 420,
more: "attachmentMore2", // size: 2,
show: "uploadImgMessage2" // sizeText: "2.0M",
}; // key: "attachmentUrl2",
if (vm.formData.type == 1) { // more: "attachmentMore2",
vm.beforeAvatarUpload(file, fileLimit); // show: "uploadImgMessage2"
} else { // };
vm.beforeUploadMp4(file); // if (vm.formData.type == 1) {
} // vm.beforeAvatarUpload(file, fileLimit);
}, // } else {
//上传mp4 // vm.beforeUploadMp4(file);
beforeUploadMp4(file) { // }
console.log(file); // },
const isMP4 = file.type === "video/mp4";
const isLt = file.size / 1024 / 1024 < 500; // //上传mp4
if (!isLt) { // beforeUploadMp4(file) {
vm.$message.error("视频不符合规范,请根据规范上传视频"); // console.log(file);
return; // const isMP4 = file.type === "video/mp4";
} // const isLt = file.size / 1024 / 1024 < 500;
if (!isMP4) { // if (!isLt) {
vm.$message.error("视频不符合规范,请根据规范上传视频"); // vm.$message.error("视频不符合规范,请根据规范上传视频");
} else { // return;
openLoading(vm); // }
doUpload( // if (!isMP4) {
vm, // vm.$message.error("视频不符合规范,请根据规范上传视频");
file, // } else {
getFilePath(file, null), // openLoading(vm);
"preview4", // doUpload(
"progress1", // vm,
"" // file,
).then(function(path) { // getFilePath(file, null),
closeLoading(vm); // "preview4",
console.log(path); // "progress1",
vm.uploadImgMessage2 = false; // ""
vm.formData.attachmentUrl2 = path.fullPath; // ).then(function(path) {
vm.$message.success("上传成功"); // closeLoading(vm);
}); // console.log(path);
} // vm.uploadImgMessage2 = false;
}, // vm.formData.attachmentUrl2 = path.fullPath;
// vm.$message.success("上传成功");
// });
// }
// },
// 点击下一步 // 点击下一步
nextStep() { nextStep() {
let flag = true; let flag = true;
...@@ -612,6 +760,7 @@ export default { ...@@ -612,6 +760,7 @@ export default {
vm.insertOrupdate(); vm.insertOrupdate();
} }
}, },
// 暂存 // 暂存
save() { save() {
if (vm.$refs['formData'].projectName == '') { if (vm.$refs['formData'].projectName == '') {
...@@ -620,6 +769,7 @@ export default { ...@@ -620,6 +769,7 @@ export default {
vm.insertOrupdate(1); vm.insertOrupdate(1);
}; };
}, },
// 新增或者更新基本信息 // 新增或者更新基本信息
insertOrupdate(status) { insertOrupdate(status) {
...@@ -652,8 +802,10 @@ export default { ...@@ -652,8 +802,10 @@ export default {
baseobj.attachmentModel = JSON.stringify(vm.attachmentModel); baseobj.attachmentModel = JSON.stringify(vm.attachmentModel);
baseobj.attachmentPDFModel= null; baseobj.attachmentPDFModel= null;
baseobj.notifyData= null; baseobj.notifyData= null;
baseobj.hotCourseForPortalModelList = vm.cartList;
console.log(baseobj);
openLoading(vm); openLoading(vm);
vm.POST("portal/portalInfo/insertOrUpdate", baseobj) vm.POST("portal/portalCustom/insertOrUpdate", baseobj)
.then(res => { .then(res => {
closeLoading(vm); closeLoading(vm);
if (res.code == "000000") { if (res.code == "000000") {
...@@ -837,4 +989,78 @@ export default { ...@@ -837,4 +989,78 @@ export default {
margin: -6px 0 20px 150px; margin: -6px 0 20px 150px;
font-size: 14px; font-size: 14px;
} }
.url1-selected {
img {
widows: 120px;
height: 90px;
}
}
.url1-list {
display: flex;
flex-direction: row;
.img-wrapper {
position: relative;
top: 0;
left: 0;
z-index: 1;
.selected-icon {
width: 60px;
height: 45px;
margin-right: 10px;
}
.status-icon {
position: absolute;
top: 5px;
right: 15px;
z-index: 2;
widows: 14px;
height: 14px;
}
}
}
.url2-selected {
img {
width: 160px;
height: 90px;
}
}
.url2-list {
display: flex;
flex-direction: row;
.img-wrapper {
position: relative;
top: 0;
left: 0;
z-index: 1;
.selected-icon {
width: 80px;
height: 45px;
margin-right: 10px;
}
.status-icon {
position: absolute;
top: 5px;
right: 15px;
z-index: 2;
widows: 14px;
height: 14px;
}
}
}
.curt-position-wrapper {
position: relative;
top: 0;
left: 0;
z-index: 100;
.curt-position {
position: absolute;
top: 0;
left: 0;
z-index: 101;
}
}
</style> </style>
\ No newline at end of file
<template>
<div class="sorted-cart-wrapper">
<div class="cart-header">
<span class="title">已选项目课程(共{{this.cartList.length}}节)</span>
<span class="sub">可上下拖拽课程行,调整课程在列表页的展示顺序</span>
</div>
<!-- <draggable v-model="myArray" class="cart-list"> -->
<draggable class="cart-list" v-model="cartList">
<div class="cart-course" v-for="item in cartList" :key="item.courseId">
<div class="img">
<img src="../../../assets/custom/test.png" alt />
<span class="level">{{item.typeStr}}</span>
</div>
<div class="detail">
<span class="title">{{item.courseName | shortName}}</span>
<div class="chapter">
<span>{{item.docName}}</span>
<span class="section-num">{{item.chapterSum}}{{item.lectureNum}}{{item.totalTime}}</span>
</div>
</div>
<div class="handler">
<img src="../../../assets/custom/icon/icon-handle.png" alt />
</div>
</div>
</draggable>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import draggable from "vuedraggable";
export default {
data() {
return {};
},
computed: {
// ...mapGetters(["cartList"]),
cartList: {
get() {
console.log('get()');
return this.$store.state.customStore.cartList;
},
set(value) {
console.log('set(value)', value);
this.$store.dispatch("setCartList", value);
}
}
},
components: {
draggable
},
methods: {}
};
</script>
<style lang="less" scoped>
.sorted-cart-wrapper {
font-family: PingFang SC !important;
width: 440px;
height: 790px;
background: #fff;
box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.15);
border-radius: 4px;
.cart-header {
display: flex;
flex-direction: column;
height: 70px;
padding: 0 15px;
background: #f9f9f9;
.title {
padding: 15px 0 28px 0;
height: 18px;
line-height: 18px;
font-size: 18px;
font-weight: 700;
color: #000000;
}
.sub {
height: 14px;
line-height: 14px;
font-size: 14px;
font-weight: 400;
color: #999999;
}
}
.cart-list {
display: flex;
flex-direction: column;
justify-content: flex-start;
height: 710px;
overflow: auto;
.cart-course {
cursor: pointer;
user-select: none;
position: relative;
display: flex;
flex-direction: row;
width: 410px;
margin: 15px;
align-items: center;
border-radius: 4px;
&::after {
position: absolute;
left: 0;
bottom: -15px;
z-index: 1;
content: "";
width: 410px;
height: 1px;
background: #e4e7ed;
}
.img {
position: relative;
top: 0;
left: 0;
width: 120;
height: 68px;
margin-right: 15px;
img {
width: 120;
height: 68px;
border-radius: 4px;
}
.level {
position: absolute;
top: 0;
left: 0;
width: 44px;
height: 22px;
line-height: 22px;
text-align: center;
font-size: 14px;
font-weight: 500;
color: #fff;
background: rgba(0, 0, 0, 0.5);
border-radius: 4px 0px 4px 0px;
}
}
.detail {
position: relative;
display: flex;
flex-direction: column;
flex: 1;
height: 60px;
.title {
position: relative;
top: -5px;
left: 0;
font-size: 16px;
line-height: 20px;
font-weight: 600;
color: #373839;
}
.chapter {
position: absolute;
bottom: -16px;
left: 0;
font-size: 14px;
font-weight: 400;
color: #999999;
.section-num::before,
.exam-num::before {
content: "";
position: relative;
top: 2.5px;
left: 0;
display: inline-block;
height: 14px;
line-height: 14px;
margin: 0 10px;
width: 1px;
background: #999999;
}
}
}
.handler {
width: 35px;
img {
cursor: pointer;
width: 20px;
height: 20px;
float: right;
}
}
}
}
}
</style>
\ No newline at end of file
...@@ -54,7 +54,7 @@ service.interceptors.request.use(config => { ...@@ -54,7 +54,7 @@ service.interceptors.request.use(config => {
} }
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境 if( process.env.BUILD_ENV == "development" ){ // 本地开发环境
// console.log('环境变量>>>> ', process.env.BUILD_ENV); // console.log('环境变量>>>> ', process.env.BUILD_ENV);
config.headers['token'] = '073861ABE10245C78D705B90A76939DC'; config.headers['token'] = '19CD6690D41D44148F53BECB7CA86B6F';
// config.headers['token'] = localStorage.getItem('storageToken') // config.headers['token'] = localStorage.getItem('storageToken')
}else{ }else{
config.headers['token'] = localStorage.getItem('storageToken') config.headers['token'] = localStorage.getItem('storageToken')
......
...@@ -61,15 +61,6 @@ ...@@ -61,15 +61,6 @@
<dialog-componet :dialogObj="dialogObj" @hide="hide"></dialog-componet> <dialog-componet :dialogObj="dialogObj" @hide="hide"></dialog-componet>
<dialog-componet :dialogObj="sendObj" @hide="hidefn" @confirm="confirmFn"></dialog-componet> <dialog-componet :dialogObj="sendObj" @hide="hidefn" @confirm="confirmFn"></dialog-componet>
<!-- <draggable v-model="myArray">
<transition-group>
<div v-for="element in myArray" :key="element.id">
{{element.name}}
</div>
</transition-group>
</draggable> -->
</div> </div>
</template> </template>
...@@ -83,7 +74,6 @@ import setOrganization from "@/components/education/template/setOrganization"; ...@@ -83,7 +74,6 @@ import setOrganization from "@/components/education/template/setOrganization";
import SelectCourseComp from "@/components/education/custom/select-course-comp"; import SelectCourseComp from "@/components/education/custom/select-course-comp";
import dialog from "@/components/education/template/dialog"; import dialog from "@/components/education/template/dialog";
import { openLoading, closeLoading, resizeHeight } from "@/utils/utils"; import { openLoading, closeLoading, resizeHeight } from "@/utils/utils";
import draggable from 'vuedraggable'
import { mapGetters, mapActions } from 'vuex' import { mapGetters, mapActions } from 'vuex'
let vm = null; let vm = null;
...@@ -148,7 +138,7 @@ export default { ...@@ -148,7 +138,7 @@ export default {
}, },
status_21: { status_21: {
title: '该项目创建数量已上限', title: '该项目创建数量已上限',
message: '本年度免费创建数已达4次,不能继续创建该项目', message: '本年度免费创建数已达20次,不能继续创建该项目',
hideMsg: '确定' hideMsg: '确定'
} }
}, },
...@@ -163,10 +153,11 @@ export default { ...@@ -163,10 +153,11 @@ export default {
projectStatus: 1, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架 projectStatus: 1, //1.草稿 2.未上架 3.审核中/待审核 4.已上架 5.已下架 6.已拒绝/未上架
status4Flag: 0, //0表示没有上过架,1表示上过架 status4Flag: 0, //0表示没有上过架,1表示上过架
isPreview: 0, // 1表示是查看信息 isPreview: 0, // 1表示是查看信息
maxLimitCreatedCustomProjectCountInYearz: 20, // 同一个用户每年能够创建的项目数
} }
}, },
computed: { computed: {
...mapGetters(['searchParam']) ...mapGetters(['searchParam', 'cartList'])
}, },
watch: { watch: {
searchParam: { searchParam: {
...@@ -174,6 +165,9 @@ export default { ...@@ -174,6 +165,9 @@ export default {
this.getCourseList(val); this.getCourseList(val);
}, },
deep: true deep: true
},
cartList(val) {
this.canNext = val.length > 0;
} }
}, },
components: { components: {
...@@ -184,7 +178,6 @@ export default { ...@@ -184,7 +178,6 @@ export default {
setOrganization, setOrganization,
dialogComponet:dialog, dialogComponet:dialog,
SelectCourseComp, SelectCourseComp,
draggable
}, },
created() { created() {
vm = this; vm = this;
...@@ -199,7 +192,7 @@ export default { ...@@ -199,7 +192,7 @@ export default {
methods: { methods: {
...mapActions(['setCourseList', 'setAllLabelList', 'setSubLabelList']), ...mapActions(['setCourseList', 'setAllLabelList', 'setSubLabelList']),
getLabelList() { getLabelList() {
vm.GET("/contents/diseases/labelList", {}).then(res => { vm.GET("contents/diseases/labelList", {}).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
// 先将所有的标签添加checked字段 // 先将所有的标签添加checked字段
let labelList = res.data; let labelList = res.data;
...@@ -235,15 +228,7 @@ export default { ...@@ -235,15 +228,7 @@ export default {
// (根据条件)查询课程 // (根据条件)查询课程
getCourseList(searchParam) { getCourseList(searchParam) {
// let param = { vm.GET("contents/diseases/courseListForPortal", searchParam).then(res => {
// orderBy: 2,
// grade: 0,
// pageNo: 1,
// pageSize: 10,
// orderBy: 2,
// labelIdList: [441, 442]
// }
vm.GET("/contents/diseases/courseListForPortal", searchParam).then(res => {
if (res.code == "000000") { if (res.code == "000000") {
let courseList = res.data; let courseList = res.data;
courseList.list.forEach( (item) => { courseList.list.forEach( (item) => {
...@@ -274,7 +259,8 @@ export default { ...@@ -274,7 +259,8 @@ export default {
// 按钮点击下一步 // 按钮点击下一步
nextStep() { nextStep() {
if (vm.active == 0) { if (vm.active == 0) {
vm.checkSelectTemplate() vm.checkSelectCustomCourse()
// vm.checkSelectTemplate()
return; return;
} }
if (vm.active == 1) { if (vm.active == 1) {
...@@ -369,6 +355,7 @@ export default { ...@@ -369,6 +355,7 @@ export default {
if (vm.$route.query.pageNum) { if (vm.$route.query.pageNum) {
query = { pageNum: vm.$route.query.pageNum }; query = { pageNum: vm.$route.query.pageNum };
} }
console.log('vm.$router.push')
vm.$router.push({ path: "edit-custom", query: query }); vm.$router.push({ path: "edit-custom", query: query });
} else { } else {
vm.$message({ vm.$message({
...@@ -396,6 +383,32 @@ export default { ...@@ -396,6 +383,32 @@ export default {
vm.openTemplateId = id; vm.openTemplateId = id;
}, },
//选中自定义课程后点击下一步时检测(机构和进行中的项目)
checkSelectCustomCourse() {
openLoading(vm);
vm.GET(`portal/portalCustom/checkBeforeCreateCustomProject`)
.then(res => {
closeLoading(vm);
if (res.code == "000000") {
if (res.data.status == 0) {
vm.maxLimitCreatedCustomProjectCountInYear = res.data.maxLimitCreatedCustomProjectCountInYear;
vm.active = 1;
return;
} else {
vm.dialogObj = Object.assign(vm.dialogObj, vm.statusObj[`status_${res.data.status}`]);
vm.dialogObj.visible = true;
return;
}
} else {
vm.$message.info(res.message);
}
})
.catch((err) => {
closeLoading(vm);
vm.$message.warning('请稍后重试');
});
},
//选中模板后点击下一步时检测(机构和进行中的项目) //选中模板后点击下一步时检测(机构和进行中的项目)
checkSelectTemplate() { checkSelectTemplate() {
openLoading(vm); openLoading(vm);
......
...@@ -31,8 +31,7 @@ ...@@ -31,8 +31,7 @@
placeholder="请选择开始时间" placeholder="请选择开始时间"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions0" :picker-options="pickerOptions0"
></el-date-picker> ></el-date-picker>~
~
<el-date-picker <el-date-picker
v-model="formInline.projectEndtime" v-model="formInline.projectEndtime"
size="small" size="small"
...@@ -56,7 +55,7 @@ ...@@ -56,7 +55,7 @@
default-time="23:59:59" default-time="23:59:59"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
</el-col> --> </el-col>-->
<el-col :span="4" style="padding:0;text-align:right;padding-right:15px;"> <el-col :span="4" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small" @click="searchList">查询</el-button> <el-button type="primary" size="small" @click="searchList">查询</el-button>
<el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button> <el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button>
...@@ -81,7 +80,12 @@ ...@@ -81,7 +80,12 @@
</el-row> </el-row>
<el-form v-if="isRoleOfOuter" :model="formInline" class="demo-form-inline"> <el-form v-if="isRoleOfOuter" :model="formInline" class="demo-form-inline">
<el-form-item> <el-form-item>
<el-button class="add-button" size="small" type="primary" @click="toEditCustomPage()">创建自定义项目</el-button> <el-button
class="add-button"
size="small"
type="primary"
@click="toEditCustomPage()"
>创建自定义项目</el-button>
<el-button class="add-button" size="small" type="primary" @click="openProject()">新建项目</el-button> <el-button class="add-button" size="small" type="primary" @click="openProject()">新建项目</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -89,9 +93,12 @@ ...@@ -89,9 +93,12 @@
<el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column> <el-table-column prop="id" label="ID编号" min-width="100" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" min-width="100" align="center"> <el-table-column prop="projectName" label="项目名称" min-width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span @click="previewTemplate(scope.row, 1)" style="color:rgb(2, 130, 132);cursor:pointer;" <span
@click="previewTemplate(scope.row, 1)"
style="color:rgb(2, 130, 132);cursor:pointer;"
v-if="scope.row.projectType == 3 v-if="scope.row.projectType == 3
&& (scope.row.level == 'L1' || scope.row.level == 'L2') ">{{scope.row.projectName}}</span> && (scope.row.level == 'L1' || scope.row.level == 'L2') "
>{{scope.row.projectName}}</span>
<span v-else>{{scope.row.projectName}}</span> <span v-else>{{scope.row.projectName}}</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -105,7 +112,7 @@ ...@@ -105,7 +112,7 @@
align="center" align="center"
min-width="100" min-width="100"
show-overflow-tooltip show-overflow-tooltip
></el-table-column> --> ></el-table-column>-->
<el-table-column prop="projectBegintime" label="项目开始时间" min-width="90" align="center"></el-table-column> <el-table-column prop="projectBegintime" label="项目开始时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectEndtime" label="项目结束时间" min-width="90" align="center"></el-table-column> <el-table-column prop="projectEndtime" label="项目结束时间" min-width="90" align="center"></el-table-column>
<el-table-column prop="projectStatus" label="状态" align="center"> <el-table-column prop="projectStatus" label="状态" align="center">
...@@ -196,16 +203,12 @@ ...@@ -196,16 +203,12 @@
type="primary" type="primary"
size="small" size="small"
>发送通知</el-button> >发送通知</el-button>
<el-button <el-button @click="reviewReport(scope.row)" type="primary" size="small">查看学情报告</el-button>
@click="reviewReport(scope.row)"
type="primary"
size="small"
>查看学情报告</el-button>
</template> </template>
</el-table-column> </el-table-column>
<div slot="empty"> <div slot="empty">
<div class="table-empty"> <div class="table-empty">
<img src="../../assets/image/no-content1.png"> <img src="../../assets/image/no-content1.png" />
<p>没有查询到相关结果</p> <p>没有查询到相关结果</p>
</div> </div>
</div> </div>
...@@ -228,7 +231,8 @@ ...@@ -228,7 +231,8 @@
:visible.sync="firstCheckVisible" :visible.sync="firstCheckVisible"
width="600px" width="600px"
:close-on-click-modal="false" :close-on-click-modal="false"
center> center
>
<span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》初审结果为?` }}</span> <span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》初审结果为?` }}</span>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleCheckLeft">通 过</el-button> <el-button type="primary" @click="handleCheckLeft">通 过</el-button>
...@@ -243,7 +247,8 @@ ...@@ -243,7 +247,8 @@
width="600px" width="600px"
:close-on-click-modal="false" :close-on-click-modal="false"
@close="handleTypeClose" @close="handleTypeClose"
center> center
>
<span style="margin: 0 20px;">项目类型:</span> <span style="margin: 0 20px;">项目类型:</span>
<el-radio-group v-model="newProjectType"> <el-radio-group v-model="newProjectType">
<el-radio :label="1">普通项目</el-radio> <el-radio :label="1">普通项目</el-radio>
...@@ -262,7 +267,8 @@ ...@@ -262,7 +267,8 @@
:visible.sync="secondCheckVisible" :visible.sync="secondCheckVisible"
width="600px" width="600px"
:close-on-click-modal="false" :close-on-click-modal="false"
center> center
>
<span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》复审结果为?` }}</span> <span style="margin: 0 20px;">{{ `项目《${currentRow.projectName}》复审结果为?` }}</span>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleCheckLeft">通 过</el-button> <el-button type="primary" @click="handleCheckLeft">通 过</el-button>
...@@ -272,11 +278,12 @@ ...@@ -272,11 +278,12 @@
<!-- 删除 弹窗 --> <!-- 删除 弹窗 -->
<el-dialog <el-dialog
title="确认删除" title="确认删除"
:show-close=false :show-close="false"
:visible.sync="deleteVisible" :visible.sync="deleteVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
width="600px" width="600px"
center> center
>
<p style="text-align: center;">删除后将不可撤销,确认删除吗?</p> <p style="text-align: center;">删除后将不可撤销,确认删除吗?</p>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="confirmDelete">删 除</el-button> <el-button @click="confirmDelete">删 除</el-button>
...@@ -287,29 +294,29 @@ ...@@ -287,29 +294,29 @@
<!-- 修改状态 --> <!-- 修改状态 -->
<el-dialog <el-dialog
:title="changeStatusConfig.title" :title="changeStatusConfig.title"
:show-close=false :show-close="false"
:visible.sync="changeStatusVisible" :visible.sync="changeStatusVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
width="600px" width="600px"
center> center
>
<p style="text-align: center;">{{changeStatusConfig.message}}</p> <p style="text-align: center;">{{changeStatusConfig.message}}</p>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="changeStatusVisible=false">取 消</el-button> <el-button @click="changeStatusVisible=false">取 消</el-button>
<el-button type="primary" @click="changeStatusPre">确 认</el-button> <el-button type="primary" @click="changeStatusPre">确 认</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import BreadCrumb from "../../components/breadcrumb.vue"; import BreadCrumb from "../../components/breadcrumb.vue";
import { create } from "domain"; import { create } from "domain";
import { mapGetters,mapActions } from 'vuex' import { mapGetters, mapActions } from "vuex";
import { returnData } from "../../utils/mock"; import { returnData } from "../../utils/mock";
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils"; import * as commonUtil from "../../utils/utils";
import { setTimeout } from 'timers'; import { setTimeout } from "timers";
let vm = null; let vm = null;
export default { export default {
components: { components: {
...@@ -321,11 +328,11 @@ export default { ...@@ -321,11 +328,11 @@ export default {
currentRow: null, currentRow: null,
currentType: 4, currentType: 4,
changeStatusConfig: { changeStatusConfig: {
title: '确认通过该项目模版审核吗?', title: "确认通过该项目模版审核吗?",
message: '下架后,用户新建项目则无法看到该模版', message: "下架后,用户新建项目则无法看到该模版"
}, },
idValue: '', idValue: "",
curmbFirst: "教培项目", curmbFirst: "教培项目",
curmbSecond: "项目管理", curmbSecond: "项目管理",
centerDialogVisible: false, // 新建项目弹窗 centerDialogVisible: false, // 新建项目弹窗
...@@ -338,7 +345,7 @@ export default { ...@@ -338,7 +345,7 @@ export default {
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10
}, },
cmeBtnText: '', cmeBtnText: "",
currentRow: {}, currentRow: {},
optionStatus: [ optionStatus: [
{ {
...@@ -388,9 +395,8 @@ export default { ...@@ -388,9 +395,8 @@ export default {
{ {
value: 11, value: 11,
label: "复审通过" label: "复审通过"
}, }
// 加上去 。。。。。。。CME // 加上去 。。。。。。。CME
], ],
tableData: [], tableData: [],
totalRows: 0, totalRows: 0,
...@@ -407,7 +413,10 @@ export default { ...@@ -407,7 +413,10 @@ export default {
}, },
pickerOptions0: { pickerOptions0: {
disabledDate: time => { disabledDate: time => {
if (this.formInline.projectEndtime != "" && this.formInline.projectEndtime !=null) { if (
this.formInline.projectEndtime != "" &&
this.formInline.projectEndtime != null
) {
return ( return (
time.getTime() > time.getTime() >
new Date(this.formInline.projectEndtime).getTime() new Date(this.formInline.projectEndtime).getTime()
...@@ -423,30 +432,30 @@ export default { ...@@ -423,30 +432,30 @@ export default {
); //减去一天的时间代表可以选择同一天; ); //减去一天的时间代表可以选择同一天;
} }
}, },
idType: '', idType: "",
deleteVisible: false, deleteVisible: false,
isRoleOfOuter: 0, isRoleOfOuter: 0
}; };
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
"_token", "_token"
// "idType", // "idType",
]) ])
}, },
created() { created() {
vm = this; vm = this;
vm.idType = localStorage.getItem('storageIdType'); vm.idType = localStorage.getItem("storageIdType");
vm.isRoleOfOuter = localStorage.getItem('isRoleOfOuter') - 0; vm.isRoleOfOuter = localStorage.getItem("isRoleOfOuter") - 0;
let pageSize = vm.formInline.pageSize; let pageSize = vm.formInline.pageSize;
console.log('idType:',vm.idType); console.log("idType:", vm.idType);
if(this.$route.query.pageNum){ if (this.$route.query.pageNum) {
this.formInline = {...this.$store.state.common.itemManager} this.formInline = { ...this.$store.state.common.itemManager };
this.formInline.pageNo = parseInt(this.$route.query.pageNum) this.formInline.pageNo = parseInt(this.$route.query.pageNum);
this.formInline.pageSize = pageSize; this.formInline.pageSize = pageSize;
} }
this.$nextTick(function() {; this.$nextTick(function() {
this.getProjectList(); this.getProjectList();
}); });
}, },
...@@ -455,17 +464,15 @@ export default { ...@@ -455,17 +464,15 @@ export default {
commonUtil.resizeHeight(); commonUtil.resizeHeight();
}, },
methods: { methods: {
...mapActions([ ...mapActions(["updateItemManager"]),
'updateItemManager'
]),
//跳转到报告详情页 //跳转到报告详情页
reviewReport(row) { reviewReport(row) {
let routerData = { let routerData = {
id: row.id, id: row.id,
projectName: row.projectName, projectName: row.projectName
}; };
vm.$router.push({ path: "/item-list" , query: routerData }); vm.$router.push({ path: "/item-list", query: routerData });
}, },
hideDeleteFrom() { hideDeleteFrom() {
...@@ -474,7 +481,7 @@ export default { ...@@ -474,7 +481,7 @@ export default {
// 打开新建页面 // 打开新建页面
openProject() { openProject() {
if(vm.idType == 2) { if (vm.idType == 2) {
vm.toTemplatePage(); vm.toTemplatePage();
} else { } else {
this.centerDialogVisible = true; this.centerDialogVisible = true;
...@@ -493,24 +500,27 @@ export default { ...@@ -493,24 +500,27 @@ export default {
this.$router.push("edit-custom?projectType=4&isPreview=" + isPreview); this.$router.push("edit-custom?projectType=4&isPreview=" + isPreview);
}, },
toShield(row) { toShield(row) {
this.$router.push("item-shield?projectId="+row.id); this.$router.push("item-shield?projectId=" + row.id);
}, },
handleTypeClose() { handleTypeClose() {
this.centerDialogVisible = false; this.centerDialogVisible = false;
this.newProjectType = 1; this.newProjectType = 1;
}, },
handleCreateProject() { handleCreateProject() {
if (this.newProjectType == 1) { // 1 普通项目 2 CME项目 if (this.newProjectType == 1) {
// 1 普通项目 2 CME项目
this.toPage(); this.toPage();
} else if (this.newProjectType == 2) { } else if (this.newProjectType == 2) {
this.toCmePage(); this.toCmePage();
} else if(this.newProjectType == 3) { } else if (this.newProjectType == 3) {
this.toTemplatePage(); this.toTemplatePage();
} }
}, },
previewTemplate(row, isPreview) { previewTemplate(row, isPreview) {
this.$router.push(`template-open?projectId=${row.id}&projectType=3&isPreview=${isPreview}`); this.$router.push(
`template-open?projectId=${row.id}&projectType=3&isPreview=${isPreview}`
);
}, },
// handleCreateProject(isPreview) { // handleCreateProject(isPreview) {
...@@ -527,15 +537,19 @@ export default { ...@@ -527,15 +537,19 @@ export default {
this.currentRow = row; this.currentRow = row;
let status = row.projectStatus; let status = row.projectStatus;
// 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过 // 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过
if (status == 7 || status == 8) { // 按钮显示 初审 if (status == 7 || status == 8) {
// 按钮显示 初审
this.firstCheckVisible = true; this.firstCheckVisible = true;
} else if (status == 9 || status == 10) { // 按钮显示 复审 } else if (status == 9 || status == 10) {
// 按钮显示 复审
this.secondCheckVisible = true; this.secondCheckVisible = true;
} else if (status == 11) { // 按钮显示 发布 } else if (status == 11) {
this.changeStatus(row,3) // 按钮显示 发布
this.changeStatus(row, 3);
} }
}, },
handleCheckLeft() { // 左边通过 handleCheckLeft() {
// 左边通过
this.goToCheckAuth(1); this.goToCheckAuth(1);
}, },
handleCheckRight() { handleCheckRight() {
...@@ -546,7 +560,10 @@ export default { ...@@ -546,7 +560,10 @@ export default {
let req = {}; let req = {};
openLoading(vm); openLoading(vm);
// refuse = 1 : 同意 refuse = 2:拒绝 // refuse = 1 : 同意 refuse = 2:拒绝
vm.GET(`portal/cme/verifyProject?projectId=${row.id}&refuse=${refuse}`, req).then(res => { vm.GET(
`portal/cme/verifyProject?projectId=${row.id}&refuse=${refuse}`,
req
).then(res => {
closeLoading(vm); closeLoading(vm);
// debugger; // debugger;
vm.firstCheckVisible = false; vm.firstCheckVisible = false;
...@@ -554,8 +571,8 @@ export default { ...@@ -554,8 +571,8 @@ export default {
if (res.code == "000000") { if (res.code == "000000") {
vm.getProjectList(); vm.getProjectList();
this.$message({ this.$message({
message: '审核成功', message: "审核成功",
type: 'success' type: "success"
}); });
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
...@@ -570,8 +587,12 @@ export default { ...@@ -570,8 +587,12 @@ export default {
getProjectList() { getProjectList() {
let req = {}; let req = {};
req = this.formInline; req = this.formInline;
this.formInline.projectBegintime = !this.formInline.projectBegintime ? "" : this.formInline.projectBegintime; this.formInline.projectBegintime = !this.formInline.projectBegintime
this.formInline.projectEndtime = !this.formInline.projectEndtime ? "" : this.formInline.projectEndtime; ? ""
: this.formInline.projectBegintime;
this.formInline.projectEndtime = !this.formInline.projectEndtime
? ""
: this.formInline.projectEndtime;
openLoading(vm); openLoading(vm);
vm.GET("portal/portalInfo/getProjectList", req).then(res => { vm.GET("portal/portalInfo/getProjectList", req).then(res => {
closeLoading(vm); closeLoading(vm);
...@@ -591,7 +612,7 @@ export default { ...@@ -591,7 +612,7 @@ export default {
// CME 专属状态码 为7~11,是这些代码的直接走新逻辑,别的走老逻辑 // CME 专属状态码 为7~11,是这些代码的直接走新逻辑,别的走老逻辑
let cmeStatus = [7, 8, 9, 10, 11]; let cmeStatus = [7, 8, 9, 10, 11];
let currentStatus = parseInt(row.projectStatus); let currentStatus = parseInt(row.projectStatus);
if ( cmeStatus.indexOf(currentStatus) > -1 ) { if (cmeStatus.indexOf(currentStatus) > -1) {
return true; return true;
} else { } else {
return false; return false;
...@@ -599,7 +620,7 @@ export default { ...@@ -599,7 +620,7 @@ export default {
}, },
//按钮展示情况 //按钮展示情况
showButton(row, type) { showButton(row, type) {
if(!row.isRoleOfOuter) return false; if (!row.isRoleOfOuter) return false;
// 按钮type类型: 0-编辑 // 按钮type类型: 0-编辑
// 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝 // 1-暂存 2-完成 3-上架 4-通过 5-下架 6-拒绝
// 7- 提醒审核 8(2)-取消审核 9-删除 // 7- 提醒审核 8(2)-取消审核 9-删除
...@@ -616,7 +637,7 @@ export default { ...@@ -616,7 +637,7 @@ export default {
//外部项目 //外部项目
buttonStatus = returnData().buttonStatusOut; buttonStatus = returnData().buttonStatusOut;
} }
if(projectStatus == null) { if (projectStatus == null) {
return false; return false;
} }
if (level != null) { if (level != null) {
...@@ -633,20 +654,26 @@ export default { ...@@ -633,20 +654,26 @@ export default {
} }
} }
// 添加新的判断逻辑 // 添加新的判断逻辑
if(flag && type == 0) { if (flag && type == 0) {
return (row.level == 'L1' && row.idType == 1) || (row.level == 'L2' && row.idType == 2) return (
(row.level == "L1" && row.idType == 1) ||
(row.level == "L2" && row.idType == 2)
);
} }
return flag; return flag;
}, },
handleCmeOperate(status) { handleCmeOperate(status) {
let text = ''; let text = "";
// 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过 // 7.待初审 8.初审未通过 9.待复审 10.复审未通过 11.复审通过
if (status == 7 || status == 8) { // 按钮显示 初审 if (status == 7 || status == 8) {
text = '初审'; // 按钮显示 初审
} else if (status == 9 || status == 10) { // 按钮显示 复审 text = "初审";
text = '复审'; } else if (status == 9 || status == 10) {
} else if (status == 11) { // 按钮显示 发布 // 按钮显示 复审
text = '发布'; text = "复审";
} else if (status == 11) {
// 按钮显示 发布
text = "发布";
} }
this.cmeBtnText = text; this.cmeBtnText = text;
return text; return text;
...@@ -662,12 +689,13 @@ export default { ...@@ -662,12 +689,13 @@ export default {
changeStatusForSP(row, type) { changeStatusForSP(row, type) {
this.currentRow = row; this.currentRow = row;
this.currentType = type; this.currentType = type;
if(type == 4) { if (type == 4) {
this.changeStatusConfig.title = '确认通过该项目审核吗?'; this.changeStatusConfig.title = "确认通过该项目审核吗?";
this.changeStatusConfig.message = '审核通过后,该项目范围内的学员可在云鹊医App进行培训学习'; this.changeStatusConfig.message =
} else if(type == 6) { "审核通过后,该项目范围内的学员可在云鹊医App进行培训学习";
this.changeStatusConfig.title = '确认要拒绝该项目吗?'; } else if (type == 6) {
this.changeStatusConfig.message = '拒绝后该项目将从列表中消失'; this.changeStatusConfig.title = "确认要拒绝该项目吗?";
this.changeStatusConfig.message = "拒绝后该项目将从列表中消失";
} }
this.changeStatusVisible = true; this.changeStatusVisible = true;
}, },
...@@ -677,16 +705,45 @@ export default { ...@@ -677,16 +705,45 @@ export default {
let projectId = row.id; let projectId = row.id;
let level = row.level; let level = row.level;
if (type === 0) { if (type === 0) {
this.updateItemManager(this.formInline) this.updateItemManager(this.formInline);
//编辑 //编辑
if(row.projectType === 1) { if (row.projectType === 1) {
this.$router.push("edit-manager?projectType=1&projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo); this.$router.push(
} else if(row.projectType === 2) { "edit-manager?projectType=1&projectId=" +
this.$router.push("edit-cme?projectType=2&projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo); projectId +
} else if(row.projectType === 3) { "&level=" +
this.$router.push("template-open?projectType=3&projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo); level +
} else if(row.projectType === 4) { "&pageNum=" +
this.$router.push("eidt-custom?projectType=4&projectId=" + projectId +"&level="+level+'&pageNum='+this.formInline.pageNo); this.formInline.pageNo
);
} else if (row.projectType === 2) {
this.$router.push(
"edit-cme?projectType=2&projectId=" +
projectId +
"&level=" +
level +
"&pageNum=" +
this.formInline.pageNo
);
} else if (row.projectType === 3) {
this.$router.push(
"template-open?projectType=3&projectId=" +
projectId +
"&level=" +
level +
"&pageNum=" +
this.formInline.pageNo
);
} else if (row.projectType === 4) {
debugger
this.$router.push(
"edit-custom?projectType=4&projectId=" +
projectId +
"&level=" +
level +
"&pageNum=" +
this.formInline.pageNo
);
} }
} else if (type === 7) { } else if (type === 7) {
//提醒审核 //提醒审核
...@@ -743,13 +800,13 @@ export default { ...@@ -743,13 +800,13 @@ export default {
}, },
getType(value) { getType(value) {
let data = value; let data = value;
if(data == 8) { if (data == 8) {
data = 2; data = 2;
} }
return data; return data;
}, },
delItem(row) { delItem(row) {
this.deleteVisible = true this.deleteVisible = true;
this.currentRow = row; this.currentRow = row;
}, },
hideDeleteFrom() { hideDeleteFrom() {
...@@ -758,13 +815,15 @@ export default { ...@@ -758,13 +815,15 @@ export default {
// 删除项目 // 删除项目
confirmDelete() { confirmDelete() {
let req = {}; let req = {};
vm.DELETE("portal/portalInfo/delete/" + this.currentRow.id, req).then(res => { vm.DELETE("portal/portalInfo/delete/" + this.currentRow.id, req).then(
res => {
vm.$message.info(res.message); vm.$message.info(res.message);
if (res.code == "000000") { if (res.code == "000000") {
this.deleteVisible = false; this.deleteVisible = false;
vm.getProjectList(); vm.getProjectList();
} }
}); }
);
}, },
// 重置表单 // 重置表单
resetForm() { resetForm() {
...@@ -821,7 +880,6 @@ export default { ...@@ -821,7 +880,6 @@ export default {
.item-manager-wrap { .item-manager-wrap {
.component-content { .component-content {
background: #fff; background: #fff;
//margin-top: 88px;
padding: 10px; padding: 10px;
.header-title { .header-title {
padding: 10px 12px; padding: 10px 12px;
...@@ -829,11 +887,12 @@ export default { ...@@ -829,11 +887,12 @@ export default {
color: #449284; color: #449284;
border-bottom: 1px solid #efefef; border-bottom: 1px solid #efefef;
} }
// .table-option span { .demo-form-inline {
// color: #409eff; margin-right: 20px;
// }
.add-button { .add-button {
float: right; float: right;
margin-right: 10px;
}
} }
.table-empty { .table-empty {
img { img {
...@@ -846,6 +905,6 @@ export default { ...@@ -846,6 +905,6 @@ export default {
} }
} }
.el-tooltip__popper { .el-tooltip__popper {
max-width:50% max-width: 50%;
} }
</style> </style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册