Browse Source

知识图谱/pression

master
xuhuajiao 4 months ago
parent
commit
0aac8da34e
  1. 4
      .env.production
  2. 4
      public/static/config.js
  3. 6
      src/components/Crud/CRUD.operation.vue
  4. 4
      src/components/Crud/UD.operation.vue
  5. 73
      src/neo4j.js
  6. 162
      src/views/AIAssistant/AICataloging/index.vue
  7. 8
      src/views/archiveKeeping/deviceManage/index.vue
  8. 4
      src/views/archiveKeeping/deviceManage/tableList.vue
  9. 8
      src/views/archivesManage/managementLibrary/module/collectHeader.vue
  10. 85
      src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue
  11. 291
      src/views/components/echarts/graph.vue
  12. 425
      src/views/components/echarts/graph222.vue
  13. 6
      src/views/storeManage/deviceManage/index.vue
  14. 4
      src/views/storeManage/deviceManage/module/deviceDetail.vue
  15. 2
      src/views/storeManage/tagManage/tagLog/index.vue
  16. 6
      src/views/system/archiveScopeManage/module/tableList.vue
  17. 2
      src/views/system/archivesCategory/fieldManage/index.vue
  18. 8
      src/views/system/archivesCategory/fileNoFormat/index.vue
  19. 8
      src/views/system/archivesCategory/index.vue
  20. 8
      src/views/system/archivesCategory/listBrowsing/index.vue
  21. 8
      src/views/system/archivesCategory/orderingRule/index.vue
  22. 8
      src/views/system/archivesClassify/module/tableList.vue
  23. 4
      src/views/system/dict/dictDetail.vue
  24. 2
      src/views/system/fileLibraryManage/fieldManage/index.vue
  25. 8
      src/views/system/fileLibraryManage/index.vue
  26. 8
      src/views/system/fileLibraryManage/listBrowsing/index.vue
  27. 8
      src/views/system/fileLibraryManage/orderingRule/index.vue
  28. 6
      src/views/system/metadata/index.vue
  29. 2
      src/views/system/subjectLibraryManage/fieldManage/index.vue
  30. 8
      src/views/system/subjectLibraryManage/listBrowsing/index.vue
  31. 8
      src/views/system/subjectLibraryManage/orderingRule/index.vue

4
.env.production

@ -2,10 +2,10 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
# VUE_APP_BASE_API = 'http://192.168.99.107:11100'
VUE_APP_BASE_API = 'http://192.168.99.107:11100'
# VUE_APP_BASE_API = 'http://27.19.215.77:11100' # VUE_APP_BASE_API = 'http://27.19.215.77:11100'
# VUE_APP_BASE_API = 'http://27.16.212.58:11100' # VUE_APP_BASE_API = 'http://27.16.212.58:11100'
VUE_APP_BASE_API = 'http://192.168.99.71:11110'
# VUE_APP_BASE_API = 'http://192.168.99.71:11110'
# 如果接口是 http 形式, wss 需要改为 ws # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws://27.16.212.58:11110' VUE_APP_WS_API = 'ws://27.16.212.58:11110'
VUE_APP_CAMERA_API = '192.168.99.107:3000' VUE_APP_CAMERA_API = '192.168.99.107:3000'

4
public/static/config.js

@ -1,8 +1,8 @@
window.g = { window.g = {
AXIOS_TIMEOUT: 10000, AXIOS_TIMEOUT: 10000,
// ApiUrl: 'http://27.16.212.58:11100', // 配置服务器地址, // ApiUrl: 'http://27.16.212.58:11100', // 配置服务器地址,
ApiUrl: 'http://192.168.99.71:11110',
// ApiUrl: 'http://192.168.99.107:11100',
// ApiUrl: 'http://192.168.99.71:11110',
ApiUrl: 'http://192.168.99.107:11100',
// ParentPage: { // 后续看需求配置 // ParentPage: { // 后续看需求配置
// CrossDomainProxyUrl: '/Home/CrossDomainProxy', // CrossDomainProxyUrl: '/Home/CrossDomainProxy',
// BtnsApi: '/api/services/app/Authorization/GetBtns', // BtnsApi: '/api/services/app/Authorization/GetBtns',

6
src/components/Crud/CRUD.operation.vue

@ -4,18 +4,18 @@
<!--左侧插槽--> <!--左侧插槽-->
<slot name="left" /> <slot name="left" />
<!-- type="primary" --> <!-- type="primary" -->
<el-button v-if="crud.optShow.add" v-permission="permission.add" size="mini" @click="crud.toAdd">
<el-button v-if="crud.optShow.add" size="mini" @click="crud.toAdd">
<i class="iconfont icon-xinzeng" /> <i class="iconfont icon-xinzeng" />
新增 新增
</el-button> </el-button>
<!-- type="success" --> <!-- type="success" -->
<el-button v-if="crud.optShow.edit" v-permission="permission.edit" size="mini" :disabled="crud.selections.length !== 1" @click="crud.toEdit(crud.selections[0])">
<el-button v-if="crud.optShow.edit" size="mini" :disabled="crud.selections.length !== 1" @click="crud.toEdit(crud.selections[0])">
<i class="iconfont icon-bianji" /> <i class="iconfont icon-bianji" />
编辑 编辑
</el-button> </el-button>
<slot name="middle" /> <slot name="middle" />
<!-- type="danger" --> <!-- type="danger" -->
<el-button v-if="crud.optShow.del" slot="reference" v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">
<el-button v-if="crud.optShow.del" slot="reference" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">
<i class="iconfont icon-shanchu" /> <i class="iconfont icon-shanchu" />
删除 删除
</el-button> </el-button>

4
src/components/Crud/UD.operation.vue

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<el-button v-permission="permission.edit" :loading="crud.status.cu === 2" :disabled="disabledEdit" size="mini" type="primary" icon="el-icon-edit" @click="crud.toEdit(data)" />
<el-popover v-model="pop" v-permission="permission.del" placement="top" width="180" trigger="manual" popper-class="myPopover" @show="onPopoverShow" @hide="onPopoverHide">
<el-button :loading="crud.status.cu === 2" :disabled="disabledEdit" size="mini" type="primary" icon="el-icon-edit" @click="crud.toEdit(data)" />
<el-popover v-model="pop" placement="top" width="180" trigger="manual" popper-class="myPopover" @show="onPopoverShow" @hide="onPopoverHide">
<p>{{ msg }}</p> <p>{{ msg }}</p>
<div style="text-align: right; margin: 10px 0 0 0;"> <div style="text-align: right; margin: 10px 0 0 0;">
<el-button size="mini" type="text" @click="doCancel">取消</el-button> <el-button size="mini" type="text" @click="doCancel">取消</el-button>

73
src/neo4j.js

@ -1,41 +1,68 @@
import neo4j from 'neo4j-driver' import neo4j from 'neo4j-driver'
// process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API
const linkSrc = 'http://192.168.99.107:11100'
const ip = linkSrc.split(':')[1].split('/').pop()
const driver = neo4j.driver( const driver = neo4j.driver(
'bolt://192.168.99.107:7687',
'bolt://' + ip + ':7687',
neo4j.auth.basic('neo4j', 'ftzn83560792') neo4j.auth.basic('neo4j', 'ftzn83560792')
) )
export async function getGraphData() {
export async function getGraphData(query) {
const session = driver.session() const session = driver.session()
console.log('session', session) console.log('session', session)
try { try {
const result = await session.run('MATCH (n)-[r]->(m) RETURN n, r, m')
// const result = await session.run('MATCH (n)-[r]->(m) RETURN n, r, m LIMIT 25')
// 这里可以根据实际情况切换查询语句
// const query = "MATCH path = (target:Archives {id: '0047B3542CE88B895E41DE'})-[r:HAS_KEYWORD*1..4]-(related:Archives) WHERE target <> related RETURN path, LENGTH(path)/2 AS depth"
// const query = "MATCH path = (target:Archives {id: '0047B3542CE88B895E41DE'})-[rels:HAS_KEYWORD*1..4]-(related:Archives) WHERE target <> related UNWIND relationships(path) AS r WITH startNode(r) AS n, r, endNode(r) AS m, length(path)/2 AS depth RETURN DISTINCT n, r, m;"
// const query = 'MATCH (n)-[r]->(m) RETURN n, r, m LIMIT 25'
const result = await session.run(query)
const nodes = [] const nodes = []
const edges = [] const edges = []
console.log('result', result) console.log('result', result)
result.records.forEach(record => { result.records.forEach(record => {
const sourceNode = record.get('n')
console.log('sourceNode', sourceNode)
const targetNode = record.get('m')
console.log('targetNode', targetNode)
const relationship = record.get('r')
console.log('relationship', relationship)
// 添加节点
if (!nodes.some(node => node.id === sourceNode.identity.low)) {
// nodes.push({ id: sourceNode.identity.low, label: sourceNode.labels[0] })
nodes.push({ id: sourceNode.identity.low, text: sourceNode.properties.title, type: sourceNode.labels[0] })
}
if (!nodes.some(node => node.id === targetNode.identity.low)) {
// nodes.push({ id: targetNode.identity.low, label: targetNode.labels[0] })
nodes.push({ id: targetNode.identity.low, text: targetNode.properties.title, type: targetNode.labels[0] })
}
if (record.has('path')) {
const path = record.get('path')
console.log('path', path)
const nodesInPath = path.segments.map(segment => segment)
nodesInPath.forEach(item => {
const sourceNode = item.start
const targetNode = item.end
if (!nodes.some(n => n.id === sourceNode.identity.low)) {
nodes.push({ id: sourceNode.identity.low, text: sourceNode.properties.title, type: sourceNode.labels[0] })
}
// 添加边
edges.push({ from: sourceNode.identity.low, to: targetNode.identity.low, text: relationship.type })
if (!nodes.some(node => node.id === targetNode.identity.low)) {
nodes.push({ id: targetNode.identity.low, text: targetNode.properties.title, type: targetNode.labels[0] })
}
if (!edges.some(edge => edge.from === sourceNode.identity.low && edge.to === targetNode.identity.low)) {
edges.push({ from: sourceNode.identity.low, to: targetNode.identity.low, text: item.relationship.type })
}
})
} else if (record.has('n') && record.has('r') && record.has('m')) {
const sourceNode = record.get('n')
const targetNode = record.get('m')
const relationship = record.get('r')
// 添加节点
if (!nodes.some(node => node.id === sourceNode.identity.low)) {
nodes.push({ id: sourceNode.identity.low, text: sourceNode.properties.title, type: sourceNode.labels[0] })
}
if (!nodes.some(node => node.id === targetNode.identity.low)) {
nodes.push({ id: targetNode.identity.low, text: targetNode.properties.title, type: targetNode.labels[0] })
}
// 添加边
if (!edges.some(edge => edge.from === sourceNode.identity.low && edge.to === targetNode.identity.low)) {
edges.push({ from: sourceNode.identity.low, to: targetNode.identity.low, text: relationship.type })
}
}
}) })
console.log(nodes, edges) console.log(nodes, edges)
return { nodes, edges } return { nodes, edges }
} finally { } finally {

162
src/views/AIAssistant/AICataloging/index.vue

@ -37,19 +37,8 @@
<span class="right-top-line" /> <span class="right-top-line" />
<span class="left-bottom-line" /> <span class="left-bottom-line" />
<div style="display: flex; justify-content: flex-start;"> <div style="display: flex; justify-content: flex-start;">
<!-- <el-form>
<el-form-item label="电子原件" prop="aiFileOriginal" class="prearch-upload">
<p class="input-style">{{ aiFileOriginal }}</p>
<div class="upload-btn">
<input id="upFile" type="file" name="upFile" @change="changeFile($event)">
<el-button size="small" type="primary" :loading="aiLoading">
<i :class="['iconfont', aiLoading ? 'icon-huoqu' : 'icon-shangchuan']" />{{ aiLoading ? 'AI辅助著录识别中' : '上传' }}
</el-button>
</div>
</el-form-item>
</el-form> -->
<div class="upload-btn"> <div class="upload-btn">
<input id="upFile" type="file" name="upFile" multiple @change="changeFile($event)">
<input id="upFile" type="file" name="upFile" multiple @change="changeAiFile($event)">
<el-button :loading="aiLoading" size="small" type="primary"><i :class="['iconfont', aiLoading ? 'icon-huoqu' : 'icon-shangchuan']" />{{ aiLoading ? 'AI辅助著录识别中' : '选择文件' }}</el-button> <el-button :loading="aiLoading" size="small" type="primary"><i :class="['iconfont', aiLoading ? 'icon-huoqu' : 'icon-shangchuan']" />{{ aiLoading ? 'AI辅助著录识别中' : '选择文件' }}</el-button>
</div> </div>
<!-- margin-left: 10px; line-height: 34px; height: 106px; overflow: hidden; overflow-y: scroll; --> <!-- margin-left: 10px; line-height: 34px; height: 106px; overflow: hidden; overflow-y: scroll; -->
@ -57,7 +46,6 @@
<div v-for="item in fileList" :key="item.name" class="file-list" style="margin-left: 10px;"> <div v-for="item in fileList" :key="item.name" class="file-list" style="margin-left: 10px;">
<i class="iconfont icon-xiaowenjian" style="font-size: 14px;" /> <i class="iconfont icon-xiaowenjian" style="font-size: 14px;" />
{{ item.name }} {{ item.name }}
<!-- <i class="el-icon-close" @click="deleteFile(item)" /> -->
</div> </div>
</div> </div>
</div> </div>
@ -102,7 +90,9 @@ import crudCategory from '@/api/system/category/category'
import CRUD, { presenter, header } from '@crud/crud' import CRUD, { presenter, header } from '@crud/crud'
import PreviewForm from '@/views/components/category/PreviewForm' import PreviewForm from '@/views/components/category/PreviewForm'
import { FetchInitCategoryInputFieldByPid, FetchCategoryMenu } from '@/api/system/category/category' import { FetchInitCategoryInputFieldByPid, FetchCategoryMenu } from '@/api/system/category/category'
// import { getCurrentTime } from '@/utils/index'
import { getCurrentTime } from '@/utils/index'
import { archivesUpload } from '@/utils/upload'
import { mapGetters } from 'vuex'
export default { export default {
name: 'AICataloging', name: 'AICataloging',
@ -139,16 +129,7 @@ export default {
isDesFormType: 'arcives', isDesFormType: 'arcives',
collectLevel: 3, collectLevel: 3,
categoryMenu: [], categoryMenu: [],
aiFileOriginal: null,
file: null, // change
fileNames: '', // - name
formatType: '', // - type
postfix: '', // -
fileSize: '', // -
filePath: '', // - path
px: '', // -
nowDate: '', // nowDate: '', //
fileJsonString: null,
aiLoading: false, aiLoading: false,
fileList: [], fileList: [],
aiJsonData: null, aiJsonData: null,
@ -159,6 +140,9 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters([
'baseApi'
])
}, },
mounted() { mounted() {
this.getCategoryDataTree() this.getCategoryDataTree()
@ -335,7 +319,7 @@ export default {
}) })
}, },
// //
async changeFile(e) {
async changeAiFile(e) {
// aiJsonData // aiJsonData
this.aiJsonData = null this.aiJsonData = null
this.currentLineIndex = 0 this.currentLineIndex = 0
@ -343,7 +327,7 @@ export default {
this.typingFinished = false this.typingFinished = false
this.typingInterval = null this.typingInterval = null
// if (this.typingInterval) { // if (this.typingInterval) {
// clearInterval(this.typingInterval)
// clearInterval(this.typingInterval);
// } // }
const selectedFiles = Array.from(e.target.files) const selectedFiles = Array.from(e.target.files)
@ -400,8 +384,8 @@ export default {
fileInfo.px = res.width + 'px*' + res.height + 'px' fileInfo.px = res.width + 'px*' + res.height + 'px'
this.fileList.push(fileInfo) this.fileList.push(fileInfo)
this.uploadSave()
} }
this.FetchAiFileUplaod(this.fileList)
} else if (nonImageFiles.length > 0) { } else if (nonImageFiles.length > 0) {
if (existingNonImageFiles.length > 0) { if (existingNonImageFiles.length > 0) {
// //
@ -435,91 +419,57 @@ export default {
), ),
px: '' px: ''
} }
this.fileList.push(fileInfo) this.fileList.push(fileInfo)
this.uploadSave()
} }
this.FetchAiFileUplaod(this.fileList)
} }
//
// reDocumentUpload(this.baseApi + '/api/re-document/uploadFile', this.file, this.selectedDocument.id).then(res => {
// if (res.data.code === 200) {
// this.filePath = res.data.data
// this.uploadSave()
// }
// })
}, },
// -
uploadSave() {
this.aiLoading = true
// this.nowDate = getCurrentTime()
// const json = {
// 'file_name': this.fileNames,
// 'file_size': this.fileSize,
// 'file_type': this.postfix,
// 'file_path': this.filePath,
// 'sequence': null,
// 'archive_id': this.arcId,
// 'file_dpi': this.px,
// 'file_thumbnail': '',
// 'create_time': this.nowDate,
// 'id': null,
// 'is_quote': null,
// 'last_modified': this.file.lastModified
// }
// const arrayUpload = []
// arrayUpload.push(json)
// this.aiFileOriginal = this.fileNames
// this.fileJsonString = JSON.stringify(arrayUpload)
// console.log(this.fileJsonString)
setTimeout(() => {
const json = `{
"fonds_no": "A001",
"archival_category_code": "WSWJ",
"archive_ctg_no": "SCGL",
"archive_year": "2024",
"retention": "永久",
"item_no": "0005",
"archive_no": "A001-WSWJ·SCGL-2024-Y-0005",
"maintitle": "Windows下如何创建FTP文件夹",
"keyword": "",
"doc_no": "武汉飞天[2024]0005",
"doc_id": "",
"security_class": "",
"secrecy_period": "",
"doc_type": "",
"serial_no": "",
"emergency_degree": "",
"created_date": "",
"doc_department": "",
"signer": "",
"main_department": "",
"copy_department": "",
"printing_department": "",
"printing_date": "",
"release_level": "",
"microfilm": "",
"attachment": "",
"annotation": "",
"file_id": "",
"software_environment": "",
"hardware_environment": "",
"disposal_type": "",
"disposal_actor": "",
"disposal_department": "",
"disposal_date": "",
"disposal_result": "",
"medium_type": "",
"medium_qty": "",
"medium_unit": "",
"medium_specs": "",
"is_entity": 1,
"id": "6C91AAD1F6D9940469F8B0"
}`
FetchAiFileUplaod(files) {
this.nowDate = getCurrentTime()
const promiseArray = files.map(async(item, index) => {
const json = {}
json.file_name = item.name
json.file_size = item.size
json.file_type = item.postfix
// json.file_path = this.filePath[index].path
json.file_path = ''
json.archive_id = this.arcId
json.file_dpi = item.px
json.file_thumbnail = ''
json.create_time = this.nowDate
json.id = null
json.last_modified = item.file.lastModified
// json.digital_summary = null
// json.public_key = null
// json.private_key = null
return json
})
console.log('promiseArray', promiseArray)
//
const fileDefault = files.map(item => item.file)
this.aiJsonData = json
this.startTypingEffect()
}, 3000)
Promise.all(promiseArray)
.then((arrayUpload) => {
//
archivesUpload(this.baseApi + '/api/collect/uploadAssistEnterFiles',
fileDefault,
this.selectedCategory.id,
this.arcId,
JSON.stringify(arrayUpload)
).then(res => {
if (res.data.code === 200) {
this.$message({ message: res.data.data, type: 'success', offset: 8 })
// this.aiJsonData = res.data;
// this.startTypingEffect();
} else {
this.$message({ message: '上传附件失败', type: 'error', offset: 8 })
}
// this.handleClose()
})
})
.catch((error) => {
console.error(error)
})
}, },
startTypingEffect() { startTypingEffect() {
const lines = this.aiJsonData.split('\n') const lines = this.aiJsonData.split('\n')

8
src/views/archiveKeeping/deviceManage/index.vue

@ -7,21 +7,21 @@
<crudOperation :permission="permission"> <crudOperation :permission="permission">
<template v-slot:left> <template v-slot:left>
<!-- crud.selections.length === 0 || crud.selections[0].isType === 2 || crud.selections[0].isType === 3 || crud.selections[0].isType === 5 --> <!-- crud.selections.length === 0 || crud.selections[0].isType === 2 || crud.selections[0].isType === 3 || crud.selections[0].isType === 5 -->
<el-button v-permission="permission.add" size="mini" :disabled="crud.selections.length === 0 || crud.selections[0].isType === 3" @click="crud.toAdd">
<el-button size="mini" :disabled="crud.selections.length === 0 || crud.selections[0].isType === 3" @click="crud.toAdd">
<i class="iconfont icon-xinzeng" /> <i class="iconfont icon-xinzeng" />
新增 新增
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" :disabled="crud.selections.length !== 1 || crud.selections[0].pid === '0'" @click="crud.toEdit(crud.selections[0])">
<el-button size="mini" :disabled="crud.selections.length !== 1 || crud.selections[0].pid === '0'" @click="crud.toEdit(crud.selections[0])">
<i class="iconfont icon-bianji" /> <i class="iconfont icon-bianji" />
编辑 编辑
</el-button> </el-button>
</template> </template>
<template v-slot:right> <template v-slot:right>
<el-button v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0 || (crud.selections.length === 1 && crud.selections[0].pid === '0' )" @click="toDelete(crud.selections)">
<el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0 || (crud.selections.length === 1 && crud.selections[0].pid === '0' )" @click="toDelete(crud.selections)">
<i class="iconfont icon-shanchu" /> <i class="iconfont icon-shanchu" />
删除 删除
</el-button> </el-button>
<el-button v-permission="permission.sort" icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="brotherNodeNum <= 1 || crud.selections[0].pid === '0' " @click="toSort(crud.selections)">排序</el-button>
<el-button icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="brotherNodeNum <= 1 || crud.selections[0].pid === '0' " @click="toSort(crud.selections)">排序</el-button>
</template> </template>
</crudOperation> </crudOperation>
</div> </div>

4
src/views/archiveKeeping/deviceManage/tableList.vue

@ -12,13 +12,13 @@
</div> </div>
<crudOperation :permission="permission"> <crudOperation :permission="permission">
<template v-slot:left> <template v-slot:left>
<el-button v-permission="permission.add" size="mini" @click="deviceSelectVisible = true">
<el-button size="mini" @click="deviceSelectVisible = true">
<i class="iconfont icon-xinzeng" /> <i class="iconfont icon-xinzeng" />
新增 新增
</el-button> </el-button>
</template> </template>
<template v-slot:right> <template v-slot:right>
<el-button slot="reference" v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">
<el-button slot="reference" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">
<i class="iconfont icon-shanchu" /> <i class="iconfont icon-shanchu" />
删除 删除
</el-button> </el-button>

8
src/views/archivesManage/managementLibrary/module/collectHeader.vue

@ -82,7 +82,7 @@
mode="horizontal" mode="horizontal"
@select="handleSelect" @select="handleSelect"
> >
<el-submenu v-if="isTitleType !== 6" v-permission="permission.convention" index="1">
<el-submenu v-if="isTitleType !== 6" index="1">
<template slot="title"> <template slot="title">
<i class="iconfont icon-changgui" /> <i class="iconfont icon-changgui" />
<span>常规</span> <span>常规</span>
@ -91,7 +91,7 @@
<el-menu-item v-if="isTitleType !== 6" index="1-1" @click="handleForm('edit')">编辑</el-menu-item> <el-menu-item v-if="isTitleType !== 6" index="1-1" @click="handleForm('edit')">编辑</el-menu-item>
</el-menu-item-group> </el-menu-item-group>
</el-submenu> </el-submenu>
<el-submenu v-if="isTitleType === 3" v-permission="permission.arrange" index="2">
<el-submenu v-if="isTitleType === 3" index="2">
<template slot="title"> <template slot="title">
<i class="iconfont icon-zhengli" /> <i class="iconfont icon-zhengli" />
<span>整理</span> <span>整理</span>
@ -114,7 +114,7 @@
<el-menu-item index="2-9" @click="handleJD(1)">销毁鉴定</el-menu-item> <el-menu-item index="2-9" @click="handleJD(1)">销毁鉴定</el-menu-item>
</el-menu-item-group> </el-menu-item-group>
</el-submenu> </el-submenu>
<el-submenu v-if="isTitleType === 4" v-permission="permission.arrange" index="2">
<el-submenu v-if="isTitleType === 4" index="2">
<template slot="title"> <template slot="title">
<i class="iconfont icon-zhengli" /> <i class="iconfont icon-zhengli" />
<span>整理</span> <span>整理</span>
@ -123,7 +123,7 @@
<el-menu-item index="2-1" @click="bindingTag(selections)">标签绑定</el-menu-item> <el-menu-item index="2-1" @click="bindingTag(selections)">标签绑定</el-menu-item>
</el-menu-item-group> </el-menu-item-group>
</el-submenu> </el-submenu>
<el-submenu v-if="isTitleType !== 6" v-permission="permission.more" index="3">
<el-submenu v-if="isTitleType !== 6" index="3">
<template slot="title"> <template slot="title">
<i class="iconfont icon-gengduo" /> <i class="iconfont icon-gengduo" />
<span>更多</span> <span>更多</span>

85
src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue

@ -171,7 +171,6 @@
<div v-for="item in fileList" :key="item.name" class="file-list"> <div v-for="item in fileList" :key="item.name" class="file-list">
<i class="iconfont icon-xiaowenjian" style="font-size: 14px;" /> <i class="iconfont icon-xiaowenjian" style="font-size: 14px;" />
{{ item.name }} {{ item.name }}
<!-- <i class="el-icon-close" @click="deleteFile(item)" /> -->
</div> </div>
</div> </div>
<!-- </div> --> <!-- </div> -->
@ -266,8 +265,8 @@ import QuickPaper from './quickPaper/index'
import PackingBox from './packingBox/index' import PackingBox from './packingBox/index'
import ArchivesFilling from './archivesFilling/index' import ArchivesFilling from './archivesFilling/index'
import qs from 'qs' import qs from 'qs'
// getCurrentTime
import { downloadFile, exportFile } from '@/utils/index'
import { archivesUpload } from '@/utils/upload'
import { downloadFile, exportFile, getCurrentTime } from '@/utils/index'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
@ -325,6 +324,7 @@ export default {
categoryMenu: [], categoryMenu: [],
isAiAutoCategory: false, isAiAutoCategory: false,
aiLoading: false, aiLoading: false,
nowDate: '',
fileList: [], fileList: [],
aiJsonData: null, aiJsonData: null,
displayedText: '', displayedText: '',
@ -1288,7 +1288,7 @@ export default {
this.typingFinished = false this.typingFinished = false
this.typingInterval = null this.typingInterval = null
// if (this.typingInterval) { // if (this.typingInterval) {
// clearInterval(this.typingInterval)
// clearInterval(this.typingInterval);
// } // }
const selectedFiles = Array.from(e.target.files) const selectedFiles = Array.from(e.target.files)
@ -1345,8 +1345,8 @@ export default {
fileInfo.px = res.width + 'px*' + res.height + 'px' fileInfo.px = res.width + 'px*' + res.height + 'px'
this.fileList.push(fileInfo) this.fileList.push(fileInfo)
this.uploadSave()
} }
this.FetchAiFileUplaod(this.fileList)
} else if (nonImageFiles.length > 0) { } else if (nonImageFiles.length > 0) {
if (existingNonImageFiles.length > 0) { if (existingNonImageFiles.length > 0) {
// //
@ -1380,34 +1380,57 @@ export default {
), ),
px: '' px: ''
} }
this.fileList.push(fileInfo) this.fileList.push(fileInfo)
this.uploadSave()
} }
this.FetchAiFileUplaod(this.fileList)
} }
}, },
uploadSave() {
this.aiLoading = true
setTimeout(() => {
const json = `{
"fonds_no": "A001",
"archival_category_code": "WSWJ",
"archive_ctg_no": "SCGL",
"archive_year": "2024",
"retention": "永久",
"item_no": "0005",
"archive_no": "A001-WSWJ·SCGL-2024-Y-0005",
"maintitle": "Windows下如何创建FTP文件夹",
"keyword": "",
"doc_no": "武汉飞天[2024]0005",
"is_entity": 1,
"id": "6C91AAD1F6D9940469F8B0"
}`
FetchAiFileUplaod(files) {
this.nowDate = getCurrentTime()
const promiseArray = files.map(async(item, index) => {
const json = {}
json.file_name = item.name
json.file_size = item.size
json.file_type = item.postfix
// json.file_path = this.filePath[index].path
json.file_path = ''
json.archive_id = this.arcId
json.file_dpi = item.px
json.file_thumbnail = ''
json.create_time = this.nowDate
json.id = null
json.last_modified = item.file.lastModified
// json.digital_summary = null
// json.public_key = null
// json.private_key = null
return json
})
console.log('promiseArray', promiseArray)
//
const fileDefault = files.map(item => item.file)
this.aiJsonData = json
this.startTypingEffect()
}, 3000)
Promise.all(promiseArray)
.then((arrayUpload) => {
//
archivesUpload(this.baseApi + '/api/collect/uploadAssistEnterFiles',
fileDefault,
this.selectedCategory.id,
this.arcId,
JSON.stringify(arrayUpload)
).then(res => {
if (res.data.code === 200) {
this.$message({ message: res.data.data, type: 'success', offset: 8 })
// this.aiJsonData = res.data;
// this.startTypingEffect();
} else {
this.$message({ message: '上传附件失败', type: 'error', offset: 8 })
}
// this.handleClose()
})
})
.catch((error) => {
console.error(error)
})
}, },
startTypingEffect() { startTypingEffect() {
const lines = this.aiJsonData.split('\n') const lines = this.aiJsonData.split('\n')
@ -1439,12 +1462,6 @@ export default {
} }
}, 200) }, 200)
}, },
// deleteFile(item) {
// const index = this.fileList.indexOf(item)
// if (index !== -1) {
// this.fileList.splice(index, 1)
// }
// },
// base64 // base64
getBase64(file) { getBase64(file) {
const reader = new FileReader() const reader = new FileReader()

291
src/views/components/echarts/graph.vue

@ -9,12 +9,11 @@
ref="graphRef" ref="graphRef"
:options="graphOptions" :options="graphOptions"
:on-node-click="onNodeClick" :on-node-click="onNodeClick"
:on-line-click="onLineClick"
:on-canvas-click="onCanvasClick" :on-canvas-click="onCanvasClick"
> >
<template #node="{node}"> <template #node="{node}">
<div @mouseover="showNodeTips(node, $event)" @mouseout="hideNodeTips(node, $event)"> <div @mouseover="showNodeTips(node, $event)" @mouseout="hideNodeTips(node, $event)">
<div :class="node.id === '1' ? 'c-my-rg-node c-big-style': 'c-my-rg-node '" :style="{'height': node.width + 'px', 'line-height': node.width + 'px'}">
<div class="c-my-rg-node" :style="{'height': node.width + 'px', 'line-height': node.width + 'px'}">
{{ node.text }} {{ node.text }}
</div> </div>
</div> </div>
@ -33,56 +32,14 @@
<script> <script>
import { getGraphData } from '../../../neo4j.js' import { getGraphData } from '../../../neo4j.js'
import RelationGraph from 'relation-graph' import RelationGraph from 'relation-graph'
const graph_json_data = { const graph_json_data = {
// 'rootId': 1,
'nodes': [ 'nodes': [
{ id: '1', text: '文书档案', force_weight: 10000, color: '#ec6941', borderColor: '#ff875e', width: 150, height: 150 },
{ id: '2', text: '档案分类' },
{ id: '21', text: '行政管理' },
{ id: '22', text: '党群工作' },
{ id: '23', text: '经营管理' },
{ id: '24', text: '生成管理' },
{ id: '3', text: '保管期限' },
{ id: '31', text: '永久' },
{ id: '32', text: '定期30年' },
{ id: '33', text: '定期10年' },
{ id: '4', text: '年度' },
{ id: '41', text: '2022' },
{ id: '42', text: '2023' },
{ id: '43', text: '2024' },
{ id: '5', text: '密级' },
{ id: '51', text: '公开' },
{ id: '52', text: '限制' },
{ id: '53', text: '秘密' },
{ id: '54', text: '机密' },
{ id: '55', text: '绝密' }
], ],
'lines': [ 'lines': [
{ from: '1', to: '2', text: 'class', dashType: 1 },
{ from: '1', to: '3', text: 'retention', dashType: 2 },
{ from: '1', to: '4', text: 'year', dashType: 3 },
{ from: '1', to: '5', text: 'classification', dashType: 4 },
{ from: '2', to: '21', text: 'class_01' },
{ from: '2', to: '22', text: 'class_02' },
{ from: '2', to: '23', text: 'class_03' },
{ from: '2', to: '24', text: 'class_04' },
{ from: '3', to: '31', text: 'retention_01' },
{ from: '3', to: '32', text: 'retention_02' },
{ from: '3', to: '33', text: 'retention_03' },
{ from: '4', to: '41', text: 'year_01' },
{ from: '4', to: '42', text: 'year_02' },
{ from: '4', to: '43', text: 'year_03' },
{ from: '5', to: '51', text: 'classification_01' },
{ from: '5', to: '52', text: 'classification_02' },
{ from: '5', to: '53', text: 'classification_03' },
{ from: '5', to: '54', text: 'classification_04' },
{ from: '5', to: '55', text: 'classification_05' }
] ]
} }
export default { export default {
name: 'Demo', name: 'Demo',
components: { RelationGraph }, components: { RelationGraph },
@ -94,18 +51,24 @@ export default {
nodeMenuPanelPosition: { x: 0, y: 0 }, nodeMenuPanelPosition: { x: 0, y: 0 },
currentNode: {}, currentNode: {},
graphOptions: { graphOptions: {
defaultNodeBorderWidth: 0,
allowSwitchLineShape: true,
allowSwitchJunctionPoint: true,
defaultLineShape: 1,
useAnimationWhenExpanded: true,
useAnimationWhenRefresh: true,
placeOtherGroup: true,
disableNodeclickEffect: true, disableNodeclickEffect: true,
reLayoutWhenExpandedOrCollapsed: true,
defaultExpandHolderPosition: 'bottom',
zoomToFitWhenRefresh: true,
layout: { layout: {
label: '自动布局',
layoutName: 'force', layoutName: 'force',
layoutClassName: 'seeks-layout-force'
'force_line_elastic': 0.5
}, },
// defaultJunctionPoint: 'border',
defaultLineColor: 'rgba(0,0,0,0.8)'
allowSwitchLineShape: true,
allowSwitchJunctionPoint: true,
defaultLineColor: 'rgba(0,0,0,0.5)',
defaultNodeBorderWidth: 0,
defaultNodeBorderColor: 'transpanret',
defaultNodeFontColor: '#000',
defaultFocusRootNode: false
}, },
isLoading: false, isLoading: false,
errorMessage: '', errorMessage: '',
@ -114,40 +77,37 @@ export default {
} }
}, },
mounted() { mounted() {
// this.showGraph()
this.resizeTimer = setInterval(async() => { this.resizeTimer = setInterval(async() => {
// const graphInstance = this.$refs.graphRef.getInstance(); // const graphInstance = this.$refs.graphRef.getInstance();
// await graphInstance.zoomToFit(); // await graphInstance.zoomToFit();
}, 3000) }, 3000)
this.fetchData()
const query = "MATCH path = (target:Archives {id: '0047B3542CE88B895E41DE'})-[rels:HAS_KEYWORD*1..4]-(related:Archives) WHERE target <> related UNWIND relationships(path) AS r WITH startNode(r) AS n, r, endNode(r) AS m, length(path)/2 AS depth RETURN DISTINCT n, r, m;"
this.fetchData(query)
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.resizeTimer) clearInterval(this.resizeTimer)
}, },
methods: { methods: {
async fetchData() {
async fetchData(query, selectedNodeId = null) {
this.isLoading = true this.isLoading = true
this.errorMessage = '' this.errorMessage = ''
try { try {
// getGraphData
const { nodes, edges } = await getGraphData()
this.nodes = nodes
this.edges = edges
//
// this.renderGraph()
this.allData.nodes = nodes.map(item => {
const newItem = { ...item }
if (item.type === 'CategoryClass') {
// newItem.color = '#ec6941'
// newItem.borderColor = '#ff875e'
} else if (item.type === 'Category') {
newItem.color = '#ec6941'
newItem.borderColor = '#ff875e'
const { nodes, edges } = await getGraphData(query)
const colors = ['rgb(225,151,102)', 'rgb(194,159,87)', 'rgb(253,183,112)', 'rgb(127,181,123)', 'rgb(224,178,159)', 'rgb(196,149,72)', 'rgb(255,162,24)', 'rgb(189,237,229)']
const typeColorMap = {}
const newNodes = nodes.map(item => {
const newItem = { ...item, id: String(item.id) }
if (item.type) {
if (!typeColorMap[item.type]) {
typeColorMap[item.type] = colors[Object.keys(typeColorMap).length % colors.length]
}
newItem.color = typeColorMap[item.type]
newItem.borderColor = typeColorMap[item.type]
} }
return newItem return newItem
}) })
this.allData.lines = edges.map(item => {
const newEdges = edges.map(item => {
return { return {
...item, ...item,
from: String(item.from), from: String(item.from),
@ -155,38 +115,67 @@ export default {
} }
}) })
console.log('this.allData', this.allData)
this.showGraph()
const existingNodeIds = new Set(this.allData.nodes.map(node => node.id))
const allNodesExist = newNodes.every(node => existingNodeIds.has(node.id))
let validNewEdges = []
let uniqueNewNodes = []
if (!allNodesExist) {
uniqueNewNodes = newNodes.filter(node => !existingNodeIds.has(node.id))
const existingLineKeys = new Set(this.allData.lines.map(line => `${line.from}-${line.to}-${line.text}`))
// to
if (selectedNodeId) {
const relatedNodeIds = [selectedNodeId, ...this.getRelatedNodeIds(selectedNodeId)]
validNewEdges = newEdges.filter(edge => {
return !relatedNodeIds.includes(edge.to) && !existingLineKeys.has(`${edge.from}-${edge.to}-${edge.text}`)
})
} else {
validNewEdges = newEdges.filter(edge => !existingLineKeys.has(`${edge.from}-${edge.to}-${edge.text}`))
}
}
const originalNodesLength = this.allData.nodes.length
const originalLinesLength = this.allData.lines.length
this.allData.nodes = [...this.allData.nodes, ...uniqueNewNodes]
this.allData.lines = [...this.allData.lines, ...validNewEdges]
this.allData.nodes.sort((a, b) => {
return parseInt(a.id) - parseInt(b.id)
})
//
if (this.allData.nodes.length > originalNodesLength || this.allData.lines.length > originalLinesLength) {
console.log('this.allData', this.allData)
this.showGraph()
} else {
console.log('数据无变化,不更新图表')
}
} catch (error) { } catch (error) {
//
this.errorMessage = `Error fetching data from Neo4j: ${error.message}` this.errorMessage = `Error fetching data from Neo4j: ${error.message}`
} finally { } finally {
this.isLoading = false this.isLoading = false
} }
}, },
renderGraph() {
try {
const container = document.getElementById('graph-container')
console.log('container', container)
if (!container) {
throw new Error('Graph container not found')
}
const graph = new RelationGraph(container, {
nodes: this.nodes,
edges: this.edges
})
console.lo('graph', graph)
//
graph.render()
} catch (error) {
this.errorMessage = `Error rendering graph: ${error.message}`
}
getRelatedNodeIds(nodeId) {
return this.allData.lines
.filter(line => line.from === nodeId || line.to === nodeId)
.map(line => line.from === nodeId ? line.to : line.from)
}, },
async showGraph() { async showGraph() {
const rootId = this.allData.nodes[0].id
this.allData.rootId = rootId
const graphInstance = this.$refs.graphRef.getInstance() const graphInstance = this.$refs.graphRef.getInstance()
await this.stopForceIfNeed()
// await this.stopForceIfNeed()
await graphInstance.setJsonData(this.allData) await graphInstance.setJsonData(this.allData)
await graphInstance.setZoom(80)
// setTimeout(async() => {
// await graphInstance.setZoom(100)
// await graphInstance.moveToCenter()
// await graphInstance.zoomToFit()
// }, 1800)
}, },
async stopForceIfNeed() { async stopForceIfNeed() {
const graphInstance = this.$refs.graphRef.getInstance() const graphInstance = this.$refs.graphRef.getInstance()
@ -203,65 +192,50 @@ export default {
}, 500) }, 500)
}, },
onNodeClick(nodeObject, $event) { onNodeClick(nodeObject, $event) {
console.log('onNodeClick:', nodeObject)
const allChildIds = this.deepGeAlltChildIds(nodeObject)
console.log('allChildIds', allChildIds)
const graphInstance = this.$refs.graphRef.getInstance()
for (const node of graphInstance.getNodes()) {
if (allChildIds.includes(node.id)) {
node.opacity = 1
node.color = 'rgb(116,2,173)'
} else {
node.opacity = 0.1
node.color = undefined
}
}
for (const link of graphInstance.getLinks()) {
if (allChildIds.includes(link.fromNode.id) && allChildIds.includes(link.toNode.id)) {
link.relations.forEach(line => {
line.color = 'rgb(116,2,173)'
})
} else {
link.relations.forEach(line => {
line.color = ''
})
}
}
},
deepGeAlltChildIds(node, ids = []) {
if (ids.includes(node.id)) return
ids.push(node.id)
// node.lot.childs
// node.targetNodes
for (const cNode of node.lot.childs) {
this.deepGeAlltChildIds(cNode, ids)
}
return ids
console.log('节点数据:', nodeObject)
const nodeId = nodeObject.id
const query = `MATCH (n) WHERE id(n) = ${nodeId} MATCH (n)-[r]-(m) RETURN n, r,m;`
this.fetchData(query, nodeId)
console.log('query', query)
// const _all_nodes = this.$refs.graphRef.getInstance().getNodes()
// const { lot } = nodeObject
// if (lot.childs && lot.childs.length) {
// _all_nodes.forEach((thisNode) => {
// let _isHideThisNode = false
// lot.childs.forEach((childNode) => {
// if (thisNode.id === childNode.id || thisNode.id === nodeObject.id) {
// _isHideThisNode = true
// }
// if (lot.parent && thisNode.id === lot.parent.id) {
// _isHideThisNode = true
// }
// })
// thisNode.opacity = _isHideThisNode ? 1 : 0.1
// })
// } else {
// _all_nodes.forEach((thisNode) => {
// let _isHideThisNode = false
// if (thisNode.id === nodeObject.id) {
// _isHideThisNode = true
// }
// if (lot.parent && thisNode.id === lot.parent.id) {
// _isHideThisNode = true
// }
// thisNode.opacity = _isHideThisNode ? 1 : 0.1
// })
// }
}, },
onCanvasClick($event) { onCanvasClick($event) {
console.log('onCanvasClick:')
const graphInstance = this.$refs.graphRef.getInstance()
for (const node of graphInstance.getNodes()) {
node.opacity = 1
this.allData.nodes.forEach((item, index) => {
if (item.id === node.id) {
node.color = item.color
}
})
}
for (const link of graphInstance.getLinks()) {
link.relations.forEach(line => {
line.color = undefined
})
}
},
onLineClick(lineObject, linkObject, $event) {
console.log('onLineClick:', lineObject)
const _all_nodes = this.$refs.graphRef.getInstance().getNodes()
_all_nodes.forEach((thisNode) => {
const _isHideThisNode = true
thisNode.opacity = _isHideThisNode ? 1 : 0.1
})
}, },
showNodeTips(nodeObject, $event) { showNodeTips(nodeObject, $event) {
this.currentNode = nodeObject this.currentNode = nodeObject
const _base_position = this.$refs.graphRef.getInstance().options.fullscreen ? { x: 0, y: 0 } : this.$refs.myPage.getBoundingClientRect() const _base_position = this.$refs.graphRef.getInstance().options.fullscreen ? { x: 0, y: 0 } : this.$refs.myPage.getBoundingClientRect()
// console.log('showNodeMenus:', this.$refs.graphRef.getInstance().options.fullscreen, $event.clientX, $event.clientY, _base_position)
this.isShowNodeTipsPanel = true this.isShowNodeTipsPanel = true
this.nodeMenuPanelPosition.x = $event.clientX - _base_position.x + 10 this.nodeMenuPanelPosition.x = $event.clientX - _base_position.x + 10
this.nodeMenuPanelPosition.y = $event.clientY - _base_position.y + 10 this.nodeMenuPanelPosition.y = $event.clientY - _base_position.y + 10
@ -273,9 +247,6 @@ export default {
} }
</script> </script>
<style>
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .rel-toolbar{ ::v-deep .rel-toolbar{
color: #000; color: #000;
@ -283,29 +254,35 @@ export default {
color: #000; color: #000;
} }
} }
// .my-graph{
// // background: linear-gradient(to right, rgb(16, 185, 129), rgb(101, 163, 13));
// }
.c-my-rg-node { .c-my-rg-node {
font-size: 16px;
font-size: 13px;
border-radius: 50%; border-radius: 50%;
cursor: pointer; cursor: pointer;
height: 80px; height: 80px;
// line-height: 80px;
display: flex; display: flex;
place-items: center;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.c-node-menu-item{ .c-node-menu-item{
line-height: 30px; line-height: 30px;
padding-left: 10px;cursor: pointer;color: #444444;font-size: 14px;border-top:#efefef solid 1px;
padding-left: 10px;
cursor: pointer;
color: #444444;
font-size: 14px;
border-top:#efefef solid 1px;
} }
.c-node-menu-item:hover{ .c-node-menu-item:hover{
background-color: rgba(66,187,66,0.2); background-color: rgba(66,187,66,0.2);
} }
.c-big-style{ .c-big-style{
font-size: 30px; font-size: 30px;
} }
::v-deep .c-rg-line-text{
font-size: 10px !important;
}
</style> </style>

425
src/views/components/echarts/graph222.vue

@ -0,0 +1,425 @@
<template>
<div>
<!-- <div id="graph-container">
<div v-if="isLoading">Loading data from Neo4j...</div>
<div v-if="errorMessage">{{ errorMessage }}</div>
</div> -->
<div ref="myPage" class="my-graph" style="height: calc(100vh - 184px);">
<!-- :on-node-click="onNodeClick"
:on-line-click="onLineClick"
:on-canvas-click="onCanvasClick"
:on-node-expand="onNodeExpand" -->
<RelationGraph
ref="graphRef"
:options="graphOptions"
:on-node-click="onNodeClick"
:on-canvas-click="onCanvasClick"
>
<template #node="{node}">
<div @mouseover="showNodeTips(node, $event)" @mouseout="hideNodeTips(node, $event)">
<!-- :class="node.id === '1' ? 'c-my-rg-node c-big-style': 'c-my-rg-node '" -->
<div class="c-my-rg-node" :style="{'height': node.width + 'px', 'line-height': node.width + 'px'}">
{{ node.text }}
</div>
</div>
</template>
<template #graph-plug>
<div v-if="isShowNodeTipsPanel" :style="{left: nodeMenuPanelPosition.x + 'px', top: nodeMenuPanelPosition.y + 'px' }" style="z-index: 999;padding:10px;background-color: #ffffff;border:#eeeeee solid 1px;box-shadow: 0px 0px 8px #cccccc;position: absolute;">
<div style="line-height: 25px;padding-left: 10px;color: #888888;font-size: 12px;">节点名称{{ currentNode.text }}</div>
<div class="c-node-menu-item">id:{{ currentNode.id }}</div>
</div>
</template>
</RelationGraph>
</div>
</div>
</template>
<script>
import { getGraphData } from '../../../neo4j.js'
import RelationGraph from 'relation-graph'
// https://relation-graph.com/#/docs/start
const graph_json_data = {
// 'rootId': 1,
'nodes': [
{ id: '1', text: '文书档案', force_weight: 10000, color: '#ec6941', borderColor: '#ff875e', width: 150, height: 150 },
{ id: '2', text: '档案分类' },
{ id: '21', text: '行政管理' },
{ id: '22', text: '党群工作' },
{ id: '23', text: '经营管理' },
{ id: '24', text: '生成管理' },
{ id: '3', text: '保管期限' },
{ id: '31', text: '永久' },
{ id: '32', text: '定期30年' },
{ id: '33', text: '定期10年' },
{ id: '4', text: '年度' },
{ id: '41', text: '2022' },
{ id: '42', text: '2023' },
{ id: '43', text: '2024' },
{ id: '5', text: '密级' },
{ id: '51', text: '公开' },
{ id: '52', text: '限制' },
{ id: '53', text: '秘密' },
{ id: '54', text: '机密' },
{ id: '55', text: '绝密' }
],
'lines': [
{ from: '1', to: '2', text: 'class', dashType: 1 },
{ from: '1', to: '3', text: 'retention', dashType: 2 },
{ from: '1', to: '4', text: 'year', dashType: 3 },
{ from: '1', to: '5', text: 'classification', dashType: 4 },
{ from: '2', to: '21', text: 'class_01' },
{ from: '2', to: '22', text: 'class_02' },
{ from: '2', to: '23', text: 'class_03' },
{ from: '2', to: '24', text: 'class_04' },
{ from: '3', to: '31', text: 'retention_01' },
{ from: '3', to: '32', text: 'retention_02' },
{ from: '3', to: '33', text: 'retention_03' },
{ from: '4', to: '41', text: 'year_01' },
{ from: '4', to: '42', text: 'year_02' },
{ from: '4', to: '43', text: 'year_03' },
{ from: '5', to: '51', text: 'classification_01' },
{ from: '5', to: '52', text: 'classification_02' },
{ from: '5', to: '53', text: 'classification_03' },
{ from: '5', to: '54', text: 'classification_04' },
{ from: '5', to: '55', text: 'classification_05' }
]
}
export default {
name: 'Demo',
components: { RelationGraph },
data() {
return {
allData: graph_json_data,
isShowCodePanel: false,
isShowNodeTipsPanel: false,
nodeMenuPanelPosition: { x: 0, y: 0 },
currentNode: {},
graphOptions: {
useAnimationWhenExpanded: true,
useAnimationWhenRefresh: true,
placeOtherGroup: true,
disableNodeclickEffect: true,
reLayoutWhenExpandedOrCollapsed: true,
defaultExpandHolderPosition: 'bottom',
zoomToFitWhenRefresh: true,
layout: {
layoutName: 'force',
// 'maxLayoutTimes': 10000,
// 'force_node_repulsion': 1.5,
'force_line_elastic': 0.5
},
allowSwitchLineShape: true,
allowSwitchJunctionPoint: true,
defaultLineColor: 'rgba(0,0,0,0.5)',
defaultNodeBorderWidth: 0,
defaultNodeBorderColor: 'transpanret',
defaultNodeFontColor: '#000', //
// defaultNodeColor: 'transparent',
// defaultNodeShape: 0,
defaultFocusRootNode: false //
// lineUseTextPath: true
},
isLoading: false,
errorMessage: '',
nodes: [],
edges: []
}
},
mounted() {
// this.showGraph()
this.resizeTimer = setInterval(async() => {
// const graphInstance = this.$refs.graphRef.getInstance();
// await graphInstance.zoomToFit();
}, 3000)
const query = "MATCH path = (target:Archives {id: '0047B3542CE88B895E41DE'})-[rels:HAS_KEYWORD*1..4]-(related:Archives) WHERE target <> related UNWIND relationships(path) AS r WITH startNode(r) AS n, r, endNode(r) AS m, length(path)/2 AS depth RETURN DISTINCT n, r, m;"
this.fetchData(query)
},
beforeDestroy() {
clearInterval(this.resizeTimer)
},
methods: {
async fetchData(query) {
this.isLoading = true
this.errorMessage = ''
try {
// getGraphData
const { nodes, edges } = await getGraphData(query)
this.nodes = nodes
this.edges = edges
//
// this.renderGraph()
// const colors = ['#FD8042', '#0348f3', '#F65163', '#563BE1', '#2B67DD', '#1AAE93', '#0FBED9', '#ffa4a4']
const colors = ['rgb(225,151,102)', 'rgb(194,159,87)', 'rgb(253,183,112)', 'rgb(127,181,123)', 'rgb(224,178,159)', 'rgb(196,149,72)', 'rgb(255,162,24)', 'rgb(189,237,229)']
const typeColorMap = {}
this.allData.nodes = nodes.map(item => {
const newItem = { ...item, id: String(item.id) }
// if (item.type === 'CategoryClass') {
// // newItem.color = '#ec6941'
// // newItem.borderColor = '#ff875e'
// } else if (item.type === 'Category') {
// newItem.color = '#ec6941'
// newItem.borderColor = '#ff875e'
// }
if (item.type) {
if (!typeColorMap[item.type]) {
typeColorMap[item.type] = colors[Object.keys(typeColorMap).length % colors.length]
}
newItem.color = typeColorMap[item.type]
newItem.borderColor = typeColorMap[item.type]
}
return newItem
})
this.allData.nodes.sort((a, b) => {
return parseInt(a.id) - parseInt(b.id)
})
this.allData.lines = edges.map(item => {
return {
...item,
from: String(item.from),
to: String(item.to)
}
})
console.log('this.allData', this.allData)
this.showGraph()
} catch (error) {
//
this.errorMessage = `Error fetching data from Neo4j: ${error.message}`
} finally {
this.isLoading = false
}
},
renderGraph() {
try {
const container = document.getElementById('graph-container')
console.log('container', container)
if (!container) {
throw new Error('Graph container not found')
}
const graph = new RelationGraph(container, {
nodes: this.nodes,
edges: this.edges
})
console.lo('graph', graph)
//
graph.render()
} catch (error) {
this.errorMessage = `Error rendering graph: ${error.message}`
}
},
async showGraph() {
const rootId = this.allData.nodes[0].id
this.allData.rootId = rootId
// this.allData.nodes.forEach(n => {
// if (n.id !== rootId) {
// this.allData.lines.push({ from: rootId, to: n.id, opacity: 0 })
// }
// })
const graphInstance = this.$refs.graphRef.getInstance()
await this.stopForceIfNeed()
await graphInstance.setJsonData(this.allData)
setTimeout(async() => {
await graphInstance.setZoom(100)
await graphInstance.moveToCenter()
await graphInstance.zoomToFit()
}, 1800)
},
async stopForceIfNeed() {
const graphInstance = this.$refs.graphRef.getInstance()
await graphInstance.stopAutoLayout()
},
async updateLayouterOptions() {
await this.stopForceIfNeed()
const graphInstance = this.$refs.graphRef.getInstance()
graphInstance.layouter.maxLayoutTimes = this.graphOptions.layout.maxLayoutTimes
graphInstance.layouter.force_node_repulsion = this.graphOptions.layout.force_node_repulsion
graphInstance.layouter.force_line_elastic = this.graphOptions.layout.force_line_elastic
setTimeout(async() => {
await graphInstance.startAutoLayout()
}, 500)
},
// onNodeExpand(node, e) {
// // //
// if (node.data.childrenLoaded) {
// console.log('')
// return
// }
// //
// if (!node.data.isNeedLoadDataFromRemoteServer) {
// console.log('')
// alert('')
// return
// }
// },
onNodeClick(nodeObject, $event) {
console.log('节点数据:', nodeObject)
const nodeId = nodeObject.id
const query = `MATCH (n) WHERE id(n) = ${nodeId} MATCH (n)-[r]-(m) RETURN n, r,m;`
this.fetchData(query)
console.log('query', query)
const _all_nodes = this.$refs.graphRef.getInstance().getNodes()
// const _all_lines = this.$refs.graphRef.getLines()
const { lot } = nodeObject
//
if (lot.childs && lot.childs.length) {
_all_nodes.forEach((thisNode) => {
let _isHideThisNode = false
lot.childs.forEach((childNode) => {
if (thisNode.id === childNode.id || thisNode.id === nodeObject.id) {
_isHideThisNode = true
}
if (lot.parent && thisNode.id === lot.parent.id) {
_isHideThisNode = true
}
})
thisNode.opacity = _isHideThisNode ? 1 : 0.1
})
} else {
//
_all_nodes.forEach((thisNode) => {
let _isHideThisNode = false
if (thisNode.id === nodeObject.id) {
_isHideThisNode = true
}
if (lot.parent && thisNode.id === lot.parent.id) {
_isHideThisNode = true
}
thisNode.opacity = _isHideThisNode ? 1 : 0.1
})
}
// console.log('onNodeClick:', nodeObject)
// const allChildIds = this.deepGeAlltChildIds(nodeObject)
// console.log('allChildIds', allChildIds)
// const graphInstance = this.$refs.graphRef.getInstance()
// for (const node of graphInstance.getNodes()) {
// if (allChildIds.includes(node.id)) {
// node.opacity = 1
// node.color = 'rgb(116,2,173)'
// } else {
// node.opacity = 0.1
// node.color = undefined
// }
// }
// for (const link of graphInstance.getLinks()) {
// if (allChildIds.includes(link.fromNode.id) && allChildIds.includes(link.toNode.id)) {
// link.relations.forEach(line => {
// line.color = 'rgb(116,2,173)'
// })
// } else {
// link.relations.forEach(line => {
// line.color = ''
// })
// }
// }
},
// deepGeAlltChildIds(node, ids = []) {
// if (ids.includes(node.id)) return
// ids.push(node.id)
// // node.lot.childs
// // node.targetNodes
// console.log('node.lot.childs', node.lot.childs)
// for (const cNode of node.lot.childs) {
// this.deepGeAlltChildIds(cNode, ids)
// }
// return ids
// },
onCanvasClick($event) {
// console.log('onCanvasClick:')
// const graphInstance = this.$refs.graphRef.getInstance()
// for (const node of graphInstance.getNodes()) {
// node.opacity = 1
// this.allData.nodes.forEach((item, index) => {
// if (item.id === node.id) {
// node.color = item.color
// }
// })
// }
// for (const link of graphInstance.getLinks()) {
// link.relations.forEach(line => {
// line.color = undefined
// })
// }
const _all_nodes = this.$refs.graphRef.getInstance().getNodes()
_all_nodes.forEach((thisNode) => {
const _isHideThisNode = true
thisNode.opacity = _isHideThisNode ? 1 : 0.1
})
},
// onLineClick(lineObject, linkObject, $event) {
// console.log('onLineClick:', lineObject)
// },
showNodeTips(nodeObject, $event) {
this.currentNode = nodeObject
const _base_position = this.$refs.graphRef.getInstance().options.fullscreen ? { x: 0, y: 0 } : this.$refs.myPage.getBoundingClientRect()
// console.log('showNodeMenus:', this.$refs.graphRef.getInstance().options.fullscreen, $event.clientX, $event.clientY, _base_position)
this.isShowNodeTipsPanel = true
this.nodeMenuPanelPosition.x = $event.clientX - _base_position.x + 10
this.nodeMenuPanelPosition.y = $event.clientY - _base_position.y + 10
},
hideNodeTips(nodeObject, $event) {
this.isShowNodeTipsPanel = false
}
}
}
</script>
<style>
</style>
<style lang="scss" scoped>
::v-deep .rel-toolbar{
color: #000;
.c-current-zoom{
color: #000;
}
}
// .my-graph{
// // background: linear-gradient(to right, rgb(16, 185, 129), rgb(101, 163, 13));
// }
.c-my-rg-node {
font-size: 13px;
border-radius: 50%;
cursor: pointer;
height: 80px;
display: flex;
justify-content: center;
align-items: center;
}
.c-node-menu-item{
line-height: 30px;
padding-left: 10px;cursor: pointer;color: #444444;font-size: 14px;border-top:#efefef solid 1px;
}
.c-node-menu-item:hover{
background-color: rgba(66,187,66,0.2);
}
.c-big-style{
font-size: 30px;
}
::v-deep .c-rg-line-text{
font-size: 10px !important;
// fill: red !important;
}
</style>

6
src/views/storeManage/deviceManage/index.vue

@ -34,13 +34,13 @@
<el-col class="curd-in-out" style="height: calc(100vh - 190px)" :xs="10" :sm="8" :md="4" :lg="4" :xl="4"> <el-col class="curd-in-out" style="height: calc(100vh - 190px)" :xs="10" :sm="8" :md="4" :lg="4" :xl="4">
<div class="crud-opts"> <div class="crud-opts">
<div class="crud-opts-left"> <div class="crud-opts-left">
<el-button v-permission="permission.add" size="mini" icon="el-icon-plus" :disabled="crud.selections[0] && crud.selections[0].id && crud.selections[0].id !== defaultExpandedKeys[0]" @click="crud.toAdd">
<el-button size="mini" icon="el-icon-plus" :disabled="crud.selections[0] && crud.selections[0].id && crud.selections[0].id !== defaultExpandedKeys[0]" @click="crud.toAdd">
新增 新增
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" icon="el-icon-edit" :disabled="crud.selections.length !== 1 || crud.selections[0].id && crud.selections[0].id === defaultExpandedKeys[0]" @click="crud.toEdit(crud.selections[0])">
<el-button size="mini" icon="el-icon-edit" :disabled="crud.selections.length !== 1 || crud.selections[0].id && crud.selections[0].id === defaultExpandedKeys[0]" @click="crud.toEdit(crud.selections[0])">
修改 修改
</el-button> </el-button>
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length !== 1 || crud.selections[0].id && crud.selections[0].id === defaultExpandedKeys[0]" @click="toDelete(crud.selections)">删除</el-button>
<el-button icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length !== 1 || crud.selections[0].id && crud.selections[0].id === defaultExpandedKeys[0]" @click="toDelete(crud.selections)">删除</el-button>
</div> </div>
</div> </div>
<!--区域树状结构--> <!--区域树状结构-->

4
src/views/storeManage/deviceManage/module/deviceDetail.vue

@ -4,10 +4,10 @@
<div class="head-container" style="padding:0 0 20px 0"> <div class="head-container" style="padding:0 0 20px 0">
<crudOperation :permission="permission"> <crudOperation :permission="permission">
<template v-slot:left> <template v-slot:left>
<el-button v-permission="permission.add" size="mini" type="primary" icon="el-icon-plus" :disabled="!activeAddBtn" @click="selectDeviceType">新增</el-button>
<el-button size="mini" type="primary" icon="el-icon-plus" :disabled="!activeAddBtn" @click="selectDeviceType">新增</el-button>
</template> </template>
<template v-slot:right> <template v-slot:right>
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections && crud.selections.length === 0" @click="toDelete(crud.selections)">删除</el-button>
<el-button icon="el-icon-delete" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections && crud.selections.length === 0" @click="toDelete(crud.selections)">删除</el-button>
<el-select v-model="deviceType" class="filter-item" style="margin-left:10px" placeholder="全部" @change="crud.toQuery"> <el-select v-model="deviceType" class="filter-item" style="margin-left:10px" placeholder="全部" @change="crud.toQuery">
<el-option :key="0" label="全部" value="" /> <el-option :key="0" label="全部" value="" />
<el-option v-for="item in deviceTypeOptions" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in deviceTypeOptions" :key="item.id" :label="item.name" :value="item.id" />

2
src/views/storeManage/tagManage/tagLog/index.vue

@ -2,7 +2,7 @@
<div> <div>
<div class="head-container"> <div class="head-container">
<!-- <crudOperation /> --> <!-- <crudOperation /> -->
<el-button v-permission="permission.download" :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="handleExport">导出</el-button>
<el-button :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="handleExport">导出</el-button>
<el-select v-model="bindingType" class="filter-item" style="width: 130px; height: 30px;margin:0 25px 0 10px" @change="crud.toQuery"> <el-select v-model="bindingType" class="filter-item" style="width: 130px; height: 30px;margin:0 25px 0 10px" @change="crud.toQuery">
<el-option v-for="item in bindingTypeOptions" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in bindingTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>

6
src/views/system/archiveScopeManage/module/tableList.vue

@ -5,15 +5,15 @@
<div class="head-container"> <div class="head-container">
<crudOperation :permission="permission"> <crudOperation :permission="permission">
<template v-slot:left> <template v-slot:left>
<el-button v-permission="permission.add" size="mini" @click="crud.toAdd">
<el-button size="mini" @click="crud.toAdd">
<i class="iconfont icon-xinzeng" /> <i class="iconfont icon-xinzeng" />
新增 新增
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" :disabled="selections.length !== 1" @click="crud.toEdit(selections[0])">
<el-button size="mini" :disabled="selections.length !== 1" @click="crud.toEdit(selections[0])">
<i class="iconfont icon-bianji" /> <i class="iconfont icon-bianji" />
编辑 编辑
</el-button> </el-button>
<el-button slot="reference" v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="selections.length === 0" @click="toDelete(selections)">
<el-button slot="reference" size="mini" :loading="crud.delAllLoading" :disabled="selections.length === 0" @click="toDelete(selections)">
<i class="iconfont icon-shanchu" /> <i class="iconfont icon-shanchu" />
删除 删除
</el-button> </el-button>

2
src/views/system/archivesCategory/fieldManage/index.vue

@ -3,7 +3,7 @@
<div class="head-container"> <div class="head-container">
<crudOperation :permission="permission" crud-tag="field"> <crudOperation :permission="permission" crud-tag="field">
<template v-slot:right> <template v-slot:right>
<el-button v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"><i class="iconfont icon-shanchu" />删除</el-button>
<el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"><i class="iconfont icon-shanchu" />删除</el-button>
<el-button size="mini" @click="toQuick"><i class="iconfont icon-kuaisushezhi" />快速设置</el-button> <el-button size="mini" @click="toQuick"><i class="iconfont icon-kuaisushezhi" />快速设置</el-button>
</template> </template>
</crudOperation> </crudOperation>

8
src/views/system/archivesCategory/fileNoFormat/index.vue

@ -2,7 +2,7 @@
<div class="format-main"> <div class="format-main">
<div class="format-main-left"> <div class="format-main-left">
<div class="head-container"> <div class="head-container">
<el-button v-permission="permission.add" size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0" @click="toAdd(table.left.selections)">
<el-button size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0" @click="toAdd(table.left.selections)">
插入 插入
</el-button> </el-button>
</div> </div>
@ -18,13 +18,13 @@
<div class="format-main-right"> <div class="format-main-right">
<div class="head-container"> <div class="head-container">
<!-- type="danger" --> <!-- type="danger" -->
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
<el-button icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
移除 移除
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
<el-button size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
编辑 编辑
</el-button> </el-button>
<el-button v-permission="permission.sort" icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
<el-button icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
</div> </div>
<!--表格渲染--> <!--表格渲染-->
<el-table ref="rightTable" v-loading="table.right.loading" :data="table.right.data" style="min-width: 100%;" height="calc(100vh - 302px)" @selection-change="(val)=>selectionChangeHandler(val,'right')" @row-click="(row,column,e)=>clickRowHandler(row,column,e,'rightTable')"> <el-table ref="rightTable" v-loading="table.right.loading" :data="table.right.data" style="min-width: 100%;" height="calc(100vh - 302px)" @selection-change="(val)=>selectionChangeHandler(val,'right')" @row-click="(row,column,e)=>clickRowHandler(row,column,e,'rightTable')">

8
src/views/system/archivesCategory/index.vue

@ -7,21 +7,21 @@
<crudOperation :permission="permission"> <crudOperation :permission="permission">
<template v-slot:left> <template v-slot:left>
<!-- crud.selections.length === 0 || crud.selections[0].isType === 2 || crud.selections[0].isType === 3 || crud.selections[0].isType === 5 --> <!-- crud.selections.length === 0 || crud.selections[0].isType === 2 || crud.selections[0].isType === 3 || crud.selections[0].isType === 5 -->
<el-button v-permission="permission.add" size="mini" :disabled="crud.selections.length === 0 || crud.selections[0].isType !== 1 || crud.selections[0].isType === 3" @click="crud.toAdd">
<el-button size="mini" :disabled="crud.selections.length === 0 || crud.selections[0].isType !== 1 || crud.selections[0].isType === 3" @click="crud.toAdd">
<i class="iconfont icon-xinzeng" /> <i class="iconfont icon-xinzeng" />
新增 新增
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" :disabled="crud.selections.length !== 1 || crud.selections[0].pid === '0' || crud.selections[0].isType === 3" @click="crud.toEdit(crud.selections[0])">
<el-button size="mini" :disabled="crud.selections.length !== 1 || crud.selections[0].pid === '0' || crud.selections[0].isType === 3" @click="crud.toEdit(crud.selections[0])">
<i class="iconfont icon-bianji" /> <i class="iconfont icon-bianji" />
编辑 编辑
</el-button> </el-button>
</template> </template>
<template v-slot:right> <template v-slot:right>
<el-button v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0 || (crud.selections.length === 1 && crud.selections[0].pid === '0' ) || crud.selections[0].isType === 3" @click="toDelete(crud.selections)">
<el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0 || (crud.selections.length === 1 && crud.selections[0].pid === '0' ) || crud.selections[0].isType === 3" @click="toDelete(crud.selections)">
<i class="iconfont icon-shanchu" /> <i class="iconfont icon-shanchu" />
删除 删除
</el-button> </el-button>
<el-button v-permission="permission.sort" icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="brotherNodeNum <= 1 || crud.selections[0].pid === '0' " @click="toSort(crud.selections)">排序</el-button>
<el-button icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="brotherNodeNum <= 1 || crud.selections[0].pid === '0' " @click="toSort(crud.selections)">排序</el-button>
</template> </template>
</crudOperation> </crudOperation>
</div> </div>

8
src/views/system/archivesCategory/listBrowsing/index.vue

@ -3,7 +3,7 @@
<div class="format-main"> <div class="format-main">
<div class="format-main-left"> <div class="format-main-left">
<div class="head-container"> <div class="head-container">
<el-button v-permission="permission.add" size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0" @click="toAdd(table.left.selections)">
<el-button size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0" @click="toAdd(table.left.selections)">
插入 插入
</el-button> </el-button>
</div> </div>
@ -18,14 +18,14 @@
</div> </div>
<div class="format-main-right"> <div class="format-main-right">
<div class="head-container"> <div class="head-container">
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
<el-button icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
移除 移除
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
<el-button size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
编辑 编辑
</el-button> </el-button>
<!-- type="danger" --> <!-- type="danger" -->
<el-button v-permission="permission.sort" icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
<el-button icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
</div> </div>
<!--表格渲染--> <!--表格渲染-->
<el-table ref="rightTable" v-loading="table.right.loading" :data="table.right.data" height="calc(100vh - 602px)" @selection-change="(val)=>selectionChangeHandler(val,'right')" @row-click="(row,column,e)=>clickRowHandler(row,column,e,'rightTable')"> <el-table ref="rightTable" v-loading="table.right.loading" :data="table.right.data" height="calc(100vh - 602px)" @selection-change="(val)=>selectionChangeHandler(val,'right')" @row-click="(row,column,e)=>clickRowHandler(row,column,e,'rightTable')">

8
src/views/system/archivesCategory/orderingRule/index.vue

@ -2,7 +2,7 @@
<div class="format-main"> <div class="format-main">
<div class="format-main-left"> <div class="format-main-left">
<div class="head-container"> <div class="head-container">
<el-button v-permission="permission.add" size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0 || orderFieldsSum >5" @click="toAdd(table.left.selections)">
<el-button size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0 || orderFieldsSum >5" @click="toAdd(table.left.selections)">
插入 插入
</el-button> </el-button>
</div> </div>
@ -18,13 +18,13 @@
<div class="format-main-right"> <div class="format-main-right">
<div class="head-container"> <div class="head-container">
<!-- type="danger" --> <!-- type="danger" -->
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
<el-button icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
移除 移除
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
<el-button size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
编辑 编辑
</el-button> </el-button>
<el-button v-permission="permission.sort" icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
<el-button icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
<span class="tip">注意最多只可选择5个字段进行排序</span> <span class="tip">注意最多只可选择5个字段进行排序</span>
</div> </div>
<!--表格渲染--> <!--表格渲染-->

8
src/views/system/archivesClassify/module/tableList.vue

@ -3,17 +3,17 @@
<div class="elect-cont-right"> <div class="elect-cont-right">
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<crudOperation :permission="permission">
<crudOperation>
<template v-slot:left> <template v-slot:left>
<el-button v-permission="permission.add" size="mini" @click="crud.toAdd">
<el-button size="mini" @click="crud.toAdd">
<i class="iconfont icon-xinzeng" /> <i class="iconfont icon-xinzeng" />
新增 新增
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" :disabled="selections.length !== 1" @click="crud.toEdit(selections[0])">
<el-button size="mini" :disabled="selections.length !== 1" @click="crud.toEdit(selections[0])">
<i class="iconfont icon-bianji" /> <i class="iconfont icon-bianji" />
编辑 编辑
</el-button> </el-button>
<el-button slot="reference" v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="selections.length === 0" @click="toDelete(selections)">
<el-button slot="reference" size="mini" :loading="crud.delAllLoading" :disabled="selections.length === 0" @click="toDelete(selections)">
<i class="iconfont icon-shanchu" /> <i class="iconfont icon-shanchu" />
删除 删除
</el-button> </el-button>

4
src/views/system/dict/dictDetail.vue

@ -3,10 +3,10 @@
<div class="head-container"> <div class="head-container">
<crudOperation :permission="permission"> <crudOperation :permission="permission">
<template v-slot:left> <template v-slot:left>
<el-button v-permission="permission.add" size="mini" type="primary" :disabled="!activeAddBtn" @click="crud.toAdd"><i class="iconfont icon-xinzeng" />新增</el-button>
<el-button size="mini" type="primary" :disabled="!activeAddBtn" @click="crud.toAdd"><i class="iconfont icon-xinzeng" />新增</el-button>
</template> </template>
<template v-slot:right> <template v-slot:right>
<el-button v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"><i class="iconfont icon-shanchu" />删除</el-button>
<el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"><i class="iconfont icon-shanchu" />删除</el-button>
</template> </template>
</crudOperation> </crudOperation>
</div> </div>

2
src/views/system/fileLibraryManage/fieldManage/index.vue

@ -3,7 +3,7 @@
<div class="head-container"> <div class="head-container">
<crudOperation :permission="permission" crud-tag="field"> <crudOperation :permission="permission" crud-tag="field">
<template v-slot:right> <template v-slot:right>
<el-button v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"><i class="iconfont icon-shanchu" />删除</el-button>
<el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"><i class="iconfont icon-shanchu" />删除</el-button>
<el-button size="mini" @click="toQuick"><i class="iconfont icon-kuaisushezhi" />快速设置</el-button> <el-button size="mini" @click="toQuick"><i class="iconfont icon-kuaisushezhi" />快速设置</el-button>
</template> </template>
</crudOperation> </crudOperation>

8
src/views/system/fileLibraryManage/index.vue

@ -6,21 +6,21 @@
<div class="head-container"> <div class="head-container">
<crudOperation :permission="permission"> <crudOperation :permission="permission">
<template v-slot:left> <template v-slot:left>
<el-button v-permission="permission.add" size="mini" :disabled="crud.selections.length === 0 || crud.selections[0].isType !== 1 || crud.selections[0].isType === 3" @click="crud.toAdd">
<el-button size="mini" :disabled="crud.selections.length === 0 || crud.selections[0].isType !== 1 || crud.selections[0].isType === 3" @click="crud.toAdd">
<i class="iconfont icon-xinzeng" /> <i class="iconfont icon-xinzeng" />
新增 新增
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" :disabled="crud.selections.length !== 1 || crud.selections[0].pid === '0' || crud.selections[0].isType === 3" @click="crud.toEdit(crud.selections[0])">
<el-button size="mini" :disabled="crud.selections.length !== 1 || crud.selections[0].pid === '0' || crud.selections[0].isType === 3" @click="crud.toEdit(crud.selections[0])">
<i class="iconfont icon-bianji" /> <i class="iconfont icon-bianji" />
编辑 编辑
</el-button> </el-button>
</template> </template>
<template v-slot:right> <template v-slot:right>
<el-button v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0 || (crud.selections.length === 1 && crud.selections[0].pid === '0' ) || crud.selections[0].isType === 3" @click="toDelete(crud.selections)">
<el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0 || (crud.selections.length === 1 && crud.selections[0].pid === '0' ) || crud.selections[0].isType === 3" @click="toDelete(crud.selections)">
<i class="iconfont icon-shanchu" /> <i class="iconfont icon-shanchu" />
删除 删除
</el-button> </el-button>
<el-button v-permission="permission.sort" icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="brotherNodeNum <= 1 || crud.selections[0].pid === '0' || crud.selections[0].isType === 3 " @click="toSort(crud.selections)">排序</el-button>
<el-button icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="brotherNodeNum <= 1 || crud.selections[0].pid === '0' || crud.selections[0].isType === 3 " @click="toSort(crud.selections)">排序</el-button>
</template> </template>
</crudOperation> </crudOperation>
</div> </div>

8
src/views/system/fileLibraryManage/listBrowsing/index.vue

@ -3,7 +3,7 @@
<div class="format-main"> <div class="format-main">
<div class="format-main-left"> <div class="format-main-left">
<div class="head-container"> <div class="head-container">
<el-button v-permission="permission.add" size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0" @click="toAdd(table.left.selections)">
<el-button size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0" @click="toAdd(table.left.selections)">
插入 插入
</el-button> </el-button>
</div> </div>
@ -18,14 +18,14 @@
</div> </div>
<div class="format-main-right"> <div class="format-main-right">
<div class="head-container"> <div class="head-container">
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
<el-button icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
移除 移除
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
<el-button size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
编辑 编辑
</el-button> </el-button>
<!-- type="danger" --> <!-- type="danger" -->
<el-button v-permission="permission.sort" icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
<el-button icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
</div> </div>
<!--表格渲染--> <!--表格渲染-->
<el-table ref="rightTable" v-loading="table.right.loading" :data="table.right.data" height="calc(100vh - 602px)" @selection-change="(val)=>selectionChangeHandler(val,'right')" @row-click="(row,column,e)=>clickRowHandler(row,column,e,'rightTable')"> <el-table ref="rightTable" v-loading="table.right.loading" :data="table.right.data" height="calc(100vh - 602px)" @selection-change="(val)=>selectionChangeHandler(val,'right')" @row-click="(row,column,e)=>clickRowHandler(row,column,e,'rightTable')">

8
src/views/system/fileLibraryManage/orderingRule/index.vue

@ -2,7 +2,7 @@
<div class="format-main"> <div class="format-main">
<div class="format-main-left"> <div class="format-main-left">
<div class="head-container"> <div class="head-container">
<el-button v-permission="permission.add" size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0 || orderFieldsSum >5" @click="toAdd(table.left.selections)">
<el-button size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0 || orderFieldsSum >5" @click="toAdd(table.left.selections)">
插入 插入
</el-button> </el-button>
</div> </div>
@ -18,13 +18,13 @@
<div class="format-main-right"> <div class="format-main-right">
<div class="head-container"> <div class="head-container">
<!-- type="danger" --> <!-- type="danger" -->
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
<el-button icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
移除 移除
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
<el-button size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
编辑 编辑
</el-button> </el-button>
<el-button v-permission="permission.sort" icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
<el-button icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
<span class="tip">注意最多只可选择5个字段进行排序</span> <span class="tip">注意最多只可选择5个字段进行排序</span>
</div> </div>
<!--表格渲染--> <!--表格渲染-->

6
src/views/system/metadata/index.vue

@ -6,17 +6,17 @@
<div class="head-container"> <div class="head-container">
<crudOperation :permission="permission"> <crudOperation :permission="permission">
<template v-slot:left> <template v-slot:left>
<el-button v-permission="permission.add" size="mini" :disabled="selectedTreeItem.parentsId !== null " @click="crud.toAdd">
<el-button size="mini" :disabled="selectedTreeItem.parentsId !== null " @click="crud.toAdd">
<i class="iconfont icon-xinzeng" /> <i class="iconfont icon-xinzeng" />
新增 新增
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" :disabled="selectedTreeItem.parentsId === null" @click="crud.toEdit(selectedTreeItem)">
<el-button size="mini" :disabled="selectedTreeItem.parentsId === null" @click="crud.toEdit(selectedTreeItem)">
<i class="iconfont icon-bianji" /> <i class="iconfont icon-bianji" />
编辑 编辑
</el-button> </el-button>
</template> </template>
<template v-slot:right> <template v-slot:right>
<el-button v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="selectedTreeItem.parentsId === null" @click="toDelete(selectedTreeItem)">
<el-button size="mini" :loading="crud.delAllLoading" :disabled="selectedTreeItem.parentsId === null" @click="toDelete(selectedTreeItem)">
<i class="iconfont icon-shanchu" /> <i class="iconfont icon-shanchu" />
删除 删除
</el-button> </el-button>

2
src/views/system/subjectLibraryManage/fieldManage/index.vue

@ -3,7 +3,7 @@
<div class="head-container"> <div class="head-container">
<crudOperation :permission="permission" crud-tag="field"> <crudOperation :permission="permission" crud-tag="field">
<template v-slot:right> <template v-slot:right>
<el-button v-permission="permission.del" size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"><i class="iconfont icon-shanchu" />删除</el-button>
<el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)"><i class="iconfont icon-shanchu" />删除</el-button>
<el-button size="mini" @click="toQuick"><i class="iconfont icon-kuaisushezhi" />快速设置</el-button> <el-button size="mini" @click="toQuick"><i class="iconfont icon-kuaisushezhi" />快速设置</el-button>
</template> </template>
</crudOperation> </crudOperation>

8
src/views/system/subjectLibraryManage/listBrowsing/index.vue

@ -3,7 +3,7 @@
<div class="format-main"> <div class="format-main">
<div class="format-main-left"> <div class="format-main-left">
<div class="head-container"> <div class="head-container">
<el-button v-permission="permission.add" size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0" @click="toAdd(table.left.selections)">
<el-button size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0" @click="toAdd(table.left.selections)">
插入 插入
</el-button> </el-button>
</div> </div>
@ -18,14 +18,14 @@
</div> </div>
<div class="format-main-right"> <div class="format-main-right">
<div class="head-container"> <div class="head-container">
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
<el-button icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
移除 移除
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
<el-button size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
编辑 编辑
</el-button> </el-button>
<!-- type="danger" --> <!-- type="danger" -->
<el-button v-permission="permission.sort" icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
<el-button icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
</div> </div>
<!--表格渲染--> <!--表格渲染-->
<el-table ref="rightTable" v-loading="table.right.loading" :data="table.right.data" height="calc(100vh - 586px)" @selection-change="(val)=>selectionChangeHandler(val,'right')" @row-click="(row,column,e)=>clickRowHandler(row,column,e,'rightTable')"> <el-table ref="rightTable" v-loading="table.right.loading" :data="table.right.data" height="calc(100vh - 586px)" @selection-change="(val)=>selectionChangeHandler(val,'right')" @row-click="(row,column,e)=>clickRowHandler(row,column,e,'rightTable')">

8
src/views/system/subjectLibraryManage/orderingRule/index.vue

@ -2,7 +2,7 @@
<div class="format-main"> <div class="format-main">
<div class="format-main-left"> <div class="format-main-left">
<div class="head-container"> <div class="head-container">
<el-button v-permission="permission.add" size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0 || orderFieldsSum >5" @click="toAdd(table.left.selections)">
<el-button size="mini" icon="el-icon-plus" :disabled="table.left.selections.length == 0 || orderFieldsSum >5" @click="toAdd(table.left.selections)">
插入 插入
</el-button> </el-button>
</div> </div>
@ -18,13 +18,13 @@
<div class="format-main-right"> <div class="format-main-right">
<div class="head-container"> <div class="head-container">
<!-- type="danger" --> <!-- type="danger" -->
<el-button v-permission="permission.del" icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
<el-button icon="el-icon-delete" size="mini" :loading="delAllLoading" :disabled="table.right.selections.length === 0" @click="toDelete(table.right.selections)">
移除 移除
</el-button> </el-button>
<el-button v-permission="permission.edit" size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
<el-button size="mini" icon="el-icon-edit" :disabled="table.right.selections.length === 0" @click="toEdit(table.right.selections)">
编辑 编辑
</el-button> </el-button>
<el-button v-permission="permission.sort" icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
<el-button icon="el-icon-sort" size="mini" :loading="sortLoading" :disabled="table.right.data <= 1" @click="toSort">排序</el-button>
<span class="tip">注意最多只可选择5个字段进行排序</span> <span class="tip">注意最多只可选择5个字段进行排序</span>
</div> </div>
<!--表格渲染--> <!--表格渲染-->

Loading…
Cancel
Save