增加计划BIM绑定功能
parent
183709ccb7
commit
d2975044b7
|
@ -455,7 +455,7 @@ export default {
|
||||||
.then((d) => {
|
.then((d) => {
|
||||||
this.models = d.rows || [];
|
this.models = d.rows || [];
|
||||||
if (this.models.length == 0) {
|
if (this.models.length == 0) {
|
||||||
this.$modal.msgError("暂无模型,请先关联模型");
|
this.$message.error("暂无模型,请先关联模型");
|
||||||
} else {
|
} else {
|
||||||
this.models.forEach((item) => {
|
this.models.forEach((item) => {
|
||||||
this.addModel(item.lightweightName);
|
this.addModel(item.lightweightName);
|
||||||
|
|
|
@ -762,7 +762,7 @@ export default {
|
||||||
.then((d) => {
|
.then((d) => {
|
||||||
this.models = d.rows || [];
|
this.models = d.rows || [];
|
||||||
if (this.models.length == 0) {
|
if (this.models.length == 0) {
|
||||||
this.$modal.msgError("暂无模型,请先关联模型");
|
this.$message.error("暂无模型,请先关联模型");
|
||||||
} else {
|
} else {
|
||||||
this.models.forEach((item) => {
|
this.models.forEach((item) => {
|
||||||
this.addModel(item.lightweightName);
|
this.addModel(item.lightweightName);
|
||||||
|
|
|
@ -166,7 +166,7 @@ export default {
|
||||||
},
|
},
|
||||||
startRoaming(data) {
|
startRoaming(data) {
|
||||||
if (!this.modelLoaded) {
|
if (!this.modelLoaded) {
|
||||||
this.$message.error("模型未加载完成,请稍后重试");
|
this.$message.error("暂无模型,请先关联模型");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let api = bimRoadmApi;
|
let api = bimRoadmApi;
|
||||||
|
@ -349,7 +349,7 @@ export default {
|
||||||
.then((d) => {
|
.then((d) => {
|
||||||
this.models = d.rows || [];
|
this.models = d.rows || [];
|
||||||
if (this.models.length == 0) {
|
if (this.models.length == 0) {
|
||||||
this.$modal.msgError("暂无模型,请先关联模型");
|
this.$modal.error("暂无模型,请先关联模型");
|
||||||
} else {
|
} else {
|
||||||
this.models.forEach((item) => {
|
this.models.forEach((item) => {
|
||||||
this.addModel(item.lightweightName);
|
this.addModel(item.lightweightName);
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class AttendanceSzjTask {
|
||||||
public String getToken(String secret) {
|
public String getToken(String secret) {
|
||||||
log.info("开始查询数智建TOKEN...{}",secret);
|
log.info("开始查询数智建TOKEN...{}",secret);
|
||||||
String key = "attendanceSzjTask.getToken::"+secret;
|
String key = "attendanceSzjTask.getToken::"+secret;
|
||||||
String token = redisService.getCacheObject(key);
|
String token = redisService!=null? redisService.getCacheObject(key):"";
|
||||||
if(StringUtils.isNotEmpty(token)){
|
if(StringUtils.isNotEmpty(token)){
|
||||||
return token;
|
return token;
|
||||||
}else{
|
}else{
|
||||||
|
@ -92,7 +92,9 @@ public class AttendanceSzjTask {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||||
if(jsonObject!=null && jsonObject.getBoolean("success")){
|
if(jsonObject!=null && jsonObject.getBoolean("success")){
|
||||||
token = jsonObject.getJSONObject("data").getString("token");
|
token = jsonObject.getJSONObject("data").getString("token");
|
||||||
redisService.setCacheObject(key,token,5L,TimeUnit.HOURS);
|
if(redisService!=null){
|
||||||
|
redisService.setCacheObject(key,token,5L,TimeUnit.HOURS);
|
||||||
|
}
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
@ -102,6 +104,40 @@ public class AttendanceSzjTask {
|
||||||
throw new RuntimeException("无效token...");
|
throw new RuntimeException("无效token...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
AttendanceSzjTask task = new AttendanceSzjTask();
|
||||||
|
String secret = "185677eed140468fbb7d4dc47c1b2806";
|
||||||
|
String token = task.getToken(secret);
|
||||||
|
task.testEnterpriseQuery(token);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testEnterpriseQuery(String token){
|
||||||
|
Map<String, String> headerMap = new HashMap<>();
|
||||||
|
headerMap.put("token",token);
|
||||||
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
try {
|
||||||
|
String result = HttpUtils.sendJSONPost(SZJ_HOST + "v1/api/enterprise/query", JSON.toJSONString(params), headerMap);
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||||
|
System.out.println(result);
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public int updateAttendanceGroup(JSONObject jsonObject) {
|
||||||
|
int result = 0;
|
||||||
|
if (jsonObject != null && jsonObject.getBoolean("success")) {
|
||||||
|
JSONArray jsonArray = jsonObject.getJSONArray("data");
|
||||||
|
if (jsonArray.size() > 0) {
|
||||||
|
for (int i = 0; i < jsonArray.size(); i++) {
|
||||||
|
JSONObject json = jsonArray.getJSONObject(i);
|
||||||
|
QuartzProSubdepts dept = new QuartzProSubdepts();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 同步单位及班组信息
|
* 同步单位及班组信息
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,6 +20,8 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static org.reflections.Reflections.log;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/uni/callback")
|
@RequestMapping("/uni/callback")
|
||||||
public class UniCallBackController {
|
public class UniCallBackController {
|
||||||
|
@ -41,10 +43,11 @@ public class UniCallBackController {
|
||||||
public AjaxResult recognize(HttpServletRequest request){
|
public AjaxResult recognize(HttpServletRequest request){
|
||||||
String eventCode=request.getParameter("eventCode");
|
String eventCode=request.getParameter("eventCode");
|
||||||
String eventGuid=request.getParameter("eventGuid");
|
String eventGuid=request.getParameter("eventGuid");
|
||||||
|
String projectId=request.getParameter("prjId");
|
||||||
String data=request.getParameter("eventMsg");
|
String data=request.getParameter("eventMsg");
|
||||||
switch (eventCode){
|
switch (eventCode){
|
||||||
case "101004"://上报识别记录
|
case "101004"://上报识别记录
|
||||||
return doAddAttendance(eventGuid,data);
|
return doAddAttendance(eventGuid,data,projectId);
|
||||||
case "100002"://设备上线
|
case "100002"://设备上线
|
||||||
return doDeviceOnLine(eventGuid,data);
|
return doDeviceOnLine(eventGuid,data);
|
||||||
case "100003"://设备下线
|
case "100003"://设备下线
|
||||||
|
@ -99,7 +102,8 @@ public class UniCallBackController {
|
||||||
* @param data
|
* @param data
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private AjaxResult doAddAttendance(String eventGuid,String data){
|
private AjaxResult doAddAttendance(String eventGuid,String data,String prjId){
|
||||||
|
log.info("考勤记录同步开始,eventGuid:{},data:{},projectId:{}",eventGuid,data,prjId);
|
||||||
JSONObject json=JSONObject.parseObject(data);
|
JSONObject json=JSONObject.parseObject(data);
|
||||||
int type=json.getInteger("type");
|
int type=json.getInteger("type");
|
||||||
if(type==1){// 人员比对结果,1:比对成功 2:比对失败
|
if(type==1){// 人员比对结果,1:比对成功 2:比对失败
|
||||||
|
|
|
@ -107,4 +107,7 @@ a {
|
||||||
.blue {
|
.blue {
|
||||||
color: rgb(30, 144, 255);
|
color: rgb(30, 144, 255);
|
||||||
}
|
}
|
||||||
|
.icon-blue{
|
||||||
|
fill:rgb(30, 144, 255) !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -154,7 +154,6 @@ export default {
|
||||||
enabled: item.show ? 1 : 0,
|
enabled: item.show ? 1 : 0,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
console.log("-->", adds, updates);
|
|
||||||
let ajaxs = [];
|
let ajaxs = [];
|
||||||
if (adds.length > 0) {
|
if (adds.length > 0) {
|
||||||
ajaxs.push(devicePositionAddItems({ items: adds }));
|
ajaxs.push(devicePositionAddItems({ items: adds }));
|
||||||
|
|
|
@ -0,0 +1,131 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog v-model="show" append-to-body :close-on-click-modal="false" :close-on-press-escape="false" :title="title" width="960px" modal-class="bim-selection-dialog">
|
||||||
|
<div id="bimSelectionDlg" :key="elId">
|
||||||
|
<div id="bimSelectionDlgContainer" class="bimSelectionDlgContainer"></div>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
title: "任务计划绑定BIM",
|
||||||
|
show: false,
|
||||||
|
plan: null,
|
||||||
|
currentPrjId: null,
|
||||||
|
currentComId: null,
|
||||||
|
models: [],
|
||||||
|
viewPoint: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showDialog(plan) {
|
||||||
|
this.plan = plan;
|
||||||
|
this.show = true;
|
||||||
|
this.userStore = useUserStore();
|
||||||
|
this.currentPrjId = this.userStore.currentPrjId;
|
||||||
|
this.currentComId = this.userStore.currentComId;
|
||||||
|
this.initEngine();
|
||||||
|
},
|
||||||
|
initEngine() {
|
||||||
|
this.elId++;
|
||||||
|
this.activeMenu = 0;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loadEngine();
|
||||||
|
}, 10);
|
||||||
|
},
|
||||||
|
loadEngine() {
|
||||||
|
window.sandSettingApi = new SAPI(
|
||||||
|
{
|
||||||
|
serverIP: window.config.serverIP, //服务ip地址
|
||||||
|
port: window.config.port, //HTTP端口
|
||||||
|
useHttps: window.config.useHttps, //使用Https
|
||||||
|
container: "bimSelectionDlgContainer", //[必须]容器id
|
||||||
|
secretKey: window.config.secretKey,
|
||||||
|
openEarth: window.config.openEarth, //[可选]开启Gis场景
|
||||||
|
bgColor: window.config.bgColor, //[可选]bim场景背景色, 传值即为纯色天空盒
|
||||||
|
tintColor: window.config.tintColor, //[可选]osgb单体化颜色
|
||||||
|
sceneTime: window.config.sceneTime, //[可选]分别为当前时间、日出时间、日落时间
|
||||||
|
cadMode: window.config.cadMode, // 是否是Cad图纸预览模式
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
this.initSuccess = true;
|
||||||
|
console.log("初始化成功");
|
||||||
|
setTimeout(() => {
|
||||||
|
this.initLoadModel();
|
||||||
|
}, 10);
|
||||||
|
let mapOptions = {
|
||||||
|
imgs: {
|
||||||
|
// 六面图片
|
||||||
|
top: "./img/top.png",
|
||||||
|
bottom: "./img/under.png",
|
||||||
|
east: "./img/east.png",
|
||||||
|
south: "./img/south.png",
|
||||||
|
west: "./img/west.png",
|
||||||
|
north: "./img/north.png",
|
||||||
|
},
|
||||||
|
offset: {
|
||||||
|
// 屏幕坐标偏移
|
||||||
|
corner: GLENavigationCube.RightTop,
|
||||||
|
x: 25,
|
||||||
|
y: 20,
|
||||||
|
},
|
||||||
|
cube: {
|
||||||
|
hoverColor: "#7193dc", // 立方导航快鼠标移过显示颜色
|
||||||
|
size: 32, // 导航立方尺寸
|
||||||
|
hotPointSize: 7, // 导航立方棱角热点区域尺寸
|
||||||
|
cubeTextColor: "#4c4c4ccc", // cube 各个面文字颜色
|
||||||
|
cubeStrokeColor: "#374769cc", // cube 各个面边框颜色
|
||||||
|
cubeFillColor: "#374769cc", // cube 各个面填充颜色
|
||||||
|
},
|
||||||
|
zoomRatios: 1, // 缩放倍率
|
||||||
|
show: true, // 是否显示
|
||||||
|
showAxes: true, // 是否显示XYZ轴线
|
||||||
|
};
|
||||||
|
sandSettingApi.Plugin.initNavCube(mapOptions);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
initLoadModel() {
|
||||||
|
listBimModel({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
comId: this.currentComId,
|
||||||
|
projectId: this.currentPrjId,
|
||||||
|
}).then((d) => {
|
||||||
|
this.models = d.rows || [];
|
||||||
|
if (this.models.length == 0) {
|
||||||
|
this.$modal.msgError("暂无模型,请先关联模型");
|
||||||
|
} else {
|
||||||
|
this.models.forEach((item) => {
|
||||||
|
this.addModel(item.lightweightName);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addModel(modelId, cb) {
|
||||||
|
let url = `${window.config.modelUrl}/Tools/output/model/${modelId}/root.glt`;
|
||||||
|
console.log(modelId, url);
|
||||||
|
sandSettingApi.Model.add(
|
||||||
|
url,
|
||||||
|
modelId,
|
||||||
|
() => {},
|
||||||
|
() => {
|
||||||
|
cb && cb();
|
||||||
|
console.log("加载模型成功");
|
||||||
|
setTimeout(()=>{
|
||||||
|
sandSettingApi.Camera.getViewPort(p=>{
|
||||||
|
this.viewPoint=p;
|
||||||
|
this.$message.info("模型加载完成")
|
||||||
|
});
|
||||||
|
},1000);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss"></style>
|
|
@ -2,12 +2,10 @@
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="项目" prop="projectId">
|
<el-form-item label="项目" prop="projectId">
|
||||||
<el-select :disabled="data.projectId" v-model="queryParams.projectId" placeholder="请选择项目" style="width: 192px;" clearable
|
<el-select :disabled="data.projectId" v-model="queryParams.projectId" placeholder="请选择项目" style="width: 192px" clearable @change="handleQuery">
|
||||||
@change="handleQuery">
|
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id"> </el-option>
|
||||||
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
@ -28,51 +26,61 @@
|
||||||
v-hasPermi="['manage:plan:remove']">删除</el-button>
|
v-hasPermi="['manage:plan:remove']">删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
-->
|
-->
|
||||||
<el-col :span="1.5" >
|
<el-col :span="1.5">
|
||||||
<el-upload ref="uploadRef" :limit="1" accept=".mpp" :headers="upload.headers"
|
<el-upload ref="uploadRef" :limit="1" accept=".mpp" :headers="upload.headers" :action="upload.url + '?compId=' + data.compId + '&projectId=' + queryParams.projectId" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="true">
|
||||||
:action="upload.url+'?compId='+data.compId+'&projectId='+queryParams.projectId" :disabled="upload.isUploading"
|
<el-button type="primary" v-loading="upload.isUploading">导入(Project)</el-button>
|
||||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="true">
|
</el-upload>
|
||||||
<el-button type="primary" v-loading="upload.isUploading" >导入(Project)</el-button>
|
|
||||||
</el-upload>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5" v-if="planList.length>0">
|
<el-col :span="1.5" v-if="planList.length > 0">
|
||||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['manage:plan:export']">导出(Project)</el-button>
|
||||||
v-hasPermi="['manage:plan:export']">导出(Project)</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" v-if="1==2"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" v-if="1 == 2"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="planList" row-key="taskId" default-expand-all>
|
<el-table v-loading="loading" :data="planList" row-key="taskId" default-expand-all>
|
||||||
<el-table-column label="任务名称" align="left" prop="taskName" />
|
<el-table-column label="任务名称" align="left" prop="taskName" />
|
||||||
<el-table-column label="任务工期" align="center" prop="taskDuation" width="120">
|
<el-table-column label="任务工期" align="center" prop="taskDuation" width="120">
|
||||||
<template #default="scope">{{scope.row.taskDuation}}d</template>
|
<template #default="scope">{{ scope.row.taskDuation }}d</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="计划开始时间" align="center" prop="planStartDate" width="180">
|
<el-table-column label="计划开始时间" align="center" prop="planStartDate" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.planStartDate, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.planStartDate, "{y}-{m}-{d}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="计划结束时间" align="center" prop="planFinishDate" width="180">
|
<el-table-column label="计划结束时间" align="center" prop="planFinishDate" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.planFinishDate, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.planFinishDate, "{y}-{m}-{d}") }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="BIM ID" align="center" prop="bimId" width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<template v-if="!scope.row.children||scope.row.children.length==0">
|
||||||
|
<span style="color: red" v-if="scope.row.bimId">已关联BIM</span>
|
||||||
|
<span v-else style="color: #8e9aaf">未关联BIM</span>
|
||||||
|
<span style="margin-left: 8px; cursor: pointer">
|
||||||
|
<el-tooltip append-to="" content="关联BIM模型" placement="top">
|
||||||
|
<svg-icon icon-class="position" style="cursor: pointer" class="icon-blue" @click="handleBim(scope.row)" />
|
||||||
|
</el-tooltip>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="BIM ID" align="center" prop="bimId" width="120"/>
|
|
||||||
<el-table-column label="负责人" align="center" prop="operator" width="120"/>
|
|
||||||
<el-table-column label="班组名称" align="center" prop="groupName" width="120"/>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
|
<el-table-column label="负责人" align="center" prop="operator" width="120" />
|
||||||
|
<el-table-column label="班组名称" align="center" prop="groupName" width="120" />
|
||||||
|
</el-table>
|
||||||
|
<bim-selection-dialog ref="bimDlg"></bim-selection-dialog>"
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Plan">
|
<script setup name="Plan">
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from "@/utils/auth";
|
||||||
import { listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/manage/plan";
|
import { listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/manage/plan";
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from "@/store/modules/user";
|
||||||
import { findMyProjectList } from "@/api/publics";
|
import { findMyProjectList } from "@/api/publics";
|
||||||
|
import bimSelectionDialog from "./bimSelectionDialog.vue";
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore();
|
||||||
const planList = ref([]);
|
const planList = ref([]);
|
||||||
const open = ref(false);
|
const open = ref(false);
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
@ -82,21 +90,22 @@ const single = ref(true);
|
||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const title = ref("");
|
const title = ref("");
|
||||||
const uploadRef=ref();
|
const uploadRef = ref();
|
||||||
|
const bimDlg = ref();
|
||||||
/*** 用户导入参数 */
|
/*** 用户导入参数 */
|
||||||
const upload = reactive({
|
const upload = reactive({
|
||||||
// 是否显示弹出层(用户导入)
|
// 是否显示弹出层(用户导入)
|
||||||
open: false,
|
open: false,
|
||||||
// 弹出层标题(用户导入)
|
// 弹出层标题(用户导入)
|
||||||
title: "",
|
title: "",
|
||||||
// 是否禁用上传
|
// 是否禁用上传
|
||||||
isUploading: false,
|
isUploading: false,
|
||||||
// 是否更新已经存在的用户数据
|
// 是否更新已经存在的用户数据
|
||||||
updateSupport: 0,
|
updateSupport: 0,
|
||||||
// 设置上传的请求头部
|
// 设置上传的请求头部
|
||||||
headers: { Authorization: "Bearer " + getToken() },
|
headers: { Authorization: "Bearer " + getToken() },
|
||||||
// 上传的地址
|
// 上传的地址
|
||||||
url: import.meta.env.VITE_APP_BASE_API + "/manage/plan/importData"
|
url: import.meta.env.VITE_APP_BASE_API + "/manage/plan/importData",
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
|
@ -125,19 +134,18 @@ const data = reactive({
|
||||||
groupName: null,
|
groupName: null,
|
||||||
isDel: null,
|
isDel: null,
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {},
|
||||||
},
|
compId: "",
|
||||||
compId:'',
|
projectId: "",
|
||||||
projectId:'',
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
function buildTree(all,id){
|
function buildTree(all, id) {
|
||||||
let tmps=all.filter(d=>d.parentId==id);
|
let tmps = all.filter((d) => d.parentId == id);
|
||||||
if(tmps.length>0){
|
if (tmps.length > 0) {
|
||||||
tmps.forEach(it=>{
|
tmps.forEach((it) => {
|
||||||
it.children=buildTree(all,it.taskId);
|
it.children = buildTree(all, it.taskId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return tmps;
|
return tmps;
|
||||||
|
@ -145,43 +153,48 @@ function buildTree(all,id){
|
||||||
|
|
||||||
/** 查询计划管理列表 */
|
/** 查询计划管理列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
queryParams.value.projectId=userStore.currentPrjId;
|
queryParams.value.projectId = userStore.currentPrjId;
|
||||||
if(!queryParams.value.projectId){
|
if (!queryParams.value.projectId) {
|
||||||
planList.value=[];
|
planList.value = [];
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listPlan(queryParams.value).then(response => {
|
listPlan(queryParams.value).then((response) => {
|
||||||
let tmps= response.data||[];
|
let tmps = response.data || [];
|
||||||
let objs= buildTree(tmps,0)
|
let objs = buildTree(tmps, 0);
|
||||||
planList.value =objs;
|
planList.value = objs;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleBim(row) {
|
||||||
|
bimDlg.value.showDialog(row);
|
||||||
|
}
|
||||||
|
|
||||||
/** 查询项目列表 */
|
/** 查询项目列表 */
|
||||||
function getProjectList() {
|
function getProjectList() {
|
||||||
findMyProjectList({ pageNum: 1, pageSize: 100 }).then(response => {
|
findMyProjectList({ pageNum: 1, pageSize: 100 }).then((response) => {
|
||||||
data.projects = response.rows;
|
data.projects = response.rows;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**文件上传中处理 */
|
/**文件上传中处理 */
|
||||||
const handleFileUploadProgress = (event, file, fileList) => {
|
const handleFileUploadProgress = (event, file, fileList) => {
|
||||||
upload.isUploading = true;
|
upload.isUploading = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 文件上传成功处理 */
|
/** 文件上传成功处理 */
|
||||||
const handleFileSuccess = (response, file, fileList) => {
|
const handleFileSuccess = (response, file, fileList) => {
|
||||||
upload.isUploading = false;
|
upload.isUploading = false;
|
||||||
if(response.code==200){
|
if (response.code == 200) {
|
||||||
proxy.$modal.msgSuccess("导入成功!");
|
proxy.$modal.msgSuccess("导入成功!");
|
||||||
}else{
|
} else {
|
||||||
proxy.$modal.msgError("导入失败!");
|
proxy.$modal.msgError("导入失败!");
|
||||||
}
|
}
|
||||||
if(fileList.length>0){
|
if (fileList.length > 0) {
|
||||||
fileList.splice(0,1)
|
fileList.splice(0, 1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
|
@ -218,19 +231,19 @@ function reset() {
|
||||||
createTime: null,
|
createTime: null,
|
||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
remark: null
|
remark: null,
|
||||||
};
|
};
|
||||||
proxy.resetForm("planRef");
|
proxy.resetForm("planRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
let prjId=queryParams.value.projectId;
|
let prjId = queryParams.value.projectId;
|
||||||
if(prjId){
|
if (prjId) {
|
||||||
let tmps=data.projects.filter(d=>d.id==prjId);
|
let tmps = data.projects.filter((d) => d.id == prjId);
|
||||||
data.compId=tmps.length>0?tmps[0].comId||'':''
|
data.compId = tmps.length > 0 ? tmps[0].comId || "" : "";
|
||||||
}else{
|
} else {
|
||||||
data.compId="";
|
data.compId = "";
|
||||||
}
|
}
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
|
@ -244,7 +257,7 @@ function resetQuery() {
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.id);
|
ids.value = selection.map((item) => item.id);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
@ -259,8 +272,8 @@ function handleAdd() {
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
const _id = row.id || ids.value
|
const _id = row.id || ids.value;
|
||||||
getPlan(_id).then(response => {
|
getPlan(_id).then((response) => {
|
||||||
form.value = response.data;
|
form.value = response.data;
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "修改计划管理";
|
title.value = "修改计划管理";
|
||||||
|
@ -269,16 +282,16 @@ function handleUpdate(row) {
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["planRef"].validate(valid => {
|
proxy.$refs["planRef"].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (form.value.id != null) {
|
if (form.value.id != null) {
|
||||||
updatePlan(form.value).then(response => {
|
updatePlan(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("修改成功");
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
open.value = false;
|
open.value = false;
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addPlan(form.value).then(response => {
|
addPlan(form.value).then((response) => {
|
||||||
proxy.$modal.msgSuccess("新增成功");
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
open.value = false;
|
open.value = false;
|
||||||
getList();
|
getList();
|
||||||
|
@ -291,25 +304,33 @@ function submitForm() {
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const _ids = row.id || ids.value;
|
const _ids = row.id || ids.value;
|
||||||
proxy.$modal.confirm('是否确认删除计划管理编号为"' + _ids + '"的数据项?').then(function () {
|
proxy.$modal
|
||||||
return delPlan(_ids);
|
.confirm('是否确认删除计划管理编号为"' + _ids + '"的数据项?')
|
||||||
}).then(() => {
|
.then(function () {
|
||||||
getList();
|
return delPlan(_ids);
|
||||||
proxy.$modal.msgSuccess("删除成功");
|
})
|
||||||
}).catch(() => { });
|
.then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
let tmps=data.projects.filter(d=>d.id==queryParams.value.projectId);
|
let tmps = data.projects.filter((d) => d.id == queryParams.value.projectId);
|
||||||
let name=tmps.length>0?tmps[0].projectName+"_":"";
|
let name = tmps.length > 0 ? tmps[0].projectName + "_" : "";
|
||||||
proxy.download('manage/plan/export', {
|
proxy.download(
|
||||||
...queryParams.value
|
"manage/plan/export",
|
||||||
}, `${name}计划_${new Date().getTime()}.mpp`)
|
{
|
||||||
|
...queryParams.value,
|
||||||
|
},
|
||||||
|
`${name}计划_${new Date().getTime()}.mpp`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
data.projectId=userStore.currentPrjId;
|
data.projectId = userStore.currentPrjId;
|
||||||
data.compId=userStore.currentComId;
|
data.compId = userStore.currentComId;
|
||||||
queryParams.value.projectId=data.projectId;
|
queryParams.value.projectId = data.projectId;
|
||||||
getList();
|
getList();
|
||||||
getProjectList();
|
getProjectList();
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue