Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.education.frontend
pica.cloud.web-education-admin
提交
3a0f49a4
提交
3a0f49a4
编写于
4月 13, 2020
作者:
haochangdi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
限制图片上传尺寸
上级
6aca0a13
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
27 行增加
和
25 行删除
+27
-25
baseMessage.vue
src/components/education/template/baseMessage.vue
+4
-4
templateMessage.vue
src/components/education/template/templateMessage.vue
+23
-21
未找到文件。
src/components/education/template/baseMessage.vue
浏览文件 @
3a0f49a4
...
...
@@ -450,10 +450,10 @@ export default {
const isJPG = file.type === "
image
/
jpeg
";
const isPNG = file.type === "
image
/
png
";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
//
if (file.width != fileLimit.width || file.height != fileLimit.height) {
//
vm.$message.error("
图片不符合规范,请根据规范上传图片
");
//
return;
//
}
if (file.width != fileLimit.width || file.height != fileLimit.height) {
vm.$message.error("
图片不符合规范,请根据规范上传图片
");
return;
}
if (!isJPG && !isPNG) {
vm.$message.error("
图片不符合规范,请根据规范上传图片
");
return;
...
...
src/components/education/template/templateMessage.vue
浏览文件 @
3a0f49a4
...
...
@@ -359,17 +359,19 @@ export default {
methods: {
// 设置已有的基本信息
setBaseMessage(data) {
this.formData = Object.assign(this.formData, data.projectData);
this.formData.attachmentUrl1 = data.attachmentData[0].attachmentUrl;
this.formData.attachmentMore1 = Object.assign(this.formData.attachmentMore1, data.attachmentData[0]);
this.formData.projectBegintime = this.formData.projectBegintime ? new Date(this.formData.projectBegintime) : '';
this.formData.projectEndtime = this.formData.projectBegintime ? new Date(this.formData.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]) {
//
this
.formData.attachmentUrl2 = data.attachmentData[1].attachmentType == 1 ? data.attachmentData[1].attachmentUrl : '';
//
this
.formData.attachmentUrl3 = data.attachmentData[1].attachmentType == 2 ? data.attachmentData[1].attachmentUrl : '';
this
.formData.attachmentUrl2 = data.attachmentData[1].attachmentUrl;
this
.formData.type = data.attachmentData[1].attachmentType;
this.formData.attachmentMore2 = Object.assign(this
.formData.attachmentMore2, data.attachmentData[1]);
//
vm
.formData.attachmentUrl2 = data.attachmentData[1].attachmentType == 1 ? data.attachmentData[1].attachmentUrl : '';
//
vm
.formData.attachmentUrl3 = data.attachmentData[1].attachmentType == 2 ? data.attachmentData[1].attachmentUrl : '';
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]);
}
},
// 获取选择模板后的基本信息
...
...
@@ -379,7 +381,7 @@ export default {
.then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
this
.setBaseMessage(res.data);
vm
.setBaseMessage(res.data);
} else {
vm.$message.info(res.message);
}
...
...
@@ -396,7 +398,7 @@ export default {
.then(res => {
closeLoading(vm);
if (res.code == "
000000
") {
this
.setBaseMessage(res.data)
vm
.setBaseMessage(res.data)
} else {
vm.$message.info(res.message);
}
...
...
@@ -461,10 +463,10 @@ export default {
const isJPG = file.type === "
image
/
jpeg
";
const isPNG = file.type === "
image
/
png
";
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
//
if (file.width != fileLimit.width || file.height != fileLimit.height) {
//
vm.$message.error("
图片不符合规范,请根据规范上传图片
");
//
return;
//
}
if (file.width != fileLimit.width || file.height != fileLimit.height) {
vm.$message.error("
图片不符合规范,请根据规范上传图片
");
return;
}
if (!isJPG && !isPNG) {
vm.$message.error("
图片不符合规范,请根据规范上传图片
");
return;
...
...
@@ -596,8 +598,8 @@ export default {
},
// 暂存
save() {
if (
this
.$refs['formData'].projectName == '') {
this
.$refs['formData'].validateField('projectName')
if (
vm
.$refs['formData'].projectName == '') {
vm
.$refs['formData'].validateField('projectName')
} else {
vm.insertOrupdate(1);
};
...
...
@@ -625,7 +627,7 @@ export default {
closeLoading(vm);
if (res.code == "
000000
" && status == 3) {
// 下一步,并将项目id传递
this
.$emit('next',res.data.id);
vm
.$emit('next',res.data.id);
} else if (res.code == "
213061
") {
vm.dialogObj.visible = true;
} else {
...
...
@@ -652,7 +654,7 @@ export default {
// 确定
hide() {
vm.dialogObj.visible = false;
this
.$emit('backSelectVue')
vm
.$emit('backSelectVue')
}
}
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录