This commit is contained in:
2025-06-20 21:21:58 +08:00
parent 2e8617147c
commit be8a44b623
11 changed files with 155 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
<script setup>
import {defineEmits, reactive, ref, watch} from "vue";
import {defineEmits, reactive, ref, watch, onMounted, nextTick} from "vue";
import XLink from "../../../components/XLink.vue";
import XUpload from "../../../components/XUpload.vue";
import XInput from "../../../components/XInput.vue";
@@ -27,7 +27,7 @@ const success = async () => {
const {msg} = await Api.system.addTaskBackfill({
id: data.children.id,
cid: current.value + 1,
content: content,
content: content.flat(),
type: data.task_content[current.value].is_image,
});
showToast(msg);
@@ -38,11 +38,25 @@ watch(
() => [data, current],
() => {
if (data.children.back[current.value]?.content_arr) {
content.push(...data.children.back[current.value].content_arr);
setTimeout(() => {
content.length = 0;
content.push(...data.children.back[current.value].content_arr.map(v => [v]));
}, 100);
}
},
{deep: true, immediate: true}
)
const initContent = () => {
content.length = 0;
data.task_content[current.value].data.forEach(v => {
content.push([]);
})
}
onMounted(() => {
initContent();
})
</script>
<template>
@@ -50,7 +64,7 @@ watch(
<view class="!flex gap-[24rpx] !mb-[28rpx]">
<view
v-for="(item,index) in data.task_content"
@click="current=index"
@click="() => {current=index;initContent()}"
:class="['tab-item', index===current?'cur':'']">
回填{{ index + 1 }}
</view>
@@ -89,16 +103,16 @@ watch(
</view>
</view>
<view class="block" v-for="(v, index) in data.fb_num">
<view class="block" v-for="(v, index) in data.task_content[current].data">
<view class="block-title">
回填{{ index + 1 }}的截图:
{{ v.name }}:
</view>
<view class="block-info">
<x-upload
:del="data.children.back[current]"
:single="true"
v-model:files="content"
v-if="data.task_content[current].is_image === 1">
v-model:files="content[index]"
v-if="v.is_image === 1">
</x-upload>
<x-input v-else v-model:model-value="content[index]" height="64rpx" placeholder="请输入内容"></x-input>
</view>
@@ -137,8 +151,9 @@ watch(
</template>
<template
v-if="data.children.back.length===0 || data.children.back[current]?.operate === 0 || data.children.back[current]?.status === 0 || data.children.back[current]?.status === -1">
<tui-button @click="success" :disabled="data.children.back[current]">
v-if="!data.children.back[current] || data.children.back[current]?.operate === 0 || data.children.back[current]?.operate === 3">
<tui-button @click="success"
:disabled="data.children.back[current]?.status === 0 || data.children.back[current]?.status === -1">
{{
data.children.back[current]?.status === 0 || data.children.back[current]?.status === -1 ? '已提交' : '提交'
}}
@@ -161,7 +176,6 @@ watch(
</view>
</view>
</template>
</template>
<style scoped lang="scss">