mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-18 23:36:46 +08:00
feat:增加模板库共享文档编辑下载及上传
This commit is contained in:
@@ -581,7 +581,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
<!--
|
||||
|
||||
<a-tab-pane key="13" tab="共享文档">
|
||||
<div class="sametab">
|
||||
<div class="Gcon">
|
||||
@@ -591,7 +591,8 @@
|
||||
<div class="box"></div>
|
||||
<div class="onetitle">上传共享文档</div>
|
||||
<div class="oneedi">
|
||||
<a-switch
|
||||
<a-switch
|
||||
size="small"
|
||||
v-model:checked="attachSwitch"
|
||||
@change="checkedClose"
|
||||
></a-switch>
|
||||
@@ -612,7 +613,7 @@
|
||||
>
|
||||
<img
|
||||
src="@/assets/images/basicinfo/cloud.png"
|
||||
style="cursor: pointer; width: 34px; height: 34px"
|
||||
style="cursor: pointer; width: 24px; height: 24px; margin-left: 8px;margin-bottom: 3px;"
|
||||
alt=""
|
||||
/>
|
||||
</a-upload>
|
||||
@@ -628,9 +629,10 @@
|
||||
<div
|
||||
v-for="item in fileList"
|
||||
:key="item.uid"
|
||||
style="margin-bottom: 30px;"
|
||||
class="docListStyle"
|
||||
>
|
||||
<img
|
||||
<!-- <img
|
||||
src="@/assets/images/basicinfo/download.png"
|
||||
style="
|
||||
cursor: pointer;
|
||||
@@ -639,10 +641,37 @@
|
||||
margin-right: 40px;
|
||||
"
|
||||
alt=""
|
||||
/>
|
||||
/> -->
|
||||
<img v-if="
|
||||
item.name.indexOf('jpg') !== -1 ||
|
||||
item.name.indexOf('jpeg') !== -1 ||
|
||||
item.name.indexOf('png') !== -1
|
||||
"
|
||||
style="width: 27px;height: 32px;margin-right: 40px;"
|
||||
src="@/assets/images/coursewareManage/pngpic.png" />
|
||||
<div v-else>
|
||||
<img v-if="item.name.indexOf('doc') !== -1" style="width: 27px;height: 32px;margin-right: 40px;" src="@/assets/images/coursewareManage/docpic.png" />
|
||||
<div v-else>
|
||||
<img v-if="item.name.indexOf('xls') !== -1" style="width: 27px;height: 32px;margin-right: 40px;" src="@/assets/images/coursewareManage/xlspic.png" />
|
||||
<div v-else>
|
||||
<img v-if="item.name.indexOf('ppt') !== -1" style="width: 27px;height: 32px;margin-right: 40px;" src="@/assets/images/coursewareManage/pptpic.png" />
|
||||
<div v-else>
|
||||
<img v-if="item.name.indexOf('pdf') !== -1" style="width: 27px;height: 32px;margin-right: 40px;" src="@/assets/images/coursewareManage/pdfpic.png" />
|
||||
<div v-else>
|
||||
<img v-if="item.name.indexOf('zip') !== -1"
|
||||
style="width: 27px;height: 32px;margin-right: 40px;"
|
||||
src="@/assets/images/coursewareManage/zippic.png" />
|
||||
<img v-else style="width: 27px;height: 32px;margin-right: 40px;" src="@/assets/images/coursewareManage/docpic.png" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span style="font: oblique bold 16px Sans-serif;width:300px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{
|
||||
item.name
|
||||
}}</span>
|
||||
<a :href="item.response?item.response.data:''" style="margin-left: 5px">下载</a>
|
||||
<span
|
||||
style="color: #4ea6ff; cursor: pointer"
|
||||
@click="deFile(item.uid)"
|
||||
@@ -654,7 +683,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
-->
|
||||
|
||||
|
||||
</a-tabs>
|
||||
</a-tab-pane>
|
||||
@@ -974,8 +1003,7 @@ export default defineComponent({
|
||||
} catch {
|
||||
state.fileList = [];
|
||||
}
|
||||
state.attachSwitch =
|
||||
res.data.data.projectTemplateInfo.attachSwitch == 1 ? true : false;
|
||||
state.attachSwitch = res.data.data.projectTemplateInfo.attachSwitch == 1 ? true : false;
|
||||
let data = res.data.data.stageList;
|
||||
console.log("data=====", data);
|
||||
for (let i in data) {
|
||||
@@ -1197,6 +1225,35 @@ export default defineComponent({
|
||||
}
|
||||
};
|
||||
|
||||
// 删除图片按钮
|
||||
const deFile = (id) => {
|
||||
console.log(id);
|
||||
let index = state.fileList.findIndex((item) => {
|
||||
item.uid == id;
|
||||
});
|
||||
state.fileList.splice(index, 1);
|
||||
let str = JSON.stringify(state.fileList);
|
||||
|
||||
api
|
||||
.templateEdit({
|
||||
sourceBelongId: state.projectInfo.sourceBelongId,
|
||||
projectTemplateId: localStorage.getItem("projectTemplateId"),
|
||||
attach: str,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
message.destroy();
|
||||
message.success("删除成功");
|
||||
return
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
message.destroy();
|
||||
message.warning("删除失败");
|
||||
return
|
||||
});
|
||||
};
|
||||
|
||||
// 设置上传图片开关
|
||||
const checkedClose = (data, a) => {
|
||||
console.log(data, a);
|
||||
@@ -1299,6 +1356,7 @@ export default defineComponent({
|
||||
scoresum,
|
||||
checkedClose,
|
||||
editNotice,
|
||||
deFile
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user