Commit afaac2d9 authored by 姬鋆屾's avatar 姬鋆屾

pref:提交产品模块所修改内容,轮播图改为多图上传,富文本等修改

parent 790d23a8
#开发环境
NODE_ENV = "development"
VUE_APP_API_BASE_URL= http://192.168.0.98:11086
......@@ -2,6 +2,7 @@
height: 100% !important;
}
.layout-menu-wrapper {
padding: 0 24px;
height: 64px !important;
line-height: 64px !important;
background: linear-gradient(90deg, #1845c6, #2999ff) !important;
......@@ -9,6 +10,13 @@
.layout-menu-wrapper .layout-logo {
font-size: 20px;
font-weight: bold;
width: 200px;
}
.layout-menu-wrapper .menu-list {
margin-left: 50px;
}
.layout-menu-wrapper .menu-list li {
padding: 0 20px;
}
.layout-menu-wrapper .menu-list li a {
display: block;
......
#app {
height: 100% !important;
height: 100% !important;
}
.layout-menu-wrapper {
height: 64px !important;
line-height: 64px !important;
background: linear-gradient(90deg, #1845c6, #2999ff) !important;
padding: 0 24px;
height: 64px !important;
line-height: 64px !important;
background: linear-gradient(90deg, #1845c6, #2999ff) !important;
.layout-logo {
font-size: 20px;
font-weight: bold;
}
.menu-list {
li {
a {
display: block;
padding: 0 12px;
height: 100%;
font-size: 14px !important;
color: rgba(254, 254, 254, .65) !important;
text-align: center !important;
i {
font-size: 14px !important;
margin-right: 10px !important;
}
.layout-logo {
font-size: 20px;
font-weight: bold;
width: 200px;
}
i:first-child {
margin-right: 0px !important;
}
.menu-list {
margin-left: 50px;
li {
padding: 0 20px;
a {
display: block;
padding: 0 12px;
height: 100%;
font-size: 14px !important;
color: rgba(254, 254, 254, 0.65) !important;
text-align: center !important;
&:hover {
color: #fff !important;
i {
font-size: 14px !important;
margin-right: 10px !important;
}
}
i:first-child {
margin-right: 0px !important;
}
&.router-link-active,
&[active] {
//background: #1890ff;
color: #fff !important;
list-style-type: none;
border-bottom: none !important;
padding-bottom: 2px;
background-color: #1890ff !important;
}
}
&:hover {
color: #fff !important;
}
&.router-link-active,
&[active] {
//background: #1890ff;
color: #fff !important;
list-style-type: none;
border-bottom: none !important;
padding-bottom: 2px;
background-color: #1890ff !important;
}
}
}
}
}
.layout-header .layout-submenu-wrapper {
width: 95% !important;
margin: 0 auto !important;
margin-top: 20px !important;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
width: 95% !important;
margin: 0 auto !important;
margin-top: 20px !important;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
}
.page.active {
width: 95% !important;
margin: 0 auto !important;
padding: 20px !important;
padding-top: 0 !important;
width: 95% !important;
margin: 0 auto !important;
padding: 20px !important;
padding-top: 0 !important;
}
.page {
height: 82% !important;
min-height: 82% !important;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
\ No newline at end of file
height: 82% !important;
min-height: 82% !important;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
// 表单节点封装,支持 input textarea select radio checkbox 及slot方式
<template>
<el-col :span='span'>
<el-form-item :label="label" :prop="prop" class='my-form-field'>
<el-col :span="span">
<el-form-item :label="label" :prop="prop" class="my-form-field">
<slot>
<el-input :disabled='disabled' :placeholder='placeholder' v-model="field" @change="emit" @input="emit" v-if='type === "text"' :class="inputClass" :clearable='clearable'></el-input>
<el-input :disabled='disabled' :placeholder='placeholder' v-model="field" @change="emit" @input="emit" type='password' v-if='type === "password"'></el-input>
<el-input-number :disabled='disabled' v-model="field" size="small" :placeholder='placeholder' @change="emit" @input="emit" v-if='type === "num"'></el-input-number>
<el-input
:disabled="disabled"
:placeholder="placeholder"
v-model="field"
@change="emit"
@input="emit"
v-if="type === 'text'"
:class="inputClass"
:clearable="clearable"
></el-input>
<el-input
:disabled="disabled"
:placeholder="placeholder"
v-model="field"
@change="emit"
@input="emit"
type="password"
v-if="type === 'password'"
></el-input>
<el-input-number
:disabled="disabled"
v-model="field"
size="small"
:placeholder="placeholder"
@change="emit"
@input="emit"
v-if="type === 'num'"
></el-input-number>
<el-input :disabled='disabled' :placeholder='placeholder' v-model="field" @change="emit" :rows='rows' @input="emit" v-if='type === "textarea"' type='textarea' :autosize="textareaSize" :class="inputClass"></el-input>
<el-input
:disabled="disabled"
:placeholder="placeholder"
v-model="field"
@change="emit"
:rows="rows"
@input="emit"
v-if="type === 'textarea'"
type="textarea"
:autosize="textareaSize"
:class="inputClass"
></el-input>
<el-select :disabled='disabled' v-model="field" @change="emit" :multiple='multiple' :filterable='filterable' :clearable='clearable' v-if='type === "select"'>
<el-select
:disabled="disabled"
v-model="field"
@change="emit"
:multiple="multiple"
:filterable="filterable"
:clearable="clearable"
v-if="type === 'select'"
>
<el-option
v-for="($label, $value) in enumData"
:key="$value"
......@@ -21,25 +63,54 @@
></el-option>
</el-select>
<el-radio-group :disabled='disabled' v-model="field" @change="emit" v-if='type === "radio"'>
<el-radio-group
:disabled="disabled"
v-model="field"
@change="emit"
v-if="type === 'radio'"
>
<el-radio
v-for='($label, $value) in enumData'
:key='$value'
v-for="($label, $value) in enumData"
:key="$value"
:label="$value"
>{{$label}}</el-radio>
>{{ $label }}</el-radio
>
</el-radio-group>
<el-checkbox-group :disabled='disabled' v-model="field" @change="emit" v-if='type === "checkbox"'>
<el-checkbox-group
:disabled="disabled"
v-model="field"
@change="emit"
v-if="type === 'checkbox'"
>
<el-checkbox
v-for='($label, $value) in enumData'
:key='$value'
v-for="($label, $value) in enumData"
:key="$value"
:label="$value"
>{{$label}}</el-checkbox>
>{{ $label }}</el-checkbox
>
</el-checkbox-group>
<el-date-picker :disabled='disabled' type="date" value-format="yyyy-MM-dd HH:mm:ss" v-model="field" @change="emit" @input="emit" placeholder="选择日期" v-if='type === "date"'></el-date-picker>
<el-date-picker :disabled='disabled' type="datetime" value-format="yyyy-MM-dd HH:mm:ss" v-model="field" @change="emit" @input="emit" placeholder="选择日期" v-if='type === "datetime"'></el-date-picker>
<el-date-picker
:disabled="disabled"
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="field"
@change="emit"
@input="emit"
placeholder="选择日期"
v-if="type === 'date'"
></el-date-picker>
<el-date-picker
:disabled="disabled"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="field"
@change="emit"
@input="emit"
placeholder="选择日期"
v-if="type === 'datetime'"
></el-date-picker>
</slot>
</el-form-item>
</el-col>
......@@ -48,29 +119,29 @@
<script>
export default {
props: {
// 字段值
// 字段值
value: {
type: [String, Number, Array],
},
// 组件的el-col span宽度 1-24,默认12
span: {
span: {
type: Number,
default: 12,
},
// 字段类型: text,password,textarea,select,radio,checkbox,date,datetime
type: {
type: {
type: String,
default: 'text',
default: "text",
},
// 字段name
prop: {
type: String,
default: '',
default: "",
},
// 字段中文标题
label: {
type: String,
default: '',
default: "",
},
// 是否禁用
disabled: {
......@@ -80,18 +151,18 @@ export default {
// 是否提示
placeholder: {
type: String,
default: '',
default: "",
},
// 字段所需的枚举类型
enumData: {
type: Object,
default: ()=>{},
default: () => {},
},
// textarea专用-自适应内容高度
textareaSize: {
type: Object,
default: ()=>{},
default: () => {},
},
// select专用-是否可搜索
filterable: {
......@@ -111,38 +182,39 @@ export default {
// 字段所需的枚举类型
options: {
type: Array,
default: ()=>[],
default: () => [],
},
children: {
type: Array,
default: ()=>[],
default: () => [],
},
inputClass: {
type: String,
default: '',
}
default: "",
},
},
methods: {
emit() {
this.$emit('input', this.newVal)
this.$emit('change', this.newVal)
}
this.$emit("input", this.newVal);
this.$emit("change", this.newVal);
console.log(this.newVal);
},
},
computed: {
field: {
get() {
return this.value
return this.value;
},
set(val) {
this.newVal = val;
}
}
},
},
},
data() {
return {
newVal: this.value,
}
}
}
};
},
};
</script>
......@@ -11,11 +11,11 @@
<router-link to="/">
<img
:src="sysLogo ? sysLogo : require('../assets/images/logo.png')"
style="margin-bottom:5px"
style="margin-bottom: 5px"
height="40"
alt=""
/>
<b style="color:white;font-size:18px;"
<b style="color: white; font-size: 18px"
>&nbsp;&nbsp;&nbsp;
{{ sysName ? sysName : "企业服务平台" }}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b
......@@ -43,7 +43,7 @@
</span> -->
<el-dropdown @command="handleCommand">
<span class="el-dropdown-link" style="color:white">
<span class="el-dropdown-link" style="color: white">
{{ userData.currUserName }}
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
......@@ -249,9 +249,7 @@ export default {
}
}
}
.layout-profile {
padding-right: 30px;
}
}
.layout-submenu-wrapper {
......
......@@ -2,7 +2,7 @@
<template>
<div class="component-upload-image">
<el-upload
:action="uploadImgUrl+'?prePath=' +prePath"
:action="uploadImgUrl + '?prePath=' + prePath"
list-type="picture-card"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
......@@ -11,14 +11,22 @@
:show-file-list="false"
:headers="headers"
style="display: inline-block; vertical-align: top"
v-if="!isList"
>
<el-image v-if="!value" :src="value">
<el-image
v-if="!value"
:src="value.indexOf('http') == -1 ? baseUrl + value : value"
>
<div slot="error" class="image-slot">
<i class="el-icon-plus" />
</div>
</el-image>
<div v-else class="image">
<el-image :src="value" :style="`width:150px;height:150px;`" fit="fill"/>
<el-image
:src="value.indexOf('http') == -1 ? baseUrl + value : value"
:style="`width:150px;height:150px;`"
fit="fill"
/>
<div class="mask">
<div class="actions">
<span title="预览" @click.stop="dialogVisible = true">
......@@ -31,8 +39,36 @@
</div>
</div>
</el-upload>
<el-dialog :visible.sync="dialogVisible" title="预览" width="800" append-to-body>
<img :src="value" style="display: block; max-width: 100%; margin: 0 auto;">
<el-upload
:action="uploadImgUrl + '?prePath=' + prePath"
list-type="picture-card"
:on-remove="handleRemove"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:on-preview="handlePictureCardPreview"
:file-list="imgList"
accept=".jpeg,.png,.jpg,.bmp,.gif"
:headers="headers"
v-else
>
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog
:visible.sync="dialogVisible"
title="预览"
width="800"
append-to-body
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
v-if="isList"
/>
<img
:src="value"
style="display: block; max-width: 100%; margin: 0 auto"
v-else
/>
</el-dialog>
</div>
</template>
......@@ -41,8 +77,11 @@
export default {
data() {
return {
baseUrl: process.env.VUE_APP_API_BASE_URL + "/",
dialogVisible: false,
uploadImgUrl: "/enterprise/file/commonupload", // 上传的图片服务器地址
uploadImgUrl: "/enterprise/file/commonupload", // 上传的图片服务器地址
imgList: [],
dialogImageUrl: "",
};
},
props: {
......@@ -53,16 +92,52 @@ export default {
//保存服务器路径前缀地址
prePath: {
type: String,
default: '',
default: "",
},
isList: {
type: Boolean,
default: false,
},
},
mounted() {
// 判断是否为多图上传
if (this.isList) {
if (this.value && this.value != "") {
this.imgList = [];
let arr = [];
arr = this.value?.split(",");
arr.forEach((v) => {
let obj = {};
obj.name = "轮播图";
obj.uid = parseInt(Math.random(0, 100));
v.indexOf("http") == -1
? (obj.url = this.baseUrl + v)
: (obj.url = v);
this.imgList.push(obj);
});
}
}
},
methods: {
handleRemove(file, fileList) {
console.log(fileList);
this.imgList = fileList;
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
removeImage() {
this.$emit("input", "");
},
handleUploadSuccess(res) {
this.$emit("input", res.url);
this.loading.close();
handleUploadSuccess(res, file, fileList) {
if (this.isList) {
this.loading.close();
this.imgList = fileList;
} else {
this.$emit("input", res.url);
this.loading.close();
}
},
handleBeforeUpload() {
this.loading = this.$loading({
......
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