|
@@ -37,11 +37,29 @@
|
|
|
<div class="text">{{ getState2(data.username) }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <div class="nav">
|
|
|
- <span>切片</span>
|
|
|
- <span>实体</span>
|
|
|
- <span>关系</span>
|
|
|
- </div> -->
|
|
|
+ <div class="nav">
|
|
|
+ <span :class="{ active: type == 1 }" @click="type = 1">切片</span>
|
|
|
+ <span :class="{ active: type == 2 }" @click="type = 2">图谱</span>
|
|
|
+ </div>
|
|
|
+ <div class="chunkBox" v-show="type == 1" v-loading="chunksLoading">
|
|
|
+ <div class="chunks" v-for="(item, index) in chunksArray" :key="index">
|
|
|
+ {{ item.text }}
|
|
|
+ </div>
|
|
|
+ <div class="noneData" v-if="!chunksArray.length">暂无获取切片数据</div>
|
|
|
+ <el-pagination
|
|
|
+ v-if="chunksArray.length > 0"
|
|
|
+ style="margin-top: 10px"
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :page-size="limit"
|
|
|
+ :total="total"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <div class="tuBox" v-show="type == 2">
|
|
|
+ <div class="noneData">暂无获取图谱数据</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<span slot="footer">
|
|
|
<el-button @click="dialogVisible = false">关 闭</el-button>
|
|
@@ -56,7 +74,13 @@ export default {
|
|
|
dialogVisible: false,
|
|
|
data: {},
|
|
|
did: "",
|
|
|
- isLoading: false
|
|
|
+ isLoading: false,
|
|
|
+ type: 1,
|
|
|
+ limit: 10,
|
|
|
+ total: 0,
|
|
|
+ page: 1,
|
|
|
+ chunksArray: [],
|
|
|
+ chunksLoading: false
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -106,7 +130,9 @@ export default {
|
|
|
openG(did) {
|
|
|
this.did = did;
|
|
|
this.dialogVisible = true;
|
|
|
+ this.page = 1;
|
|
|
this.getFileDetail();
|
|
|
+ this.getChunks();
|
|
|
},
|
|
|
getFileDetail() {
|
|
|
this.isLoading = true;
|
|
@@ -124,6 +150,30 @@ export default {
|
|
|
this.isLoading = false;
|
|
|
console.error(err);
|
|
|
});
|
|
|
+ },
|
|
|
+ getChunks() {
|
|
|
+ this.chunksLoading = true;
|
|
|
+ let params = {
|
|
|
+ documentId: this.did,
|
|
|
+ page: this.page
|
|
|
+ };
|
|
|
+ // 获取切片
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.fileApi + "getChunks", [params])
|
|
|
+ .then(res => {
|
|
|
+ this.chunksLoading = false;
|
|
|
+ console.log(res.data);
|
|
|
+ this.total = res.data.result.totalEntries;
|
|
|
+ this.chunksArray = res.data.result.results;
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ this.chunksLoading = false;
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.page = val;
|
|
|
+ this.getChunks();
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -131,10 +181,10 @@ export default {
|
|
|
|
|
|
<style scoped>
|
|
|
.el-dialogClass >>> .el-dialog {
|
|
|
- margin: 0 auto !important;
|
|
|
- height: calc(100% - 200px);
|
|
|
- transform: translateY(-50%);
|
|
|
- top: 50%;
|
|
|
+ margin: 0 auto !important;
|
|
|
+ height: calc(100% - 200px);
|
|
|
+ transform: translateY(-50%);
|
|
|
+ top: 50%;
|
|
|
}
|
|
|
|
|
|
.el-dialogClass >>> .el-dialog__body {
|
|
@@ -144,9 +194,9 @@ export default {
|
|
|
box-sizing: border-box;
|
|
|
padding: 0 20px;
|
|
|
}
|
|
|
-.container{
|
|
|
- height: 100%;
|
|
|
- overflow: auto;
|
|
|
+.container {
|
|
|
+ height: 100%;
|
|
|
+ overflow: auto;
|
|
|
}
|
|
|
|
|
|
.contentBox {
|
|
@@ -173,4 +223,57 @@ export default {
|
|
|
|
|
|
.contentBox > .content > .text {
|
|
|
}
|
|
|
+
|
|
|
+.nav {
|
|
|
+ width: 100%;
|
|
|
+ height: 40px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ background: #f8f8f8;
|
|
|
+ margin: 15px 0;
|
|
|
+ border-radius: 5px;
|
|
|
+ padding: 5px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ color: #a3a3a3;
|
|
|
+}
|
|
|
+
|
|
|
+.nav > span {
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ width: calc(100% / 2);
|
|
|
+ justify-content: center;
|
|
|
+ border-radius: 5px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.nav > span.active {
|
|
|
+ background: #fff;
|
|
|
+ color: #000;
|
|
|
+}
|
|
|
+
|
|
|
+.noneData {
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ margin: 20px 0;
|
|
|
+ color: #000;
|
|
|
+}
|
|
|
+
|
|
|
+.chunkBox {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.chunks {
|
|
|
+ width: 100%;
|
|
|
+ background: #f8f9fc;
|
|
|
+ border-radius: 5px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 10px;
|
|
|
+ color: rgb(15, 21, 40);
|
|
|
+ line-height: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.chunks + .chunks {
|
|
|
+ margin-top: 10px;
|
|
|
+}
|
|
|
</style>
|