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