|
@@ -18,7 +18,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
- <tf-table highlight-current-row @current-change="selectChange" class="tabletree" :stripe='false' row-key="id" border style='width:100%' :data="tableData" :tree-props="{children:'children'}">
|
|
|
+ <tf-table v-if="!isNewProj" highlight-current-row @current-change="selectChange" class="tabletree" :stripe='false' row-key="id" border style='width:100%' :data="tableData" :tree-props="{children:'children'}">
|
|
|
<el-table-column prop="name" label="节点名称" width="400" :show-overflow-tooltip="true">
|
|
|
|
|
|
</el-table-column>
|
|
@@ -34,9 +34,6 @@
|
|
|
<el-tag v-else type="danger">未发布</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column prop="" label="创建时间">
|
|
|
-
|
|
|
- </el-table-column> -->
|
|
|
<el-table-column prop="" label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<div v-if="scope.row.levelname==='工程'||scope.row.levelname==='单项工程'||scope.row.levelname==='单位工程(CWP)'">
|
|
@@ -44,17 +41,18 @@
|
|
|
</div>
|
|
|
<div v-else-if="scope.row.levelname==='分部工程(专业)'">
|
|
|
<el-button class="tdbutton" size="mini" type="success" @click="pipeDataImport(scope.row)">导入</el-button>
|
|
|
- <!-- <el-button size="mini" type="danger" icon="el-icon-delete"></el-button> -->
|
|
|
<i class="el-icon-delete" style="color:red;margin-left:10px;" @click="deleteData(scope.row)"></i>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<el-button class="tdbutton" size="mini" type="primary" @click="openNewNode(scope.row)">新建</el-button>
|
|
|
- <!-- <el-button size="mini" type="danger" icon="el-icon-delete"></el-button> -->
|
|
|
<i class="el-icon-delete" style="color:red;margin-left:10px;" @click="deleteData(scope.row)"></i>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</tf-table>
|
|
|
+ <el-row v-else type="flex" justify="center" align="middle" style="height:100%;background:#fff;">
|
|
|
+ <el-button type="primary" @click="addProjectNode">创建项目工程结构树</el-button>
|
|
|
+ </el-row>
|
|
|
</tf-page>
|
|
|
<tf-dialog :visible.sync="newNodeDialogShow" title="新建下级节点" width="600px">
|
|
|
<el-form :model="addNodeForm" label-width="140px">
|
|
@@ -272,6 +270,8 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
pointData: [],
|
|
|
lineData: []
|
|
|
}
|
|
|
+ /**是否创建新项目 */
|
|
|
+ isNewProj=false
|
|
|
/**服务发布对话框 */
|
|
|
isPublicDialogShow = false
|
|
|
/**发布服务选项 */
|
|
@@ -375,7 +375,7 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
*/
|
|
|
onlineRecords = []
|
|
|
/**树结构 */
|
|
|
- structures=[]
|
|
|
+ structures = []
|
|
|
/**
|
|
|
* 上传文件
|
|
|
*/
|
|
@@ -438,8 +438,8 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
}
|
|
|
/**未过滤发布状态的 */
|
|
|
getPbsTree() {
|
|
|
- const params={structDetailId:this.searchStructureId}
|
|
|
- pbsTreeListwithPublish(params ).then((res) => {
|
|
|
+ const params = { structDetailId: this.searchStructureId }
|
|
|
+ pbsTreeListwithPublish(params).then((res) => {
|
|
|
const { code, result } = res
|
|
|
if (code === 1) {
|
|
|
function formatTree(obj) {
|
|
@@ -452,9 +452,11 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
})
|
|
|
}
|
|
|
if (result[0]) {
|
|
|
- this.structures=result[0].structures
|
|
|
+ this.structures = result[0].structures
|
|
|
let data = formatTree(result[0].structures)
|
|
|
this.tableData = data
|
|
|
+ }else{
|
|
|
+ this.isNewProj=true;
|
|
|
}
|
|
|
} else {
|
|
|
this.$message.error('信息获取失败')
|
|
@@ -523,7 +525,7 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
pid: this.addNodeForm.pid,
|
|
|
code: this.addNodeForm.code,
|
|
|
name: this.addNodeForm.name,
|
|
|
- prjId: 9
|
|
|
+ prjId: this.$store.state.project.project.currentPrj
|
|
|
}
|
|
|
addStrctureNode(data)
|
|
|
.then((result) => {
|
|
@@ -547,6 +549,59 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
this.addNodeForm.code = this.addNodeForm.pCode + this.connector + node.value
|
|
|
this.addNodeForm.name = node.name
|
|
|
}
|
|
|
+ /**添加项目 */
|
|
|
+ addProjectNode() {
|
|
|
+ const { pbsModel } = this.$store.state.project.project
|
|
|
+ if (!pbsModel) {
|
|
|
+ this.$message.warning('项目未绑定PBS模板')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ getPbsLevelPage({ pbsId: pbsModel, alevel: 1 }).then((pbslevel) => {
|
|
|
+ if (pbslevel.code == 1 && pbslevel.result.records.length > 0) {
|
|
|
+ const levelId = pbslevel.result.records[0].id
|
|
|
+ //获取层级对应的业务对象
|
|
|
+ getPbsCodeDetailPage({ pbslevelId: levelId }).then((codeDetail) => {
|
|
|
+ if (codeDetail.code === 1 && codeDetail.result.records.length === 1) {
|
|
|
+ getBoinfoPage({
|
|
|
+ boId: codeDetail.result.records[0].boId,
|
|
|
+ size: 100,
|
|
|
+ 'orders[0].column': 'code',
|
|
|
+ 'orders[0].asc': true
|
|
|
+ }).then((boinfos) => {
|
|
|
+ if (boinfos.code === 1) {
|
|
|
+ const list = boinfos.result.records.map((item) => {
|
|
|
+ return { name: item.name, value: item.code }
|
|
|
+ })
|
|
|
+ if(list.length===0){
|
|
|
+ this.$message.warning('未创建工程业务对象');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const proj=list[0]
|
|
|
+ const data = {
|
|
|
+ pid: null,
|
|
|
+ code: proj.value,
|
|
|
+ name: proj.name,
|
|
|
+ prjId: this.$store.state.project.project.id
|
|
|
+ }
|
|
|
+ addStrctureNode(data)
|
|
|
+ .then((result) => {
|
|
|
+ if (result.code === -1) {
|
|
|
+ this.$message.error('添加失败')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$message.success('添加成功')
|
|
|
+ this.getPbsTree()
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
/**导入按钮点击事件 */
|
|
|
pipeDataImport(row) {
|
|
|
this.impForm.id = row.id
|
|
@@ -558,13 +613,13 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
console.log(err)
|
|
|
})
|
|
|
this.importDialogShow = true
|
|
|
- this.fileList=[];
|
|
|
- this.impForm.pointColumns=[]
|
|
|
- this.impForm.lineColumns=[]
|
|
|
- this.impForm.pointData=[]
|
|
|
- this.impForm.lineData=[]
|
|
|
- this.importInfo=''
|
|
|
- this.priviewInfo=''
|
|
|
+ this.fileList = []
|
|
|
+ this.impForm.pointColumns = []
|
|
|
+ this.impForm.lineColumns = []
|
|
|
+ this.impForm.pointData = []
|
|
|
+ this.impForm.lineData = []
|
|
|
+ this.importInfo = ''
|
|
|
+ this.priviewInfo = ''
|
|
|
this.$nextTick(() => {
|
|
|
this.addToMap()
|
|
|
})
|
|
@@ -581,8 +636,8 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
this.$message.warning('请选择导入层级')
|
|
|
return
|
|
|
}
|
|
|
- const loading=this.$loading({
|
|
|
- text:"后台处理中",
|
|
|
+ const loading = this.$loading({
|
|
|
+ text: '后台处理中',
|
|
|
lock: true,
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
@@ -602,16 +657,16 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
.then((result) => {
|
|
|
if (result.code === 1) {
|
|
|
this.$message.success('临时库数据集生成成功')
|
|
|
- console.log(result.result);
|
|
|
- this.priviewInfo='管点:'+result.result["管点数量"]+',管线'+result.result["管线数量"]+'条';
|
|
|
+ this.priviewInfo = '管点:' + result.result['管点数量'] + ',管线' + result.result['管线数量'] + '条'
|
|
|
//this.buildNetwork()
|
|
|
}
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
this.$message.error('临时数据集生成失败')
|
|
|
console.log(err)
|
|
|
- }).finally(()=>{
|
|
|
- loading.close();
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.close()
|
|
|
})
|
|
|
}
|
|
|
/**
|
|
@@ -626,8 +681,8 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
this.$message.warning('请选择导入层级')
|
|
|
return
|
|
|
}
|
|
|
- const loading=this.$loading({
|
|
|
- text:"后台处理中",
|
|
|
+ const loading = this.$loading({
|
|
|
+ text: '后台处理中',
|
|
|
lock: true,
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
@@ -673,8 +728,9 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
.catch((err) => {
|
|
|
this.$message.error('导入excel出错')
|
|
|
console.log(err)
|
|
|
- }).finally(()=>{
|
|
|
- loading.close();
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.close()
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -690,8 +746,8 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
this.$message.warning('请选择导入层级')
|
|
|
return
|
|
|
}
|
|
|
- const loading=this.$loading({
|
|
|
- text:"后台处理中",
|
|
|
+ const loading = this.$loading({
|
|
|
+ text: '后台处理中',
|
|
|
lock: true,
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
@@ -715,8 +771,9 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
.catch((err) => {
|
|
|
this.$message.error('正式库数据集生成失败')
|
|
|
console.log(err)
|
|
|
- }).finally(()=>{
|
|
|
- loading.close();
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.close()
|
|
|
})
|
|
|
}
|
|
|
/**
|
|
@@ -870,12 +927,12 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
const id = row.id
|
|
|
this.$confirm('是否删除该节点')
|
|
|
.then(() => {
|
|
|
- const loading=this.$loading({
|
|
|
- text:"后台处理中",
|
|
|
- lock: true,
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(0, 0, 0, 0.7)'
|
|
|
- })
|
|
|
+ const loading = this.$loading({
|
|
|
+ text: '后台处理中',
|
|
|
+ lock: true,
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ })
|
|
|
request({
|
|
|
url: '/tofly-lzd-data/data/deleteData/' + id + '?importType=1&id=' + id,
|
|
|
method: 'POST'
|
|
@@ -889,8 +946,9 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
.catch((err) => {
|
|
|
this.$message.error('数据删除失败')
|
|
|
console.log(err)
|
|
|
- }).finally(()=>{
|
|
|
- loading.close();
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ loading.close()
|
|
|
})
|
|
|
})
|
|
|
.catch(() => {
|
|
@@ -1121,7 +1179,6 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- console.log(window.impViewer.imageryLayers)
|
|
|
|
|
|
// window.impViewer.imageryLayers.addImageryProvider(
|
|
|
// new Cesium.SuperMapImageryProvider({
|
|
@@ -1332,13 +1389,13 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
imagelayers.addImageryProvider(poilayer)
|
|
|
}
|
|
|
/**刷新地图 */
|
|
|
- refreshViewer(){
|
|
|
- window.impViewer.render();
|
|
|
+ refreshViewer() {
|
|
|
+ window.impViewer.render()
|
|
|
}
|
|
|
/**服务发布按钮点击事件 */
|
|
|
publicService() {
|
|
|
this.isPublicDialogShow = true
|
|
|
- this.publicConfig=[]
|
|
|
+ this.publicConfig = []
|
|
|
}
|
|
|
/**发布服务 */
|
|
|
submitPublicService() {
|
|
@@ -1432,7 +1489,7 @@ export default class PipeOnlineImprt extends Vue {
|
|
|
left: 0 !important;
|
|
|
}
|
|
|
}
|
|
|
-.refresjBtn{
|
|
|
+.refresjBtn {
|
|
|
position: absolute;
|
|
|
top: 10px;
|
|
|
left: 10px;
|