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