Commit 6a2fe6bf authored by 王飞龙's avatar 王飞龙

新闻资讯 中心案例修改

parent e6ef3284
......@@ -236,95 +236,6 @@ export default {
title: _this.queryParams.title
}
listCmsProject(params).then(res => {
var pages = res.rows// 查询过来的每页数据
_this.total = res.total// 总记录数
_this.bussid = []
res.rows.forEach(item => {
item.srclist = []
item.srclist.push(item.path)
})
_this.tableData = res.rows
_this.fullscreenLoading = false
if (res.rows.length === 0) {
_this.tableDataTips = '暂无数据'
}
}).catch(function() {
_this.fullscreenLoading = false
console.log(error)
})
_this.dataIsReady = true
_this.uploadList.fm = this.interfaceUrl + 'BLesson/picImport'
_this.getCourseDirection()
},
// 上传
importmould() {
document.getElementById('btn_file').click()
},
fileupload() {
const _this = this
this.fullscreenLoading = true
const dom = document.getElementById('btn_file')
const fileSize = dom.files[0].size // 文件的大小,单位为字节B
if (fileSize > 5 * 1024 * 1024) {
this.fullscreenLoading = false
this.$notify({
title: '提示',
message: '上传文件大小不能超过5M',
type: 'warning'
})
return false
}
// 获取欲上传的文件路径
const filePath = dom.value
const suf = filePath.split('.')[filePath.split('.').length - 1]
if (suf !== 'xls' && suf !== 'xlsx') {
this.$notify({
title: '提示',
message: '只能上传.xls/.xlsx格式的文件',
type: 'warning'
})
dom.value = ''
_this.fullscreenLoading = false
} else {
_this.eduUtil.ajaxPostUtil(
'BLesson/excelImport',
{ importFile: dom.files[0] },
function(res) {
console.log(res)
dom.value = ''
_this.fullscreenLoading = false
if (res.code === 200) {
_this.$notify({
title: '成功',
message: res.message,
type: 'success'
})
_this.loadData()
} else {
_this.$notify({
title: '失败',
message: res.message,
type: 'error'
})
}
},
function(err) {
dom.value = ''
_this.$notify({
title: '失败',
message: err.message,
type: 'error'
})
_this.fullscreenLoading = false
}
)
}
},
// 修改状态
handleStatusChange(row) {
......@@ -366,25 +277,6 @@ export default {
}
})
},
bindThis(index) {
// console.log(index);
this.formLabelAlign.id = this.tableData[index].tcode
this.formLabelAlign.region = this.tableData[index].tlessonName
this.formLabelAlign.couDire = this.tableData[index].directionId
this.formLabelAlign.credit = this.tableData[index].credit
this.formLabelAlign.totalStuHours = this.tableData[index].totalStuHours
},
// 打印页
handleSizeChange(val) {
this.pagesize = val
this.loadData()
},
handleCurrentChange(val) {
this.currentPage = val
this.loadData()
},
// search
removeCourse(row) {
const id = row.businessId
......@@ -411,42 +303,6 @@ export default {
justOut(event) {
// $("#pic").remove();
},
//* ************目录*************//
loadCurCat(index) {
this.showSwitch.courseContent = false
this.showSwitch.curCat = true
this.curCatForm.id = this.bussid[index]
this.curCatForm.totalStuHours = this.tableData[index].totalStuHours
this.curCatForm.tlessonName = this.tableData[index].tlessonName
this.curCatForm.tcode = this.tableData[index].tcode
this.curCatForm.directionId = this.tableData[index].directionId
this.curCatForm.directionCode = this.tableData[index].directionCode
// 加载课程目录
this.$refs.curcat.loadCatalog(this.curCatForm.id, this.curCatForm.totalStuHours, this.curCatForm.tlessonName, this.curCatForm.tcode, this.curCatForm.directionId, this.curCatForm.directionCode)
},
// 目录页更新
refreshData() {
this.$refs.curcat.loadCatalog(this.curCatForm.id, this.curCatForm.totalStuHours, this.curCatForm.tlessonName, this.curCatForm.tcode, this.curCatForm.directionId, this.curCatForm.directionCode)
},
// 子组件关闭
closeChild() {
// this.showSwitch.courseContent = true;
// this.showSwitch.curCat = false;
this.$router.go(0)
},
// 清空封面上传列表
clearCoverFileList() {
this.$refs.coverUpload.clearFiles()
this.$refs.coverUpload.abort()
this.filelist = []
},
// 封面限制
coverChange(file, fileList) {
if (this.filelist.length > 0) {
this.filelist = []
}
}
}
}
</script>
......
......@@ -110,7 +110,6 @@ export default {
},
data() {
return {
imagePath: 'http://49.232.167.247:20020/eduServer/',
businessId: null,
// 变更字段存储数组
......@@ -208,6 +207,16 @@ export default {
this.form.pictureId = res.data.businessId
},
beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg' || file.type === 'image/png'
const isLt2M = file.size / 1024 / 1024 < 2
if (!isJPG) {
this.$message.error('只能上传图片格式的文件')
return false
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
return false
}
this.file = file
},
// 判断要进行什么操作 isOperation值 1:新增 2:编辑 3:查看
......
......@@ -288,18 +288,6 @@ export default {
})
})
},
beforeUpload(file) {
// console.log(file);
// this.filelist = [];
this.filelist.push(file)
},
uploadCustom() {
const cover = this.filelist[0]
},
removeCover(file, fileList) {
const cover = null
this.filelist = []
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push({
......@@ -320,74 +308,7 @@ export default {
}
})
},
// 改变课程
change_course(formName, index) {
const that = this
this.$refs[formName].validate((valid) => {
if (valid) {
if (that.formLabelAlign.totalStuHours < that.tableData[index].chapterClassHour) {
that.fullscreenLoading = false
that.$notify({
title: '失败',
message: '总学时不能小于已添加的章节课时',
type: 'error'
})
} else {
that.fullscreenLoading = true
that.eduUtil.ajaxPostUtil('BLesson/add', {
businessId: that.bussid[index],
code: that.formLabelAlign.id,
lessonName: that.formLabelAlign.region,
credits: that.formLabelAlign.credit,
directionId: that.formLabelAlign.couDire,
classHour: that.formLabelAlign.totalStuHours
}, function(response) {
that.fullscreenLoading = false
// alert(JSON.stringify(response));
let type = response.code
const message = response.message
// type = that.eduUtil.tip_custom(type);
type = (type === 200) ? 'success' : 'error'
that.$notify({
title: '成功',
message: message,
type: type
})
that.loadData()
$('.el-popover').css('display', 'none')
}
, function(err) {
console.log(err)
}
)
}
} else {
that.fullscreenLoading = false
console.log('error submit!!')
return false
}
})
},
bindThis(index) {
// console.log(index);
this.formLabelAlign.id = this.tableData[index].tcode
this.formLabelAlign.region = this.tableData[index].tlessonName
this.formLabelAlign.couDire = this.tableData[index].directionId
this.formLabelAlign.credit = this.tableData[index].credit
this.formLabelAlign.totalStuHours = this.tableData[index].totalStuHours
},
// 打印页
handleSizeChange(val) {
this.pagesize = val
this.loadData()
},
handleCurrentChange(val) {
this.currentPage = val
this.loadData()
},
// search
/** 删除按钮操作 */
removeCourse(row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
......
......@@ -157,62 +157,13 @@ export default {
}
],
imageUrl: '',
open: false,
// 弹框控制器
dialog: {
secondDialogVisible: false
},
// 申请变更表单
applicationForm: {
// 变更信息
list1: [],
userfrom: {
idmName: '',
idmId: '',
staffLevel: '',
deptName: '',
createDate: '',
remarks: ''
},
deptList: [
{
deptId: undefined,
approveUserId: undefined,
approveName: '审批人1',
flag: '0',
processGroup: '1',
currentNode: 1,
isMessage: '0',
reviewerType: '1',
approveUser: '',
roleTemp: ''
}
]
},
// // 时间选向
// times: this.generateTimes(), // 生成时间选项数组
// 所属产线
productionLineList: [],
// 所属科室集合
deptList: [],
deptForm: [],
// 控制表单
controls: {
// 1:代表新增 2:代表编辑 3:代表查看
isOperation: '1',
// 输入框输入最大长度
ONEMAXLENGTH: 40,
TWOMAXLENGTH: 16,
THREEMAXLENGTH: 4,
FOURMAXLENGTH: 255
isOperation: '1'
},
formName: [
{ value: 'equipmentName', label: '设备型号' },
{ value: 'weight', label: '权重' },
{ value: 'flag', label: '状态' },
{ value: 'remarks', label: '备注' }
],
fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'temp',
fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'newsInformation',
// 提交表单
form: {
// 主表id
......@@ -238,20 +189,6 @@ export default {
value: '0'
}
],
// 原班次表单
oldForm: {
// 主表id
businessId: undefined,
createBy: undefined,
createDate: undefined,
deptId: undefined,
deptTwoId: undefined,
equipmentName: undefined,
flag: undefined,
photoossId: undefined,
remarks: undefined,
weight: undefined
},
// 校验规则
rules: {
startDateS: [],
......@@ -292,6 +229,17 @@ export default {
this.form.pictureId = res.data.businessId
},
beforeAvatarUpload(file) {
// 判断文件是否为图片类型
const isJPG = file.type === 'image/jpeg' || file.type === 'image/png'
const isLt2M = file.size / 1024 / 1024 < 2
if (!isJPG) {
this.$message.error('只能上传图片格式的文件!')
return false
}
if (!isLt2M) {
this.$message.error('上传图片大小不能超过 2MB!')
return false
}
this.file = file
},
goBack() {
......
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