Commit 8635a277 by 史敦盼

整体onlyoffice配置修改,数据成图完善,

1 parent 66ad51a3
......@@ -4,7 +4,7 @@
* @Autor: pan
* @Date: 2024-03-12 14:55:59
* @LastEditors: pan
* @LastEditTime: 2024-05-07 15:00:21
* @LastEditTime: 2024-06-21 10:47:29
-->
<template>
<div class="form-box">
......@@ -30,6 +30,7 @@
</template>
<SearchFormItem
ref="formItem"
v-else
v-model="formData[item.prop]"
:itemOptions="item"
......@@ -105,14 +106,10 @@ export default {
* @param {any} value 修改的值
* @return {void}
* @author: pan
*/
*/
changeFormItemData(prop, value) {
this.$nextTick(() => {
this.$set(
this.formData,
prop,
value,
)
this.$set(this.formData, prop, value)
this.$refs['formRef'].clearValidate(prop)
})
},
......
......@@ -6,7 +6,7 @@
<script>
import loadScript from './loadScript.js'
import { EADC_SHARED_ABILITY } from '@/config/micromodule'
export default {
name: 'DocumentEditor',
props: {
......@@ -16,7 +16,7 @@ export default {
},
documentServerUrl: {
type: String,
default: '',
default: SystemConfig.documentServerUrl2,
},
config: {
type: Object,
......@@ -36,20 +36,29 @@ export default {
},
editorConfig_lang: {
type: String,
default: '',
default: 'zh-CN',
},
height: {
type: String,
default: '',
default: '100%',
},
type: {
type: String,
default: '',
},
width: {
fileId: {
type: String,
default: '',
},
//阅读状态 view/edit
mode: {
type: String,
default: 'edit',
},
width: {
type: String,
default: '100%',
},
events_onAppReady: {
type: Function,
default: () => {},
......@@ -194,11 +203,35 @@ export default {
document: {
fileType: this.document_fileType,
title: this.document_title,
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${this.documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${this.fileId}`,
},
documentType: this.documentType,
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: this.editorConfig_lang,
//阅读状态 view/edit
mode: this.mode,
customization: {
//是否显示插件
plugins: false,
forcesave: true,
autosave: false,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${this.documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${this.fileId}`,
},
events: {
onAppReady: this.onAppReady,
onDocumentStateChange: this.events_onDocumentStateChange,
......
......@@ -6,7 +6,10 @@
v-for="tag in visitedViews"
ref="tag"
:key="tag.path"
:class="[isActive(tag) ? 'active' : '', {'length1': visitedViews.length == 1}]"
:class="[
isActive(tag) ? 'active' : '',
{ length1: visitedViews.length == 1 },
]"
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
tag="span"
class="tags-view-item"
......@@ -20,9 +23,15 @@
/>
</router-link>
</scroll-pane>
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
<ul
v-show="visible"
:style="{ left: left + 'px', top: top + 'px' }"
class="contextmenu"
>
<li @click="refreshSelectedTag(selectedTag)">刷新</li>
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">关闭</li>
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">
关闭
</li>
<li @click="closeOthersTags(selectedTag)">关闭其他</li>
<!-- <li @click="closeAllTags(selectedTag)">关闭所有</li> -->
</ul>
......@@ -234,7 +243,7 @@ export default {
scrollbar-width: none;
}
.length1 {
padding-right: 20px!important;
padding-right: 20px !important;
}
.tags-view-container {
height: 32px;
......@@ -329,7 +338,7 @@ export default {
&:before {
transform: scale(0.6);
display: inline-block;
vertical-align: -3px;
vertical-align: middle;
}
&:hover {
background-color: #b4bccc;
......
......@@ -169,6 +169,7 @@ export default {
value: 'assetId',
checkStrictly: true,
},
'append-to-body': false,
events: {
change(e) {
that.superiorNodeChange(e)
......
......@@ -11,7 +11,7 @@
<vab-only-office
id="office-preview-tab1-1"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="readonlyConfig"
/>
</div>
</div>
......@@ -25,14 +25,20 @@
<el-select class="select-title" v-model="select">
<el-option label="概要设计说明书.doc" value="1"></el-option>
</el-select>
<el-button type="primary" size='mini' class="backBtn" @click="backRoute">返回</el-button>
<el-button
type="primary"
size="mini"
class="backBtn"
@click="backRoute"
>返回</el-button
>
</div>
<div class="right_container_content flex-1">
<div class="office w-100 h-100">
<vab-only-office
id="office-preview-tab1-2"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -74,6 +80,7 @@ import {
saveReviewArchiFollowCheckRightSuggestion,
queryReviewArchiFollowCheckRightSuggestionDetails,
} from '@/api/index.js'
import { documentServerUrl2 } from '@/config'
export default {
name: 'tab1',
components: { vabOnlyOffice },
......@@ -92,47 +99,23 @@ export default {
},
],
select: '1',
documentServerUrl: 'http://192.168.0.120:18050/',
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '71df19fbd1',
// 文件名
title: '65f90a662c18a9e9f1878156.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: 'http://192.168.0.120:7005/downloadFile/29',
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '',
},
// 指定文档存储服务器的绝对路径
callbackUrl: 'http://192.168.0.120:7005/callback?fileId=29',
},
fileId: '',
},
}
},
computed: {
readonlyConfig() {
return {
...this.config,
mode: 'view',
}
},
},
created() {
this.getDetail()
},
......@@ -170,8 +153,11 @@ export default {
}
})
},
backRoute(){
this.$router.push({path: '/main/artPolicyExamine', query: {activeName: '2'}})
backRoute() {
this.$router.push({
path: '/main/artPolicyExamine',
query: { activeName: '2' },
})
},
},
}
......@@ -179,9 +165,9 @@ export default {
<style lang="scss" scoped>
@import '@/styles/common.scss';
@import '@/views/reviewArchiPoliticeCheck/index.scss';
.backBtn{
position: absolute;
right: 10px;
top: 10px;
.backBtn {
position: absolute;
right: 10px;
top: 10px;
}
</style>
......@@ -7,7 +7,7 @@
* @Autor: pan
* @Date: 2024-03-21 20:58:31
* @LastEditors: pan
* @LastEditTime: 2024-03-29 09:24:54
* @LastEditTime: 2024-06-24 09:05:56
-->
<template>
<div class="flex-column m-10 w-100 conceptualExamine">
......@@ -44,7 +44,7 @@
<vab-only-office
id="office-preview"
:documentServerUrl="documentServerUrl"
:config="readonlyConfig"
v-bind="readonlyConfig"
/>
</div>
<template v-else>
......@@ -89,7 +89,7 @@
<vab-only-office
id="office-preview2"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
<template v-else>
......@@ -189,43 +189,10 @@ export default {
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '',
// 文件名
title: '概要设计说明书.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/302`,
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
autosave: false,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=302`,
},
fileId: '',
},
selectData: [],
}
......@@ -308,10 +275,7 @@ export default {
readonlyConfig() {
return {
...this.config,
editorConfig: {
...this.config.editorConfig,
mode: 'view',
},
mode: 'view',
}
},
},
......@@ -327,8 +291,7 @@ export default {
if (res.code === 200) {
this.selectData = res.data
if (this.selectData.length) {
this.config.document.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${this.selectData[0].fileId}`
this.config.editorConfig.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${this.selectData[0].fileId}`
this.config.fileId = selectData[0].fileId
}
}
})
......
......@@ -30,7 +30,7 @@
<vab-only-office
id="office-preview"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -91,43 +91,10 @@ export default {
onlineReviewState: 1,
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '',
// 文件名
title: '概要设计说明书.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/302`,
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
autosave: false,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=302`,
},
fileId: '',
},
}
},
......@@ -153,8 +120,7 @@ export default {
if (res.code === 200) {
const selectData = res.data
if (selectData.length) {
this.config.document.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${selectData[0].fileId}`
this.config.editorConfig.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${selectData[0].fileId}`
this.config.fileId = selectData[0].fileId
}
}
})
......
......@@ -94,7 +94,7 @@ import {
getQryByTree,
queryRepeatAssetByNumber,
getAssetDetail,
getAssetCode
getAssetCode,
} from '@/api/index'
import { archiEleColor } from '@/config'
export default {
......@@ -144,7 +144,7 @@ export default {
graphId: '',
// 选择的上级节点对应的详细信息
selectedObject: {},
assetNumberDis: false
assetNumberDis: false,
}
},
components: { Form, ChooseSvg },
......@@ -169,7 +169,7 @@ export default {
{ required: true, trigger: 'blur', message: '不能为空' },
{ validator: this.assetNameValidator, trigger: 'blur' },
],
readonly: this.assetNumberDis
readonly: this.assetNumberDis,
},
{
label: '所属元素', // label文字
......@@ -214,6 +214,7 @@ export default {
element: 'el-cascader', // 指定elementui组件
initValue: undefined, // 字段初始值
placeholder: '请选择', // elementui组件属性
// __slotName: 'superiorNode',
filterable: true,
options: this.treeSelectData,
props: {
......@@ -222,6 +223,8 @@ export default {
value: 'assetId',
checkStrictly: true,
},
'append-to-body': false,
ref: 'cascader',
events: {
change(e) {
that.superiorNodeChange(e)
......@@ -330,7 +333,7 @@ export default {
(item) => item.elementId == data,
)
this.getParentElementOptions(currentItem)
if (addRowData) {
console.log('addRowData.fieldsValue', addRowData.fieldsValue)
if (addRowData.assetId || addRowData.id) {
......@@ -357,7 +360,6 @@ export default {
} else {
this.getDicArray(data)
}
},
getDicArray(data) {
const params = {
......@@ -428,10 +430,10 @@ export default {
// 当选中值变化时,更新绑定的对象
this.selectedObject = {}
if (value && value.length) {
this.selectedObject =
this.$refs.addForm.$refs.formItem[4].$refs.cascader.getCheckedNodes()[0].data
// 假设我们根据id来查询对象
this.selectedObject = this.findObjectById(this.treeSelectData, value[0])
} else {
this.selectedObject = null
// this.selectedObject = this.findObjectById(this.treeSelectData, value[0])
}
this.superiorNodeValue = this.selectedObject.assetId
this.superiorNodeLabel = this.selectedObject.assetName
......@@ -439,10 +441,10 @@ export default {
getAssetCode({
archiType: this.getArchiType,
superiorAssetCode: this.selectedObject.assetNumber
}).then(res => {
superiorAssetCode: this.selectedObject.assetNumber,
}).then((res) => {
this.assetNumberDis = true
if(res.code === 200) {
if (res.code === 200) {
this.selectCode = res.msg
this.$refs['addForm'].changeFormItemData('assetNumber', res.msg)
}
......@@ -520,7 +522,19 @@ export default {
v.initValue = item.parentElement[0]
}
} else if (v.prop === 'superiorNode') {
v.initValue = item.parentAsset ? item.parentAsset.split(', ') : []
let su
if (item.superiorNode) {
su = item.superiorNode
v.initValue = su
} else {
su = item.parentAsset ? item.parentAsset.split(', ') : []
v.initValue = su
}
if (su.length) {
this.$nextTick(() => {
this.superiorNodeChange(su)
})
}
} else {
v.initValue = item[v.prop]
}
......@@ -533,6 +547,7 @@ export default {
},
// 处理完善时,带入一些其他的不在页面展示的参数
handleOtherProp(item) {
debugger
this.selectGraphSrc = item.icon || ''
this.selectGraphShape = item.iconName
this.graphId = item.graphId
......@@ -555,6 +570,7 @@ export default {
this.graphId = ''
this.dynamicForm_ = []
this.archiEleOptions = []
this.selectedObject = {}
// 上级元素集合
this.parentElementOptions = []
// 上级节点
......@@ -599,6 +615,7 @@ export default {
name: params.assetName,
parentId: params.parentAssetId,
archiAssetType,
id: this.addRowData.id,
},
],
}
......@@ -619,9 +636,11 @@ export default {
name: params.assetName,
}
}
if(archiAssetType === 3) {
if (archiAssetType === 3) {
console.log('emit', emitParams)
this.$emit('add', emitParams)
} else {
console.log('emit', emitParams)
this.$emit('perfect', emitParams)
}
this.handleClose()
......
......@@ -4,7 +4,7 @@
* @Autor: pan
* @Date: 2024-04-23 11:30:05
* @LastEditors: pan
* @LastEditTime: 2024-05-11 14:06:16
* @LastEditTime: 2024-06-21 14:29:57
-->
<template>
<div class="dataMapping w-100">
......@@ -75,7 +75,6 @@
show-checkbox
node-key="id"
check-on-click-node
:check-strictly="true"
:expand-on-click-node="false"
:filter-node-method="filterNode"
@check="handleNodeClick"
......@@ -88,10 +87,14 @@
</div>
<transition name="slide">
<div style="width: 50%" v-show="!collapse">
<PropTable v-if="activeName === '3'" :columns="dataSubColumn" :table-data="dataSubGraphData" />
<PropTable
v-if="activeName === '3'"
:columns="dataSubColumn"
:table-data="dataSubGraphData"
/>
<el-table
v-else
:data="tableData"
:data="rightTable"
border
stripe
height="100%"
......@@ -154,7 +157,6 @@
</template>
</el-table-column>
</el-table>
</div>
</transition>
<div class="graphContent flex-1">
......@@ -183,7 +185,11 @@
:add-row-data="addRowData"
/>
<!-- 关系维护 -->
<RelationMaintenance @updateData="updateRelationData" :row-data="rowData" :visible.sync="relationVisible" />
<RelationMaintenance
@updateData="updateRelationData"
:row-data="rowData"
:visible.sync="relationVisible"
/>
</div>
</template>
......@@ -217,6 +223,7 @@ export default {
visible: false,
tableData: [],
addData: [],
perfectData: [],
checkAll: false,
allKeys: [],
collapse: false,
......@@ -229,7 +236,7 @@ export default {
rowIndex: 0,
legendActive: 0,
relationVisible: false,
rowData: {}
rowData: {},
}
},
components: { MxGraph, Add, SvgIcon, RelationMaintenance, PropTable },
......@@ -245,13 +252,20 @@ export default {
},
},
computed: {
rightTable() {
return this.tableData.filter((v) => !v.children)
},
dataSubColumn() {
return [
{ label: '序号', type: 'index', width: '80px' },
{ label: '业务域', prop: 'assetName' },
{ label: '一级业务职能', prop: 'name' },
{ label: '状态', prop: 'archiAssetType', collectionType: 'archiAssetType',
options: archiAssetTypeOptions, },
{
label: '状态',
prop: 'archiAssetType',
collectionType: 'archiAssetType',
options: archiAssetTypeOptions,
},
{
label: '操作',
type: 'operation',
......@@ -282,7 +296,7 @@ export default {
},
},
]
}
},
},
mounted() {
// this.$refs.tree.setCheckedKeys(["176", '1775128878519729929', '1775128878519729938', '1775128878519729939', '177', '180', '1062', '1775128878519729932', '1775128878519729925', '1775128878519729933', '1775128878519729934', '1775128878519729926', '1775128878519729935', '1775128878519730025', '1775128878519730026']);
......@@ -333,33 +347,67 @@ export default {
})
},
handlePerfect(data) {
this.perfectData.push(data.children[0])
// this.tableData[this.rowIndex] = data
const repData = {
...this.tableData[this.rowIndex],
archiAssetType: 2,
let replaceData = null
const includeAddDataIdx = this.tableData.findIndex(
(v) => v.name === data.children[0].name,
)
// this.tableData.splice(includeAddDataIdx, 1)
// if (includeAddDataIdx === -1) {
// replaceData = data
// }
if (data.children.length) {
replaceData = data.children[0]
}
const node = this.$refs.tree.getNode(repData.id)
node.data.archiAssetType = 2
this.tableData.splice(this.rowIndex, 1, repData)
this.handleBusGraph('init')
// const repData = {
// ...this.tableData[this.rowIndex],
// archiAssetType: 2,
// }
// const node = this.$refs.tree.getNode(repData.id)
// node.data.archiAssetType = 2
// this.tableData[includeAddDataIdx] = replaceData
if (includeAddDataIdx != -1) {
this.tableData.splice(includeAddDataIdx, 1, replaceData)
}
const addIdx = this.addData.findIndex(
(v) => v.name === data.children[0].name,
)
if (addIdx !== -1) {
this.addData.splice(addIdx, 1)
}
console.log('t1', includeAddDataIdx, this.tableData[includeAddDataIdx])
// this.handleBusGraph('init')
this.handleDataToGraph()
},
handleAdd(data) {
this.addData = []
const includeAddData = this.tableData.findIndex((v) => v.id === data.id)
// this.addData = []
const includeAddData = this.tableData.findIndex(
(v) => v.name === data.name,
)
if (includeAddData === -1) {
this.addData.push(data)
}
if (data.children.length) {
this.addData.push(data.children[0])
}
this.tableData = [...this.tableData, ...this.addData]
this.tableData = [...this.tableData, ...this.addData, ...this.perfectData]
this.tableData = deduplication(this.tableData, 'name')
console.log('this.tableData2', this.tableData)
console.log('addData', this.addData)
this.handleBusGraph('init')
// this.handleBusGraph('init')
this.handleDataToGraph()
},
fnPushData(row, index) {
fnPushData() {
this.visible = true
this.title = '添加行'
this.assetId = ''
this.rowIndex = 0
this.addRowData = {}
},
fnDel(row, index) {
if (row.id) {
......@@ -370,14 +418,32 @@ export default {
})
}
}
this.tableData.splice(index, 1)
this.rightTable.splice(index, 1)
this.tableData.splice(
this.tableData.findIndex((v) => v.name == row.name),
1,
)
if (row.archiAssetType == 2) {
this.perfectData.splice(
this.perfectData.findIndex((v) => v.name == row.name),
1,
)
}
if (row.archiAssetType == 3) {
this.addData.splice(
this.addData.findIndex((v) => v.name == row.name),
1,
)
}
// console.log('t', this.tableData)
// 有子级,对应删除子级
if (row.checkChildren) {
this.tableData = this.tableData.filter((v) => v.parentId != row.id)
}
if(this.activeName === '1') {
this.handleBusGraph('init')
}
this.handleDataToGraph()
// if (this.activeName === '1') {
// this.handleBusGraph('init')
// }
},
// 关系维护
fnRelationM(row) {
......@@ -387,19 +453,18 @@ export default {
fnDataSubOperation(row, title, rowIndex) {
switch (title) {
case '完善':
break;
break
case '关系维护':
this.fnRelationM(row)
break;
break
case '移除':
this.fnRelationRemove(row, rowIndex)
break;
break
default:
break;
break
}
},
//
//
fnRelationRemove(row, rowIndex) {
this.$refs.tree.setChecked(row.id, false)
this.dataSubGraphData.splice(rowIndex, 1)
......@@ -407,8 +472,10 @@ export default {
},
// 关系更新
updateRelationData(data) {
const idx = this.dataSubGraphData.findIndex(v => v.id === this.rowData.id)
if(idx != -1) {
const idx = this.dataSubGraphData.findIndex(
(v) => v.id === this.rowData.id,
)
if (idx != -1) {
this.dataSubGraphData[idx].targetAsset = JSON.stringify(data)
this.fnUpdateRelationGraph()
}
......@@ -524,7 +591,8 @@ export default {
// 微服务总视图
handleMicroservicesGraph() {
const checkedKeys = this.$refs.tree.getCheckedKeys()
const checkedNodes = checkedKeys.map((v) => {
const halfCheckedKeys = this.$refs.tree.getHalfCheckedKeys()
const checkedNodes = [...checkedKeys, ...halfCheckedKeys].map((v) => {
const node = this.$refs.tree.getNode(v)
return node
})
......@@ -564,7 +632,7 @@ export default {
},
// 安全管理体系视图
handleSafeManageGraph() {
const checkedNodes = this.$refs.tree.getCheckedNodes()
const checkedNodes = this.$refs.tree.getCheckedNodes(false, true)
let parentNodes = checkedNodes.filter((v) => v.parentId === '0')
console.log('e', parentNodes)
const childNodes = checkedNodes.filter((v) => v.parentId !== '0')
......@@ -615,7 +683,7 @@ export default {
},
// 技术框架视图
handleTechFrameGraph() {
const checkedNodes = this.$refs.tree.getCheckedNodes()
const checkedNodes = this.$refs.tree.getCheckedNodes(false, true)
let parentNodes = checkedNodes.filter((v) => v.parentId === '0')
const childNodes = checkedNodes.filter((v) => v.parentId !== '0')
this.handleGraphData(parentNodes, childNodes)
......@@ -691,8 +759,10 @@ export default {
this.graphData = this.tableData.filter((v) => v.parentId === '0')
const childNodes = this.tableData.filter((v) => v.parentId !== '0')
const showGraphData = this.graphData
let showGraphData = this.graphData
this.handleGraphData(showGraphData, childNodes)
showGraphData = this.graphData.filter((v) => v.checkChildren.length)
showGraphData = deduplication(showGraphData, 'id')
console.log('showGraphData', showGraphData)
console.log('tableData', this.tableData)
this.$store.commit('graphData/CHANGE_GRAPH_DATA', showGraphData)
......@@ -740,16 +810,31 @@ export default {
}
console.log('data', data)
console.log('node', node)
console.log('checkedNodes', this.$refs.tree.getCheckedNodes())
if(this.activeName === '3') {
console.log('checkedNodes', this.$refs.tree.getCheckedNodes(false, true))
if (this.activeName === '3') {
this.handleDataSubGraph(data, node)
} else {
this.setNode(node)
console.log('this.tableData', this.tableData)
this.tableData = [...this.$refs.tree.getCheckedNodes(), ...this.addData]
// this.setNode(node)
// console.log('this.tableData', this.tableData)
let checkItem = this.$refs.tree.getCheckedNodes(false, true)
checkItem = checkItem.filter((v) => {
const perfectItem =
this.perfectData.find((v2) => v2.name === v.name) || {}
if (Object.keys(perfectItem).length) {
return false
} else {
return true
}
})
if (!node.checked) {
this.perfectData = this.perfectData.filter(
(v) => v.name !== data.name,
)
}
this.tableData = [...checkItem, ...this.addData, ...this.perfectData]
console.log(
'this.tableData',
this.$refs.tree.getCheckedNodes(),
'this.tableData1',
this.$refs.tree.getCheckedNodes(false, true),
this.addData,
)
if (!this.tableData.length) {
......
......@@ -10,7 +10,7 @@
<vab-only-office
id="office-preview"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -74,6 +74,8 @@ import {
} from '@/api/index.js'
import { MessageBox, Message } from 'element-ui'
import vabOnlyOffice from '@/components/onlyOffice/index.vue'
import { documentServerUrl2 } from '@/config'
export default {
name: 'tab1',
components: {
......@@ -89,45 +91,12 @@ export default {
rightImageSrc: null,
prjId: null,
rightSelect: [],
documentServerUrl: 'http://192.168.0.120:18050/',
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: 'f0db25df77',
// 文件名
title: '65f90a662c18a9e9f1878156.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: 'http://192.168.0.103:7005/downloadFile/302',
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
autosave: false,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '',
},
// 指定文档存储服务器的绝对路径
callbackUrl: 'http://192.168.0.103:7005/callback?fileId=302',
},
fileId: '',
},
}
},
......@@ -202,7 +171,7 @@ export default {
},
}
</script>
<style scoped>
<style scoped lang="scss">
.tab1 {
height: 100%;
}
......
......@@ -11,7 +11,7 @@
<vab-only-office
id="office-preview-tab1-1"
:documentServerUrl="documentServerUrl"
:config="readonlyConfig"
v-bind="readonlyConfig"
/>
</div>
</div>
......@@ -31,7 +31,7 @@
<vab-only-office
id="office-preview-tab1-2"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -96,43 +96,10 @@ export default {
select: '1',
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '',
// 文件名
title: '概要设计说明书.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/302`,
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
autosave: false,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=302`,
},
fileId: ''
},
}
},
......@@ -140,10 +107,7 @@ export default {
readonlyConfig() {
return {
...this.config,
editorConfig: {
...this.config.editorConfig,
mode: 'view',
},
mode: 'view',
}
},
},
......@@ -164,8 +128,7 @@ export default {
if (res.code === 200) {
const selectData = res.data
if (selectData.length) {
this.config.document.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${selectData[0].fileId}`
this.config.editorConfig.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${selectData[0].fileId}`
this.config.fileId = selectData[0].fileId
}
}
})
......
......@@ -11,7 +11,7 @@
<vab-only-office
id="office-preview-tab2-1"
:documentServerUrl="documentServerUrl"
:config="readonlyConfig"
v-bind="readonlyConfig"
/>
</div>
</div>
......@@ -31,7 +31,7 @@
<vab-only-office
id="office-preview-tab2-2"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -95,42 +95,10 @@ export default {
select: '1',
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '',
// 文件名
title: '概要设计说明书.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/293`,
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=293`,
},
fileId: '',
},
}
},
......@@ -138,10 +106,7 @@ export default {
readonlyConfig() {
return {
...this.config,
editorConfig: {
...this.config.editorConfig,
mode: 'view',
},
mode: 'view',
}
},
},
......@@ -161,8 +126,7 @@ export default {
if (res.code === 200) {
const selectData = res.data
if (selectData.length) {
this.config.document.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${selectData[0].fileId}`
this.config.editorConfig.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${selectData[0].fileId}`
this.config.fileId = selectData[0].fileId
}
}
})
......
......@@ -11,7 +11,7 @@
<vab-only-office
id="office-preview-tab3-1"
:documentServerUrl="documentServerUrl"
:config="readonlyConfig"
v-bind="readonlyConfig"
/>
</div>
</div>
......@@ -31,7 +31,7 @@
<vab-only-office
id="office-preview-tab3-2"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -86,43 +86,10 @@ export default {
select: '1',
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '',
// 文件名
title: '概要设计说明书.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/302`,
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
autosave: false,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=302`,
},
fileId: '',
},
}
},
......@@ -130,10 +97,7 @@ export default {
readonlyConfig() {
return {
...this.config,
editorConfig: {
...this.config.editorConfig,
mode: 'view',
},
mode: 'view',
}
},
},
......@@ -153,8 +117,7 @@ export default {
if (res.code === 200) {
const selectData = res.data
if (selectData.length) {
this.config.document.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${selectData[0].fileId}`
this.config.editorConfig.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${selectData[0].fileId}`
this.config.fileId = selectData[0].fileId
}
}
})
......
......@@ -11,7 +11,7 @@
<vab-only-office
id="office-preview-tab4-1"
:documentServerUrl="documentServerUrl"
:config="readonlyConfig"
v-bind="readonlyConfig"
/>
</div>
</div>
......@@ -31,7 +31,7 @@
<vab-only-office
id="office-preview-tab4-2"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -86,43 +86,10 @@ export default {
select: '1',
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '',
// 文件名
title: '概要设计说明书.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/302`,
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
autosave: false,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=302`,
},
fileId: '',
},
}
},
......@@ -130,10 +97,7 @@ export default {
readonlyConfig() {
return {
...this.config,
editorConfig: {
...this.config.editorConfig,
mode: 'view',
},
mode: 'view',
}
},
},
......@@ -153,8 +117,7 @@ export default {
if (res.code === 200) {
const selectData = res.data
if (selectData.length) {
this.config.document.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${selectData[0].fileId}`
this.config.editorConfig.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${selectData[0].fileId}`
this.config.fileId = selectData[0].fileId
}
}
})
......
......@@ -11,7 +11,7 @@
<vab-only-office
id="office-preview-tab5-1"
:documentServerUrl="documentServerUrl"
:config="readonlyConfig"
v-bind="readonlyConfig"
/>
</div>
</div>
......@@ -31,7 +31,7 @@
<vab-only-office
id="office-preview-tab5-2"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -86,42 +86,10 @@ export default {
select: '1',
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '',
// 文件名
title: '概要设计说明书.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/293`,
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=293`,
},
fileId: '',
},
}
},
......@@ -129,10 +97,7 @@ export default {
readonlyConfig() {
return {
...this.config,
editorConfig: {
...this.config.editorConfig,
mode: 'view',
},
mode: 'view',
}
},
},
......@@ -152,8 +117,7 @@ export default {
if (res.code === 200) {
const selectData = res.data
if (selectData.length) {
this.config.document.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${selectData[0].fileId}`
this.config.editorConfig.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${selectData[0].fileId}`
this.config.fileId = selectData[0].fileId
}
}
})
......
......@@ -11,7 +11,7 @@
<vab-only-office
id="office-preview-tab6-1"
:documentServerUrl="documentServerUrl"
:config="readonlyConfig"
v-bind="readonlyConfig"
/>
</div>
</div>
......@@ -31,7 +31,7 @@
<vab-only-office
id="office-preview-tab6-2"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -95,43 +95,10 @@ export default {
select: '1',
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '',
// 文件名
title: '概要设计说明书.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/302`,
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
autosave: false,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=302`,
},
fileId: '',
},
}
},
......@@ -139,10 +106,7 @@ export default {
readonlyConfig() {
return {
...this.config,
editorConfig: {
...this.config.editorConfig,
mode: 'view',
},
mode: 'view',
}
},
},
......@@ -162,8 +126,7 @@ export default {
if (res.code === 200) {
const selectData = res.data
if (selectData.length) {
this.config.document.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${selectData[0].fileId}`
this.config.editorConfig.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${selectData[0].fileId}`
this.config.fileId = selectData[0].fileId
}
}
})
......
......@@ -20,7 +20,7 @@
<vab-only-office
id="office-preview"
:documentServerUrl="documentServerUrl"
:config="readonlyConfig"
v-bind="readonlyConfig"
/>
</div>
</div>
......@@ -38,7 +38,7 @@
<vab-only-office
id="office-preview2"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -106,43 +106,10 @@ export default {
row: {},
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '',
// 文件名
title: '概要设计说明书.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/302`,
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
autosave: false,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=302`,
},
fileId: '',
},
leftSelectData: [],
}
......@@ -151,10 +118,7 @@ export default {
readonlyConfig() {
return {
...this.config,
editorConfig: {
...this.config.editorConfig,
mode: 'view',
},
mode: 'view',
}
},
},
......@@ -175,8 +139,7 @@ export default {
if (res.code === 200) {
this.leftSelectData = res.data
if (this.leftSelectData.length) {
this.config.document.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${this.leftSelectData[0].fileId}`
this.config.editorConfig.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${this.leftSelectData[0].fileId}`
this.config.fileId = selectData[0].fileId
}
}
})
......
......@@ -10,7 +10,7 @@
<vab-only-office
id="office-preview-tab4-1"
:documentServerUrl="documentServerUrl"
:config="readonlyConfig"
v-bind="readonlyConfig"
/>
</div>
</div>
......@@ -28,7 +28,7 @@
<vab-only-office
id="office-preview-tab4-2"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -76,43 +76,10 @@ export default {
row: {},
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '',
// 文件名
title: '概要设计说明书.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/302`,
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'edit',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
autosave: false,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=302`,
},
fileId: '',
},
leftSelectData: [],
}
......@@ -121,10 +88,7 @@ export default {
readonlyConfig() {
return {
...this.config,
editorConfig: {
...this.config.editorConfig,
mode: 'view',
},
mode: 'view',
}
},
},
......@@ -145,8 +109,7 @@ export default {
if (res.code === 200) {
this.leftSelectData = res.data
if (this.leftSelectData.length) {
this.config.document.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${this.leftSelectData[0].fileId}`
this.config.editorConfig.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${this.leftSelectData[0].fileId}`
this.config.fileId = selectData[0].fileId
}
}
})
......
......@@ -10,7 +10,7 @@
<vab-only-office
id="office-preview-tab5"
:documentServerUrl="documentServerUrl"
:config="config"
v-bind="config"
/>
</div>
</div>
......@@ -73,43 +73,11 @@ export default {
row: {},
documentServerUrl: documentServerUrl2,
config: {
document: {
fileType: 'docx',
// 给服务端用的唯一id,同一个id就会获取服务器缓存里的文件(有这个key,就会先根据它去缓存里找),这项如果最开始只是先试用,可以先给个空字符串
key: '',
// 文件名
title: '概要设计说明书.docx',
//相关权限
// permissions: {
// copy: true, //定义内容是否可以复制到剪贴板。如果该参数设置为false,则只能在当前文档编辑器中粘贴内容。默认值为true。
// download: true, //定义文档是可以下载还是只能在线查看或编辑。如果下载权限设置为“假”的下载为...菜单选项将是缺席的文件菜单。默认值为true。
// edit: true, //定义文档是可以编辑还是只能查看。如果编辑权限设置为“true”,则文件菜单将包含编辑文档菜单选项;请注意,如果编辑权限设置为“false”,文档将在查看器中打开,即使模式参数设置为edit,您也无法将其切换到编辑器。默认值为true。
// print: true, //定义是否可以打印文档。如果打印权限设置为“false”的打印菜单选项将是缺席的文件菜单。默认值为true
// },
// 所要渲染的文件的绝对路径,这个参数很重要,它传的不是文件的本地地址,而是需要把文件传到项目所依赖的服务器,然后拿到文件在服务器的url地址(这个一般情况需要后端支持)才可以用,这个参数决定了能不能实例化出来onlyoffice对象
url: `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/302`,
},
document_fileType: 'docx',
document_title: '概要设计说明书.docx',
documentType: 'word',
height: '100%',
width: '100%',
editorConfig: {
//语言:zh-CN简体中文/en英文
lang: 'zh-CN',
//阅读状态 view/edit
mode: 'view',
customization: {
//是否显示插件
plugins: false,
forcesave: true,
autosave: false,
},
user: {
// 当前正在view/edit此文档的用户信息
name: '管理员',
},
// 指定文档存储服务器的绝对路径
callbackUrl: `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=302`,
},
fileId: '',
mode: 'view',
},
rightImgs: [],
leftSelectData: [],
......@@ -133,8 +101,7 @@ export default {
if (res.code === 200) {
this.leftSelectData = res.data
if (this.leftSelectData.length) {
this.config.document.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/downloadFile/${this.leftSelectData[0].fileId}`
this.config.editorConfig.url = `${documentServerUrl}${EADC_SHARED_ABILITY}/callback?fileId=${this.leftSelectData[0].fileId}`
this.config.fileId = selectData[0].fileId
}
}
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!