|
|
@ -2,6 +2,12 @@ |
|
|
<div style="width: 100%;height: 100%;"> |
|
|
<div style="width: 100%;height: 100%;"> |
|
|
<div style="width: 100%;height: 4vw;background-color: #42b983;"> |
|
|
<div style="width: 100%;height: 4vw;background-color: #42b983;"> |
|
|
<div style="background-color: silver;width: 3vw;height: 2vw;line-height: 2vw;text-align: center;" @click="goBook">跳转1</div> |
|
|
<div style="background-color: silver;width: 3vw;height: 2vw;line-height: 2vw;text-align: center;" @click="goBook">跳转1</div> |
|
|
|
|
|
<div class="stText">关键字:</div> |
|
|
|
|
|
<input class="stInput" placeholder="请输入关键字" v-model="keywords"/> |
|
|
|
|
|
<div @click="getInfo" |
|
|
|
|
|
style="width: 4vw;height: 2vw;margin-left:0.2vw;background-color: #0AB7FD;float: right;font-size: 1vw;line-height: 2vw;text-align: center;border-radius:2vw;margin-top: 0.1vw;"> |
|
|
|
|
|
查询 |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div style="width: 100%;height: 80%;"> |
|
|
<div style="width: 100%;height: 80%;"> |
|
|
<div class="gContainer"> |
|
|
<div class="gContainer"> |
|
|
@ -9,42 +15,49 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 弹窗 --> |
|
|
<!-- 弹窗 --> |
|
|
<div v-if="isModalVisible" style="height: 5vw;width: 100%;" class="modal-overlay" @click.self="closeModal"> |
|
|
<el-dialog |
|
|
<div class="modal-content"> |
|
|
:visible.sync="isModalVisible" |
|
|
<h3>请输入分支内容</h3> |
|
|
title="添加分支内容" |
|
|
<label for="fileId">fileId:</label> |
|
|
width="30%" |
|
|
<input type="text" id="fileId" v-model="newBranchFileId" /> |
|
|
top="15vh" |
|
|
|
|
|
append-to-body |
|
|
<label for="type">类型:</label> |
|
|
custom-class="custom-dialog" |
|
|
<select id="type" name="type"> |
|
|
> |
|
|
<option value="图文">图文</option> |
|
|
<el-form label-width="80px"> |
|
|
<option value="视频">视频</option> |
|
|
<el-form-item label="fileId"> |
|
|
<option value="动画">动画</option> |
|
|
<el-input v-model="newBranchFileId"></el-input> |
|
|
</select> |
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="类型"> |
|
|
<label for="txtName">节点名称:</label> |
|
|
<el-select v-model="typeValue" placeholder="请选择类型"> |
|
|
<input type="text" id="txtName" v-model="newBranchContent" /> |
|
|
<el-option label="图文" value="图文"></el-option> |
|
|
|
|
|
<el-option label="视频" value="视频"></el-option> |
|
|
|
|
|
<el-option label="动画" value="动画"></el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="节点名称"> |
|
|
|
|
|
<el-input v-model="newBranchContent"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="节点内容"> |
|
|
|
|
|
<el-input type="textarea" v-model="newBranchValue"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="父级节点ID"> |
|
|
|
|
|
<el-input v-model="newBranchParentId" disabled></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="关系"> |
|
|
|
|
|
<el-input v-model="newBranchRelation" |
|
|
|
|
|
@input="newBranchRelation = $event.target.value.replace(/[^a-zA-Z\u4e00-\u9fa5]/g, '')"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="层级"> |
|
|
|
|
|
<el-input-number v-model="newBranchLevel" controls-position="right" :min="1"></el-input-number> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button @click="closeModal">取 消</el-button> |
|
|
|
|
|
<el-button type="primary" @click="addNewBranch">提 交</el-button> |
|
|
|
|
|
</span> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<label for="TxtValue">节点内容:</label> |
|
|
|
|
|
<textarea id="TxtValue" v-model="newBranchValue"></textarea> |
|
|
|
|
|
|
|
|
|
|
|
<label for="parentId">父级节点ID:</label> |
|
|
|
|
|
<input type="text" id="parentId" v-model="newBranchParentId" /> |
|
|
|
|
|
|
|
|
|
|
|
<label for="relation">关系:</label> |
|
|
|
|
|
<input type="text" id="relation" v-model="newBranchRelation" |
|
|
|
|
|
@input="newBranchRelation = $event.target.value.replace(/[^a-zA-Z\u4e00-\u9fa5]/g, '')" /> |
|
|
|
|
|
|
|
|
|
|
|
<label for="level">层级:</label> |
|
|
|
|
|
<input type="number" id="level" v-model="newBranchLevel" /> |
|
|
|
|
|
|
|
|
|
|
|
<button @click="addNewBranch">提交</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
@ -76,8 +89,9 @@ export default { |
|
|
newBranchFileId: '', |
|
|
newBranchFileId: '', |
|
|
newBranchLevel: null, |
|
|
newBranchLevel: null, |
|
|
newBranchParentId: '', |
|
|
newBranchParentId: '', |
|
|
newBranchRelation:'' |
|
|
newBranchRelation:'', |
|
|
|
|
|
typeValue: '', |
|
|
|
|
|
keywords: '', |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods:{ |
|
|
methods:{ |
|
|
@ -87,12 +101,34 @@ export default { |
|
|
onCreated(editor) { |
|
|
onCreated(editor) { |
|
|
this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错 |
|
|
this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错 |
|
|
}, |
|
|
}, |
|
|
getInfo(){ |
|
|
// getInfo(){ |
|
|
var data = {} |
|
|
// var data = {} |
|
|
getgraphInfo(data).then((res)=>{ |
|
|
// getgraphInfo(data).then((res)=>{ |
|
|
this.zhengl(res.data); |
|
|
// this.zhengl(res.data); |
|
|
|
|
|
// |
|
|
|
|
|
// }) |
|
|
|
|
|
// }, |
|
|
|
|
|
getInfo() { |
|
|
|
|
|
|
|
|
|
|
|
this.data = undefined; |
|
|
|
|
|
if (this.keywords != '' && this.keywords != undefined) { |
|
|
|
|
|
this.visGraph.clearAll(); |
|
|
|
|
|
let params = { |
|
|
|
|
|
nodename: this.keywords, |
|
|
|
|
|
}; |
|
|
|
|
|
getgraphInfo(params).then((res) => { |
|
|
|
|
|
this.zhengl(res.data); |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
let params = {}; |
|
|
|
|
|
|
|
|
|
|
|
getgraphInfo(params).then((res) => { |
|
|
|
|
|
this.zhengl(res.data); |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
async drawGraphData() { |
|
|
async drawGraphData() { |
|
|
this.graphData = this.demoData; |
|
|
this.graphData = this.demoData; |
|
|
@ -134,7 +170,7 @@ export default { |
|
|
console.log(node) |
|
|
console.log(node) |
|
|
this.selectedNode = node; |
|
|
this.selectedNode = node; |
|
|
this.newBranchParentId = node.properties.docId; |
|
|
this.newBranchParentId = node.properties.docId; |
|
|
|
|
|
this.newBranchLevel = parseInt(node.properties.level) + 1; |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
const response = await this.getFileIdByDocId({ docId: node.properties.docId }); |
|
|
const response = await this.getFileIdByDocId({ docId: node.properties.docId }); |
|
|
@ -145,7 +181,6 @@ export default { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.newBranchLevel = parseInt(node.properties.level) + 1; |
|
|
|
|
|
this.isModalVisible = true; // 显示模态框 |
|
|
this.isModalVisible = true; // 显示模态框 |
|
|
}, |
|
|
}, |
|
|
getFileIdByDocId(data) { |
|
|
getFileIdByDocId(data) { |
|
|
@ -323,7 +358,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
this.doLogin(); |
|
|
this.doLogin(); |
|
|
|
|
|
this.getInfo(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|