This commit is contained in:
yuping
2022-12-17 23:22:47 +08:00
parent 9228fc3eac
commit 655482a91e
2 changed files with 33 additions and 18 deletions

View File

@@ -58,12 +58,10 @@
</div>
</div>
</div>
<UploadImg v-model="fileList" ref="uploadRef">
<UploadImg v-model:value="fileList" ref="uploadRef">
<button
class="shangchuan"
style="cursor: pointer"
@mousemove="showFileList = 1"
@mouseout="showFileList = 0"
>
上传
</button>
@@ -71,8 +69,6 @@
<div
class="uploadDetail"
:style="{ display: showFileList ? 'block' : 'none' }"
@mousemove="showFileList = 1"
@mouseout="showFileList = 0"
style="padding-top: 60px"
>
<div class="triangle"></div>
@@ -193,6 +189,9 @@
"
>
{{ value.workUploadContent }}
<span style="margin-left: 10px">
<el-link target="_blank" type="primary" :href="value.workUploadAddress?.split(',')[0] || ''">{{value.workUploadAddress?.split(',')[0].split('/').at(-1)|| ''}}</el-link>
</span>
</div>
</div>
</div>
@@ -256,7 +255,7 @@
</template>
<script setup>
import { reactive, ref, toRefs } from "vue";
import {computed, reactive, ref, toRefs} from "vue";
import { request, useRequest } from "@/api/request";
import {
TASK_WORK_COMMIT,
@@ -272,7 +271,6 @@ import { useRoute } from "vue-router/dist/vue-router";
const fileList = ref([]);
const uploadRef = ref();
const showFileList = ref(0);
const sbValue = ref({
content: "",
attach: "",
@@ -290,9 +288,11 @@ const { data: submitList } = useRequest(TASK_WORK_SUBMIT_LIST, {
workerId: workId,
});
const showFileList = computed(()=>{
return fileList.value.length
})
const handleClick = () => {
console.log(sbValue.value);
console.log(fileList);
request(TASK_WORK_COMMIT, {
projectOrRouterLogo: type,
workUploadContent: sbValue.value.content,
@@ -304,6 +304,7 @@ const handleClick = () => {
submitList.value.unshift(res.data);
});
sbValue.value.content = "";
fileList.value = [];
};
function remove(i) {
@@ -452,8 +453,8 @@ function reUpload(i) {
}
.square {
width: 475px;
height: 243px;
padding-bottom: 40px;
width: 600px;
background: #ffffff;
box-shadow: 0px 1px 24px 0px rgba(0, 0, 0, 0.11);
border-radius: 8px;