1.优化上传

v1.0.0
sws 2024-09-04 18:17:11 +08:00
parent 02642ee3d1
commit 0886714c0f
3 changed files with 24 additions and 6 deletions

View File

@ -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) => {

View File

@ -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);

View File

@ -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;
}