From 8a3046817d6bf207f38accd0cd6b65d770db3bea Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 12 九月 2025 17:20:08 +0800
Subject: [PATCH] 1. 修改静安第三方接口url地址 2. 修改静安新增设备匹配功能中,上传的经纬度信息为我方的信息
---
src/views/fysp/task/components/CompSubTaskList.vue | 142 +++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 130 insertions(+), 12 deletions(-)
diff --git a/src/views/fysp/task/components/CompSubTaskList.vue b/src/views/fysp/task/components/CompSubTaskList.vue
index d6cc205..2ff7199 100644
--- a/src/views/fysp/task/components/CompSubTaskList.vue
+++ b/src/views/fysp/task/components/CompSubTaskList.vue
@@ -1,42 +1,160 @@
<template>
<el-row justify="space-between">
<el-text>鍗曟棩璁″垝</el-text>
- <el-button type="success" size="small" @click="add">鏂板</el-button>
+ <div>
+ <el-button
+ type="success"
+ size="small"
+ plain
+ @click="handleInspectFileDownload"
+ >鍗曟嵁涓嬭浇</el-button
+ >
+ <el-button
+ v-show="create && data && data.length > 0"
+ type="success"
+ size="small"
+ @click="add"
+ >浠诲姟璋冩暣</el-button
+ >
+ </div>
</el-row>
<el-divider />
<div>
- <el-scrollbar :height="height">
- <el-space fill direction="vertical">
+ <el-scrollbar v-loading="loading" :height="height">
+ <el-space
+ v-if="data && data.length > 0"
+ fill
+ :fill-ratio="100"
+ direction="vertical"
+ style="width: 100%"
+ >
<ItemSubTask v-for="s in data" :key="s.guid" :item="s">
<template #default="{ item }">
- <el-button type="danger" size="small" @click="remove(item)"
- >绉婚櫎</el-button
- >
+ <el-space direction="vertical">
+ <el-button
+ :disabled="item.status != '鏈墽琛�'"
+ plain
+ type="primary"
+ size="small"
+ @click="edit(item)"
+ >缂栬緫</el-button
+ >
+ <el-button
+ :disabled="item.status != '鏈墽琛�'"
+ type="default"
+ size="small"
+ @click="remove(item)"
+ >绉婚櫎</el-button
+ >
+ </el-space>
</template>
</ItemSubTask>
</el-space>
+ <div v-else>
+ <el-empty description="鏃犱换鍔¤褰�" />
+ <el-row v-if="create" justify="center">
+ <el-button
+ type="success"
+ size="small"
+ :loading="createLoading"
+ @click="add"
+ >娣诲姞浠诲姟</el-button
+ >
+ </el-row>
+ </div>
</el-scrollbar>
</div>
+ <el-dialog
+ v-model="dialogVisible"
+ width="600"
+ title="宸℃煡浠诲姟缂栬緫"
+ destroy-on-close
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ :show-close="false"
+ >
+ <CompSubTaskEdit
+ v-model="activeItem"
+ @submit="onEditSubmit"
+ @cancel="dialogVisible = false"
+ ></CompSubTaskEdit>
+ </el-dialog>
+ <SceneInspectFile v-model="downloadDialog" :value="downloadSceneList"></SceneInspectFile>
</template>
<script setup>
-import { ref, watch, onMounted } from 'vue';
+import { ref, computed, watch, onMounted, onUnmounted } from 'vue';
+import { ElMessageBox, ElNotification, ElMessage } from 'element-plus';
+import CompSubTaskEdit from './CompSubTaskEdit.vue';
+import SceneInspectFile from "@/views/fysp/scene/SceneInspectFile.vue";
+import subtaskApi from '@/api/fysp/subtaskApi';
const props = defineProps({
- data: Array,
+ modelValue: Array,
height: {
type: String,
default: '70vh'
- }
+ },
+ // 鏄惁鏄剧ず娣诲姞浠诲姟鎸夐挳
+ create: Boolean,
+ loading: Boolean,
+ createLoading: Boolean
});
-const curSubTaskList = ref([]);
-const emit = defineEmits(['add', 'remove']);
+const dialogVisible = ref(false);
+const activeItem = ref(null);
+const data = computed(() => props.modelValue);
+const downloadDialog = ref(false);
+const downloadSceneList = ref([])
+
+const emit = defineEmits(['submit', 'add', 'remove', 'update:modelValue']);
function remove(item) {
- emit('remove', item);
+ if (item.status == '鏈墽琛�') {
+ ElMessageBox.confirm('鏄惁绉婚櫎鐩戠浠诲姟', `绉婚櫎纭`, {
+ confirmButtonText: '纭',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ return subtaskApi.deleteSubtask(item.stguid).then((res) => {
+ if (res == 1) {
+ const index = data.value.indexOf(item);
+ data.value.splice(index, 1);
+
+ emit('update:modelValue', data.value);
+ emit('remove', item);
+ } else {
+ Promise.reject('鍒犻櫎宸℃煡浠诲姟澶辫触');
+ }
+ });
+ });
+ }
+}
+
+function edit(item) {
+ activeItem.value = item;
+ dialogVisible.value = true;
+}
+
+function onEditSubmit(item) {
+ dialogVisible.value = false;
+ const index = data.value.findIndex((v) => {
+ return item.stguid == v.stguid;
+ });
+ data.value.splice(index, 1, item);
+ emit('update:modelValue', data.value);
+ emit('submit');
}
function add() {
emit('add');
}
+
+onUnmounted(() => {
+ dialogVisible.value = false;
+});
+
+function handleInspectFileDownload() {
+ downloadSceneList.value = data.value.map(v=>v.scenseid)
+ downloadDialog.value = true
+}
</script>
--
Gitblit v1.9.3