提交 11aebd07 编写于 作者: zhentian.jia's avatar zhentian.jia

解决上传问题 添加项目管理查询

上级 5ab0ed42
......@@ -2821,12 +2821,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -2841,17 +2843,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
......@@ -2968,7 +2973,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
......@@ -2980,6 +2986,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
......@@ -2994,6 +3001,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -3001,12 +3009,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
......@@ -3025,6 +3035,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
......@@ -3105,7 +3116,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
......@@ -3117,6 +3129,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
......@@ -3238,6 +3251,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
......
......@@ -58,7 +58,7 @@
></el-input>
</el-col>
</el-form-item>
<el-form-item label="列表图片:">
<el-form-item label="列表图片:" prop="attachmentUrl1">
<el-upload
v-model="formData.attachmentUrl1"
class="bg-uploader"
......@@ -70,8 +70,8 @@
<img v-if="!formData.attachmentUrl1" class="bg-img" src="../../assets/image/small.png">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
<div class="limit-text">
<p>尺寸大小:750*420</p>
<p>限制大小: 2.0 Mb</p>
<p>尺寸:48*48</p>
<p>限制大小: 500Kb</p>
<p>支持.jpg,.png格式</p>
</div>
</el-upload>
......@@ -82,7 +82,7 @@
<el-radio :label="2">视频</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="封面图片">
<el-form-item label="封面图片(视频):" prop="attachmentUrl2">
<el-upload
v-model="formData.attachmentUrl2"
class="bg-uploader"
......@@ -94,7 +94,7 @@
<img v-if="!formData.attachmentUrl2" class="bg-img" src="../../assets/image/small.png">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
<div class="limit-text">
<p>尺寸大小:750*420</p>
<p>尺寸:750*420</p>
<p>限制大小: 2.0 Mb</p>
<p>支持.jpg,.png格式</p>
</div>
......@@ -377,7 +377,7 @@ export default {
},
fileList: [
{
name: "food.jpeg",
name: "food.pdf",
url:
"https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg"
}
......@@ -485,37 +485,12 @@ export default {
],
projectIntro: [
{ required: true, message: "请填写活动形式", trigger: "blur" }
]
},
pickerOptions: {
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
}
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
}
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
}
}
],
attachmentUrl1: [
{ required: true, message: "请选择列表图片", trigger: "blur" }
],
attachmentUrl2: [
{ required: true, message: "请选择封面", trigger: "blur" }
]
}
};
......@@ -568,7 +543,7 @@ export default {
{
attachmentType: 2,
attachmentUrl: this.formData.attachmentUrl2,
kind: 2,
kind: this.formData.type,
seqNo: 1
}
];
......@@ -706,26 +681,65 @@ export default {
},
//上传列表图片
beforeUploadListPic(file) {
this.beforeAvatarUpload(file);
let fileLimit = {
width: 48,
height: 48,
size: 0.5,
sizeText: "500Kb",
key: "attachmentUrl1"
};
this.beforeAvatarUpload(file, fileLimit);
},
//上传封面图片
beforeUploadCoverPic(file) {
this.beforeAvatarUpload(file);
let fileLimit = {
width: 750,
height: 420,
size: 2,
sizeText: "2.0Mb",
key: "attachmentUrl2"
};
if (this.formData.type == 1) {
this.beforeAvatarUpload(file, fileLimit);
} else {
console.log(file);
}
},
//上传PDF
beforeUploadPDF(file) {
console.log(file);
const isPDF = file.type === "application/pdf";
if (!isPDF) {
this.$message.error("请上传PDF格式文件!");
} else {
doUpload(
vm,
file,
getFilePath(file, null),
"preview4",
"progress1",
1
).then(function(path) {
console.log(path);
//vm.formData[fileLimit.key] = path.fullPath;
vm.$message.success("上传成功");
});
}
},
//上传mp4
beforeUploadMp4(file) {},
//上传图片校验
beforeAvatarUpload(file) {
beforeAvatarUpload(file, fileLimit) {
const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < 2;
const isLt2M = file.size / 1024 / 1024 < fileLimit.size;
if (!isJPG && !isPNG) {
this.$message.error("上传头像图片只能是 JPG 格式!");
}
if (!isLt2M) {
this.$message.error("上传头像图片大小不能超过 2MB!");
this.$message.error(
"上传头像图片大小不能超过 " + fileLimit.sizeText + "!"
);
}
let _img = new FileReader();
_img.readAsDataURL(file);
......@@ -734,8 +748,11 @@ export default {
image.src = theFile.target.result;
image.onload = function() {
let _this = this;
if (_this.width != 750 || _this.height != 420) {
vm.$message.info("上传图片宽度不合适,请重新上传");
if (
_this.width != fileLimit.width ||
_this.height != fileLimit.height
) {
vm.$message.info("上传图片长宽不合适,请重新上传");
} else {
doUpload(
vm,
......@@ -745,7 +762,8 @@ export default {
"progress1",
1
).then(function(path) {
vm.componentList.imageUrl = path.fullPath;
console.log(path);
vm.formData[fileLimit.key] = path.fullPath;
vm.$message.success("上传成功");
});
}
......
......@@ -5,24 +5,25 @@
<div class="header-title">项目管理</div>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="项目名称:">
<el-input v-model="formInline.name" placeholder="审批人"></el-input>
<el-input v-model="formInline.projectName" placeholder="审批人"></el-input>
</el-form-item>
<el-form-item label="项目时间:">
<el-date-picker
v-model="formInline.startDate"
type="date"
placeholder="请选择开始时间"
v-model="formInline.projectBegintime"
type="daterange"
start-placeholder="请选择开始时间"
end-placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
></el-date-picker>
<el-date-picker
v-model="formInline.endDate"
<!-- <el-date-picker
v-model="formInline.projectEndtime"
type="date"
placeholder="请选择结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
></el-date-picker>
></el-date-picker> -->
</el-form-item>
<el-form-item>
<el-button type="primary" @click="searchData()">查询</el-button>
<el-button type="primary" @click="getProjectList()">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="default" plain>重置</el-button>
......@@ -30,9 +31,9 @@
</el-form>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="发布状态:">
<el-select v-model="formInline.type" placeholder="请选择发布状态">
<el-option label="状态1" value="shanghai"></el-option>
<el-option label="状态2" value="beijing"></el-option>
<el-select v-model="formInline.projectStatus" placeholder="请选择发布状态">
<el-option label="状态1" value="1"></el-option>
<el-option label="状态2" value="2"></el-option>
</el-select>
</el-form-item>
</el-form>
......@@ -110,10 +111,10 @@ export default {
timingTime: "",
currentPage: 1,
formInline: {
name: "",
startDate: "",
endDate: "",
type: "",
projectName: "",
projectBegintime: "",
projectEndtime: "",
projectStatus: "",
pageNo: 1,
pageSize: 10
}
......@@ -140,10 +141,8 @@ export default {
},
//查询项目列表
getProjectList() {
let req = {
pageNo: this.formInline.pageNo,
pageSize: this.formInline.pageSize
};
let req = {};
req = this.formInline;
vm.GET("portalInfo/getProjectList", req).then(res => {
if (res.code == "000000") {
vm.tableData = res.data.data;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册