@@ -619,3 +619,30 @@ export namespace StatsAnalysis { | |||||
name: string; | name: string; | ||||
} | } | ||||
} | } | ||||
// 语义管理模块 | |||||
export namespace Semantics { | |||||
// 列表查询请求参数 | |||||
export interface ReqSemanticsParams extends ReqPage { | |||||
semanticsName: string; | |||||
updateTime: string; | |||||
dataSources: string; | |||||
} | |||||
// 列表参数 | |||||
export interface ResSemanticsList extends ListCommon { | |||||
[key: string]: any; | |||||
} | |||||
} | |||||
// 语义关联管理模块 | |||||
export namespace SemanticsAssociation { | |||||
// 列表查询请求参数 | |||||
export interface ReqSemanticsAssociationParams extends ReqPage { | |||||
semanticsName: string; | |||||
updateTime: string; | |||||
dataSources: string; | |||||
} | |||||
// 列表参数 | |||||
export interface ResSemanticsAssociationList extends ListCommon { | |||||
[key: string]: any; | |||||
} | |||||
} |
@@ -23,9 +23,9 @@ export const getCodeImgApi = () => { | |||||
// 获取菜单列表 | // 获取菜单列表 | ||||
export const getAuthMenuListApi = () => { | export const getAuthMenuListApi = () => { | ||||
return http.get<Menu.MenuOptions[]>(PORT1 + `/getRouters`, {}, { loading: false }); | |||||
// return http.get<Menu.MenuOptions[]>(PORT1 + `/getRouters`, {}, { loading: false }); | |||||
// 如果想让菜单变为本地数据,注释上一行代码,并引入本地 authMenuList.json 数据 | // 如果想让菜单变为本地数据,注释上一行代码,并引入本地 authMenuList.json 数据 | ||||
// console.log("getAuthMenuListApi", ruoyiAuthMenuList); | |||||
console.log("getAuthMenuListApi", ruoyiAuthMenuList); | |||||
http.get<Menu.MenuOptions[]>(PORT1 + `/getRouters`, {}, { loading: false }); | http.get<Menu.MenuOptions[]>(PORT1 + `/getRouters`, {}, { loading: false }); | ||||
return ruoyiAuthMenuList; | return ruoyiAuthMenuList; | ||||
}; | }; | ||||
@@ -3,16 +3,329 @@ | |||||
"code": 200, | "code": 200, | ||||
"data": [ | "data": [ | ||||
{ | { | ||||
"name": "home", | |||||
"path": "/home/index", | |||||
"name": "Corpus", | |||||
"path": "/corpus", | |||||
"hidden": true, | |||||
"redirect": "noRedirect", | |||||
"component": "Layout", | |||||
"alwaysShow": true, | |||||
"meta": { | |||||
"title": "语料库", | |||||
"icon": "Briefcase", | |||||
"noCache": false, | |||||
"link": null | |||||
}, | |||||
"children": [ | |||||
{ | |||||
"name": "/corpus/first-clause", | |||||
"path": "/corpus/first-clause", | |||||
"hidden": false, | |||||
"component": "/corpus/first-clause/index", | |||||
"meta": { | |||||
"title": "首见条文", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "/corpus/trace-origin", | |||||
"path": "/corpus/trace-origin", | |||||
"hidden": false, | |||||
"component": "/corpus/trace-origin/index", | |||||
"meta": { | |||||
"title": "条文溯源", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "/corpus/clause-trash", | |||||
"path": "/corpus/clause-trash", | |||||
"hidden": false, | |||||
"component": "/corpus/clause-trash/index", | |||||
"meta": { | |||||
"title": "条文回收站", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
} | |||||
] | |||||
}, | |||||
{ | |||||
"name": "Annotation", | |||||
"path": "/annotation", | |||||
"hidden": true, | |||||
"redirect": "noRedirect", | |||||
"component": "Layout", | |||||
"alwaysShow": true, | |||||
"meta": { | |||||
"title": "标注", | |||||
"icon": "Checked", | |||||
"noCache": false, | |||||
"link": null | |||||
}, | |||||
"children": [ | |||||
{ | |||||
"name": "/annotation/home", | |||||
"path": "/annotation/home", | |||||
"hidden": false, | |||||
"component": "/annotation/home/index", | |||||
"meta": { | |||||
"title": "标注首页", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "/annotation/division", | |||||
"path": "/annotation/division", | |||||
"hidden": false, | |||||
"component": "/annotation/division/index", | |||||
"meta": { | |||||
"title": "标注分工", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "/annotation/labeling", | |||||
"path": "/annotation/labeling", | |||||
"hidden": false, | |||||
"component": "/annotation/labeling/index", | |||||
"meta": { | |||||
"title": "数据标注", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "/annotation/audit", | |||||
"path": "/annotation/audit", | |||||
"hidden": false, | |||||
"component": "/annotation/audit/index", | |||||
"meta": { | |||||
"title": "标注审核", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "/annotation/tag", | |||||
"path": "/annotation/tag", | |||||
"hidden": false, | |||||
"component": "/annotation/tag/index", | |||||
"meta": { | |||||
"title": "标签管理", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "/annotation/lexicon", | |||||
"path": "/annotation/lexicon", | |||||
"hidden": false, | |||||
"component": "/annotation/lexicon/index", | |||||
"meta": { | |||||
"title": "词表库管理", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
} | |||||
] | |||||
}, | |||||
{ | |||||
"path": "/", | |||||
"hidden": true, | |||||
"component": "Layout", | |||||
"children": [ | |||||
{ | |||||
"name": "/retrieval", | |||||
"path": "/retrieval", | |||||
"hidden": true, | |||||
"component": "/retrieval/index", | |||||
"meta": { | |||||
"title": "检索", | |||||
"icon": "Promotion", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
} | |||||
] | |||||
}, | |||||
{ | |||||
"path": "/", | |||||
"hidden": true, | |||||
"component": "Layout", | |||||
"children": [ | |||||
{ | |||||
"name": "/stats-analysis", | |||||
"path": "/stats-analysis", | |||||
"hidden": true, | |||||
"component": "/stats-analysis/index", | |||||
"meta": { | |||||
"title": "统计分析", | |||||
"icon": "TrendCharts", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
} | |||||
] | |||||
}, | |||||
{ | |||||
"path": "/task", | |||||
"name": "Task", | |||||
"hidden": true, | |||||
"meta": { | |||||
"title": "任务管理", | |||||
"isFull": false | |||||
}, | |||||
"children": [ | |||||
{ | |||||
"path": "/task/home", | |||||
"name": "/task/home", | |||||
"component": "/task/home/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "任务首页", | |||||
"isFull": false | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/task/taskAllocation", | |||||
"name": "/task/taskAllocation", | |||||
"component": "/task/taskAllocation/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "任务分配", | |||||
"isFull": false | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/task/indexData", | |||||
"name": "/task/indexData", | |||||
"component": "/task/indexData/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "数据标引", | |||||
"isFull": false, | |||||
"isKeepAlive": true | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/task/indexData/operateIndex", | |||||
"name": "OperateIndex", | |||||
"component": "/task/indexData/operateIndex", | |||||
"meta": { | |||||
"title": "标引", | |||||
"isHide": true, | |||||
"isFull": false, | |||||
"activeMenu": "/task/indexData" | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/task/examine", | |||||
"name": "/task/examine", | |||||
"meta": { | |||||
"title": "标引审核", | |||||
"isFull": false | |||||
}, | |||||
"children": [ | |||||
{ | |||||
"path": "/task/examine/firstInstance", | |||||
"name": "/task/examine/firstInstance", | |||||
"component": "/task/examine/firstInstance/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "标引一审", | |||||
"isFull": false | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/task/examine/secondInstance", | |||||
"name": "/task/examine/secondInstance", | |||||
"component": "/task/examine/secondInstance/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "标引二审", | |||||
"isFull": false | |||||
} | |||||
} | |||||
] | |||||
} | |||||
] | |||||
}, | |||||
{ | |||||
"name": "index-template", | |||||
"path": "/indexTemplate", | |||||
"hidden": false, | "hidden": false, | ||||
"component": "/home/index", | |||||
"redirect": "noRedirect", | |||||
"component": "Layout", | |||||
"alwaysShow": true, | |||||
"meta": { | "meta": { | ||||
"title": "首页", | |||||
"icon": "HomeFilled", | |||||
"title": "标引模板管理", | |||||
"icon": "Memo", | |||||
"noCache": false, | "noCache": false, | ||||
"link": null | "link": null | ||||
} | |||||
}, | |||||
"children": [ | |||||
{ | |||||
"name": "/index-template/knowledgeManage", | |||||
"path": "/index-template/knowledgeManage", | |||||
"hidden": false, | |||||
"component": "/index-template/knowledgeManage/index", | |||||
"meta": { | |||||
"title": "知识管理", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "/index-template/semanticsManage", | |||||
"path": "/index-template/semanticsManage", | |||||
"hidden": false, | |||||
"component": "/index-template/semanticsManage/index", | |||||
"meta": { | |||||
"title": "语义管理", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "/index-template/semanticAssociationManage", | |||||
"path": "/index-template/semanticAssociationManage", | |||||
"hidden": false, | |||||
"component": "/index-template/semanticAssociationManage/index", | |||||
"meta": { | |||||
"title": "语义关联管理", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "/index-template/semanticsAudit", | |||||
"path": "/index-template/semanticsAudit", | |||||
"hidden": false, | |||||
"component": "/index-template/semanticsAudit/index", | |||||
"meta": { | |||||
"title": "语义审核", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
} | |||||
] | |||||
}, | }, | ||||
{ | { | ||||
"name": "System", | "name": "System", | ||||
@@ -29,52 +342,139 @@ | |||||
}, | }, | ||||
"children": [ | "children": [ | ||||
{ | { | ||||
"name": "accountManage", | |||||
"name": "/system/accountManage", | |||||
"path": "/system/accountManage", | "path": "/system/accountManage", | ||||
"hidden": false, | "hidden": false, | ||||
"component": "/system/accountManage/index", | "component": "/system/accountManage/index", | ||||
"meta": { | "meta": { | ||||
"title": "账号管理", | "title": "账号管理", | ||||
"icon": "Menu", | |||||
"icon": "#", | |||||
"noCache": false, | "noCache": false, | ||||
"link": null | "link": null | ||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"name": "roleManage", | |||||
"name": "/system/roleManage", | |||||
"path": "/system/roleManage", | "path": "/system/roleManage", | ||||
"hidden": false, | "hidden": false, | ||||
"component": "/system/roleManage/index", | "component": "/system/roleManage/index", | ||||
"meta": { | "meta": { | ||||
"title": "角色管理", | "title": "角色管理", | ||||
"icon": "Menu", | |||||
"icon": "#", | |||||
"noCache": false, | "noCache": false, | ||||
"link": null | "link": null | ||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"name": "menuMange", | |||||
"name": "/system/menuMange", | |||||
"path": "/system/menuMange", | "path": "/system/menuMange", | ||||
"hidden": false, | "hidden": false, | ||||
"component": "/system/menuMange/index", | "component": "/system/menuMange/index", | ||||
"meta": { | "meta": { | ||||
"title": "菜单管理", | "title": "菜单管理", | ||||
"icon": "Menu", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/system/logManage", | |||||
"name": "/system/logManage", | |||||
"component": "/system/logManage/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "日志管理", | |||||
"isFull": false | |||||
} | |||||
}, | |||||
{ | |||||
"name": "/system/postManage", | |||||
"path": "/system/postManage", | |||||
"hidden": true, | |||||
"component": "/system/postManage/index", | |||||
"meta": { | |||||
"title": "岗位管理", | |||||
"icon": "#", | |||||
"noCache": false, | "noCache": false, | ||||
"link": null | "link": null | ||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
"name": "departmentManage", | |||||
"path": "/system/departmentManage", | |||||
"name": "/system/dictManage", | |||||
"path": "/system/dictManage", | |||||
"hidden": false, | "hidden": false, | ||||
"component": "/system/departmentManage/index", | |||||
"component": "/system/dictManage/index", | |||||
"meta": { | |||||
"title": "字典管理", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "Config", | |||||
"path": "config", | |||||
"hidden": true, | |||||
"component": "system/config/index", | |||||
"meta": { | |||||
"title": "参数设置", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"isHide": true, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "Notice", | |||||
"path": "notice", | |||||
"hidden": true, | |||||
"component": "system/notice/index", | |||||
"meta": { | "meta": { | ||||
"title": "部门管理", | |||||
"icon": "Menu", | |||||
"title": "通知公告", | |||||
"icon": "#", | |||||
"noCache": false, | "noCache": false, | ||||
"link": null | "link": null | ||||
} | } | ||||
}, | |||||
{ | |||||
"name": "Log", | |||||
"path": "log", | |||||
"hidden": true, | |||||
"redirect": "noRedirect", | |||||
"component": "ParentView", | |||||
"alwaysShow": true, | |||||
"meta": { | |||||
"title": "日志管理", | |||||
"icon": "#", | |||||
"noCache": false, | |||||
"link": null | |||||
}, | |||||
"children": [ | |||||
{ | |||||
"name": "Operlog", | |||||
"path": "operlog", | |||||
"hidden": false, | |||||
"component": "monitor/operlog/index", | |||||
"meta": { | |||||
"title": "操作日志", | |||||
"icon": "Menu", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "Logininfor", | |||||
"path": "logininfor", | |||||
"hidden": false, | |||||
"component": "monitor/logininfor/index", | |||||
"meta": { | |||||
"title": "登录日志", | |||||
"icon": "Menu", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
} | |||||
] | |||||
} | } | ||||
] | ] | ||||
} | } | ||||
@@ -0,0 +1,174 @@ | |||||
{ | |||||
"msg": "操作成功", | |||||
"code": 200, | |||||
"data": [ | |||||
{ | |||||
"name": "home", | |||||
"path": "/home/index", | |||||
"hidden": false, | |||||
"component": "/home/index", | |||||
"meta": { | |||||
"title": "首页", | |||||
"icon": "HomeFilled", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "System", | |||||
"path": "/system", | |||||
"hidden": false, | |||||
"redirect": "noRedirect", | |||||
"component": "Layout", | |||||
"alwaysShow": true, | |||||
"meta": { | |||||
"title": "系统管理", | |||||
"icon": "Tools", | |||||
"noCache": false, | |||||
"link": null | |||||
}, | |||||
"children": [ | |||||
{ | |||||
"name": "accountManage", | |||||
"path": "/system/accountManage", | |||||
"hidden": false, | |||||
"component": "/system/accountManage/index", | |||||
"meta": { | |||||
"title": "账号管理", | |||||
"icon": "Menu", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "roleManage", | |||||
"path": "/system/roleManage", | |||||
"hidden": false, | |||||
"component": "/system/roleManage/index", | |||||
"meta": { | |||||
"title": "角色管理", | |||||
"icon": "Menu", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "menuMange", | |||||
"path": "/system/menuMange", | |||||
"hidden": false, | |||||
"component": "/system/menuMange/index", | |||||
"meta": { | |||||
"title": "菜单管理", | |||||
"icon": "Menu", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"name": "departmentManage", | |||||
"path": "/system/departmentManage", | |||||
"hidden": false, | |||||
"component": "/system/departmentManage/index", | |||||
"meta": { | |||||
"title": "部门管理", | |||||
"icon": "Menu", | |||||
"noCache": false, | |||||
"link": null | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/system/logManage", | |||||
"name": "/system/logManage", | |||||
"component": "/system/logManage/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "日志管理", | |||||
"isFull": false | |||||
} | |||||
} | |||||
] | |||||
}, | |||||
{ | |||||
"path": "/task", | |||||
"name": "Task", | |||||
"meta": { | |||||
"title": "任务管理", | |||||
"isFull": false | |||||
}, | |||||
"children": [ | |||||
{ | |||||
"path": "/task/home", | |||||
"name": "/task/home", | |||||
"component": "/task/home/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "任务首页", | |||||
"isFull": false | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/task/taskAllocation", | |||||
"name": "/task/taskAllocation", | |||||
"component": "/task/taskAllocation/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "任务分配", | |||||
"isFull": false | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/task/indexData", | |||||
"name": "/task/indexData", | |||||
"component": "/task/indexData/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "数据标引", | |||||
"isFull": false, | |||||
"isKeepAlive": true | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/task/indexData/operateIndex", | |||||
"name": "OperateIndex", | |||||
"component": "/task/indexData/operateIndex", | |||||
"meta": { | |||||
"title": "标引", | |||||
"isHide": true, | |||||
"isFull": false, | |||||
"activeMenu": "/task/indexData" | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/task/examine", | |||||
"name": "/task/examine", | |||||
"meta": { | |||||
"title": "标引审核", | |||||
"isFull": false | |||||
}, | |||||
"children": [ | |||||
{ | |||||
"path": "/task/examine/firstInstance", | |||||
"name": "/task/examine/firstInstance", | |||||
"component": "/task/examine/firstInstance/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "标引一审", | |||||
"isFull": false | |||||
} | |||||
}, | |||||
{ | |||||
"path": "/task/examine/secondInstance", | |||||
"name": "/task/examine/secondInstance", | |||||
"component": "/task/examine/secondInstance/index", | |||||
"permissions": ["search:common", "search:advance"], | |||||
"meta": { | |||||
"title": "标引二审", | |||||
"isFull": false | |||||
} | |||||
} | |||||
] | |||||
} | |||||
] | |||||
} | |||||
] | |||||
} |
@@ -1,5 +1,5 @@ | |||||
.date-range-filter { | .date-range-filter { | ||||
display: inline-flex; | |||||
align-items: center; | |||||
width: 100%; | |||||
display: inline-flex; | |||||
align-items: center; | |||||
width: 100%; | |||||
} | } |
@@ -20,6 +20,14 @@ | |||||
<div class="header-button-lf"> | <div class="header-button-lf"> | ||||
<slot name="tableHeader" :selected-list="selectedList" :selected-list-ids="selectedListIds" :is-selected="isSelected" /> | <slot name="tableHeader" :selected-list="selectedList" :selected-list-ids="selectedListIds" :is-selected="isSelected" /> | ||||
</div> | </div> | ||||
<div class="header-button-ri"> | |||||
<slot | |||||
name="tableHeaderRight" | |||||
:selected-list="selectedList" | |||||
:selected-list-ids="selectedListIds" | |||||
:is-selected="isSelected" | |||||
></slot> | |||||
</div> | |||||
<div v-if="toolButton" class="header-button-ri"> | <div v-if="toolButton" class="header-button-ri"> | ||||
<slot name="toolButton"> | <slot name="toolButton"> | ||||
<el-button v-if="showToolButton('refresh')" :icon="Refresh" circle @click="getTableList" /> | <el-button v-if="showToolButton('refresh')" :icon="Refresh" circle @click="getTableList" /> | ||||
@@ -207,6 +215,11 @@ watch(tableData, val => { | |||||
// 接收 columns 并设置为响应式 | // 接收 columns 并设置为响应式 | ||||
const tableColumns = reactive<ColumnProps[]>(props.columns); | const tableColumns = reactive<ColumnProps[]>(props.columns); | ||||
// 接收 columns 并设置为响应式 | |||||
// const tableColumns = computed<ColumnProps[]>(() => { | |||||
// flatColumnsFunc(props.columns); // 执行数组扁平化 | |||||
// return props.columns; | |||||
// }); | |||||
// 扁平化 columns | // 扁平化 columns | ||||
const flatColumns = computed(() => flatColumnsFunc(tableColumns)); | const flatColumns = computed(() => flatColumnsFunc(tableColumns)); | ||||
@@ -0,0 +1 @@ | |||||
<!-- 设置语义关系 --> |
@@ -22,13 +22,38 @@ | |||||
@node-click="handleNodeClick" | @node-click="handleNodeClick" | ||||
@check="handleCheckChange" | @check="handleCheckChange" | ||||
> | > | ||||
<template #default="scope"> | |||||
<!-- <template #default="scope"> | |||||
<span class="el-tree-node__label"> | <span class="el-tree-node__label"> | ||||
<slot :row="scope"> | <slot :row="scope"> | ||||
{{ scope.node.label }} | {{ scope.node.label }} | ||||
</slot> | </slot> | ||||
</span> | </span> | ||||
</template> --> | |||||
<template #default="{ node, data }"> | |||||
<span class="custom-tree-node"> | |||||
{{ node.label }} | |||||
<!-- <template v-else> | |||||
<el-input v-model="editingNodeLabel" @blur="cancelEdit" @keyup.enter="updateNodeLabel(data)"></el-input> | |||||
</template> --> | |||||
<span> | |||||
<a :style="{ marginRight: '0.5rem' }" @click.stop="edit(node, data)"> | |||||
<el-icon :style="{ color: '#0000FF' }"> | |||||
<Edit /> | |||||
</el-icon> | |||||
</a> | |||||
<a :style="{ marginRight: '0.5rem' }" @click.stop="remove(node, data)"> | |||||
<el-icon :style="{ color: '#DA3434' }"> | |||||
<Delete /> | |||||
</el-icon> | |||||
</a> | |||||
</span> | |||||
</span> | |||||
</template> | </template> | ||||
<!-- <span slot-scope="{ node, data }"> | |||||
<span class="el-tree-node__label"> | |||||
{{ node.label }} | |||||
</span> | |||||
</span> --> | |||||
</el-tree> | </el-tree> | ||||
</el-scrollbar> | </el-scrollbar> | ||||
</div> | </div> | ||||
@@ -59,6 +84,11 @@ const defaultProps = { | |||||
label: props.label | label: props.label | ||||
}; | }; | ||||
/** 树形结构数据 */ | |||||
interface Tree { | |||||
[key: string]: any; | |||||
} | |||||
const treeRef = ref<InstanceType<typeof ElTree>>(); | const treeRef = ref<InstanceType<typeof ElTree>>(); | ||||
const treeData = ref<{ [key: string]: any }[]>([]); | const treeData = ref<{ [key: string]: any }[]>([]); | ||||
const treeAllData = ref<{ [key: string]: any }[]>([]); | const treeAllData = ref<{ [key: string]: any }[]>([]); | ||||
@@ -69,6 +99,30 @@ const setSelected = () => { | |||||
else selected.value = typeof props.defaultValue === "string" ? props.defaultValue : ""; | else selected.value = typeof props.defaultValue === "string" ? props.defaultValue : ""; | ||||
}; | }; | ||||
const edit = (node: Node, data: Tree) => { | |||||
console.log("node", node); | |||||
console.log("data", data); | |||||
console.log("打开弹窗"); | |||||
// const newChild = { id: id++, label: "testtest", children: [] }; | |||||
// if (!data.children) { | |||||
// data.children = []; | |||||
// } | |||||
// data.children.push(newChild); | |||||
// dataSource.value = [...dataSource.value]; | |||||
}; | |||||
/** 删除树节点 */ | |||||
const remove = (node: Node, data: Tree) => { | |||||
console.log("node", node); | |||||
console.log("data", data); | |||||
const parent = node?.parent; | |||||
const children: Tree[] = parent.data.children || parent.data; | |||||
const index = children.findIndex(d => d.id === data.id); | |||||
children.splice(index, 1); | |||||
const dataResult = props.multiple ? treeData : treeAllData; | |||||
dataResult.value = [...dataResult.value]; | |||||
}; | |||||
onBeforeMount(async () => { | onBeforeMount(async () => { | ||||
setSelected(); | setSelected(); | ||||
if (props.requestApi) { | if (props.requestApi) { | ||||
@@ -45,110 +45,7 @@ export const useAuthStore = defineStore({ | |||||
if (index > -1) { | if (index > -1) { | ||||
data.splice(index, 1, ...((data[index].children as Menu.MenuOptions[]) || [])); | data.splice(index, 1, ...((data[index].children as Menu.MenuOptions[]) || [])); | ||||
} | } | ||||
const routerArr = [ | |||||
{ | |||||
path: "/system/logManage", | |||||
name: "/system/logManage", | |||||
component: "/system/logManage/index", | |||||
permissions: ["search:common", "search:advance"], | |||||
meta: { | |||||
title: "日志管理", | |||||
isFull: false | |||||
} | |||||
}, | |||||
// { | |||||
// path: "/data-manage", | |||||
// name: "/data-manage", | |||||
// component: "/dataManage/index", | |||||
// meta: { | |||||
// title: "数据管理", | |||||
// isFull: false | |||||
// } | |||||
// }, | |||||
{ | |||||
path: "/task", | |||||
name: "Task", | |||||
meta: { | |||||
title: "任务管理", | |||||
isFull: false | |||||
}, | |||||
children: [ | |||||
{ | |||||
path: "/task/home", | |||||
name: "/task/home", | |||||
component: "/task/home/index", | |||||
permissions: ["search:common", "search:advance"], | |||||
meta: { | |||||
title: "任务首页", | |||||
isFull: false | |||||
} | |||||
}, | |||||
{ | |||||
path: "/task/taskAllocation", | |||||
name: "/task/taskAllocation", | |||||
component: "/task/taskAllocation/index", | |||||
permissions: ["search:common", "search:advance"], | |||||
meta: { | |||||
title: "任务分配", | |||||
isFull: false | |||||
} | |||||
}, | |||||
{ | |||||
path: "/task/indexData", | |||||
name: "/task/indexData", | |||||
component: "/task/indexData/index", | |||||
permissions: ["search:common", "search:advance"], | |||||
meta: { | |||||
title: "数据标引", | |||||
isFull: false, | |||||
isKeepAlive: true | |||||
} | |||||
}, | |||||
{ | |||||
path: "/task/indexData/operateIndex", | |||||
name: "OperateIndex", | |||||
component: "/task/indexData/operateIndex", | |||||
meta: { | |||||
title: "标引", | |||||
isHide: true, | |||||
isFull: false, | |||||
activeMenu: "/task/indexData" | |||||
} | |||||
}, | |||||
{ | |||||
path: "/task/examine", | |||||
name: "/task/examine", | |||||
meta: { | |||||
title: "标引审核", | |||||
isFull: false | |||||
}, | |||||
children: [ | |||||
{ | |||||
path: "/task/examine/firstInstance", | |||||
name: "/task/examine/firstInstance", | |||||
component: "/task/examine/firstInstance/index", | |||||
permissions: ["search:common", "search:advance"], | |||||
meta: { | |||||
title: "标引一审", | |||||
isFull: false | |||||
} | |||||
}, | |||||
{ | |||||
path: "/task/examine/secondInstance", | |||||
name: "/task/examine/secondInstance", | |||||
component: "/task/examine/secondInstance/index", | |||||
permissions: ["search:common", "search:advance"], | |||||
meta: { | |||||
title: "标引二审", | |||||
isFull: false | |||||
} | |||||
} | |||||
] | |||||
} | |||||
] | |||||
} | |||||
]; | |||||
this.authMenuList = ruoyiMenuAdapter(data).concat(routerArr); | |||||
this.authMenuList = ruoyiMenuAdapter(data); | |||||
console.log(111, this.authMenuList); | console.log(111, this.authMenuList); | ||||
}, | }, | ||||
// Set RouteName | // Set RouteName | ||||
@@ -42,7 +42,12 @@ export const useGlobalStore = defineStore({ | |||||
// 页脚 | // 页脚 | ||||
footer: false | footer: false | ||||
}), | }), | ||||
getters: {}, | |||||
getters: { | |||||
// 设置页面字体大小 | |||||
getBodyFontSize: (store: GlobalState) => { | |||||
return store.assemblySize === "large" ? "20" : store.assemblySize === "small" ? "16" : "18"; | |||||
} | |||||
}, | |||||
actions: { | actions: { | ||||
// Set GlobalState | // Set GlobalState | ||||
setGlobalState(...args: ObjToKeyValArray<GlobalState>) { | setGlobalState(...args: ObjToKeyValArray<GlobalState>) { | ||||
@@ -123,7 +123,6 @@ | |||||
padding-left: #{$i}px !important; | padding-left: #{$i}px !important; | ||||
} | } | ||||
} | } | ||||
.p0 { | .p0 { | ||||
padding: 0; | padding: 0; | ||||
} | } | ||||
@@ -297,6 +296,5 @@ | |||||
// 滚动条 | // 滚动条 | ||||
.scroll-y { | .scroll-y { | ||||
overflow-x: hidden; | |||||
overflow-y: auto; | |||||
overflow: hidden auto; | |||||
} | } |
@@ -0,0 +1,111 @@ | |||||
<template> | |||||
<el-dialog | |||||
v-model="dialogVisible" | |||||
:title="isAdd ? '添加' : '编辑'" | |||||
:width="500" | |||||
center | |||||
align-center | |||||
:close-on-click-modal="false" | |||||
@closed="handleBeforeClose" | |||||
> | |||||
<el-form :model="formData" ref="formRef" label-width="100px" :rules="formRules" class="mt20"> | |||||
<el-form-item label="知识元名称" prop="knowledgeName"> | |||||
<el-input v-model="formData.knowledgeName" placeholder="请输入知识元名称" /> | |||||
</el-form-item> | |||||
<el-form-item label="注释" prop="annotation"> | |||||
<el-input v-model="formData.annotation" placeholder="请输入注释" /> | |||||
</el-form-item> | |||||
</el-form> | |||||
<template #footer> | |||||
<span class="dialog-footer"> | |||||
<el-button @click="handleCancel">取消</el-button> | |||||
<el-button type="primary" class="ml30" v-throttle="handleSubmit">确定</el-button> | |||||
</span> | |||||
</template> | |||||
</el-dialog> | |||||
</template> | |||||
<script lang="ts" setup name="editKnowledge"> | |||||
import { ref, reactive, nextTick } from "vue"; | |||||
import { FormInstance, FormRules, ElMessage } from "element-plus"; | |||||
//* 接收注入 | |||||
const dialogVisible = ref(false); | |||||
//* data | |||||
//* ref | |||||
const formRef = ref<FormInstance>(); | |||||
const openPromise = ref<any>({}); | |||||
const isAdd = ref(false); | |||||
const formData = reactive<FormData>(getFormDefaultValue()); | |||||
interface FormData { | |||||
[key: string]: any; | |||||
} | |||||
function getFormDefaultValue(): FormData { | |||||
return { | |||||
knowledgeId: undefined, | |||||
parentId: 0, | |||||
annotation: undefined | |||||
}; | |||||
} | |||||
//* 方法 | |||||
// 校验规则 | |||||
let formRules = reactive<FormRules>({ | |||||
knowledgeName: [{ required: true, message: "知识体名称不能为空", trigger: "blur" }] | |||||
}); | |||||
// 取消 | |||||
function handleCancel() { | |||||
dialogVisible.value = false; | |||||
} | |||||
function handleBeforeClose() { | |||||
dialogVisible.value = false; | |||||
const defaultValue = getFormDefaultValue(); | |||||
for (const key of Object.keys(defaultValue)) { | |||||
formData[key] = defaultValue[key]; | |||||
} | |||||
nextTick(formRef.value?.clearValidate); | |||||
} | |||||
//提交 | |||||
function handleSubmit() { | |||||
console.log("提交"); | |||||
ElMessage.success("新增成功"); | |||||
openPromise.value.resolve(); | |||||
dialogVisible.value = false; | |||||
// formRef.value?.validate(async valid => { | |||||
// if (!valid) return; | |||||
// const params = { | |||||
// ...formData | |||||
// }; | |||||
// if (isAdd.value) { | |||||
// await addMenu(params); | |||||
// ElMessage.success("新增成功"); | |||||
// } else { | |||||
// await editMenu(params); | |||||
// ElMessage.success("编辑成功"); | |||||
// } | |||||
// openPromise.value.resolve(); | |||||
// dialogVisible.value = false; | |||||
// } | |||||
} | |||||
function open(params?: FormData) { | |||||
isAdd.value = !params?.knowledgeId; | |||||
dialogVisible.value = true; | |||||
if (params) { | |||||
if (params.knowledgeId) { | |||||
for (const key of Object.keys(formData)) { | |||||
formData[key] = params[key]; | |||||
} | |||||
} else { | |||||
formData.parentId = params.parentId; | |||||
} | |||||
} | |||||
return new Promise(resolve => { | |||||
openPromise.value.resolve = resolve; | |||||
}); | |||||
} | |||||
defineExpose({ | |||||
open | |||||
}); | |||||
</script> |
@@ -0,0 +1,86 @@ | |||||
<template> | |||||
<div class="main-box"> | |||||
<div class="table-box"> | |||||
<ProTable | |||||
ref="proTable" | |||||
row-key="menuId" | |||||
:columns="columns" | |||||
:request-api="getTableList" | |||||
:init-param="initParam" | |||||
:search-col="{ xs: 1, sm: 1, md: 2, lg: 3, xl: 3 }" | |||||
:pagination="false" | |||||
> | |||||
<!-- 表格 header 按钮 --> | |||||
<template #tableHeader> | |||||
<el-button type="primary" :icon="CirclePlus" @click="openDialog('isAdd')">添加知识体</el-button> | |||||
</template> | |||||
<!-- 表格操作 --> | |||||
<template #operation="scope"> | |||||
<el-button v-if="scope.row.parentId === 0" type="primary" link :icon="Plus">添加知识元</el-button> | |||||
<el-button type="primary" link :icon="EditPen" @click="openDialog(scope.row)"> 编辑 </el-button> | |||||
<!-- <el-button | |||||
:disabled="scope.row.menuType === 'F'" | |||||
type="primary" | |||||
link | |||||
:icon="Plus" | |||||
@click="openDialog({ parentId: scope.row.menuId })" | |||||
> | |||||
新增 | |||||
</el-button> --> | |||||
<el-button type="primary" link :icon="Delete" @click="handleDelete(scope.row)"> 删除 </el-button> | |||||
</template> | |||||
</ProTable> | |||||
<KnowledgeDialog ref="dialogRef" /> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script setup lang="ts" name="knowledgeManage"> | |||||
import { ref, reactive, provide } from "vue"; | |||||
import { Menu } from "@/api/interface"; | |||||
import { useHandleData } from "@/hooks/useHandleData"; | |||||
import ProTable from "@/components/ProTable/index.vue"; | |||||
import { ProTableInstance, ColumnProps } from "@/components/ProTable/interface"; | |||||
import KnowledgeDialog from "./components/KnowledgeDialog.vue"; | |||||
import { getMenuList, deleteMenu } from "@/api/modules/system/menu"; | |||||
import { generateTree } from "@/utils"; | |||||
import { Plus, CirclePlus, Delete, EditPen } from "@element-plus/icons-vue"; | |||||
// ProTable 实例 | |||||
const proTable = ref<ProTableInstance>(); | |||||
const menuOptions = ref<Menu.TreeMenu[]>([]); | |||||
// 如果表格需要初始化请求参数,直接定义传给 ProTable(之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据) | |||||
const initParam = reactive({}); | |||||
provide("menuOptions", menuOptions); | |||||
// 表格配置项 | |||||
const columns = reactive<ColumnProps<Menu.ResMenuList>[]>([ | |||||
{ prop: "menuName", label: "名称", align: "left", search: { el: "input" } }, | |||||
{ prop: "annotation", label: "注释" }, | |||||
{ prop: "createTime", label: "更新时间", search: { el: "date-range-picker", custom: true } }, | |||||
{ prop: "annotation", label: "更新人" }, | |||||
{ prop: "operation", label: "操作", width: 330, fixed: "right" } | |||||
]); | |||||
// 分页列表获取数据 | |||||
const getTableList = (params: Menu.ReqMenuParams) => { | |||||
return getMenuList(params).then(res => { | |||||
menuOptions.value = generateTree(res.data as any, { idField: "menuId" }) as Menu.TreeMenu[]; | |||||
return { | |||||
...res, | |||||
data: menuOptions.value | |||||
}; | |||||
}); | |||||
}; | |||||
// 删除 | |||||
const handleDelete = async (params: Menu.ResMenuList) => { | |||||
await useHandleData(deleteMenu, [params.menuId], `删除菜单【${params.menuName}】`); | |||||
proTable.value?.getTableList(); | |||||
}; | |||||
// 打开 drawer(新增、查看、编辑) | |||||
const dialogRef = ref<InstanceType<typeof KnowledgeDialog> | null>(null); | |||||
const openDialog = (row?: Partial<Menu.ResMenuList>) => { | |||||
dialogRef.value?.open(row).then(proTable.value?.getTableList); | |||||
}; | |||||
</script> |
@@ -0,0 +1,96 @@ | |||||
<template> | |||||
<div class="main-box"> | |||||
<div class="table-box"> | |||||
<ProTable | |||||
ref="proTable" | |||||
:columns="columns" | |||||
:data="getTableList" | |||||
:init-param="initParam" | |||||
:search-col="{ xs: 1, sm: 1, md: 2, lg: 3, xl: 3 }" | |||||
> | |||||
<!-- 表格 header 按钮 --> | |||||
<template #tableHeader> | |||||
<el-button type="primary" plain :icon="Download" @click="exportAction"> 导出 </el-button> | |||||
</template> | |||||
<template #tableHeaderRight> | |||||
<el-button type="primary" :icon="Plus" @click="openDialog()"> 添加 </el-button> | |||||
</template> | |||||
<!-- 表格操作 --> | |||||
<template #operation="scope"> | |||||
<el-button type="primary" link :icon="EditPen" @click="openDialog(scope.row)"> 编辑 </el-button> | |||||
<el-button type="primary" link :icon="Delete" @click="handleDelete(scope.row)"> 删除 </el-button> | |||||
</template> | |||||
</ProTable> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script setup lang="ts" name="semanticAssociationManage"> | |||||
import { ref, reactive } from "vue"; | |||||
import { SemanticsAssociation } from "@/api/interface"; | |||||
import ProTable from "@/components/ProTable/index.vue"; | |||||
import { ProTableInstance, ColumnProps } from "@/components/ProTable/interface"; | |||||
import { Download, Plus, Delete, EditPen } from "@element-plus/icons-vue"; | |||||
// import { useDownload } from "@/hooks/useDownload"; | |||||
// ProTable 实例 | |||||
const proTable = ref<ProTableInstance>(); | |||||
// 如果表格需要初始化请求参数,直接定义传给 ProTable(之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据) | |||||
const initParam = reactive({ deptId: "" }); | |||||
// 表格配置项 | |||||
const columns = reactive<ColumnProps<SemanticsAssociation.ResSemanticsAssociationList>[]>([ | |||||
{ prop: "semanticsName", label: "语义关联", search: { el: "input" } }, | |||||
{ prop: "semanticsName", label: "定义", search: { el: "input" } }, | |||||
{ prop: "updateTime", label: "更新时间", search: { el: "date-range-picker", custom: true } }, | |||||
{ prop: "updatePerson", label: "更新人", search: { el: "input" } }, | |||||
{ | |||||
prop: "dataSources", | |||||
label: "数据来源", | |||||
// enum: () => getDictOptions("sys_oper_type"), | |||||
// enum: [{ label: "添加", value: "1" }], | |||||
search: { el: "select" } | |||||
}, | |||||
{ prop: "notes", label: "备注" }, | |||||
{ prop: "operation", label: "操作", width: 330, fixed: "right" } | |||||
]); | |||||
// 分页列表获取数据 | |||||
const getTableList = [ | |||||
{ | |||||
semanticsId: "111222", | |||||
semanticsName: "111", | |||||
updateTime: "2024-10-01 12:02:03", | |||||
updatePerson: "更新人", | |||||
dataSources: "数据来源", | |||||
notes: "备注" | |||||
} | |||||
]; | |||||
console.log("getTableList", getTableList); | |||||
// const getTableList = (params: SemanticsAssociation.ReqSemanticsAssociationParams) => { | |||||
// if (params.createTime) { | |||||
// const [beginTime, endTime] = params.createTime; | |||||
// params.params = { | |||||
// beginTime, | |||||
// endTime | |||||
// }; | |||||
// delete params.createTime; | |||||
// } | |||||
// return getUserList(params); | |||||
// }; | |||||
// 删除 | |||||
const handleDelete = async (params: SemanticsAssociation.ResSemanticsAssociationList) => { | |||||
console.log(params); | |||||
proTable.value?.getTableList(); | |||||
}; | |||||
// 打开(新增、查看、编辑) | |||||
// const dialogRef = ref<InstanceType<typeof SemanticsDialog> | null>(null); | |||||
const openDialog = (row?: Partial<SemanticsAssociation.ResSemanticsAssociationList>) => { | |||||
console.log("打开语义关联", row); | |||||
// dialogRef.value?.open(row).then(proTable.value?.getTableList); | |||||
}; | |||||
// 导出 | |||||
async function exportAction() { | |||||
console.log("导出"); | |||||
} | |||||
</script> |
@@ -0,0 +1,87 @@ | |||||
<template> | |||||
<div class="main-box"> | |||||
<el-tabs v-model="activeName" @tab-change="handleClick"> | |||||
<el-tab-pane label="待审核" name="pending"> </el-tab-pane> | |||||
<el-tab-pane label="已审核" name="resolve"> </el-tab-pane> | |||||
</el-tabs> | |||||
<ProTable | |||||
ref="proTable" | |||||
:columns="columns" | |||||
:data="getTableList" | |||||
:init-param="initParam" | |||||
:search-col="{ xs: 1, sm: 1, md: 2, lg: 3, xl: 3 }" | |||||
></ProTable> | |||||
</div> | |||||
</template> | |||||
<script lang="ts" setup> | |||||
import { ref, reactive } from "vue"; | |||||
import ProTable from "@/components/ProTable/index.vue"; | |||||
import { ProTableInstance, ColumnProps } from "@/components/ProTable/interface"; | |||||
import type { TabsPaneContext } from "element-plus"; | |||||
// ProTable 实例 | |||||
const proTable = ref<ProTableInstance>(); | |||||
const activeName = ref("pending"); | |||||
// 如果表格需要初始化请求参数,直接定义传给 ProTable(之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据) | |||||
const initParam = reactive({ deptId: "" }); | |||||
const handleClick = (tab: TabsPaneContext, event: Event) => { | |||||
console.log(tab, event); | |||||
if (tab === "resolve") { | |||||
getTableList = [ | |||||
{ | |||||
semanticsId: "111222", | |||||
semanticsName: "22222", | |||||
updateTime: "2024-10-01 12:02:03", | |||||
updatePerson: "更新人", | |||||
dataSources: "数据来源", | |||||
notes: "备注" | |||||
} | |||||
]; | |||||
} else { | |||||
getTableList = [ | |||||
{ | |||||
semanticsId: "111222", | |||||
semanticsName: "111", | |||||
updateTime: "2024-10-01 12:02:03", | |||||
updatePerson: "更新人", | |||||
dataSources: "数据来源", | |||||
notes: "备注" | |||||
} | |||||
]; | |||||
} | |||||
}; | |||||
// 表格配置项 | |||||
const columns = reactive<ColumnProps[]>([ | |||||
{ prop: "semanticsName", label: "语义", search: { el: "input" } }, | |||||
{ prop: "updateTime", label: "更新时间", search: { el: "date-range-picker", custom: true } }, | |||||
{ prop: "updatePerson", label: "更新人", search: { el: "input" } }, | |||||
{ | |||||
prop: "dataSources", | |||||
label: "数据来源", | |||||
// enum: () => getDictOptions("sys_oper_type"), | |||||
// enum: [{ label: "添加", value: "1" }], | |||||
search: { el: "select" } | |||||
}, | |||||
{ prop: "notes", label: "备注" }, | |||||
{ prop: "operation", label: "操作", width: 330, fixed: "right" } | |||||
]); | |||||
// 分页列表获取数据 | |||||
let getTableList = [ | |||||
{ | |||||
semanticsId: "111222", | |||||
semanticsName: "111", | |||||
updateTime: "2024-10-01 12:02:03", | |||||
updatePerson: "更新人", | |||||
dataSources: "数据来源", | |||||
notes: "备注" | |||||
} | |||||
]; | |||||
</script> | |||||
<style lang="scss" scoped> | |||||
.main-box { | |||||
height: 100%; | |||||
padding: 0; | |||||
padding-bottom: 10px; | |||||
} | |||||
</style> |
@@ -0,0 +1,103 @@ | |||||
<!-- 添加/编辑语义 --> | |||||
<template> | |||||
<el-dialog | |||||
v-model="dialogVisible" | |||||
:title="isAdd ? '添加' : '编辑'" | |||||
:width="500" | |||||
center | |||||
align-center | |||||
:close-on-click-modal="false" | |||||
@closed="handleBeforeClose" | |||||
> | |||||
<el-form :model="formData" ref="formRef" label-width="100px" :rules="formRules" class="mt20"> | |||||
<el-form-item label="语义名称" prop="semanticsName"> | |||||
<el-input v-model="formData.semanticsName" placeholder="请输入语义名称" /> | |||||
</el-form-item> | |||||
<el-form-item label="备注" prop="annotation"> | |||||
<el-input v-model="formData.annotation" placeholder="请输入备注" /> | |||||
</el-form-item> | |||||
</el-form> | |||||
<template #footer> | |||||
<span class="dialog-footer"> | |||||
<el-button @click="handleCancel">取消</el-button> | |||||
<el-button type="primary" class="ml30" v-throttle="handleSubmit">确定</el-button> | |||||
</span> | |||||
</template> | |||||
</el-dialog> | |||||
</template> | |||||
<script lang="ts" setup name="editSemantics"> | |||||
import { ref, reactive, nextTick } from "vue"; | |||||
import { FormInstance, FormRules, ElMessage } from "element-plus"; | |||||
//* 接收注入 | |||||
const dialogVisible = ref(false); | |||||
//* data | |||||
//* ref | |||||
const formRef = ref<FormInstance>(); | |||||
const openPromise = ref<any>({}); | |||||
const isAdd = ref(false); | |||||
const formData = reactive<FormData>(getFormDefaultValue()); | |||||
interface FormData { | |||||
[key: string]: any; | |||||
} | |||||
function getFormDefaultValue(): FormData { | |||||
return { | |||||
semanticsName: undefined, | |||||
semanticsId: undefined, | |||||
annotation: undefined | |||||
}; | |||||
} | |||||
//* 方法 | |||||
// 校验规则 | |||||
let formRules = reactive<FormRules>({ | |||||
semanticsName: [{ required: true, message: "语义名称不能为空", trigger: "blur" }] | |||||
}); | |||||
// 取消 | |||||
function handleCancel() { | |||||
dialogVisible.value = false; | |||||
} | |||||
function handleBeforeClose() { | |||||
dialogVisible.value = false; | |||||
const defaultValue = getFormDefaultValue(); | |||||
for (const key of Object.keys(defaultValue)) { | |||||
formData[key] = defaultValue[key]; | |||||
} | |||||
nextTick(formRef.value?.clearValidate); | |||||
} | |||||
//提交 | |||||
function handleSubmit() { | |||||
console.log("提交"); | |||||
ElMessage.success("新增成功"); | |||||
openPromise.value.resolve(); | |||||
dialogVisible.value = false; | |||||
// formRef.value?.validate(async valid => { | |||||
// if (!valid) return; | |||||
// const params = { | |||||
// ...formData | |||||
// }; | |||||
// if (isAdd.value) { | |||||
// await addMenu(params); | |||||
// ElMessage.success("新增成功"); | |||||
// } else { | |||||
// await editMenu(params); | |||||
// ElMessage.success("编辑成功"); | |||||
// } | |||||
// openPromise.value.resolve(); | |||||
// dialogVisible.value = false; | |||||
// } | |||||
} | |||||
function open(params?: FormData) { | |||||
isAdd.value = !params?.semanticsId; | |||||
dialogVisible.value = true; | |||||
return new Promise(resolve => { | |||||
openPromise.value.resolve = resolve; | |||||
}); | |||||
} | |||||
defineExpose({ | |||||
open | |||||
}); | |||||
</script> |
@@ -0,0 +1,105 @@ | |||||
<template> | |||||
<div class="main-box"> | |||||
<div class="table-box"> | |||||
<ProTable | |||||
ref="proTable" | |||||
:columns="columns" | |||||
:data="getTableList" | |||||
:init-param="initParam" | |||||
:search-col="{ xs: 1, sm: 1, md: 2, lg: 3, xl: 3 }" | |||||
> | |||||
<!-- 表格 header 按钮 --> | |||||
<template #tableHeader> | |||||
<el-button type="primary" :icon="Upload" @click="importAction"> 导入 </el-button> | |||||
<el-button type="primary" plain :icon="Download" @click="exportAction"> 导出 </el-button> | |||||
<el-button type="primary" :icon="Plus">设置语义关联</el-button> | |||||
</template> | |||||
<template #tableHeaderRight> | |||||
<el-button type="primary" :icon="Plus" @click="openDialog()"> 添加 </el-button> | |||||
</template> | |||||
<!-- 表格操作 --> | |||||
<template #operation="scope"> | |||||
<el-button type="primary" link :icon="EditPen" @click="openDialog(scope.row)"> 编辑 </el-button> | |||||
<el-button type="primary" link :icon="Delete" @click="handleDelete(scope.row)"> 删除 </el-button> | |||||
</template> | |||||
</ProTable> | |||||
<SemanticsDialog ref="dialogRef"></SemanticsDialog> | |||||
<!-- <ImportExcelDialog ref="importRef" :file-size="50" title="语义" temp-path="./excel/trace_origin_temp.xlsx" /> --> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script setup lang="ts" name="semanticsManage"> | |||||
import { ref, reactive } from "vue"; | |||||
import { Semantics } from "@/api/interface"; | |||||
import ProTable from "@/components/ProTable/index.vue"; | |||||
// import ImportExcelDialog from "@/components/ImportExcelDialog/index.vue"; | |||||
import { ProTableInstance, ColumnProps } from "@/components/ProTable/interface"; | |||||
import { Upload, Download, Plus, Delete, EditPen } from "@element-plus/icons-vue"; | |||||
import SemanticsDialog from "./components/SemanticsDialog.vue"; | |||||
// import { useDownload } from "@/hooks/useDownload"; | |||||
// ProTable 实例 | |||||
const proTable = ref<ProTableInstance>(); | |||||
// 如果表格需要初始化请求参数,直接定义传给 ProTable(之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据) | |||||
const initParam = reactive({ deptId: "" }); | |||||
// 表格配置项 | |||||
const columns = reactive<ColumnProps<Semantics.ResSemanticsList>[]>([ | |||||
{ prop: "semanticsName", label: "语义", search: { el: "input" } }, | |||||
{ prop: "updateTime", label: "更新时间", search: { el: "date-range-picker", custom: true } }, | |||||
{ prop: "updatePerson", label: "更新人", search: { el: "input" } }, | |||||
{ | |||||
prop: "dataSources", | |||||
label: "数据来源", | |||||
// enum: () => getDictOptions("sys_oper_type"), | |||||
// enum: [{ label: "添加", value: "1" }], | |||||
search: { el: "select" } | |||||
}, | |||||
{ prop: "notes", label: "备注" }, | |||||
{ prop: "operation", label: "操作", width: 330, fixed: "right" } | |||||
]); | |||||
// 分页列表获取数据 | |||||
const getTableList = [ | |||||
{ | |||||
semanticsId: "111222", | |||||
semanticsName: "111", | |||||
updateTime: "2024-10-01 12:02:03", | |||||
updatePerson: "更新人", | |||||
dataSources: "数据来源", | |||||
notes: "备注" | |||||
} | |||||
]; | |||||
console.log("getTableList", getTableList); | |||||
// const getTableList = (params: Semantics.ReqSemanticsParams) => { | |||||
// if (params.createTime) { | |||||
// const [beginTime, endTime] = params.createTime; | |||||
// params.params = { | |||||
// beginTime, | |||||
// endTime | |||||
// }; | |||||
// delete params.createTime; | |||||
// } | |||||
// return getUserList(params); | |||||
// }; | |||||
// 删除 | |||||
const handleDelete = async (params: Semantics.ResSemanticsList) => { | |||||
console.log(params); | |||||
proTable.value?.getTableList(); | |||||
}; | |||||
// 打开(新增、查看、编辑) | |||||
const dialogRef = ref<InstanceType<typeof SemanticsDialog> | null>(null); | |||||
const openDialog = (row?: Partial<Semantics.ResSemanticsList>) => { | |||||
dialogRef.value?.open(row).then(proTable.value?.getTableList); | |||||
}; | |||||
// 导入 | |||||
// const importRef = ref<typeof ImportExcelDialog>(); | |||||
function importAction() { | |||||
console.log("导入"); | |||||
// importRef.value?.open().then(proTable.value?.getTableList); | |||||
} | |||||
// 导出 | |||||
async function exportAction() { | |||||
console.log("导出"); | |||||
} | |||||
</script> |
@@ -9,7 +9,7 @@ | |||||
@closed="closed" | @closed="closed" | ||||
> | > | ||||
<el-form :model="formData" ref="formRef" label-width="90px" :rules="formRules"> | <el-form :model="formData" ref="formRef" label-width="90px" :rules="formRules"> | ||||
<el-row> | |||||
<el-row class="mt20"> | |||||
<el-col :span="12"> | <el-col :span="12"> | ||||
<el-form-item label="姓名" prop="nickName"> | <el-form-item label="姓名" prop="nickName"> | ||||
<el-input v-model="formData.nickName" placeholder="请输入姓名" :maxlength="20" /> | <el-input v-model="formData.nickName" placeholder="请输入姓名" :maxlength="20" /> | ||||
@@ -70,6 +70,11 @@ | |||||
<el-switch v-model="formData.status" active-value="0" inactive-value="1" /> | <el-switch v-model="formData.status" active-value="0" inactive-value="1" /> | ||||
</el-form-item> | </el-form-item> | ||||
</el-col> | </el-col> | ||||
<el-col :span="12"> | |||||
<el-form-item label="是否为临时账号" prop="temporary" label-width="110px"> | |||||
<el-switch v-model="formData.temporary" active-value="0" inactive-value="1" /> | |||||
</el-form-item> | |||||
</el-col> | |||||
</el-row> | </el-row> | ||||
</el-form> | </el-form> | ||||
<template #footer> | <template #footer> | ||||
@@ -28,14 +28,12 @@ const initParam = reactive({ deptId: "" }); | |||||
// 表格配置项 | // 表格配置项 | ||||
const columns = reactive<ColumnProps<User.ResUserList>[]>([ | const columns = reactive<ColumnProps<User.ResUserList>[]>([ | ||||
// { prop: "userId", label: "用户编号", width: 100 }, | |||||
{ prop: "userName", label: "操作人员", search: { el: "input" } }, | { prop: "userName", label: "操作人员", search: { el: "input" } }, | ||||
{ prop: "nickName", label: "所属模块", search: { el: "input" } }, | { prop: "nickName", label: "所属模块", search: { el: "input" } }, | ||||
{ | { | ||||
prop: "status", | prop: "status", | ||||
label: "操作类型", | label: "操作类型", | ||||
sortable: true, | |||||
enum: () => getDictOptions("sys_normal_disable"), | |||||
enum: () => getDictOptions("sys_oper_type"), | |||||
search: { el: "select" }, | search: { el: "select" }, | ||||
fieldNames: { label: "dictLabel", value: "dictValue" } | fieldNames: { label: "dictLabel", value: "dictValue" } | ||||
}, | }, | ||||
@@ -13,15 +13,23 @@ | |||||
</li> | </li> | ||||
</ul> | </ul> | ||||
<TreeFilter | <TreeFilter | ||||
style="opacity: 0" | |||||
ref="treeFilterRef" | ref="treeFilterRef" | ||||
title="日志列表" | title="日志列表" | ||||
:request-api="getUserDepartment" | :request-api="getUserDepartment" | ||||
:default-value="initParam.deptId" | :default-value="initParam.deptId" | ||||
@change="changeTreeFilter" | @change="changeTreeFilter" | ||||
:multiple="true" | |||||
/> | /> | ||||
</div> | </div> | ||||
<div> | <div> | ||||
<div ref="articleBody" class="article" @mousedown="startSelection" v-html="showHtml"></div> | |||||
<div | |||||
ref="articleBody" | |||||
:style="{ fontSize: getBodyFontSize + 'px' }" | |||||
class="article" | |||||
@mousedown="startSelection" | |||||
v-html="showHtml" | |||||
></div> | |||||
<section> | <section> | ||||
<el-button type="primary" @click="endSelection('中医理论', 'red', '八宝串')" class="mr-10"> 中医理论 </el-button> | <el-button type="primary" @click="endSelection('中医理论', 'red', '八宝串')" class="mr-10"> 中医理论 </el-button> | ||||
<el-button @click="endSelection('方剂', 'blue', '八宝')" class="mr-10"> 方剂 </el-button> | <el-button @click="endSelection('方剂', 'blue', '八宝')" class="mr-10"> 方剂 </el-button> | ||||
@@ -38,18 +46,22 @@ | |||||
</template> | </template> | ||||
<script setup lang="ts"> | <script setup lang="ts"> | ||||
import { ref, reactive, onMounted, provide } from "vue"; | |||||
import { ref, reactive, onMounted, provide, computed } from "vue"; | |||||
import { ElMessage } from "element-plus"; | import { ElMessage } from "element-plus"; | ||||
import { useRouter } from "vue-router"; | import { useRouter } from "vue-router"; | ||||
import { usePageLeave } from "@/hooks/usePageLeave"; | import { usePageLeave } from "@/hooks/usePageLeave"; | ||||
import { getUserDepartment } from "@/api/modules/system/user"; | import { getUserDepartment } from "@/api/modules/system/user"; | ||||
import { ProTableInstance } from "@/components/ProTable/interface"; | |||||
// import { ProTableInstance } from "@/components/ProTable/interface"; | |||||
import TreeFilter from "@/components/TreeFilter/index.vue"; | import TreeFilter from "@/components/TreeFilter/index.vue"; | ||||
import { useGlobalStore } from "@/stores/modules/global"; | |||||
// hooks | // hooks | ||||
usePageLeave("TaskIndexData"); | usePageLeave("TaskIndexData"); | ||||
const globalStore = useGlobalStore(); | |||||
const getBodyFontSize = computed(() => globalStore.getBodyFontSize); | |||||
// ProTable 实例 | // ProTable 实例 | ||||
const proTable = ref<ProTableInstance>(); | |||||
// const proTable = ref<ProTableInstance>(); | |||||
const treeFilterRef = ref<typeof TreeFilter>(); | const treeFilterRef = ref<typeof TreeFilter>(); | ||||
provide("getDeptTree", () => { | provide("getDeptTree", () => { | ||||
return treeFilterRef.value?.treeAllData.filter((item: any) => item.id > 0); | return treeFilterRef.value?.treeAllData.filter((item: any) => item.id > 0); | ||||
@@ -58,7 +70,7 @@ const initParam = reactive({ deptId: "" }); | |||||
// 树形筛选切换 | // 树形筛选切换 | ||||
const changeTreeFilter = (val: string) => { | const changeTreeFilter = (val: string) => { | ||||
proTable.value!.pageable.pageNum = 1; | |||||
// proTable.value!.pageable.pageNum = 1; | |||||
initParam.deptId = val; | initParam.deptId = val; | ||||
}; | }; | ||||
@@ -751,6 +763,7 @@ p::selection { | |||||
background: lightblue; | background: lightblue; | ||||
} | } | ||||
.article { | .article { | ||||
font-size: 14px; | |||||
cursor: text; /* 表明这个区域是可选择的 */ | cursor: text; /* 表明这个区域是可选择的 */ | ||||
user-select: text; /* 允许文本被选择 */ | user-select: text; /* 允许文本被选择 */ | ||||
} | } | ||||