Commit 84346e27 by Lyan

bug更改

parent b8fc2da9
......@@ -368,6 +368,7 @@ img {
width: 100%;
}
.avatar-uploader>.el-upload {
border: 2px dashed #666666;
cursor: pointer;
position: relative;
......@@ -398,6 +399,9 @@ img {
}
.avatar2{
width: 70%;
img{
width: 100%;
}
}
p{
margin: 0;
......
......@@ -159,10 +159,10 @@
],
directpath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
picIndexPath: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
// picIndexPath: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ]
// colorBackground: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
......
......@@ -82,15 +82,15 @@
<el-upload
v-show="!showInfo"
class="avatar-uploader"
class="avatar-uploader avatar2"
action=""
:show-file-list="false"
:http-request="Upload"
:before-upload="beforeAvatarUpload">
<img v-if="dialogVisible" :src="imgUrlStr" class="avatar">
<img v-if="dialogVisible" :src="imgUrlStr" class="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar"></p>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar2"></p>
</el-form-item>
<el-form-item label="简介:" prop="brief">
......@@ -202,7 +202,7 @@
},
created () {
this.getClassList([])
this.getClassList([5, 9])
},
mounted () {
console.log(this.classidList)
......@@ -230,7 +230,7 @@
this.loading = false
if (data && data.code === 0) {
this.dataForm = data.news
this.getClassList([])
this.getClassList([5, 9])
this.dataForm.ishead = parseInt(data.news.ishead)
this.dataForm.classid = this.dataForm.classid
this.getClassList([this.dataForm.classid])
......@@ -295,7 +295,7 @@
data: id
}).then(({data}) => {
if (data && data.code === 0) {
if (id.length === 0) {
if (id.length === 2) {
this.classidList = data.data
} else {
this.cclassidList = data.data[0].child
......
......@@ -64,27 +64,27 @@
</el-form-item>
<el-form-item label="描述图片:" prop="pic">
<el-upload
class="avatar-uploader"
class="avatar-uploader avatar2"
action=""
:show-file-list="false"
:http-request="Upload"
:before-upload="beforeAvatarUpload">
<img v-if="dialogVisible" :src="imgUrlStr" class="avatar">
<img v-if="dialogVisible" :src="imgUrlStr" class="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar"></p>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar2"></p>
</el-form-item>
<el-form-item label="MP4文件:" prop="video">
<el-upload
class="avatar-uploader"
class="avatar-uploader avatar2"
action=""
:show-file-list="false"
:http-request="UploadVideo"
:before-upload="beforeUploadVideo">
<video v-if="dialogVisible2" :src="videoUrlStr" class="avatar"></video>
<video v-if="dialogVisible2" :src="videoUrlStr" class=""></video>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p v-show="showInfo"><video :src="videoUrlStr" class="avatar"></video></p>
<p v-show="showInfo"><video :src="videoUrlStr" class="avatar2"></video></p>
</el-form-item>
<el-form-item label="" prop="content" >
......
......@@ -46,29 +46,37 @@
<p v-show="showInfo">{{dataForm.levels}}</p>
</el-form-item>
<el-form-item label="显示时间:" prop="showtime" class=" setdes setdes1">
<el-row v-show="!showInfo">
<el-col :span="22">
<el-date-picker
v-show="!showInfo"
v-model="dataForm.showtime"
value-format='yyyy-MM-dd'
type="date"
placeholder="选择日期">
</el-date-picker>
<span v-show="!showInfo">时间格式为:xxxx/xx/xx</span>
</el-col>
<el-col :span="2" class="iconStyle">
<el-tooltip placement="top" effect="light">
<div slot="content">时间格式为:xxxx/xx/xx</div>
<i class="el-icon-warning"></i>
</el-tooltip>
</el-col>
</el-row>
<p v-show="showInfo">{{dataForm.showtime}}</p>
</el-form-item>
<el-form-item label="专题图片:" prop="pic">
<el-upload
v-show="!showInfo"
class="avatar-uploader"
class="avatar-uploader avatar2"
action=""
:show-file-list="false"
:http-request="Upload"
:before-upload="beforeAvatarUpload">
<img v-if="dialogVisible" :src="imgUrlStr" class="avatar">
<img v-if="dialogVisible" :src="imgUrlStr" class="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar"></p>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar2"></p>
</el-form-item>
<el-form-item label="专题简介:" prop="shortcontent">
<el-input type="textarea" v-model="dataForm.shortcontent" placeholder="请输入专题简介" v-show="!showInfo"></el-input>
......@@ -135,12 +143,12 @@
levels: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
directpath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
ppic: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// directpath: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// ppic: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// content: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
......@@ -178,7 +186,7 @@
},
created () {
this.getClassList([])
this.getClassList([9, 12, 13])
},
mounted () {
......@@ -256,13 +264,8 @@
data: id
}).then(({data}) => {
if (data && data.code === 0) {
if (id.length === 0) {
this.classidList = data.data
} else {
this.dataForm.cclassid = ''
this.cclassidList = data.data[0].child
}
} else {
this.$message.error(data.msg)
}
})
......@@ -321,19 +324,11 @@
}
</script>
<style scoped>
.form-list{
padding-left: 4%!important;
}
.el-form-item__content{
width: 50%;
}
.el-select,.el-input{
width: 241px!important;
}
.edui-editor{
width: 100%;
}
.setdes1 .el-form-item__content > span{
left: 280px!important;
}
.iconStyle{
font-size: 18px;
text-align: center;
color: #e6a23c;
cursor: pointer;
}
</style>
\ No newline at end of file
......@@ -145,7 +145,7 @@
<script>
import { piclevelList } from '@/utils'
import AddOrUpdate from './news-add-or-update'
import AddOrUpdate from './newtopic-add-or-update'
export default {
components: {
AddOrUpdate
......
......@@ -128,13 +128,13 @@ export default {
trigger: 'blur'
}
],
picFile: [
{
required: true,
message: '不能为空',
trigger: 'blur'
}
],
// picFile: [
// {
// required: true,
// message: '不能为空',
// trigger: 'blur'
// }
// ],
editor: [
{
required: true,
......@@ -163,13 +163,13 @@ export default {
trigger: 'blur'
}
],
jumppath: [
{
required: true,
message: '不能为空',
trigger: 'blur'
}
],
// jumppath: [
// {
// required: true,
// message: '不能为空',
// trigger: 'blur'
// }
// ],
showtime: [
{
required: true,
......
......@@ -134,9 +134,9 @@
keyword: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
jumppath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// jumppath: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
author: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
......
......@@ -126,9 +126,9 @@
keyword: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
jumpath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// jumpath: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
author: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
......
......@@ -55,15 +55,15 @@
<el-form-item label="图片:" prop="pic">
<el-upload
v-show="!showInfo"
class="avatar-uploader"
class="avatar-uploader avatar2"
action=""
:show-file-list="false"
:http-request="Upload"
:before-upload="beforeAvatarUpload">
<img v-if="dialogVisible" :src="imgUrlStr" class="avatar">
<img v-if="dialogVisible" :src="imgUrlStr" class="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar"></p>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar2"></p>
</el-form-item>
<el-form-item label="简介:" prop="brief">
<el-input type="textarea" rows="5" v-model="dataForm.brief" placeholder="请输入简介" v-show="!showInfo"></el-input>
......@@ -134,12 +134,12 @@
levels: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
directpath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
pic: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// directpath: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// pic: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// content: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
......
......@@ -55,15 +55,15 @@
<el-form-item label="图片:" prop="pic">
<el-upload
v-show="!showInfo"
class="avatar-uploader"
class="avatar-uploader avatar2"
action=""
:show-file-list="false"
:http-request="Upload"
:before-upload="beforeAvatarUpload">
<img v-if="dialogVisible" :src="imgUrlStr" class="avatar">
<img v-if="dialogVisible" :src="imgUrlStr" class="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar"></p>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar2"></p>
</el-form-item>
<el-form-item label="简介:" prop="brief">
<el-input type="textarea" rows="5" v-model="dataForm.brief" placeholder="请输入简介" v-show="!showInfo"></el-input>
......@@ -133,12 +133,12 @@
levels: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
directpath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
pic: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// directpath: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// pic: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// content: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
......
......@@ -55,15 +55,15 @@
<el-form-item label="图片:" prop="pic">
<el-upload
v-show="!showInfo"
class="avatar-uploader"
class="avatar-uploader avatar2"
action=""
:show-file-list="false"
:http-request="Upload"
:before-upload="beforeAvatarUpload">
<img v-if="dialogVisible" :src="imgUrlStr" class="avatar">
<img v-if="dialogVisible" :src="imgUrlStr" class="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar"></p>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar2"></p>
</el-form-item>
<el-form-item label="简介:" prop="brief">
<el-input type="textarea" v-model="dataForm.brief" placeholder="请输入简介" v-show="!showInfo"></el-input>
......@@ -134,12 +134,12 @@
levels: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
directpath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
pic: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// directpath: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// pic: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// content: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
......
......@@ -55,15 +55,15 @@
<el-form-item label="图片:" prop="pic">
<el-upload
v-show="!showInfo"
class="avatar-uploader"
class="avatar-uploader avatar2"
action=""
:show-file-list="false"
:http-request="Upload"
:before-upload="beforeAvatarUpload">
<img v-if="dialogVisible" :src="imgUrlStr" class="avatar">
<img v-if="dialogVisible" :src="imgUrlStr" class="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar"></p>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar2"></p>
</el-form-item>
<el-form-item label="简介:" prop="brief">
<el-input type="textarea" v-model="dataForm.brief" placeholder="请输入简介" v-show="!showInfo"></el-input>
......@@ -134,12 +134,12 @@
levels: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
directpath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
pic: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// directpath: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// pic: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
// content: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
......
......@@ -135,9 +135,9 @@
keyword: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
directpath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// directpath: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
author: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
......
......@@ -105,16 +105,16 @@
<el-form-item label="上传图片:" prop="pic">
<el-upload
v-show="!showInfo"
class="avatar-uploader"
class="avatar-uploader avatar2"
action=""
:show-file-list="false"
:http-request="Upload"
:before-upload="beforeAvatarUpload"
>
<img v-if="dialogVisible" :src="imgUrlStr" class="avatar" />
<img v-if="dialogVisible" :src="imgUrlStr" class="" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar" /></p>
<p v-show="showInfo"><img :src="imgUrlStr" class="avatar2" /></p>
</el-form-item>
<el-form-item label="企业简介:" prop="brief">
......@@ -138,166 +138,166 @@
<script>
import { piclevelList } from '@/utils'
import Ueditor from "../temps/ueditor";
import Ueditor from '../temps/ueditor'
export default {
components: {
Ueditor,
Ueditor
},
data() {
data () {
return {
loading: false,
showInfo: false,
visible: false,
defaultProps: {
children: "children",
label: "label",
children: 'children',
label: 'label'
},
technologyList: [
{
value: "1",
label: "标识的打印和制作",
value: '1',
label: '标识的打印和制作'
},
{
value: "2",
label: "系统集成",
value: '2',
label: '系统集成'
},
{
value: "3",
label: "信息服务",
value: '3',
label: '信息服务'
},
{
value: "4",
label: "咨询服务",
value: '4',
label: '咨询服务'
},
{
value: "5",
label: "咨询服务",
},
value: '5',
label: '咨询服务'
}
],
serviceList: [
{
value: "1",
label: "零售",
value: '1',
label: '零售'
},
{
value: "2",
label: "电子商务",
value: '2',
label: '电子商务'
},
{
value: "3",
label: "食品烟酒",
value: '3',
label: '食品烟酒'
},
{
value: "4",
label: "医疗",
value: '4',
label: '医疗'
},
{
value: "5",
label: "物流",
value: '5',
label: '物流'
},
{
value: "6",
label: "服装",
value: '6',
label: '服装'
},
{
value: "7",
label: "快速消费品",
value: '7',
label: '快速消费品'
},
{
value: "8",
label: "消费电子产品",
value: '8',
label: '消费电子产品'
},
{
value: "9",
label: "制造和零部件",
value: '9',
label: '制造和零部件'
},
{
value: "10",
label: "建材",
value: '10',
label: '建材'
},
{
value: "11",
label: "其他",
},
value: '11',
label: '其他'
}
],
dataForm: {
id: 0,
firmname: "",
technology: "",
service: "",
site: "",
name: "",
phone: "",
email: "",
levels: "",
pic: "",
brief: "",
firmname: '',
technology: '',
service: '',
site: '',
name: '',
phone: '',
email: '',
levels: '',
pic: '',
brief: ''
},
cclassidStr: undefined,
dataRule: {
firmname: [{ required: true, message: "企业名称不能为空", trigger: "blur" }],
technology: [{ required: true, message: "技术领域不能为空", trigger: "blur" }],
service: [{ required: true, message: "服务行业不能为空", trigger: "blur" }],
site: [{ required: true, message: "网址不能为空", trigger: "blur" }],
name: [{ required: true, message: "联系人姓名不能为空", trigger: "blur" }],
phone: [{ required: true, message: "联系电话不能为空", trigger: "blur" }],
email: [{ required: true, message: "邮箱不能为空", trigger: "blur" }],
levels: [{ required: true, message: "级别不能为空", trigger: "blur" }],
pic: [{ required: true, message: "请上传图片", trigger: "blur" }],
brief: [{ required: true, message: "企业简介不能为空", trigger: "blur" }],
firmname: [{ required: true, message: '企业名称不能为空', trigger: 'blur' }],
technology: [{ required: true, message: '技术领域不能为空', trigger: 'blur' }],
service: [{ required: true, message: '服务行业不能为空', trigger: 'blur' }],
site: [{ required: true, message: '网址不能为空', trigger: 'blur' }],
name: [{ required: true, message: '联系人姓名不能为空', trigger: 'blur' }],
phone: [{ required: true, message: '联系电话不能为空', trigger: 'blur' }],
email: [{ required: true, message: '邮箱不能为空', trigger: 'blur' }],
levels: [{ required: true, message: '级别不能为空', trigger: 'blur' }],
pic: [{ required: true, message: '请上传图片', trigger: 'blur' }],
brief: [{ required: true, message: '企业简介不能为空', trigger: 'blur' }]
},
imgUrl: new FormData(),
imgUrlStr: "",
imgUrlStr: '',
dialogVisible: false,
ueditor: {
value: "",
config: {},
value: '',
config: {}
},
piclevelList,
};
piclevelList
}
},
methods: {
getSelectName(list, id) {
getSelectName (list, id) {
let arr = list.filter((item) => {
return item.id === id;
});
return arr[0].name;
return item.id === id
})
return arr[0].name
},
init(id, showInfo) {
this.dataForm.id = id || 0;
this.visible = true;
this.showInfo = showInfo;
init (id, showInfo) {
this.dataForm.id = id || 0
this.visible = true
this.showInfo = showInfo
this.$nextTick(() => {
this.clearInp();
this.clearInp()
if (this.dataForm.id) {
this.loading = true;
this.loading = true
this.$http({
url: this.$http.adornUrl(`/office/partners/info/${this.dataForm.id}`),
method: "get",
params: this.$http.adornParams(),
method: 'get',
params: this.$http.adornParams()
}).then(({ data }) => {
this.loading = false;
this.loading = false
if (data && data.code === 0) {
this.dataForm = data.partners;
this.imgUrlStr = data.partners.pic;
this.dialogVisible = true;
this.ueditor.value = this.dataForm.brief;
this.dataForm = data.partners
this.imgUrlStr = data.partners.pic
this.dialogVisible = true
this.ueditor.value = this.dataForm.brief
}
});
})
}
});
})
},
// 表单提交
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
console.log(valid, '表单提交表单提交');
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
console.log(valid, '表单提交表单提交')
if (valid) {
this.loading = true;
this.loading = true
this.$http({
url: this.$http.adornUrl(
`/office/partners/${!this.dataForm.id ? "save" : "update"}`
`/office/partners/${!this.dataForm.id ? 'save' : 'update'}`
),
method: "post",
method: 'post',
data: this.$http.adornData({
id: this.dataForm.id || undefined,
firmname: this.dataForm.firmname,
......@@ -309,89 +309,89 @@ export default {
email: this.dataForm.email,
levels: this.dataForm.levels,
pic: this.dataForm.pic,
brief: this.dataForm.brief,
}),
brief: this.dataForm.brief
})
}).then(({ data }) => {
this.loading = false;
this.loading = false
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
},
});
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg);
this.$message.error(data.msg)
}
});
})
}
});
})
},
// 上传之前校验
beforeAvatarUpload(file) {
const isJPG = file.type === "image/jpeg";
const isPNG = file.type === "image/png";
const isLt2M = file.size / 1024 / 1024 < 2;
beforeAvatarUpload (file) {
const isJPG = file.type === 'image/jpeg'
const isPNG = file.type === 'image/png'
const isLt2M = file.size / 1024 / 1024 < 2
if (!isJPG) {
if (!isPNG) {
this.$message.error("上传图片只能是 JPG, PNG 格式!");
this.$message.error('上传图片只能是 JPG, PNG 格式!')
}
}
if (!isLt2M) {
this.$message.error("上传头像图片大小不能超过 2MB!");
this.$message.error('上传头像图片大小不能超过 2MB!')
}
if (file) {
var windowURL = window.URL || window.webkitURL;
this.imgUrlStr = windowURL.createObjectURL(file);
this.dialogVisible = true;
this.imgUrl.append("file", file);
var windowURL = window.URL || window.webkitURL
this.imgUrlStr = windowURL.createObjectURL(file)
this.dialogVisible = true
this.imgUrl.append('file', file)
}
},
Upload() {
Upload () {
this.$http({
url: this.$http.adornUrl("/office/file/uploadFile"),
method: "post",
url: this.$http.adornUrl('/office/file/uploadFile'),
method: 'post',
data: this.imgUrl,
headers: {
"Content-Type": "multipart/form-data",
},
'Content-Type': 'multipart/form-data'
}
})
.then((res) => {
console.log(res);
this.dataForm.pic = res.data.data;
console.log(res)
this.dataForm.pic = res.data.data
})
.catch((err) => {
console.log(err);
});
console.log(err)
})
},
// 选择栏目
handleChange(value) {
handleChange (value) {
if (value.length === 1) {
this.classid = value[0];
this.classid = value[0]
} else if (value.length === 2) {
this.dataForm.classid = value[0];
this.dataForm.cclassid = value[1];
this.dataForm.classid = value[0]
this.dataForm.cclassid = value[1]
}
},
clearInp() {
this.$refs["dataForm"].resetFields();
this.imgUrlStr = "";
this.dialogVisible = false;
this.ueditor.value = "";
clearInp () {
this.$refs['dataForm'].resetFields()
this.imgUrlStr = ''
this.dialogVisible = false
this.ueditor.value = ''
},
// 更新父子组件内容
editorReady(instance) {
instance.setContent(this.dataForm.brief);
instance.addListener("contentChange", () => {
this.dataForm.brief = instance.getContent();
});
},
},
};
editorReady (instance) {
instance.setContent(this.dataForm.brief)
instance.addListener('contentChange', () => {
this.dataForm.brief = instance.getContent()
})
}
}
}
</script>
<style scoped>
/* .form-list{
......
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