From c2e1086435ce675420a757e912f268780d4622cb Mon Sep 17 00:00:00 2001
From: revive <1664535558@qq.com>
Date: Mon, 4 Jan 2021 15:05:03 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B5=8C=E5=A5=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/static/css/main.css | 9 ++
src/utils/request.js | 1 -
.../components_web/projDetail/projDetail.vue | 20 ++---
src/views/components_web/project/nestTemp.vue | 1 -
src/views/components_web/project/newProj.vue | 44 +++++++---
src/views/manage_system/customer/index.vue | 1 -
src/views/manage_system/customer/services.js | 4 +-
src/views/manage_system/template/index.vue | 1 +
src/views/manage_system/template/mind.vue | 88 +++++++++++++++++--
9 files changed, 136 insertions(+), 33 deletions(-)
diff --git a/public/static/css/main.css b/public/static/css/main.css
index 6cbbf274..7e3f88b5 100644
--- a/public/static/css/main.css
+++ b/public/static/css/main.css
@@ -8705,6 +8705,15 @@ h5.dulilabel{
background-color: #fff;
box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
+/* 滑动的时候 顶部导航栏的底部阴影 */
+.header-bottom-shadow::after {
+/* box-shadow: 0 18px 18px 0 #f1f1f1; */
+ content:'';
+ display: block;
+ width: 100%;
+ height: 30px;
+ background: linear-gradient(rgba(#000, .06),rgba(#000, 0));
+}
.tinylabel{
font-size: 12px;
display: block;
diff --git a/src/utils/request.js b/src/utils/request.js
index c9ac6bc3..bd999705 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -121,7 +121,6 @@ function mapApiPathToFullPath(path) {
case 'template/uploadingXmind':
case 'template/addTemplateNodeModelFile':
case 'template/createNestedRelevance':
- case 'template/deleteNestedRelevance':
case 'template/connectNestTemplateFolder':
case "folder/createSubfolder":
case "project/createProject":
diff --git a/src/views/components_web/projDetail/projDetail.vue b/src/views/components_web/projDetail/projDetail.vue
index 85b7d19d..62bdc741 100644
--- a/src/views/components_web/projDetail/projDetail.vue
+++ b/src/views/components_web/projDetail/projDetail.vue
@@ -1496,6 +1496,15 @@ import NestTemp from '../project/nestTemp.vue';
font-family: PingFangSC-Regular;
}
+ /* 滑动的时候 顶部导航栏的底部阴影 */
+ .header-bottom-shadow::after {
+ /* box-shadow: 0 18px 18px 0 #f1f1f1; */
+ content:'';
+ display: block;
+ width: 100%;
+ height: 30px;
+ background: linear-gradient(rgba(#000, .06),rgba(#000, 0));
+ }
/* 编辑模板自定义字段 调整标题位置 */
.adjust-title-position {
position: relative;
@@ -1571,17 +1580,6 @@ import NestTemp from '../project/nestTemp.vue';
color: #32323c !important;
z-index: 99;
}
-
- /* 滑动的时候 顶部导航栏的底部阴影 */
- .header-bottom-shadow::after {
- /* box-shadow: 0 18px 18px 0 #f1f1f1; */
- content:'';
- display: block;
- width: 100%;
- height: 30px;
- background: linear-gradient(rgba(#000, .06),rgba(#000, 0));
- }
-
/* 模板概况按钮 */
.template-detail-btn {
height: 40px;
diff --git a/src/views/components_web/project/nestTemp.vue b/src/views/components_web/project/nestTemp.vue
index 98521f7f..bf351994 100644
--- a/src/views/components_web/project/nestTemp.vue
+++ b/src/views/components_web/project/nestTemp.vue
@@ -176,7 +176,6 @@ export default {
this.checkedIndex=0;
}
},
-
},
watch:{
isTemNestInProp:{
diff --git a/src/views/components_web/project/newProj.vue b/src/views/components_web/project/newProj.vue
index 926f434c..5726b17f 100644
--- a/src/views/components_web/project/newProj.vue
+++ b/src/views/components_web/project/newProj.vue
@@ -44,6 +44,8 @@
backBtnTitle="修改项目名称"
:onBackBtnClick="enterProjNameInput"
title="选择项目名称"
+ ref="projdesc"
+ :class="{'header-bottom-shadow': isProjDescScroll}"
>
选定模板
@@ -122,6 +124,9 @@ export default {
srcIndex: 2, // 封面切换Index
coverSrc: 'static/img/faceImg/face01.png',
templateList:[],
+ isProjDescScroll: false,//项目概况页面是否滚动
+ projDescEl: null,
+ plastScrollTime: null,
createDate: new Date().toLocaleDateString(),
checkNewProjData: {
"Proj": {
@@ -365,19 +370,34 @@ export default {
if(!res.Data) return;
this.nodeClick(res.Data);
},
-
+ /**
+ * 监听滚动条事件
+ */
+ // 项目概况页面滚动
+ watchProjDescScroll() {
+ this.isProjDescScroll = this.projDescEl.scrollTop > 0;
+ },
},
- // watch:{
- // isTemNestInProp:{
- // handler(value){
- // this.isTemNest = value;
- // if(value){
- // this.getNestTemplate(this.nestNodeFolder.nodeId);
- // }
- // },
- // immediate: true
- // }
- // }
+ watch:{
+ isProjDescScroll(val) {
+ if(val) {
+ setTimeout(()=> {
+ this.projDescEl = this.$refs.projdesc;
+ if(this.projDescEl) {
+ this.projDescEl.addEventListener('scroll', this.watchProjDescScroll);
+ }
+ }, 50)
+ }
+ },
+ },
+ mounted(){
+ if(this.projDescEl) {
+ this.projDescEl.addEventListener('scroll', this.watchProjDescScroll);
+ }
+ },
+ beforeDestroy(){
+ this.projDescEl && this.projDescEl.removeEventListener('scroll', this.watchProjDescScroll);
+ }
}
diff --git a/src/views/manage_system/customer/index.vue b/src/views/manage_system/customer/index.vue
index a4b70d76..37141d21 100644
--- a/src/views/manage_system/customer/index.vue
+++ b/src/views/manage_system/customer/index.vue
@@ -1204,7 +1204,6 @@ export default {
thisApp.$notify({
message: `企业“${this.currentCompany.companyName}”已完成修改。`,
type: ["success"],
- // offset: 100,
duration: 2500,
});
thisApp.listCompany();
diff --git a/src/views/manage_system/customer/services.js b/src/views/manage_system/customer/services.js
index df01ff0c..f2924800 100644
--- a/src/views/manage_system/customer/services.js
+++ b/src/views/manage_system/customer/services.js
@@ -147,10 +147,12 @@ export async function updateCompany(data) {
Remark: data.remark,
Telphone: data.telphone,
Id: data.companyID,
+ IpfsApi: data.ipfsApi,
+ IpfsBootstrap: data.ipfsBootstrap
}
const resData = await fetchApi('company/updateCompanyById', { company: fixedData, user: userData });
- return (resData);
+ return wrapErrorHint(resData);
}
async function recursionFetchNode(parentNodeId, topNodeId) {
diff --git a/src/views/manage_system/template/index.vue b/src/views/manage_system/template/index.vue
index 02333953..b317b346 100644
--- a/src/views/manage_system/template/index.vue
+++ b/src/views/manage_system/template/index.vue
@@ -3283,6 +3283,7 @@ export default {
});
},
goscanMind: function () {
+ sessionStorage.templateID = this.templateID;
this.$router.push({
name: "system_template_mind",
params: {
diff --git a/src/views/manage_system/template/mind.vue b/src/views/manage_system/template/mind.vue
index d036483c..5e565f96 100644
--- a/src/views/manage_system/template/mind.vue
+++ b/src/views/manage_system/template/mind.vue
@@ -59,6 +59,8 @@
import AppHeader from '@/components/app-header';
import TemplateTree from './components/template-tree';
import {notify} from '@/utils/tool';
+ import * as tempalteService from '@/services/template.js'
+ import { cloneDeep } from 'lodash';
const jsMind = window.jsMind;
const $ = window.jQuery;
const popupViewType = {
@@ -73,11 +75,13 @@
},
data() {
return {
+ nestNodeList:[],//嵌套模板节点信息
templateList: [],
+ cloneTemplateMindTree:[],//克隆思维导图节点数据
listTemplateMindTree: [], //思维导图数据
mindZoom: 60,
tempName: this.$route.params.name,
- tempId: this.$route.params.id,
+ tempId: sessionStorage.templateID,
jm: null,
selectedNode: null,
popupViewType,
@@ -87,11 +91,79 @@
};
},
created: function () {
+ this.getNestNode(this.tempId)
this.getTemplateMindTree();
-
},
+ mounted(){
+
+ },
+
watch: {},
methods: {
+ /**
+ * 查找嵌套节点信息
+ */
+ async getNestNode(id){
+ const res = await tempalteService.queryNestTemplateByTemplateId(id);
+ this.nestNodeList = res.Data || [];
+ },
+ /**
+ * 思维导图数据增加嵌套节点
+ */
+ addNestNode(addNodeList){
+ let childrenList = this.findAllNestNode(addNodeList);
+ if(!addNodeList.children){
+ if(childrenList.length !== 0){
+ addNodeList.children = [];
+ addNodeList.children = addNodeList.children.concat(childrenList);
+ }
+ }else{
+ if(childrenList.length !== 0){
+ addNodeList.children = addNodeList.children.concat(childrenList);
+ }
+ }
+ },
+ /**
+ * get
+ */
+ getAddNestNode(addNodeList){
+ this.addNestNode(addNodeList);
+ if(!addNodeList.children){
+ return;
+ }
+ addNodeList.children.forEach(node =>{
+ this.getAddNestNode(node);
+ })
+ },
+ /**
+ * 查找所有嵌套节点
+ */
+ findAllNestNode(node){
+ let nodeList;
+ nodeList = this.nestNodeList.filter(temp => temp.ParentNodeId == node.id);
+ let len = nodeList.length;
+ if(len > 0){
+ let nestNodeListData=[];
+ nodeList.forEach(item =>{
+ let nestNodeData = {
+ id:'',
+ isNest: true,
+ label:'',
+ topic:'',
+ templateId:''
+ }
+ nestNodeData.id = item.Id;
+ nestNodeData.label = item.TemplateName;
+ nestNodeData.topic = item.TemplateName;
+ nestNodeData.templateId = item.TemplateId
+ nestNodeListData.push(nestNodeData);
+ //debugger;
+ })
+ return nestNodeListData;
+ }
+ return [];
+
+ },
onBackBtnClick() {
this.$router.push({
name: "system_template",
@@ -182,6 +254,7 @@
const templateId = this.tempId;
const res = await services.queryTemplateNodeByTemplateId(templateId);
this.listTemplateMindTree = res.Data ? [res.Data] : [];
+ this.getAddNestNode(this.listTemplateMindTree[0]);
this.scanMind();
},
/**
@@ -243,7 +316,9 @@
if(res.Code !== 0) return;
notify.success('嵌套成功');
this.selectedNode = null;
+ this.getNestNode(this.tempId)
this.getTemplateMindTree();
+
},
/**
* 移除嵌套模板
@@ -251,15 +326,16 @@
async removeNestTemplate(node){
const selectedNode = this.selectedNode;
const parentNode = selectedNode.parent;
- const mainTemplateId = this.tempId;
+ const mainTemplateId = selectedNode.data.templateId;
const res = await services.deleteNestedRelevance({
- id: selectedNode.id,
- parentId: parentNode.id,
- parentTemplateId: mainTemplateId,
+ //id: selectedNode.id,
+ parentNodeId: parentNode.id,
+ templateId : mainTemplateId,
});
if(res.Code !== 0) return;
notify.success('移除成功');
this.selectedNode = null;
+ this.getNestNode(this.tempId);
this.getTemplateMindTree();
},
/**