|
@@ -4,6 +4,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { toRaw } from "vue";
|
|
|
import { listVersion } from "@/api/biz/version";
|
|
|
import { users } from "@/api/biz/info";
|
|
|
export default {
|
|
@@ -80,46 +81,65 @@ export default {
|
|
|
// })
|
|
|
// },
|
|
|
onRequestUsers(event) {
|
|
|
- users(this.docId).then(response => {
|
|
|
- const users=new Array();
|
|
|
- response.data.forEach((item,index)=>{
|
|
|
- users.push({
|
|
|
+ // users(this.docId).then(response => {
|
|
|
+ // const users=new Array();
|
|
|
+ // response.data.forEach((item,index)=>{
|
|
|
+ // users.push({
|
|
|
+ // email:item.deptName,
|
|
|
+ // id: item.userId,
|
|
|
+ // name: item.userName
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ const users = toRaw(this.usersArr)
|
|
|
+ const curUsers = users.map(item=>{
|
|
|
+ return {
|
|
|
email:item.deptName,
|
|
|
id: item.userId,
|
|
|
name: item.userName
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
+ }
|
|
|
+ })
|
|
|
this.docEditor.setUsers({
|
|
|
c: event.data.c,
|
|
|
- users: this.usersArr
|
|
|
+ users: curUsers
|
|
|
})
|
|
|
- // console.log('usersArr',this.usersArr);
|
|
|
- })
|
|
|
+ // console.log('usersArr',users);
|
|
|
+ // console.log('this.docEditor',this.docEditor);
|
|
|
+ // })
|
|
|
},
|
|
|
|
|
|
onRequestHistory() {
|
|
|
- listVersion({ pageNum: 1, pageSize: 10000, docId: this.docId }).then(response => {
|
|
|
- const his=new Array();
|
|
|
- response.rows.forEach((item,index)=>{
|
|
|
- his.push({
|
|
|
+ // listVersion({ pageNum: 1, pageSize: 10000, docId: this.docId }).then(response => {
|
|
|
+ // const his=new Array();
|
|
|
+ // response.rows.forEach((item,index)=>{
|
|
|
+ // his.push({
|
|
|
+ // created: item.createTime,
|
|
|
+ // key: item.fileId,
|
|
|
+ // user: {
|
|
|
+ // name: item.createBy
|
|
|
+ // },
|
|
|
+ // version: item.fileId
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // this.docEditor.refreshHistory({
|
|
|
+ // currentVersion: 1,
|
|
|
+ // history: his
|
|
|
+ // })
|
|
|
+ const his = toRaw(this.hisArr)
|
|
|
+ const curHis = his.map(item=>{
|
|
|
+ return {
|
|
|
created: item.createTime,
|
|
|
key: item.fileId,
|
|
|
user: {
|
|
|
name: item.createBy
|
|
|
},
|
|
|
version: item.fileId
|
|
|
- })
|
|
|
- })
|
|
|
- // this.docEditor.refreshHistory({
|
|
|
- // currentVersion: 1,
|
|
|
- // history: his
|
|
|
- // })
|
|
|
+ }
|
|
|
+ })
|
|
|
this.docEditor.refreshHistory({
|
|
|
currentVersion: 1,
|
|
|
- history: this.hisArr
|
|
|
+ history: curHis
|
|
|
})
|
|
|
- })
|
|
|
+ // })
|
|
|
},
|
|
|
onRequestHistoryData(event) {
|
|
|
console.log(event);
|