ソースを参照

update

master
unknown 4年前
コミット
2ad6613972
2個のファイルの変更94行の追加20行の削除
  1. +85
    -0
      src/views/main_web/workspace/components/file-item.vue
  2. +9
    -20
      src/views/main_web/workspace/workspace.vue

+ 85
- 0
src/views/main_web/workspace/components/file-item.vue ファイルの表示

@@ -0,0 +1,85 @@
<template>
<div>
<el-tooltip
:content="file.strToolTip"
:disabled="!file.strToolTip"
placement="right"
effect="light"
>
<div class="yiyun_wenjian_list">
<div>
<!-- 非图片文件图标 -->
<div
v-if="!isImageFile"
class="defultImage-mid"
:class="`${file.extension}-mid ${
isClient && !file.isDownload && file.status === 2 ? 'toumin' : ''
}`"
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)"
/>

<!-- 图片文件图标 -->
<div
v-if="isImageFile"
class="defultImage-mid img_bg-mid"
:class="
isClient && !file.isDownload && file.status == 2 ? 'toumin' : ''
"
@contextmenu.prevent.stop="rightShowMenu($event, file, 1)"
>
<div class="file_Im gbox-mid">
<img v-lazy="imgSrc + file.alias" alt class="file_Img" />
</div>
</div>

<!-- 标签 -->
<div
class="eidtTip"
v-if="file.workStatus == 2 && file.modifyUserId !== currentUserId"
>
工作中
</div>

<div v-if="file.status == 1" class="yijianxietong isonselect_defual">
<i
class="icon font_family icon-icon_status_wenjianbiaojiwancheng yijianIcon"
title="点击启用协同"
@click="setFileStatus(file, 2, '更新为已完成', 1)"
></i>
</div>
</div>
</div>
</el-tooltip>
</div>
</template>

<script>
import system from "@/services/system";

const imgExtensionList = ["jpg", "png", "bmp", "gif", "jpeg"];

export default {
props: {
file: {
type: Object,
default: {},
currentUserId: sessionStorage.userId,
},
},
data() {
return {
isClient: system.isClient,
};
},
computed: {
isImageFile: () => {
return this.oneOf(this.file.extension, imgExtensionList);
},
},
methods: {
oneOf(target, list) {
return list.indexOf(target) !== -1;
},
},
};
</script>

+ 9
- 20
src/views/main_web/workspace/workspace.vue ファイルの表示

@@ -838,7 +838,7 @@
file.createUserId != userId file.createUserId != userId
" "
class="yiyunwenjian_infodesc" class="yiyunwenjian_infodesc"
>{{ file.cnName }}创建</span
>{{ file.createUserName }}创建</span
> >
<!--span 本来就注视着呢--> <!--span 本来就注视着呢-->
<!-- <span <!-- <span
@@ -851,7 +851,7 @@
file.createUserId != userId file.createUserId != userId
" "
class="yiyunwenjian_infodesc" class="yiyunwenjian_infodesc"
>{{ file.cnName }}创建</span
>{{ file.createUserName }}创建</span
> >
</div> </div>
<!-- 文件状态显示 --> <!-- 文件状态显示 -->
@@ -1401,7 +1401,7 @@
<span class="yiyunwenjian_infodesc"> <span class="yiyunwenjian_infodesc">
{{ file.folderName }} {{ file.folderName }}
</span> </span>
<!-- <span class="yiyunwenjian_infodesc">{{ file.cnName }}创建</span> -->
<span class="yiyunwenjian_infodesc">{{ file.createUserName }}创建</span>
<div class="top_optionBar"> <div class="top_optionBar">
<el-dropdown> <el-dropdown>
<span class="el-dropdown-link"> <span class="el-dropdown-link">
@@ -2591,6 +2591,7 @@ import system from '@/services/system';
import * as services from './service'; import * as services from './service';
import { firstCharToLowerCase, firstCharToUpperCase, notify } from '@/utils/tool'; import { firstCharToLowerCase, firstCharToUpperCase, notify } from '@/utils/tool';



const $ = window.jQuery; const $ = window.jQuery;
const Velocity = window.Velocity; const Velocity = window.Velocity;
Vue.use(vuetify); Vue.use(vuetify);
@@ -3280,6 +3281,8 @@ export default {
// UserId: this.userId, // UserId: this.userId,
// FileStatus: file.status // FileStatus: file.status
// } // }
// file.loadingProgress = 0;
const [resFlag] = await Promise.all([ const [resFlag] = await Promise.all([
services.changeFileWorkStatus(file.id, workStatus), services.changeFileWorkStatus(file.id, workStatus),
// services.fileCoordinationChange(params) // services.fileCoordinationChange(params)
@@ -3289,7 +3292,7 @@ export default {
file.workStatus = workStatus; file.workStatus = workStatus;
this.$forceUpdate(); this.$forceUpdate();
// todo 获取文件最新的hash并更新文件 // todo 获取文件最新的hash并更新文件
// if(workStatus === 1) {
// if(workStatus === 1 && file.workStatus === 2) {
// } // }
}, },
@@ -3305,25 +3308,12 @@ export default {
FileStatus: state FileStatus: state
} }
try { try {
const res = await services.fileCoordinationChange(params); const res = await services.fileCoordinationChange(params);
let thisApp = this; let thisApp = this;
if(res.Code === 0) { if(res.Code === 0) {
thisApp.$notify({
title: "恭喜您",
message: res,
type: "success",
offset: 100,
duration: 2500,
});
notify.success(res.Msg);
} else { } else {
thisApp.$notify({
title: "温馨提醒",
message: res.Msg,
type: "info",
offset: 100,
duration: 2500,
});
notify.info(res.Msg);
return; return;
} }
} catch(err) { } catch(err) {
@@ -4471,7 +4461,6 @@ export default {
var folderName = this.listUserFolders[this.nowFolderIndex].folderName; var folderName = this.listUserFolders[this.nowFolderIndex].folderName;
var projID = file.projID; var projID = file.projID;
var type = "open"; var type = "open";
debugger;
system.openFile( system.openFile(
archid, archid,
filename, filename,


読み込み中…
キャンセル
保存