|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div v-if="editor" :loading="loading">
|
|
|
- <el-row>
|
|
|
+ <el-row v-show="!readonly">
|
|
|
<span style="float: right;">
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="primary" plain icon="el-icon-check" size="mini" @click="handleApprove('2')" :loading="loading">审批</el-button>
|
|
@@ -13,41 +13,41 @@
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-card style="margin:10px">
|
|
|
- <el-button @click="highlight_new_h" :class="{
|
|
|
+ <el-button v-show="!readonly" @click="highlight_new_h" :class="{
|
|
|
'is-active': editor.isActive('highlight', { color: '#ff5d5d' }),
|
|
|
}">
|
|
|
主体
|
|
|
</el-button>
|
|
|
- <el-button @click="highlight_new_t" :class="{
|
|
|
+ <el-button v-show="!readonly" @click="highlight_new_t" :class="{
|
|
|
'is-active': editor.isActive('highlight', { color: '#119525' }),
|
|
|
}">
|
|
|
客体
|
|
|
</el-button>
|
|
|
- <el-button @click="editor.chain().focus().unsetHighlight().run()" :disabled="!editor.isActive('highlight')">
|
|
|
+ <el-button v-show="!readonly" @click="editor.chain().focus().unsetHighlight().run()" :disabled="!editor.isActive('highlight')">
|
|
|
取消标记
|
|
|
</el-button>
|
|
|
|
|
|
- <el-select v-model="selectedRelationId" placeholder="请选择关系" @change="handleSelectRelation">
|
|
|
+ <el-select v-show="!readonly" v-model="selectedRelationId" placeholder="请选择关系" @change="handleSelectRelation">
|
|
|
<el-option v-for="relation in relations" :label="relation.name" :value="relation.id"
|
|
|
:key="relation.id"></el-option>
|
|
|
<el-option v-if="showAddRelationOption" :label="'添加关系'" :value="-1"></el-option>
|
|
|
</el-select>
|
|
|
- <el-dialog :visible.sync="dialogVisible" append-to-body>
|
|
|
+ <el-dialog v-show="!readonly" :visible.sync="dialogVisible" append-to-body>
|
|
|
<el-input v-model="newRelationName" placeholder="请输入关系名称"></el-input>
|
|
|
<div slot="footer">
|
|
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
|
<el-button type="primary" @click="handleAddRelation">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <el-button type="primary" @click="summit" style="margin-left:20px">标记</el-button>
|
|
|
- <bubble-menu :editor="editor" :tippy-options="{ duration: 100 }" v-if="editor">
|
|
|
+ <el-button v-show="!readonly" type="primary" @click="summit" style="margin-left:20px">标记</el-button>
|
|
|
+ <!-- <bubble-menu :editor="editor" :tippy-options="{ duration: 100 }" v-if="editor">
|
|
|
<el-button @click="highlight_new_h" style="color: '#ff5d5d'">
|
|
|
主体
|
|
|
</el-button>
|
|
|
<el-button @click="highlight_new_t">
|
|
|
客体
|
|
|
</el-button>
|
|
|
- <!-- <button @click="highlight_new_h" style="backgrand-color:red" :class="{
|
|
|
+ <button @click="highlight_new_h" style="backgrand-color:red" :class="{
|
|
|
'is-active': editor.isActive('highlight', { color: '#ff5d5d' }),
|
|
|
}">
|
|
|
主体
|
|
@@ -56,8 +56,8 @@
|
|
|
'is-active': editor.isActive('highlight', { color: '#119525' }),
|
|
|
}">
|
|
|
客体
|
|
|
- </button> -->
|
|
|
- </bubble-menu>
|
|
|
+ </button>
|
|
|
+ </bubble-menu> -->
|
|
|
<editor-content :editor="editor" />
|
|
|
</el-card>
|
|
|
</el-col>
|
|
@@ -67,12 +67,12 @@
|
|
|
<el-table-column prop="start" label="主体" width="180" />
|
|
|
<el-table-column prop="end" label="客体" width="180" />
|
|
|
<el-table-column prop="relation" label="关系" />
|
|
|
- <el-table-column prop="" label="操作" min-width="180" align="center">
|
|
|
+ <el-table-column prop="" label="操作" min-width="180" align="center" v-show="!readonly">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="handleDelete(scope.$index)" class="btn-text-red" type="danger" size="mini"
|
|
|
+ <el-button v-show="!readonly" @click="handleDelete(scope.$index)" class="btn-text-red" type="danger" size="mini"
|
|
|
icon="el-icon-delete">删除
|
|
|
</el-button>
|
|
|
- <el-button @click="handleSearch(scope.$index)" type="primary" size="mini" icon="el-icon-search">查找
|
|
|
+ <el-button v-show="!readonly" @click="handleSearch(scope.$index)" type="primary" size="mini" icon="el-icon-search">查找
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -90,7 +90,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getResultBySubTaskId, updateResult } from "@/api/extract/result";
|
|
|
+import { getResultBySubTaskId, getResultJson } from "@/api/extract/result";
|
|
|
import { approveSubTask } from "@/api/extract/subTask";
|
|
|
|
|
|
import Highlight from "@tiptap/extension-highlight";
|
|
@@ -107,6 +107,9 @@ export default {
|
|
|
subTask: {
|
|
|
type: Object,
|
|
|
},
|
|
|
+ readonly: {
|
|
|
+ type: Boolean,
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
data() {
|
|
@@ -161,8 +164,10 @@ export default {
|
|
|
getResult(){
|
|
|
this.loading = true
|
|
|
getResultBySubTaskId(this.subTask.id).then(response => {
|
|
|
- this.input = JSON.parse(response.data.result)
|
|
|
this.result = response.data
|
|
|
+ });
|
|
|
+ getResultJson(this.subTask.id).then(response => {
|
|
|
+ this.input = response.data
|
|
|
this.createEditor()
|
|
|
this.loading = false
|
|
|
});
|
|
@@ -438,7 +443,7 @@ export default {
|
|
|
},
|
|
|
handleApprove(status) {
|
|
|
this.loading = true
|
|
|
- this.result.result = JSON.stringify(this.input)
|
|
|
+ this.result.resultData = JSON.stringify(this.input)
|
|
|
approveSubTask(this.subTask.id, status, this.result).then(resp => {
|
|
|
let message;
|
|
|
if (status == 2){
|