1.优化上传
parent
02642ee3d1
commit
0886714c0f
|
|
@ -111,10 +111,10 @@
|
|||
</div>
|
||||
<div class="text-line-1 name">
|
||||
<template v-if="edit_index !== -1 && edit_index === index">
|
||||
<el-input v-model="item.original" type="text" placeholder="请输入内容" size="small" @change="edit_input_change" />
|
||||
<el-input v-model="item.original" v-focus type="text" placeholder="请输入内容" size="small" @blur="edit_index = -1" @keydown="edit_input_keydown" @change="edit_input_change" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="ptb-1 plr-7">
|
||||
<div class="ptb-1 plr-7 c-pointer no-select" @dblclick="edit_index = index">
|
||||
{{ item.original }}
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -555,10 +555,16 @@ const edit_event = (item: any, index: number) => {
|
|||
// 输入框 输入完成
|
||||
const edit_input_change = (val: string) => {
|
||||
edit_index.value = -1;
|
||||
UploadAPI.saveAttachmentName({ id: edit_id.value, original: val }).then((res) => {
|
||||
UploadAPI.saveAttachmentName({ id: edit_id.value, original: val || '' }).then((res) => {
|
||||
ElMessage.success('修改成功!');
|
||||
});
|
||||
};
|
||||
const edit_input_keydown = (event: any) => {
|
||||
// 阻止回车键默认事件
|
||||
if (event.keyCode === 13) {
|
||||
edit_index.value = -1;
|
||||
}
|
||||
};
|
||||
|
||||
// 删除图片/视频/文件
|
||||
const del_event = (item: uploadList) => {
|
||||
|
|
|
|||
10
src/main.ts
10
src/main.ts
|
|
@ -7,15 +7,19 @@ import Particles from 'vue3-particles';
|
|||
|
||||
import common from '@/utils/common';
|
||||
//default styles
|
||||
import Vue3DraggableResizable from 'vue3-draggable-resizable'
|
||||
import 'vue3-draggable-resizable/dist/Vue3DraggableResizable.css'
|
||||
import Vue3DraggableResizable from 'vue3-draggable-resizable';
|
||||
import 'vue3-draggable-resizable/dist/Vue3DraggableResizable.css';
|
||||
|
||||
import '@/styles/index.scss';
|
||||
const app = createApp(App);
|
||||
|
||||
// 将common设置为全局
|
||||
app.config.globalProperties.$common = common;
|
||||
|
||||
app.directive('focus', {
|
||||
mounted(el) {
|
||||
el.querySelector('input').focus();
|
||||
},
|
||||
});
|
||||
app.use(router);
|
||||
app.use(Particles);
|
||||
app.use(Vue3DraggableResizable);
|
||||
|
|
|
|||
|
|
@ -263,3 +263,11 @@
|
|||
height: 0.8rem;
|
||||
background-color: #f0f2f5;
|
||||
}
|
||||
|
||||
// 禁止双击选中
|
||||
.no-select {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
Loading…
Reference in New Issue