修改现场反馈问题

This commit is contained in:
GGJ
2024-10-10 10:46:10 +08:00
parent 0877ae5df0
commit facd4f55c5
12 changed files with 198 additions and 313 deletions

View File

@@ -7,9 +7,9 @@ import { isNumber } from '@/utils/is'
import { ElMessage } from 'element-plus'
import { useLocaleStore } from '@/stores/modules/locale'
import { getAccessToken, getTenantId } from '@/utils/auth'
import { useAdminInfo } from '@/stores/adminInfo'
defineOptions({ name: 'Editor' })
const adminInfo = useAdminInfo()
type InsertFnType = (url: string, alt: string, href: string) => void
const localeStore = useLocaleStore()
@@ -104,8 +104,7 @@ const editorConfig = computed((): IEditorConfig => {
// 自定义增加 http header
headers: {
Accept: '*',
Authorization: 'Bearer ' + getAccessToken(),
'tenant-id': getTenantId()
Authorization: adminInfo.getToken(),
},
// 跨域是否传递 cookie ,默认为 false

View File

@@ -98,7 +98,7 @@ const initChart = () => {
end: 100
}
],
toolbox:props.options?.toolbox||{},
toolbox: props.options?.toolbox || {},
color: props.options?.color || color,
series: props.options?.series,
...props.options?.options
@@ -141,6 +141,7 @@ const handlerYAxis = () => {
nameTextStyle: {
color: '#000'
},
splitNumber: 5,
minInterval: 1,
axisLine: {
show: true,

View File

@@ -1,5 +1,5 @@
<template>
<div style="width: 600px">
<div style="width: 540px">
<el-select v-model="interval" style="min-width: 90px; width: 90px; margin-right: 10px" @change="timeChange">
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
@@ -397,7 +397,11 @@ const next = () => {
endTime = presentY + '-0' + presentM + '-' + presentD
}
} else {
endTime = presentY + '-' + presentM + '-' + presentD
if (presentD < 10) {
endTime = presentY + '-' + presentM + '-0' + presentD
} else {
endTime = presentY + '-' + presentM + '-' + presentD
}
}
} else {
startTime = year + '-01-01'

View File

@@ -28,7 +28,7 @@
<!-- tag -->
<div v-if="field.render == 'tag' && fieldValue !== ''">
<el-tag :type="getTagType(fieldValue, field.custom) || 'primary'" :effect="field.effect || ''" size="small">
<el-tag :type="getTagType(fieldValue, field.custom) || 'primary'" size="small">
{{ field.replaceValue ? field.replaceValue[fieldValue] : fieldValue }}
</el-tag>
</div>

View File

@@ -1,28 +1,20 @@
<template>
<div style="border: 1px solid #e4e4e4; height: 100%">
<Toolbar
style="border-bottom: 1px solid #e4e4e4; border-top: 1px solid #e4e4e4"
:editor="editorRef"
:defaultConfig="toolbarConfig"
mode="default"
/>
<Editor
v-bind="$attrs"
:defaultConfig="editorConfig"
mode="default"
@onCreated="handleCreated"
style="height: calc(100% - 42px)"
/>
<Toolbar style="border-bottom: 1px solid #e4e4e4; border-top: 1px solid #e4e4e4" :editor="editorRef"
:defaultConfig="toolbarConfig" mode="default" />
<Editor v-bind="$attrs" :defaultConfig="editorConfig" mode="default" @onCreated="handleCreated"
style="height: calc(100% - 42px)" />
</div>
</template>
<script lang="ts" setup>
import '@wangeditor/editor/dist/css/style.css' // 引入 css
import { getAccessToken, getTenantId } from '@/utils/auth'
import { onBeforeUnmount, ref, shallowRef, onMounted } from 'vue'
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { useAdminInfo } from '@/stores/adminInfo'
// 编辑器实例,必须用 shallowRef
const editorRef = shallowRef()
const adminInfo = useAdminInfo()
// 内容 HTML
const valueHtml = ref('<p>hello</p>')
@@ -51,7 +43,12 @@ const editorConfig = {
compress: true,
uploadFileName: 'file',
withCredentials: true,
headers: {},
headers: {
Accept: '*',
Authorization: adminInfo.getToken(),
},
meta: { path: '/supervision/' },
timeout: 0,
customInsert(res: any, insertFn: InsertFnType) {