qianlishi 3 years ago
parent 00052fd175
commit 8eead79f1c

@ -54,6 +54,12 @@
<div class="content unicode" style="display: block;"> <div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe70f;</span>
<div class="name">文件</div>
<div class="code-name">&amp;#xe70f;</div>
</li>
<li class="dib"> <li class="dib">
<span class="icon iconfont">&#xe724;</span> <span class="icon iconfont">&#xe724;</span>
<div class="name"></div> <div class="name"></div>
@ -714,9 +720,9 @@
<pre><code class="language-css" <pre><code class="language-css"
>@font-face { >@font-face {
font-family: 'iconfont'; font-family: 'iconfont';
src: url('iconfont.woff2?t=1625116809861') format('woff2'), src: url('iconfont.woff2?t=1625204671216') format('woff2'),
url('iconfont.woff?t=1625116809861') format('woff'), url('iconfont.woff?t=1625204671216') format('woff'),
url('iconfont.ttf?t=1625116809861') format('truetype'); url('iconfont.ttf?t=1625204671216') format('truetype');
} }
</code></pre> </code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3> <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@ -742,6 +748,15 @@
<div class="content font-class"> <div class="content font-class">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont iconfolder-o"></span>
<div class="name">
文件
</div>
<div class="code-name">.iconfolder-o
</div>
</li>
<li class="dib"> <li class="dib">
<span class="icon iconfont iconjinlingyingcaiwangtubiao01"></span> <span class="icon iconfont iconjinlingyingcaiwangtubiao01"></span>
<div class="name"> <div class="name">
@ -1732,6 +1747,14 @@
<div class="content symbol"> <div class="content symbol">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#iconfolder-o"></use>
</svg>
<div class="name">文件</div>
<div class="code-name">#iconfolder-o</div>
</li>
<li class="dib"> <li class="dib">
<svg class="icon svg-icon" aria-hidden="true"> <svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#iconjinlingyingcaiwangtubiao01"></use> <use xlink:href="#iconjinlingyingcaiwangtubiao01"></use>

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 1513211 */ font-family: "iconfont"; /* Project id 1513211 */
src: url('iconfont.woff2?t=1625116809861') format('woff2'), src: url('iconfont.woff2?t=1625204671216') format('woff2'),
url('iconfont.woff?t=1625116809861') format('woff'), url('iconfont.woff?t=1625204671216') format('woff'),
url('iconfont.ttf?t=1625116809861') format('truetype'); url('iconfont.ttf?t=1625204671216') format('truetype');
} }
.iconfont { .iconfont {
@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.iconfolder-o:before {
content: "\e70f";
}
.iconjinlingyingcaiwangtubiao01:before { .iconjinlingyingcaiwangtubiao01:before {
content: "\e724"; content: "\e724";
} }

File diff suppressed because one or more lines are too long

@ -5,6 +5,13 @@
"css_prefix_text": "icon", "css_prefix_text": "icon",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "15461480",
"name": "文件",
"font_class": "folder-o",
"unicode": "e70f",
"unicode_decimal": 59151
},
{ {
"icon_id": "182207", "icon_id": "182207",
"name": "上", "name": "上",

@ -1,18 +1,20 @@
<template> <template>
<el-upload <div>
class="upload-demo" <el-input
:action="requestUrl" clearable
:on-success="handleSucess" v-model.trim="uploadImgUrl"
:on-remove="handleRemove" size="mini"
:file-list="fileList" @change="changeInput"
:headers="headers" >
:limit="1" <template slot="append">
list-type="picture" <i class="iconfont iconfolder-o"></i>
> <input type="file" class="file" ref="files" @change="getImages" />
<el-button size="small" type="primary">点击上传</el-button> </template>
</el-upload> </el-input>
</div>
</template> </template>
<script> <script>
import axios from "axios";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
export default { export default {
model: { model: {
@ -21,8 +23,8 @@ export default {
}, },
props: { props: {
value: { value: {
type: Array, type: "",
default: [] default: ""
} }
}, },
data() { data() {
@ -31,25 +33,69 @@ export default {
headers: { headers: {
Authorization: getToken() Authorization: getToken()
}, },
fileList: [] fileList: [],
uploadImgUrl: ""
}; };
}, },
created() { created() {
this.fileList = this.value; this.uploadImgUrl = this.value;
}, },
methods: { methods: {
handleSucess(file) { getImages(el) {
console.log(file); var file = el.target.files[0];
this.fileList = [{ name: file.data.fileType, url: file.data.urlPath }]; var type = file.type.split("/")[0];
this.$emit("input", this.fileList); if (type === "image") {
this.$emit("change", this.fileList); this.upload(file);
} else {
this.$message.warn("只能上次图片格式");
}
}, },
handleRemove(file) { upload(imgUrl) {
this.fileList = []; var that = this;
this.$emit("input", []); console.log(that.headers);
this.$emit("change", []); var formdata = new FormData();
formdata.append("file", imgUrl);
axios
.post(this.requestUrl, formdata, {
headers: that.headers
})
.then(response => {
let res = response.data;
if (res.code == "200") {
that.uploadImgUrl = res.data.urlPath;
that.$emit("input", that.uploadImgUrl);
that.$emit("change", that.uploadImgUrl);
}
});
},
changeInput(e) {
if (e) {
this.uploadImgUrl = e;
} else {
this.$refs.files.value = "";
this.uploadImgUrl = "";
}
this.$emit("input", this.uploadImgUrl);
this.$emit("change", this.uploadImgUrl);
} }
} }
}; };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped>
.file {
position: absolute;
width: 100%;
padding: 100%;
right: 0;
top: 0;
opacity: 0;
}
/deep/.el-input-group__append,
/deep/.el-input-group__prepend {
padding: 0 10px !important;
overflow: hidden;
}
.iconfont {
font-size: 12px;
}
</style>

@ -319,6 +319,7 @@ export default {
widthLeftAndRight += this.widthLeftForOptions; // widthLeftAndRight += this.widthLeftForOptions; //
var middleWidth = this.bodyWidth - widthLeftAndRight; var middleWidth = this.bodyWidth - widthLeftAndRight;
console.log(middleWidth, this.bodyWidth, widthLeftAndRight);
return middleWidth; return middleWidth;
}, },
middleHeight() { middleHeight() {
@ -399,15 +400,15 @@ export default {
} }
} }
return { return {
backgroundColor: data.backgroundColor, backgroundColor: (data && data.backgroundColor) || "",
backgroundImage: data.backgroundImage, backgroundImage: (data && data.backgroundImage) || "",
height: data.height, height: (data && data.height) || "",
title: data.title, title: (data && data.title) || "",
width: data.width width: (data && data.width) || ""
}; };
}, },
handleInitEchartsData(data) { handleInitEchartsData(data) {
const widgets = data.dashboard.widgets; const widgets = data.dashboard ? data.dashboard.widgets : [];
const widgetsData = []; const widgetsData = [];
for (let i = 0; i < widgets.length; i++) { for (let i = 0; i < widgets.length; i++) {
var obj = {}; var obj = {};

@ -649,7 +649,7 @@ const widgetTools = [
name: 'imageAdress', name: 'imageAdress',
required: false, required: false,
placeholder: '', placeholder: '',
value: [{url: 'http://pic.ik123.com/uploads/allimg/190813/12-1ZQ3095508.jpg'}], value: 'http://pic.ik123.com/uploads/allimg/190813/12-1ZQ3095508.jpg',
}, },
{ {
type: 'vue-color', type: 'vue-color',

@ -45,10 +45,7 @@ export default {
}, },
imgStyle() { imgStyle() {
return { return {
imageAdress: imageAdress: this.transStyle.imageAdress,
this.options.setup.imageAdress.length > 0
? this.options.setup.imageAdress[0].url
: "",
"border-radius": this.transStyle.borderRadius + "px", "border-radius": this.transStyle.borderRadius + "px",
opacity: this.transStyle.transparency / 100 opacity: this.transStyle.transparency / 100
}; };

Loading…
Cancel
Save