Commit 13fd76ea authored by 彭松's avatar 彭松
parents fef13653 eccf5c70
......@@ -14,12 +14,11 @@
<!-- 富文本 -->
<quill-editor
class="editor ql-editor"
v-model="value"
v-model="contnet"
ref="myQuillEditor"
:options="editorOption"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@change="onEditorChange($event)"
>
</quill-editor>
</div>
......@@ -106,9 +105,7 @@ export default {
data() {
return {
quillUpdateImg: false, // 根据图片上传状态来确定是否显示loading动画,刚开始是false,不显示
api: process.env.VUE_APP_API_BASE_URL.includes("base")
? process.env.VUE_APP_API_BASE_URL.replace("base", "")
: process.env.VUE_APP_API_BASE_URL + "/",
api: process.env.VUE_APP_API_BASE_URL + "/",
editorOption: {
theme: "snow", // or 'bubble'
placeholder: "请输入文本......",
......@@ -151,7 +148,16 @@ export default {
},
};
},
computed: {
contnet: {
get() {
return this.value;
},
set(val) {
this.$emit("input", val);
},
},
},
methods: {
onEditorBlur() {
//失去焦点事件
......@@ -159,10 +165,6 @@ export default {
onEditorFocus() {
//获得焦点事件
},
onEditorChange() {
//内容改变事件
this.$emit("input", this.value);
},
// 富文本图片上传前
beforeUpload() {
......
......@@ -34,6 +34,22 @@
</a-form-model-item>
<a-form-model-item label="应用图标" prop="appIconPath">
<a-upload
name="file"
list-type="picture-card"
:action="api + 'base/file/commonupload'"
:file-list="iconFileList"
@change="handleChangeIcon"
:accept="accept"
:before-upload="iconBeforeUpload"
@preview="handlePreview"
>
<div v-if="iconFileList.length < 1">
<a-icon type="plus" />
<div class="ant-upload-text">选择图标</div>
</div>
</a-upload>
<!-- <a-upload
name="file"
list-type="picture-card"
class="avatar-uploader"
......@@ -51,7 +67,7 @@
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">选择图标</div>
</div>
</a-upload>
</a-upload> -->
</a-form-model-item>
<a-form-model-item label="应用简介" prop="summary">
<a-textarea
......@@ -150,6 +166,11 @@
<a-button type="primary" @click="onSubmit"> 保存 </a-button>
</a-space>
</div>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</a-drawer>
</div>
</template>
......@@ -159,9 +180,11 @@ import YSwitch from "../../../../components/yswitch/YSwitch.vue";
import { saveApp } from "@/services/market";
import { mapGetters } from "vuex";
import { changeCodeNumber } from "@/utils/validate";
import PrevieModal from "@/components/PrevieModal.vue";
export default {
components: {
YSwitch,
PrevieModal,
},
props: {
title: {
......@@ -184,8 +207,12 @@ export default {
},
data() {
return {
accept: "image/jpeg,image/png,image/svg+xml",
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
previewData: {}, // 预览
previewVisible: false,
iconFileList: [],
labelCol: {
span: 3,
},
......@@ -290,27 +317,51 @@ export default {
// 图标上传之前
iconBeforeUpload(file) {
const isJpgOrPng =
file.type === "image/jpeg" || file.type === "image/png";
file.type === "image/jpeg" ||
file.type === "image/png" ||
file.type === "image/svg+xml";
if (!isJpgOrPng) {
this.$message.error("请上传jpeg或者png格式图片!");
this.$message.error("请上传jpeg、png或者svg格式图片!");
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error("图片大小不能超过 2MB!");
const isLt5M = file.size / 1024 / 1024 < 5;
if (!isLt5M) {
this.$message.error("图片大小不能超过 5MB!");
}
return isJpgOrPng && isLt2M;
return isJpgOrPng && isLt5M;
},
// 上传图标
handleChangeIcon(info) {
if (info.file.status === "uploading") {
this.loading = true;
return;
}
if (info.file.status === "done") {
this.form.appIconPath = info.file.response.url;
this.loading = false;
handleChangeIcon({ fileList }) {
// if (info.file.status === "uploading") {
// this.loading = true;
// return;
// }
// if (info.file.status === "done") {
// this.form.appIconPath = info.file.response.url;
// this.loading = false;
// }
this.iconFileList = [...fileList].slice(-1);
this.iconFileList = this.iconFileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api2 + v.response.url;
}
return v;
});
if (this.iconFileList[0]) {
this.form.appIconPath = this.iconFileList[0].url2;
} else {
this.form.appIconPath = "";
}
},
// 预览
handlePreview(info) {
this.previewData = {
type: "img",
url: info.url,
};
this.previewVisible = true;
},
// 上传应用
handleChangeFile(info) {
let fileList = [...info.fileList];
......@@ -338,7 +389,6 @@ export default {
},
// 编辑
onEdit(data) {
console.log(data);
this.form = { ...data };
this.fileList = [
{
......@@ -348,6 +398,15 @@ export default {
url: this.form.filePath,
},
];
this.iconFileList = [
{
uid: "-2",
name: this.form.appIconPath,
status: "done",
url: this.api2 + this.form.appIconPath,
url2: this.form.appIconPath,
},
];
},
// 选中站点
changeSite(value, label) {
......
......@@ -57,6 +57,7 @@
</template>
<!-- 展现类型 -->
<template slot="displayType" slot-scope="text">
<!-- {{ text.displayType || "--" }} -->
<a-tag>{{ filterItems(text.displayType, dict.displayType) }} </a-tag>
</template>
<!-- 操作 -->
......
......@@ -41,6 +41,7 @@
</a-select>
</a-form-model-item>
<a-form-model-item label="展现类型" prop="displayType">
<!-- <a-input v-model="form.displayType" placeholder="请输入排序" /> -->
<a-select v-model="form.displayType" placeholder="请选择展现类型">
<a-select-option
v-for="(v, key) in dict.displayType"
......
......@@ -106,6 +106,15 @@ spring:
metadata:
response-timeout: 200000
connect-timeout: 200000
# 证照打印
- id: certificate-manager
#uri: http://192.168.0.98:21080
uri: lb://certificate-manager
predicates:
- Path=/cpm/**
metadata:
response-timeout: 200000
connect-timeout: 200000
nacos:
# Nacos 作为注册中心的配置项,对应 NacosDiscoveryProperties 配置类
discovery:
......
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