123
This commit is contained in:
@ -552,6 +552,9 @@ export function MapUtil(map) {
|
|||||||
if( flag == 'zdxl_fzyc'){
|
if( flag == 'zdxl_fzyc'){
|
||||||
emitter.emit('showFzycInfo', {info:val,type:true})
|
emitter.emit('showFzycInfo', {info:val,type:true})
|
||||||
}
|
}
|
||||||
|
if(flag == 'taskFg-flag'){
|
||||||
|
emitter.emit('showTaskFgInfo', val)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,8 +24,9 @@
|
|||||||
<el-input v-model="listQuery.fgRwmc" placeholder="请输入任务名称" style="width: 100%" clearable />
|
<el-input v-model="listQuery.fgRwmc" placeholder="请输入任务名称" style="width: 100%" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="width: 45%" label="方格" prop="fgData">
|
<el-form-item style="width: 45%" label="方格" prop="fgData">
|
||||||
<div :class="listQuery.fgData.length === 0 ? 'ipt mj' : 'ipt'" @click.stop="fgVisible = true">
|
<div :class="listQuery?.fgData && listQuery?.fgData.length === 0 ? 'ipt mj' : 'ipt'"
|
||||||
<el-tag v-for="(tag, idx) in listQuery.fgData" :key="tag.id" class="mx-1" closable :type="tag.type"
|
@click.stop="fgVisible = true">
|
||||||
|
<el-tag v-for="(tag, idx) in listQuery?.fgData" :key="tag.id" class="mx-1" closable :type="tag.type"
|
||||||
@close="handleClose(idx)">
|
@close="handleClose(idx)">
|
||||||
{{ tag.fgmc }}
|
{{ tag.fgmc }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
@ -34,35 +35,46 @@
|
|||||||
<el-form-item style="width: 48%" prop="dkjgsj" label="间隔时间">
|
<el-form-item style="width: 48%" prop="dkjgsj" label="间隔时间">
|
||||||
<el-input v-model="listQuery.dkjgsj" type="number" placeholder="请输入间隔时间" style="width: 100%" clearable />
|
<el-input v-model="listQuery.dkjgsj" type="number" placeholder="请输入间隔时间" style="width: 100%" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="center-btn"><el-button style="margin-top: 12px" @click="next">下一步</el-button></div>
|
<div class="center-btn"><el-button style="margin: 12px 0;" @click="next">下一步</el-button></div>
|
||||||
|
<div style="height: 40vh; width: 100%">
|
||||||
|
<gd-map />
|
||||||
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="box_main" v-if="stepActive == 1">
|
<div class="box_main" v-if="stepActive == 1">
|
||||||
<el-button style="margin: 12px 0 10px 0;" @click="addDw" v-if="openType !== 'detail'">新增点位</el-button>
|
<el-button style="margin: 12px 0 10px 0;" @click="addDw" v-if="openType !== 'detail'">新增点位</el-button>
|
||||||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
||||||
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
|
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
|
||||||
@chooseData="chooseData">
|
@chooseData="chooseData">
|
||||||
|
<template #dktp="{ row }">
|
||||||
|
<el-image :append-to-body="true" :preview-src-list="[
|
||||||
|
`/mosty-api/mosty-base/minio/image/download/${row.dktp}`
|
||||||
|
]" style="width: 75px; height: 75px" :src="`/mosty-api/mosty-base/minio/image/download/${row.dktp}`"
|
||||||
|
fit="cover" lazy />
|
||||||
|
</template>
|
||||||
<!-- 操作 -->
|
<!-- 操作 -->
|
||||||
<template #controls="{ row, index }">
|
<template #controls="{ row, index }">
|
||||||
<el-button @click="deletList(index)" type="danger" size="small">删除</el-button>
|
<el-button @click="deletList(index)" type="danger" size="small">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</MyTable>
|
</MyTable>
|
||||||
<div class="center-btn">
|
<div class="center-btn">
|
||||||
<el-button style="margin-top: 12px" @click="stepActive--; pageData.tableData = []">上一步</el-button>
|
<el-button style="margin-top: 12px" @click="stepFn">上一步</el-button>
|
||||||
<el-button style="margin-top: 12px" @click="submit" v-if="openType !== 'detail'">提交</el-button>
|
<el-button style="margin-top: 12px" @click="submit" v-if="openType !== 'detail'">提交</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<FgLoad v-model="fgVisible" @choosedUsers="hanlderChoose" :Single="true" />
|
<FgLoad v-model="fgVisible" @choosedUsers="hanlderChoose" :Single="true" />
|
||||||
<AddDw v-model="showDialog" v-if="showDialog" :data="listQuery.fgData"
|
<AddDw v-model="showDialog" v-if="showDialog" :data="listQuery?.fgData"
|
||||||
:dic="{ D_ZDXL_FGXLRW_YJYS, D_ZDXL_FGXLRW_YJDJ, D_ZDXL_FGXLRW_RWZT }" @submit="dwSubmit" />
|
:dic="{ D_ZDXL_FGXLRW_YJYS, D_ZDXL_FGXLRW_YJDJ, D_ZDXL_FGXLRW_RWZT }" @submit="dwSubmit" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import FgLoad from "./fgLoad.vue";
|
import FgLoad from "./fgLoad.vue";
|
||||||
import AddDw from "./addDw.vue";
|
import AddDw from "./addDw.vue";
|
||||||
|
import emitter from "@/utils/eventBus";
|
||||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||||
import { qcckGet, qcckPost } from "@/api/qcckApi.js";
|
import { qcckGet, qcckPost } from "@/api/qcckApi.js";
|
||||||
import emitter from "@/utils/eventBus.js";
|
import GdMap from "@/components/Map/GdMap/index.vue";
|
||||||
|
import { fetchTbZdxlFgdwSelectList } from "@/api/service/taskProgress";
|
||||||
import {
|
import {
|
||||||
ref,
|
ref,
|
||||||
defineExpose,
|
defineExpose,
|
||||||
@ -99,7 +111,7 @@ const pageData = reactive({
|
|||||||
tableConfiger: {
|
tableConfiger: {
|
||||||
loading: false,
|
loading: false,
|
||||||
rowHieght: 61,
|
rowHieght: 61,
|
||||||
showSelectType: "checkBox"
|
haveControls: true,
|
||||||
},
|
},
|
||||||
total: 0,
|
total: 0,
|
||||||
pageConfiger: {
|
pageConfiger: {
|
||||||
@ -114,6 +126,25 @@ const pageData = reactive({
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 点击地图方格选择
|
||||||
|
emitter.on("showTaskFgInfo", (val) => {
|
||||||
|
if (openType.value !== 'detail') {
|
||||||
|
listQuery.value.fgData = [{
|
||||||
|
id: val.id,
|
||||||
|
fgmc: val.mc1,
|
||||||
|
x1: val.x1,
|
||||||
|
y1: val.y1,
|
||||||
|
x2: val.x2,
|
||||||
|
y2: val.y2,
|
||||||
|
x11: val.x11,
|
||||||
|
y11: val.y11,
|
||||||
|
x21: val.x21,
|
||||||
|
y21: val.y21,
|
||||||
|
zxX: val.zxX,
|
||||||
|
zxY: val.zxY,
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
@ -121,33 +152,98 @@ const init = (type, row) => {
|
|||||||
dialogForm.value = true;
|
dialogForm.value = true;
|
||||||
openType.value = type;
|
openType.value = type;
|
||||||
title.value = row ? "编辑任务" : "新增任务";
|
title.value = row ? "编辑任务" : "新增任务";
|
||||||
|
stepActive.value = 0;
|
||||||
|
getData()
|
||||||
|
pageData.tableColumn = [
|
||||||
|
{ label: "点位名称", prop: "bxdMc", showOverflowTooltip: true },
|
||||||
|
{ label: "经度", prop: "jd", showOverflowTooltip: true },
|
||||||
|
{ label: "维度", prop: "wd", showOverflowTooltip: true },
|
||||||
|
]
|
||||||
|
pageData.tableConfiger.haveControls = true
|
||||||
if (row) {
|
if (row) {
|
||||||
getDataById(row);
|
getDataById(row);
|
||||||
|
if (openType.value == 'detail') {
|
||||||
|
pageData.tableColumn = [
|
||||||
|
{ label: "点位名称", prop: "bxdMc", showOverflowTooltip: true },
|
||||||
|
{ label: "经度", prop: "jd", showOverflowTooltip: true },
|
||||||
|
{ label: "维度", prop: "wd", showOverflowTooltip: true },
|
||||||
|
{ label: "打卡时间", prop: "dksj", showOverflowTooltip: true },
|
||||||
|
{ label: "图片", prop: "dktp", showOverflowTooltip: true, showSolt: true },
|
||||||
|
]
|
||||||
|
pageData.tableConfiger.haveControls = false
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
stepActive.value = 0;
|
|
||||||
listQuery.value = { fgData: [] };
|
listQuery.value = { fgData: [] };
|
||||||
pageData.tableData = [];
|
pageData.tableData = [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 根据id查询详情
|
// 根据id查询详情
|
||||||
const getDataById = (row) => {
|
const getDataById = (row) => {
|
||||||
qcckGet({ fgrwid: row.id }, "/mosty-yjzl/tbZdyrw/getFgrwXq").then(async (res) => {
|
qcckGet({ fgrwid: row.id }, "/mosty-yjzl/tbZdyrw/getFgrwXq").then((res) => {
|
||||||
listQuery.value = res;
|
listQuery.value = res;
|
||||||
listQuery.value.fgData = [{...res.fgxx,
|
listQuery.value.fgData = [{
|
||||||
|
...res.fgxx,
|
||||||
fgmc: res.fgmc,
|
fgmc: res.fgmc,
|
||||||
id: res.fgId,
|
id: res.fgId,
|
||||||
}]
|
}]
|
||||||
console.log(listQuery.value.fgData ,'listQuery.value.fgData ');
|
const fginfo = listQuery.value.fgData?.map((el, index) => {
|
||||||
|
let position = [
|
||||||
|
[Number(el.x1), Number(el.y1)],
|
||||||
|
[Number(el.x2), Number(el.y2)]
|
||||||
|
];
|
||||||
|
let text = el.mc;
|
||||||
|
let obj = { position: position, text, id: el.id, userData: el };
|
||||||
|
return obj;
|
||||||
|
});
|
||||||
|
emitter.emit("echoPlane", {
|
||||||
|
fontColor: "white",
|
||||||
|
coords: fginfo,
|
||||||
|
type: "rectangle",
|
||||||
|
flag: "taskFg-info",
|
||||||
|
color: "red",
|
||||||
|
linecolor: "red"
|
||||||
|
});
|
||||||
pageData.tableData = res.bxds
|
pageData.tableData = res.bxds
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const getData = async () => {
|
||||||
|
const res = await fetchTbZdxlFgdwSelectList();
|
||||||
|
if (res && res?.length > 0) {
|
||||||
|
emitter.emit("deletePointArea", "taskFg-flag");
|
||||||
|
let cc = [];
|
||||||
|
const list = res?.map((el, index) => {
|
||||||
|
let centerPoint = [el.zxX, el.zxY];
|
||||||
|
if (index == 0) cc = centerPoint;
|
||||||
|
let position = [
|
||||||
|
[Number(el.x1), Number(el.y1)],
|
||||||
|
[Number(el.x2), Number(el.y2)]
|
||||||
|
];
|
||||||
|
let text = el.mc;
|
||||||
|
let obj = { position: position, text, id: el.id, userData: el };
|
||||||
|
return obj;
|
||||||
|
});
|
||||||
|
emitter.emit("echoPlane", {
|
||||||
|
fontColor: "#12fdb8",
|
||||||
|
coords: list,
|
||||||
|
type: "rectangle",
|
||||||
|
flag: "taskFg-flag",
|
||||||
|
color: "rgba(2,20,51,0.5)",
|
||||||
|
linecolor: "#1C97FF"
|
||||||
|
});
|
||||||
|
emitter.emit("setMapCenter", { location: cc, zoomLevel: 11 });
|
||||||
|
}
|
||||||
|
};
|
||||||
const next = () => {
|
const next = () => {
|
||||||
elform.value.validate((valid) => {
|
elform.value.validate((valid) => {
|
||||||
if (!valid) return false;
|
if (!valid) return false;
|
||||||
stepActive.value++;
|
stepActive.value++;
|
||||||
});
|
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 上一步
|
||||||
|
const stepFn = () => {
|
||||||
|
stepActive.value--;
|
||||||
|
getData()
|
||||||
}
|
}
|
||||||
const addDw = () => {
|
const addDw = () => {
|
||||||
showDialog.value = true
|
showDialog.value = true
|
||||||
@ -174,17 +270,11 @@ function hanlderChoose(arr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const dwSubmit = (val) => {
|
const dwSubmit = (val) => {
|
||||||
console.log(val, 'val');
|
|
||||||
pageData.tableData.push(val)
|
pageData.tableData.push(val)
|
||||||
}
|
}
|
||||||
// 提交
|
// 提交
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
// elform.value.validate((valid) => {
|
|
||||||
// if (!valid) return false;
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
if (title.value == "新增任务") {
|
|
||||||
console.log(listQuery.value, pageData.tableData);
|
|
||||||
|
|
||||||
const pramas = {
|
const pramas = {
|
||||||
fgRwmc: listQuery.value.fgRwmc,
|
fgRwmc: listQuery.value.fgRwmc,
|
||||||
fgId: listQuery.value.fgData[0].id,
|
fgId: listQuery.value.fgData[0].id,
|
||||||
@ -197,6 +287,7 @@ const submit = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (title.value == "新增任务") {
|
||||||
qcckPost(pramas, "/mosty-yjzl/tbZdyrw/addTbZdyrw")
|
qcckPost(pramas, "/mosty-yjzl/tbZdyrw/addTbZdyrw")
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
proxy.$message({ type: "success", message: "新增成功" });
|
proxy.$message({ type: "success", message: "新增成功" });
|
||||||
@ -207,20 +298,20 @@ const submit = () => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// qcckPut(listQuery.value, "/mosty-yszx/tbYsSxt/update")
|
pramas.id = listQuery.value.id
|
||||||
// .then((res) => {
|
qcckPost(pramas, "/mosty-yjzl/tbZdyrw/editTbZdyrw")
|
||||||
// proxy.$message({ type: "success", message: "修改成功" });
|
.then((res) => {
|
||||||
// close();
|
proxy.$message({ type: "success", message: "修改成功" });
|
||||||
// emit("updateDate");
|
close();
|
||||||
// })
|
emit("updateDate");
|
||||||
// .catch(() => {
|
})
|
||||||
// loading.value = false;
|
.catch(() => {
|
||||||
// });
|
loading.value = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// });
|
// });
|
||||||
};
|
};
|
||||||
const deletList = (idx) => {
|
const deletList = (idx) => {
|
||||||
console.log(idx, 'idx');
|
|
||||||
pageData.tableData.splice(idx, 1)
|
pageData.tableData.splice(idx, 1)
|
||||||
}
|
}
|
||||||
// 关闭
|
// 关闭
|
||||||
|
|||||||
@ -37,10 +37,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { getCountBqsl } from "@/api/xfll";
|
import { getCountBqsl } from "@/api/xfll";
|
||||||
import * as rule from "@/utils/rules.js";
|
|
||||||
import { qcckGet, qcckPost, qcckPut } from "@/api/qcckApi.js";
|
import { qcckGet, qcckPost, qcckPut } from "@/api/qcckApi.js";
|
||||||
import * as MOSTY from "@/components/MyComponents/index";
|
|
||||||
import { ElMessage } from "element-plus";
|
|
||||||
import {
|
import {
|
||||||
defineProps,
|
defineProps,
|
||||||
watch,
|
watch,
|
||||||
@ -50,7 +47,6 @@ import {
|
|||||||
nextTick,
|
nextTick,
|
||||||
watchEffect
|
watchEffect
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import { getTbJcglXfll } from "@/api/xfll";
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|||||||
@ -21,9 +21,6 @@
|
|||||||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
||||||
:tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth" @chooseData="chooseData">
|
:tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth" @chooseData="chooseData">
|
||||||
<template #fgrwzt="{ row }">
|
<template #fgrwzt="{ row }">
|
||||||
<!-- <el-table-column prop="wlq" label="未领取"/>
|
|
||||||
<el-table-column prop="ylq" label="已领取"/>
|
|
||||||
<el-table-column prop="ywc" label="已完成"/> -->
|
|
||||||
<dict-tag :options="D_BZ_QWRWZT" :value="row.fgrwzt" :tag="false" />
|
<dict-tag :options="D_BZ_QWRWZT" :value="row.fgrwzt" :tag="false" />
|
||||||
</template>
|
</template>
|
||||||
<template #controls="{ row }">
|
<template #controls="{ row }">
|
||||||
@ -60,13 +57,13 @@ const editInfo = ref();
|
|||||||
const searchConfiger = reactive([
|
const searchConfiger = reactive([
|
||||||
{
|
{
|
||||||
showType: "input",
|
showType: "input",
|
||||||
prop: "sbmc",
|
prop: "fgRwmc",
|
||||||
placeholder: "请输入任务名称",
|
placeholder: "请输入任务名称",
|
||||||
label: "任务名称"
|
label: "任务名称"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
showType: "select",
|
showType: "select",
|
||||||
prop: "rwLqZt",
|
prop: "fgrwzt",
|
||||||
placeholder: "请选择任务领取状态",
|
placeholder: "请选择任务领取状态",
|
||||||
label: "任务领取状态",
|
label: "任务领取状态",
|
||||||
options: D_BZ_QWRWZT
|
options: D_BZ_QWRWZT
|
||||||
@ -138,7 +135,7 @@ const chooseData = (val) => {
|
|||||||
//批量删除
|
//批量删除
|
||||||
const deletList = (id) => {
|
const deletList = (id) => {
|
||||||
proxy.$confirm("确定要删除", "警告", { type: "warning" }).then(() => {
|
proxy.$confirm("确定要删除", "警告", { type: "warning" }).then(() => {
|
||||||
qcckPost({ id }, "/mosty-yjzl/tbZdxlFgxlrw/delZdyxlFgxlrw").then(() => {
|
qcckPost({ id }, "/mosty-yjzl/tbZdyrw/delTbZdyrw").then(() => {
|
||||||
proxy.$message({ type: "success", message: "删除成功" });
|
proxy.$message({ type: "success", message: "删除成功" });
|
||||||
getDataList();
|
getDataList();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -29,7 +29,6 @@ const fetchTaskList = async () => {
|
|||||||
emitter.emit("deletePointArea", "zdxl_fzyc");
|
emitter.emit("deletePointArea", "zdxl_fzyc");
|
||||||
if (res && res?.length > 0) {
|
if (res && res?.length > 0) {
|
||||||
data.list = res;
|
data.list = res;
|
||||||
|
|
||||||
let cc = [];
|
let cc = [];
|
||||||
const list = data.list?.map((el, index) => {
|
const list = data.list?.map((el, index) => {
|
||||||
let centerPoint = [el.zxX, el.zxY];
|
let centerPoint = [el.zxX, el.zxY];
|
||||||
@ -62,7 +61,6 @@ const getData = async () => {
|
|||||||
const res = await fetchTbZdxlFgdwSelectList();
|
const res = await fetchTbZdxlFgdwSelectList();
|
||||||
if (res && res?.length > 0) {
|
if (res && res?.length > 0) {
|
||||||
emitter.emit("deletePointArea", "tbZdxlFgdw");
|
emitter.emit("deletePointArea", "tbZdxlFgdw");
|
||||||
|
|
||||||
let cc = [];
|
let cc = [];
|
||||||
const list = res?.map((el, index) => {
|
const list = res?.map((el, index) => {
|
||||||
let centerPoint = [el.zxX, el.zxY];
|
let centerPoint = [el.zxX, el.zxY];
|
||||||
@ -87,7 +85,6 @@ const getData = async () => {
|
|||||||
});
|
});
|
||||||
emitter.emit("setMapCenter", { location: cc, zoomLevel: 14 });
|
emitter.emit("setMapCenter", { location: cc, zoomLevel: 14 });
|
||||||
}
|
}
|
||||||
|
|
||||||
await fetchTaskList();
|
await fetchTaskList();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user