adtec-core-package 2.7.7 → 2.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adtec-core-package",
3
- "version": "2.7.7",
3
+ "version": "2.7.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  <script setup lang="ts">
18
18
  import { AiEditor } from 'aieditor'
19
19
  import 'aieditor/dist/style.css'
20
- import type { WatchStopHandle } from 'vue'
20
+ import { onActivated, type WatchStopHandle } from 'vue'
21
21
  import { onMounted, onUnmounted, ref, watch } from 'vue'
22
22
  import { ElMessage } from 'element-plus'
23
23
 
@@ -366,6 +366,7 @@ onMounted(() => {
366
366
  ]
367
367
  },
368
368
  onCreated: (editor: AiEditor) => {
369
+ setFooter()
369
370
  stopWatchByType(WatchType.initWatch)
370
371
  watchHandlers.value[WatchType.initWatch] = watch(
371
372
  () => props.isEdit,
@@ -402,7 +403,19 @@ onMounted(() => {
402
403
  aiEditor = new AiEditor(config)
403
404
  }, 100)
404
405
  })
405
-
406
+ onActivated(()=>{
407
+ const header = divRef.value?.querySelector('aie-header') as HTMLElement
408
+ if (header) {
409
+ const div = header.querySelector('div') as HTMLElement
410
+ div.style.justifyContent = props.isEdit ? '' : 'end'
411
+ const menuItems = header.querySelectorAll('.aie-menu-item:not(:last-child)')
412
+ if (menuItems.length) {
413
+ menuItems.forEach((item) => {
414
+ item.style.display = props.isEdit ? '' : 'none'
415
+ })
416
+ }
417
+ }
418
+ })
406
419
  const setFooter = () => {
407
420
  const footer = divRef.value?.querySelector('aie-footer') as HTMLElement
408
421
  if (footer) {
@@ -75,7 +75,7 @@
75
75
  ></el-icons>
76
76
  </el-flex>
77
77
  </el-flex>
78
- <slot @submit.prevent ></slot>
78
+ <slot></slot>
79
79
  <el-flex align="flex-end" justify="flex-end" height="40px" style="border-top: var(--border)">
80
80
  <el-button @click="reset">重置</el-button>
81
81
  <el-button type="primary" @click="search">查询</el-button>
@@ -210,7 +210,7 @@ const getAccept = computed(() => {
210
210
  } else if (props.accept === 'ppt') {
211
211
  return '.ppt,.pptx'
212
212
  } else {
213
- return ''
213
+ return undefined
214
214
  }
215
215
  })
216
216
  const getIcon = (fileName: string) => {
@@ -270,7 +270,7 @@ const beforeUpload = (file: File) => {
270
270
  ?.split(',')
271
271
  .map(suffix => suffix.slice(1).toLowerCase())
272
272
  const fileSuffix = file.name.split('.').pop()?.toLowerCase()
273
- if (acceptSuffixes && !acceptSuffixes.includes(fileSuffix)) {
273
+ if (acceptSuffixes && !acceptSuffixes.includes(fileSuffix??'')) {
274
274
  ElMessage.error(`文件 ${file.name} 格式不支持,仅允许 ${getAccept.value}!`)
275
275
  setTimeout(() => {
276
276
  ref_upload.value?.clearFiles(["ready"])