Compare commits
71 Commits
@ -0,0 +1,124 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="Palette2"> |
|||
<group name="Swing"> |
|||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> |
|||
</item> |
|||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> |
|||
</item> |
|||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> |
|||
</item> |
|||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true"> |
|||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> |
|||
</item> |
|||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> |
|||
<initial-values> |
|||
<property name="text" value="Button" /> |
|||
</initial-values> |
|||
</item> |
|||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
|||
<initial-values> |
|||
<property name="text" value="RadioButton" /> |
|||
</initial-values> |
|||
</item> |
|||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> |
|||
<initial-values> |
|||
<property name="text" value="CheckBox" /> |
|||
</initial-values> |
|||
</item> |
|||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> |
|||
<initial-values> |
|||
<property name="text" value="Label" /> |
|||
</initial-values> |
|||
</item> |
|||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
|||
<preferred-size width="150" height="-1" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
|||
<preferred-size width="150" height="-1" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> |
|||
<preferred-size width="150" height="-1" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> |
|||
</item> |
|||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> |
|||
<preferred-size width="150" height="50" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
|||
<preferred-size width="200" height="200" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> |
|||
<preferred-size width="200" height="200" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
|||
</item> |
|||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> |
|||
</item> |
|||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> |
|||
</item> |
|||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> |
|||
</item> |
|||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> |
|||
<preferred-size width="-1" height="20" /> |
|||
</default-constraints> |
|||
</item> |
|||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false"> |
|||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> |
|||
</item> |
|||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false"> |
|||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> |
|||
</item> |
|||
</group> |
|||
</component> |
|||
</project> |
|||
@ -0,0 +1,61 @@ |
|||
import request from '@/utils/request'; |
|||
import {getToken} from "@/utils/auth"; |
|||
|
|||
export function getBaoGaoInfo(params) { |
|||
return request({ |
|||
url: '/baoGao/getBaoGaoInfo', |
|||
method: 'post', |
|||
data:params, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
export function exportToWord(params) { |
|||
return request({ |
|||
url: '/baoGao/exportToWord', |
|||
method: 'post', |
|||
data:params, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
export function getAllHistory(params) { |
|||
return request({ |
|||
url: '/baoGao/getAllHistory', |
|||
method: 'post', |
|||
data:params, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function downLoadBaoGao(id) { |
|||
return request({ |
|||
url: '/baoGao/downLoadBaoGao?id='+id, |
|||
method: 'get', |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
export function insertBaoGao(params) { |
|||
return request({ |
|||
url: '/baoGao/insertBaoGao', |
|||
method: 'post', |
|||
data:params, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,38 @@ |
|||
import request from '@/utils/request'; |
|||
import {getToken} from "@/utils/auth"; |
|||
|
|||
|
|||
export function exportAll(data) { |
|||
return request({ |
|||
url: '/export/exportAll', |
|||
method: 'post', |
|||
data:data, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
export function getFileId() { |
|||
return request({ |
|||
url: '/file/getFileId', |
|||
method: 'get', |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function getFileIdData() { |
|||
return request({ |
|||
url: '/export/getFileIdData', |
|||
method: 'get', |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
|
|||
@ -0,0 +1,59 @@ |
|||
import request from '@/utils/request'; |
|||
import {getToken} from "@/utils/auth"; |
|||
|
|||
|
|||
|
|||
export function addFile(file, config = {}) { |
|||
const formData = new FormData(); |
|||
formData.append('file', file); |
|||
|
|||
// 合并默认配置与传入的配置
|
|||
const defaultConfig = { |
|||
headers: {'Authorization': 'Bearer ' + getToken()}, |
|||
|
|||
}; |
|||
const finalConfig = {...defaultConfig, ...config}; |
|||
|
|||
return request({ |
|||
url: '/file/addFile', |
|||
method: 'post', |
|||
data: formData, |
|||
...finalConfig |
|||
}); |
|||
} |
|||
|
|||
export function addNode(data) { |
|||
return request({ |
|||
url: '/file/addNodeNew', |
|||
method: 'post', |
|||
data:data |
|||
}) |
|||
} |
|||
|
|||
export function getFileIdByDocId(data) { |
|||
return request({ |
|||
url: '/file/getFileIdByDocId', |
|||
method: 'post', |
|||
data:data |
|||
}) |
|||
} |
|||
|
|||
|
|||
export function uploadAndExecuteSql(file, config = {}) { |
|||
const formData = new FormData(); |
|||
formData.append('sqlFile', file); |
|||
|
|||
// 合并默认配置与传入的配置
|
|||
const defaultConfig = { |
|||
headers: {'Authorization': 'Bearer ' + getToken()}, |
|||
|
|||
}; |
|||
const finalConfig = {...defaultConfig, ...config}; |
|||
|
|||
return request({ |
|||
url: '/file/uploadAndExecuteSql', |
|||
method: 'post', |
|||
data: formData, |
|||
...finalConfig |
|||
}); |
|||
} |
|||
@ -0,0 +1,86 @@ |
|||
import request from '@/utils/request'; |
|||
import {getToken} from "@/utils/auth"; |
|||
|
|||
|
|||
export function getDocList(data) { |
|||
return request({ |
|||
url: '/kcDoc/getDocList', |
|||
method: 'post', |
|||
data:data, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
export function getSpList(data) { |
|||
return request({ |
|||
url: '/kcDoc/getSpList', |
|||
method: 'post', |
|||
data:data, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function getDhList(data) { |
|||
return request({ |
|||
url: '/kcDoc/getDhList', |
|||
method: 'post', |
|||
data:data, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
export function getJsList(data) { |
|||
return request({ |
|||
url: '/kcDoc/getJsList', |
|||
method: 'post', |
|||
data:data, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
export function editInfo(data) { |
|||
return request({ |
|||
url: '/kcDoc/editInfo', |
|||
method: 'post', |
|||
data:data, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
|
|||
export function getInfo(params) { |
|||
return request({ |
|||
url: '/kcDoc/getInfo', |
|||
method: 'get', |
|||
params, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
export function editInfoGraph(data) { |
|||
return request({ |
|||
url: '/kcDoc/editInfoGraph', |
|||
method: 'post', |
|||
data:data, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
|||
@ -0,0 +1,13 @@ |
|||
import request from '@/utils/request'; |
|||
import {getToken} from "@/utils/auth"; |
|||
|
|||
export function dbDLC(data) { |
|||
return request({ |
|||
url: '/pythonJs/dbDLC', |
|||
method: 'post', |
|||
data:data, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
import request from '@/utils/request'; |
|||
|
|||
|
|||
export function twdelete(id){ |
|||
return request({ |
|||
url: `/twdelete/${id}`, // 使用模板字符串来包含变量
|
|||
method: 'delete', |
|||
}); |
|||
} |
|||
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 182 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 98 KiB |
|
After Width: | Height: | Size: 101 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 186 B |
|
After Width: | Height: | Size: 643 B |
|
After Width: | Height: | Size: 178 B |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 882 B |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 360 B |
|
After Width: | Height: | Size: 373 B |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 548 B |
|
After Width: | Height: | Size: 774 B |
|
After Width: | Height: | Size: 374 B |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 156 B |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 662 B |
|
After Width: | Height: | Size: 933 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 329 KiB |
|
After Width: | Height: | Size: 948 B |
|
After Width: | Height: | Size: 370 B |
|
After Width: | Height: | Size: 1007 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 626 KiB |
|
After Width: | Height: | Size: 618 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 581 B |
|
After Width: | Height: | Size: 971 KiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 971 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 894 B |
|
After Width: | Height: | Size: 893 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 413 B |
@ -0,0 +1,333 @@ |
|||
<template> |
|||
<div> |
|||
<el-upload |
|||
:action="uploadUrl" |
|||
:before-upload="handleBeforeUpload" |
|||
:on-success="handleUploadSuccess" |
|||
:on-error="handleUploadError" |
|||
name="file" |
|||
:show-file-list="false" |
|||
:headers="headers" |
|||
style="display: none" |
|||
ref="upload" |
|||
v-if="this.type == 'url'" |
|||
> |
|||
</el-upload> |
|||
<div class="editor" ref="editor" :style="styles"></div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Quill from "quill"; |
|||
import "quill/dist/quill.core.css"; |
|||
import "quill/dist/quill.snow.css"; |
|||
import "quill/dist/quill.bubble.css"; |
|||
import {getToken} from "@/utils/auth"; |
|||
|
|||
export default { |
|||
// eslint-disable-next-line vue/multi-word-component-names |
|||
name: "Editor", |
|||
props: { |
|||
/* 编辑器的内容 */ |
|||
value: { |
|||
type: String, |
|||
default: "", |
|||
}, |
|||
/* 高度 */ |
|||
height: { |
|||
type: Number, |
|||
default: null, |
|||
}, |
|||
/* 最小高度 */ |
|||
minHeight: { |
|||
type: Number, |
|||
default: null, |
|||
}, |
|||
maxHeigth:{ |
|||
type: Number, |
|||
default: null, |
|||
}, |
|||
/* 只读 */ |
|||
readOnly: { |
|||
type: Boolean, |
|||
default: false, |
|||
}, |
|||
/* 上传文件大小限制(MB) */ |
|||
fileSize: { |
|||
type: Number, |
|||
default: 5, |
|||
}, |
|||
/* 类型(base64格式、url格式) */ |
|||
type: { |
|||
type: String, |
|||
default: "url", |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
uploadUrl:"http://127.0.0.1:10035/fileUpdate/upload", // 上传的图片服务器地址 |
|||
headers: { |
|||
Authorization: "Bearer " + getToken() |
|||
}, |
|||
Quill: null, |
|||
currentValue: "", |
|||
options: { |
|||
theme: "snow", |
|||
bounds: document.body, |
|||
debug: "warn", |
|||
modules: { |
|||
// 工具栏配置 |
|||
toolbar: [ |
|||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线 |
|||
["blockquote", "code-block"], // 引用 代码块 |
|||
[{list: "ordered"}, {list: "bullet"}], // 有序、无序列表 |
|||
[{indent: "-1"}, {indent: "+1"}], // 缩进 |
|||
[{size: ["small", false, "large", "huge"]}], // 字体大小 |
|||
[{header: [1, 2, 3, 4, 5, 6, false]}], // 标题 |
|||
[{color: []}, {background: []}], // 字体颜色、字体背景颜色 |
|||
[{align: []}], // 对齐方式 |
|||
["clean"], // 清除文本格式 |
|||
["link", "image", "video"] // 链接、图片、视频 |
|||
], |
|||
}, |
|||
placeholder: "请输入内容", |
|||
readOnly: this.readOnly, |
|||
}, |
|||
}; |
|||
}, |
|||
computed: { |
|||
styles() { |
|||
let style = {}; |
|||
if (this.minHeight) { |
|||
style.minHeight = `${this.minHeight}px`; |
|||
} |
|||
if (this.maxHeigth) { |
|||
style.maxHeigth = `${this.maxHeigth}px`; |
|||
} |
|||
if (this.height) { |
|||
style.height = `${this.height}px`; |
|||
} |
|||
return style; |
|||
}, |
|||
}, |
|||
watch: { |
|||
value: { |
|||
handler(val) { |
|||
if (val !== this.currentValue) { |
|||
this.currentValue = val === null ? "" : val; |
|||
if (this.Quill) { |
|||
this.Quill.pasteHTML(this.currentValue); |
|||
} |
|||
} |
|||
}, |
|||
immediate: true, |
|||
}, |
|||
}, |
|||
mounted() { |
|||
this.init(); |
|||
}, |
|||
beforeDestroy() { |
|||
this.Quill = null; |
|||
}, |
|||
methods: { |
|||
init() { |
|||
const editor = this.$refs.editor; |
|||
this.Quill = new Quill(editor, this.options); |
|||
// 如果设置了上传地址则自定义图片上传事件 |
|||
if (this.type == 'url') { |
|||
let toolbar = this.Quill.getModule("toolbar"); |
|||
toolbar.addHandler("image", (value) => { |
|||
|
|||
if (value) { |
|||
this.$refs.upload.$children[0].$refs.input.click(); |
|||
} else { |
|||
this.quill.format("image", false); |
|||
} |
|||
}); |
|||
} |
|||
|
|||
this.Quill.pasteHTML(this.currentValue); |
|||
// eslint-disable-next-line no-unused-vars |
|||
this.Quill.on("text-change", (delta, oldDelta, source) => { |
|||
const html = this.$refs.editor.children[0].innerHTML; |
|||
const text = this.Quill.getText(); |
|||
const quill = this.Quill; |
|||
this.currentValue = html; |
|||
this.$emit("input", html); |
|||
this.$emit("on-change", {html, text, quill}); |
|||
}); |
|||
this.Quill.on("text-change", (delta, oldDelta, source) => { |
|||
this.$emit("on-text-change", delta, oldDelta, source); |
|||
}); |
|||
this.Quill.on("selection-change", (range, oldRange, source) => { |
|||
this.$emit("on-selection-change", range, oldRange, source); |
|||
}); |
|||
this.Quill.on("editor-change", (eventName, ...args) => { |
|||
this.$emit("on-editor-change", eventName, ...args); |
|||
}); |
|||
}, |
|||
// 上传前校检格式和大小 |
|||
handleBeforeUpload(file) { |
|||
const type = ["image/jpeg", "image/jpg", "image/png", "image/svg"]; |
|||
const isJPG = type.includes(file.type); |
|||
// 检验文件格式 |
|||
if (!isJPG) { |
|||
this.$message.error(`图片格式错误!`); |
|||
return false; |
|||
} |
|||
// 校检文件大小 |
|||
if (this.fileSize) { |
|||
const isLt = file.size / 1024 / 1024 < this.fileSize; |
|||
if (!isLt) { |
|||
this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`); |
|||
return false; |
|||
} |
|||
} |
|||
return true; |
|||
}, |
|||
// eslint-disable-next-line no-unused-vars |
|||
handleUploadSuccess(res, file) { |
|||
// 如果上传成功 |
|||
if (res.code == 200) { |
|||
// 获取富文本组件实例 |
|||
let quill = this.Quill; |
|||
// 获取光标所在位置 |
|||
let length = quill.getSelection().index; |
|||
// this.fileToBase64(file) |
|||
// console.log(this.fileToBase64(file)) |
|||
// 插入图片 res.url为服务器返回的图片地址 |
|||
console.log("k------------") |
|||
console.log(res.data.url) |
|||
this.$emit('child-event', res.data.url); // 触发自定义事件 |
|||
quill.insertEmbed(length, "image", res.data.url); |
|||
// 调整光标到最后 |
|||
quill.setSelection(length + 1); |
|||
} else { |
|||
this.$message.error("图片插入失败"); |
|||
} |
|||
}, |
|||
|
|||
fileToBase64(file) { |
|||
return new Promise((resolve, reject) => { |
|||
// 创建一个新的 FileReader 对象 |
|||
const reader = new FileReader(); |
|||
// 读取 File 对象 |
|||
reader.readAsDataURL(file); |
|||
// 加载完成后 |
|||
reader.onload = function () { |
|||
// 将读取的数据转换为 base64 编码的字符串 |
|||
const base64String = reader.result.split(",")[1]; |
|||
// 解析为 Promise 对象,并返回 base64 编码的字符串 |
|||
resolve(base64String); |
|||
}; |
|||
|
|||
// 加载失败时 |
|||
reader.onerror = function () { |
|||
reject(new Error("Failed to load file")); |
|||
}; |
|||
}); |
|||
}, |
|||
handleUploadError() |
|||
{ |
|||
this.$message.error("图片插入失败"); |
|||
} |
|||
, |
|||
}, |
|||
} |
|||
; |
|||
</script> |
|||
|
|||
<style> |
|||
.editor, .ql-toolbar { |
|||
white-space: pre-wrap !important; |
|||
line-height: normal !important; |
|||
} |
|||
|
|||
.quill-img { |
|||
display: none; |
|||
} |
|||
|
|||
.ql-snow .ql-tooltip[data-mode="link"]::before { |
|||
content: "请输入链接地址:"; |
|||
} |
|||
|
|||
.ql-snow .ql-tooltip.ql-editing a.ql-action::after { |
|||
border-right: 0px; |
|||
content: "保存"; |
|||
padding-right: 0px; |
|||
} |
|||
|
|||
.ql-snow .ql-tooltip[data-mode="video"]::before { |
|||
content: "请输入视频地址:"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-size .ql-picker-label::before, |
|||
.ql-snow .ql-picker.ql-size .ql-picker-item::before { |
|||
content: "14px"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before, |
|||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before { |
|||
content: "10px"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before, |
|||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before { |
|||
content: "18px"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before, |
|||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before { |
|||
content: "32px"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-header .ql-picker-label::before, |
|||
.ql-snow .ql-picker.ql-header .ql-picker-item::before { |
|||
content: "文本"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, |
|||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { |
|||
content: "标题1"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, |
|||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { |
|||
content: "标题2"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, |
|||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { |
|||
content: "标题3"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, |
|||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { |
|||
content: "标题4"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before, |
|||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { |
|||
content: "标题5"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before, |
|||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { |
|||
content: "标题6"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-font .ql-picker-label::before, |
|||
.ql-snow .ql-picker.ql-font .ql-picker-item::before { |
|||
content: "标准字体"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before, |
|||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before { |
|||
content: "衬线字体"; |
|||
} |
|||
|
|||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before, |
|||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before { |
|||
content: "等宽字体"; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,28 @@ |
|||
<template> |
|||
<div style="width: 100%;height: 5vw;"> |
|||
<img src="../assets/img/foot.png" style="width: 100%;object-fit: contain;"> |
|||
</div> |
|||
|
|||
</template> |
|||
<script> |
|||
|
|||
export default { |
|||
// eslint-disable-next-line vue/multi-word-component-names |
|||
name: 'foot', |
|||
data() { |
|||
return{ |
|||
|
|||
} |
|||
|
|||
}, |
|||
methods:{ |
|||
|
|||
}, |
|||
mounted() { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
|
|||
</style> |
|||