mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-19 07:46:46 +08:00
feat:增加模板库共享文档编辑下载及上传
This commit is contained in:
@@ -581,7 +581,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<!--
|
|
||||||
<a-tab-pane key="13" tab="共享文档">
|
<a-tab-pane key="13" tab="共享文档">
|
||||||
<div class="sametab">
|
<div class="sametab">
|
||||||
<div class="Gcon">
|
<div class="Gcon">
|
||||||
@@ -591,7 +591,8 @@
|
|||||||
<div class="box"></div>
|
<div class="box"></div>
|
||||||
<div class="onetitle">上传共享文档</div>
|
<div class="onetitle">上传共享文档</div>
|
||||||
<div class="oneedi">
|
<div class="oneedi">
|
||||||
<a-switch
|
<a-switch
|
||||||
|
size="small"
|
||||||
v-model:checked="attachSwitch"
|
v-model:checked="attachSwitch"
|
||||||
@change="checkedClose"
|
@change="checkedClose"
|
||||||
></a-switch>
|
></a-switch>
|
||||||
@@ -612,7 +613,7 @@
|
|||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src="@/assets/images/basicinfo/cloud.png"
|
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=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
@@ -628,9 +629,10 @@
|
|||||||
<div
|
<div
|
||||||
v-for="item in fileList"
|
v-for="item in fileList"
|
||||||
:key="item.uid"
|
:key="item.uid"
|
||||||
|
style="margin-bottom: 30px;"
|
||||||
class="docListStyle"
|
class="docListStyle"
|
||||||
>
|
>
|
||||||
<img
|
<!-- <img
|
||||||
src="@/assets/images/basicinfo/download.png"
|
src="@/assets/images/basicinfo/download.png"
|
||||||
style="
|
style="
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -639,10 +641,37 @@
|
|||||||
margin-right: 40px;
|
margin-right: 40px;
|
||||||
"
|
"
|
||||||
alt=""
|
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;">{{
|
<span style="font: oblique bold 16px Sans-serif;width:300px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{
|
||||||
item.name
|
item.name
|
||||||
}}</span>
|
}}</span>
|
||||||
|
<a :href="item.response?item.response.data:''" style="margin-left: 5px">下载</a>
|
||||||
<span
|
<span
|
||||||
style="color: #4ea6ff; cursor: pointer"
|
style="color: #4ea6ff; cursor: pointer"
|
||||||
@click="deFile(item.uid)"
|
@click="deFile(item.uid)"
|
||||||
@@ -654,7 +683,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
-->
|
|
||||||
|
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
@@ -974,8 +1003,7 @@ export default defineComponent({
|
|||||||
} catch {
|
} catch {
|
||||||
state.fileList = [];
|
state.fileList = [];
|
||||||
}
|
}
|
||||||
state.attachSwitch =
|
state.attachSwitch = res.data.data.projectTemplateInfo.attachSwitch == 1 ? true : false;
|
||||||
res.data.data.projectTemplateInfo.attachSwitch == 1 ? true : false;
|
|
||||||
let data = res.data.data.stageList;
|
let data = res.data.data.stageList;
|
||||||
console.log("data=====", data);
|
console.log("data=====", data);
|
||||||
for (let i in 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) => {
|
const checkedClose = (data, a) => {
|
||||||
console.log(data, a);
|
console.log(data, a);
|
||||||
@@ -1299,6 +1356,7 @@ export default defineComponent({
|
|||||||
scoresum,
|
scoresum,
|
||||||
checkedClose,
|
checkedClose,
|
||||||
editNotice,
|
editNotice,
|
||||||
|
deFile
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user