9aa62fda by lxs

Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop

2 parents 295d1a3f 6417cb3e
......@@ -175,7 +175,7 @@ export const getLargeCategoryList = (params) => request({
/**
* 获取字段类型
*/
export const getFieldTypeList = (params) => request({
export const getNewDataTypeList = (params) => request({
url: `${import.meta.env.VITE_APP_CONFIG_URL}/dict/data/get-by-dictType?dictType=${params.dictType}`,
method: 'get',
})
......@@ -740,6 +740,36 @@ export const createTableSql = (data) => request({
data
})
/**
* 导出分类分级目录列表
* @param {no params}
* @path /cg-dir/export
*/
export const exportCgDir = () => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-dir/export`,
method: 'post',
})
/**
* 数据库目录导出
* @param {no params}
* @path /db-dir/table/export
*/
export const exportDbDirTable = () => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/export`,
method: 'post',
})
/**
* 数据库目录详情
* @param {query}
* @path /db-dir/detail
*
*/
export const getDbDirDetail = (params) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/detail?guid=${params.tableGuid}`,
method: 'get',
})
......@@ -756,14 +786,17 @@ export const getBizRuleConfigDetail = (params) => request({
method: 'get',
})
/**-----------------根据文件新建表-------------------------------------- */
/**
* 业务规则配置-修改
* 根据字段中文名解析字段英文名
* @param {Object}
* @path /biz-rule-config/update
* @returns
* @path /db-dir/field/get-field-en-name
*/
export const updateBizRuleConfig = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/biz-rule-config/update`,
export const getFidldEnName = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/get-field-en-name`,
method: 'post',
data
})
......
......@@ -5,13 +5,13 @@ import request from "@/utils/request";
**/
// 新增
export const addMetaDataTask = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/add`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-task/add`,
method: 'post',
data: params
})
// 删除
export const deleteMetaDataTask = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/del`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-task/del`,
method: 'delete',
data: params
})
......@@ -24,24 +24,24 @@ export const getMetaDataTask = (params) => request({
// 修改
export const updateMetaDataTask = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/update`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-task/update`,
method: 'put',
data: params
})
// 详情
export const getMetaDataTaskDetail = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/detail/${params}`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-task/detail/${params}`,
method: 'get'
})
// 上线下线
export const updateMetaDataState = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/change-state`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-task/change-state`,
method: 'get',
params
})
// 名称唯一性验证
export const checkMetaDataTask = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/check-exist`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-task/check-exist`,
method: 'post',
data: {
collectTaskName: params,
......@@ -49,18 +49,18 @@ export const checkMetaDataTask = (params) => request({
})
// 执行元数据采集任务
export const executeMetaDataTask = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/execute/${params}`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-task/execute/${params}`,
method: 'get'
})
// 执行日志
export const getMetaDataTaskLog = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-exec/page-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-exec/page-list`,
method: 'post',
data: params
})
//
export const saveMetaReportAnalysis = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage-analysis-report/add`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/lineage-analysis-report/add`,
method: 'post',
data: params
})
......@@ -99,86 +99,86 @@ export const getMetaSheetField = (params) => request({
})
// 表索引查询
export const getMetaSheetKeys = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-table-index-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-table-index-list`,
method: 'post',
params
})
// 变更查询
export const getMetaChange = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-collect-change-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-collect-change-list`,
method: 'post',
data: params
})
// 变更明细
export const getMetaChangeRecord = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-change-record-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-change-record-list`,
method: 'post',
data: params
})
//
export const getMetacompareList = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-change-compare-list/${params}`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-change-compare-list/${params}`,
method: 'get',
//data: params
})
// 表信息详情
export const getMetaDetail = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/detail/${params}`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/detail/${params}`,
method: 'get',
})
/** 根据表获取血缘数据 */
export const getTableLineage = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/lineage-query?guid=${params.guid}&lineageType=tb`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/lineage/lineage-query?guid=${params.guid}&lineageType=tb`,
method: 'get',
})
/** 根据字段获取血缘数据 */
export const getTableFieldLineage = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/lineage-query?guid=${params.guid}&lineageType=co`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/lineage/lineage-query?guid=${params.guid}&lineageType=co`,
method: 'get',
})
/** 获取表的所有字段血缘数据 */
export const getTableAllFieldLineage = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/lineage-query-field?databaseName=${params.databaseName}&tableName=${params.tableName}`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/lineage/lineage-query-field?databaseName=${params.databaseName}&tableName=${params.tableName}`,
method: 'get',
})
// 查询列表
export const getMetaList = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/list-meta-all`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/list-meta-all`,
method: 'post',
data:params
})
// 元数据表字段查询
export const getMetaTableField = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-table-field-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-table-field-list`,
method: 'post',
params,
})
// 保存血缘字段节点
export const saveLineageField = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/save-field`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/lineage/save-field`,
method: 'post',
data:params
})
// 保存血源节点
export const saveLineageTable = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/save-table`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/lineage/save-table`,
method: 'post',
data:params
})
// 删除血源节点
export const delLineageTable = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/del-vertex?vertexId=${params.vertexId}`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/lineage/del-vertex?vertexId=${params.vertexId}`,
method: 'delete',
//data:params
})
/** 获取同步任务变更记录 */
export const getTaskChangeList = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/task-change-record/page-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/task-change-record/page-list`,
method: 'post',
data:params
})
......@@ -200,41 +200,41 @@ export const getDatabase = (params) => request({
/** 源数据分析报告 */
/**查询列表 */
export const getAnalysisReportList = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage-analysis-report/list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/lineage-analysis-report/list`,
method: 'post',
data: params
})
/** 根据guid删除 */
export const delAnalysisRepor = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage-analysis-report/del`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/lineage-analysis-report/del`,
method: 'delete',
data: params
})
/** 根据guid更新 */
export const updateAnalysisRepor = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage-analysis-report/update`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/lineage-analysis-report/update`,
method: 'put',
data: params
})
/** 删除边 */
export const delLineAge = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/del-edge?euid=${params}`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/lineage/del-edge?euid=${params}`,
method: 'delete',
})
/** 判断是否有元数据数据 */
export const checkTableData = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/check-table-data/${params}`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/check-table-data/${params}`,
method: 'get',
})
/**校验任务是否有数据库信息 */
export const checkDatabaseIsExist = (dataSourceGuid) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/check-database-is-exist/${dataSourceGuid}`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-task/check-database-is-exist/${dataSourceGuid}`,
method: 'get',
})
/**同步任务 变更详情展示 */
export const syncChangeDetail = (guid) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/task-change-record/sync-change-detail/${guid}`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/task-change-record/sync-change-detail/${guid}`,
method: 'get',
})
......
......@@ -33,6 +33,7 @@ const emits = defineEmits([
"tableRowClick",
"tableRowDblClick",
"tableInputChange",
]);
const tableRef = ref();
......@@ -198,6 +199,8 @@ const rowSelectable = (row, index) => {
return row.selectable ?? true;
};
const pageChange = (page) => {
let info = { ...page, id: props.tableInfo.id };
emits("tablePageChange", info);
......@@ -277,7 +280,7 @@ onMounted(() => {
@show="() => popoverHover(scope, item)">
<template #reference>
<span :class="{ text_btn: item.checkName ? item.checkName(scope) : true }">{{
item.getName ? item.getName(scope):"详情" }}</span>
item.getName ? item.getName(scope) : "详情" }}</span>
</template>
<el-table :data="props.tableInfo.popoverData" v-loading="props.tableInfo.popoverloading" class="tablePover"
:row-class-name="tableRowClassName1" border tooltip-effect="light"
......
......@@ -503,9 +503,14 @@ export const tagType = (row, type) => {
case "R":
state = 'danger'
break;
case 0:
state = 'info';
break;
case 1:
state = 'success';
break;
case 2:
state = 'info';
state = 'warning';
break;
case 3:
state = 'warning'
......
......@@ -77,7 +77,8 @@ const levelMap = {
}
const currTableInfo = ref<any>({});
const drawerRef = ref<any>('');
const currentRowKey = ref<any>(null);
const scopeRow = ref<any>(null);
const tableInfo = ref({
id: "data-class-standard-table",
multiple: false,
......@@ -108,6 +109,7 @@ const tableInfo = ref({
],
data: [],
rowKey: 'guid',
currentRowKey: '',
showPage: false,
actionInfo: {
label: "操作",
......@@ -116,7 +118,7 @@ const tableInfo = ref({
btns: [
{
label: "编辑", value: "edit", click: (scope) => {
console.log(scope.row);
scopeRow.value = scope.row;
currentEditingGuid.value = scope.row.guid;
selectParentEdit(scope.row.guid);
currTableInfo.value = scope.row;
......@@ -147,6 +149,8 @@ const tableInfo = ref({
loading: false,
});
const classEditFormItems = ref([{
label: '分类名称',
type: 'input',
......@@ -218,38 +222,9 @@ const classEditFormItems = ref([{
block: true
}]);
// const validateUniqueClassifyName = (rule, value, callback) => {
// console.log('validateUniqueClassifyName', value);
// // 递归遍历treeListData,判断是否有重复的分类名称
// // 检查空值情况
// if (!value) {
// callback(new Error('请填写分类名称'));
// return;
// }
// // 递归检查函数
// const isExist = (data, value) => {
// return data.some(item => {
// if (item.classifyName === value) {
// return true;
// }
// return item.children && isExist(item.children, value);
// });
// };
// // 检查是否存在
// if (isExist(treeListData.value, value)) {
// callback(new Error('分类名称已存在,请填写其他名称'));
// } else {
// callback(); // 校验通过
// }
// }
let currentEditingGuid = ref<any>('');
const validateUniqueClassifyName = (rule, value, callback) => {
console.log('validateUniqueClassifyName', treeListData.value, value, currentEditingGuid);
// 检查空值情况
if (!value) {
callback(new Error('请填写分类名称'));
......@@ -341,6 +316,7 @@ const drawerBtnClick = async (btn, info) => {
}
} else {
// 编辑分类
drawerInfo.value.footer.btns.map((item: any) => (item.disabled = true));
const params = {
...info,
......@@ -357,8 +333,14 @@ const drawerBtnClick = async (btn, info) => {
getTreeListData();
// 清空当前编辑的guid
currentEditingGuid.value = '';
nextTick(() => {
console.log('tableRef进来了吗', scopeRow.value.guid);
tableInfo.value.currentRowKey = scopeRow.value.guid;
tableRef.value.tableRef.setCurrentRow(scopeRow.value.guid);
});
} else {
proxy.$ElMessage.error(res.msg);
drawerInfo.value.footer.btns.map((item: any) => (item.disabled = false));
}
}
}
......@@ -387,7 +369,7 @@ const findStandardName = (guid: string) => {
const item: any = classifyGradListData.value.find((item: any) => item.guid == guid);
return item ? item.name : '';
}
const tableRef = ref(null); // 表格的 ref
const tableRef = ref<any>(null); // 表格的 ref
// 获取分类树形列表
const treeListParams = ref({
pageIndex: 1,
......@@ -404,7 +386,6 @@ const getTreeListData = async () => {
classEditFormItems.value[2].options = treeListData.value;
shapeTreeListData.value = treeListData.value;
tableInfo.value.loading = false;
} else {
proxy.$ElMessage.error(res.msg);
}
......@@ -493,10 +474,10 @@ const saveUpdate = async () => {
type: 'C',
description: formRef.value.formInline.description
}
console.log(params);
const res: any = await updateClassifyGrad(params);
if (res.code == proxy.$passCode) {
proxy.$ElMessage.success('修改分类成功');
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
router.push({
name: 'templateConfig'
});
......@@ -518,7 +499,6 @@ const updatedTreeData = ref<any>();
/** 切换是图形展示,还是表格展示。 */
const changeShowMethod = () => {
dataShowMethod.value = dataShowMethod.value == 'table' ? 'shape' : 'table';
console.log(shapeTreeListData.value);
if (dataShowMethod.value == 'shape') {
const tempArr = {
classifyName: router.currentRoute.value.query.classStandardName,
......@@ -526,13 +506,10 @@ const changeShowMethod = () => {
children: shapeTreeListData.value
}
updatedTreeData.value = [tempArr];
console.log('updatedTreeData', [tempArr]);
}
}
const cancel = () => {
console.log(userStore.tabbar);
console.log(fullPath);
proxy.$openMessageBox("当前页面尚未保存,确定放弃修改吗?", () => {
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
router.push({
......@@ -823,6 +800,19 @@ const expand = (item) => {
isExpand1.value = item
}
onActivated(() => {
const classClassifyGradName = route.query.classClassifyGradName;
let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath);
if (tab) {
if (classClassifyGradName) {
tab.meta.title = `编辑-${classClassifyGradName}`;
}
if (fullPath === route.fullPath) {
document.title = tab.meta.title;
}
}
});
</script>
<template>
......@@ -832,14 +822,16 @@ const expand = (item) => {
:isExpand="isExpand">
<Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" />
</ContentWrap>
<ContentWrap id="id-classStandard" class="detail-content" title="分类规则" description=""
style="margin-top:16px; height: calc(100% - 161px)" :expandSwicth="true" :isExpand="isExpand1" @expand="expand">
<ContentWrap id="id-classStandard" class="class-content" title="分类规则" description="" style="margin-top:16px; "
:expandSwicth="true" :isExpand="isExpand1" @expand="expand">
<div class="tools_btns">
<el-button v-show="dataShowMethod == 'table'" type="primary" @click="newCreateClass">添加规则</el-button>
<!-- <el-button v-show="dataShowMethod == 'table'" @click="importClass">导入分类</el-button> -->
<el-button class="show-change-btn" @click="changeShowMethod">{{ '图形展示' }}</el-button>
<!-- <el-button class="show-change-btn" @click="changeShowMethod">{{ '图形展示' }}</el-button> -->
</div>
<div class="table_panel">
<Table v-show="dataShowMethod == 'table'" :tableInfo="tableInfo" ref="tableRef" />
</div>
<Table v-show="dataShowMethod == 'table'" :tableInfo="tableInfo" :ref="tableRef" />
<div ref="shapeMain" class="shape-main" v-show="dataShowMethod != 'table'"></div>
<div v-if="showNodeDetails" class="node-details-popup"
:style="{ top: popupPosition.top + 'px', left: popupPosition.left + 'px' }">
......@@ -890,9 +882,10 @@ const expand = (item) => {
}
:deep(.detail-content) {
height: calc(100% - 50px);
.el-card__body {
height: calc(100% - 50px) !important;
height: calc(100% - 50px);
.card-body-content {
height: 100%;
......@@ -916,7 +909,7 @@ const expand = (item) => {
}
.table_panel {
height: calc(100% - 44px) !important;
height: 500px
}
.node-details-popup {
......
......@@ -137,7 +137,6 @@ const tableInfo = ref({
btns: [
{
label: "编辑", value: "edit", click: (scope) => {
console.log(scope);
filterDataGradeEdit(scope.row.dataGrade);
newCreateGradeStandardDialogInfo.value.visible = true;
newCreateGradeStandardDialogInfo.value.title = '编辑规则';
......@@ -364,6 +363,7 @@ const saveUpdate = async () => {
const res: any = await updateClassifyGrad(params);
if (res.code == proxy.$passCode) {
proxy.$ElMessage.success('修改分级成功');
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
router.push({
name: 'templateConfig'
});
......@@ -385,6 +385,20 @@ const cancel = () => {
});
}
onActivated(() => {
const classClassifyGradName = route.query.classClassifyGradName;
let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath);
console.log(tab, '-----------');
if (tab) {
if (classClassifyGradName) {
tab.meta.title = `编辑-${classClassifyGradName}`;
}
if (fullPath === route.fullPath) {
document.title = tab.meta.title;
}
}
});
</script>
<template>
......
......@@ -9,10 +9,15 @@ import {
getCgDirTreeList, getCgDirFieldPageList, getDictionary, saveBizRuleConfig,
getDbDirTreeList, getDbDirTablePageList, getDbDirFieldPageList, getExecGuidAndName,
getClassifyTreeList, getCgLabelPageList, execTaskFieldList, execTaskSheetList, getTaskExeTreeList,
getDbFieldList
getDbFieldList, exportCgDir,
getGradeList,
exportDbDirTable,
getDbDirDetail
} from '@/api/modules/dataInventory';
import { TableColumnWidth } from "@/utils/enum";
import router from "@/router";
import { download } from "@/utils/common";
import { getLabelList } from "@/api/modules/dataLabel";
const currentPath = ref<string[]>([]);
const { proxy } = getCurrentInstance() as any;
......@@ -99,6 +104,7 @@ onMounted(async () => {
});
getDictionaryList();
getSearchTableList();
getLabelListData();
})
......@@ -140,7 +146,7 @@ const searchItemList = ref([
default: '',
options: [],
props: {
label: 'name',
label: 'label',
value: 'guid',
},
clearable: true,
......@@ -178,27 +184,34 @@ const searchItemList = ref([
clearable: true,
},
])
const searchParams = ref({})
// 搜索
const searchCount = ref(0);
const toSearch = (val: any, clear: boolean = false) => {
if (clear) {
selectedA.value = null;
selectedB.value = null;
selectedC.value = null;
searchItemList.value.map(item => item.default = '')
searchParams.value = {}
}
if (Object.keys(val).length) {
searchParams.value = { ...val }
}
// let params: any = { ...searchParams.value }
// params.pageIndex = page.value.curr;
// params.pageSize = page.value.limit;
// //params.standardSetGuid = standardSetGuid.value;
// params.standardSetLevelCode = standardSetLevelCode.value;
// return getTableData(params);
// 差一个label标签 -- 未完成
getCgDirFieldPage({
pageIndex: 1,
pageSize: 50,
execGuid: execGuidInfo.value.execGuid,
classifyDetail: val.classifyName,
gradeDetailGuid: val.levelName,
databaseGuid: selectedA.value,
tableGuid: selectedB.value,
fieldGuid: selectedC.value,
});
};
const nodeClick = async (data: any) => {
console.log('nodeClick', data);
const { guid, classifyDetailGuid } = data
const { guid, classifyDetailGuid, refGradeGuid } = data
getGradeData(refGradeGuid);
searchItemList.value[1].default = data.classifyName;
await getCgDirFieldPage({
execGuid: execGuidInfo.value.execGuid,
......@@ -230,6 +243,26 @@ const findPath = (data: any[], targetGuid: string, path: string[] = []) => {
};
// 根据选择的分类获取分级
const getGradeData = async (refGradeGuid) => {
const res: any = await getGradeList({ classifyGradeGuid: refGradeGuid, pageIndex: 1, pageSize: -1 });
if (res.code == proxy.$passCode) {
searchItemList.value[2].options = res.data.records || [];
} else {
proxy.$ElMessage.error(res.msg);
}
}
// 获取标签
const getLabelListData = async () => {
const res: any = await getLabelList({ label: '' });
if (res.code == proxy.$passCode) {
searchItemList.value[0].options = res.data || [];
} else {
proxy.$ElMessage.error(res.msg);
}
}
// btns-area
const checked = ref(false);
const changeCheck = (val) => {
......@@ -245,7 +278,7 @@ const page = ref({
curr: 1,
sizes: [
{ label: "10", value: 10 },
{ label: "20", value: 20 },
{ label: "50", value: 50 },
{ label: "100", value: 100 },
{ label: "150", value: 150 },
{ label: "200", value: 200 },
......@@ -258,10 +291,10 @@ const tableInfo = ref({
fields: [
{ label: "序号", type: "index", width: 56, align: "center" },
{ label: "字段名", field: "fieldName", width: 140 },
{ label: "分类", field: "classifyName", width: 180 },
{ label: "分类", field: "classifyDetailName", width: 180 },
{ label: "分级", field: "gradeDetailName", width: 120 },
{ label: "标签", field: "label", width: 140 },
{ label: "规则", field: "rulesName", width: 180 },
{ label: "规则", field: "ruleDetail", width: 180 },
{ label: "表名", field: "tableName", width: 120, align: 'center' },
{ label: "表中文名", field: "tableChName", width: 120, align: 'center' },
{ label: "数据库名", field: "database", width: 120, align: 'center' },
......@@ -285,7 +318,8 @@ const tablePageChange = (info) => {
page.value.limit = Number(info.limit);
getCgDirFieldPage({
pageIndex: info.curr,
pageSize: info.limit
pageSize: info.limit,
execGuid: execGuidInfo.value.execGuid
});
}
......@@ -355,7 +389,7 @@ const dataBasePage = ref({
curr: 1,
sizes: [
{ label: "10", value: 10 },
{ label: "20", value: 20 },
{ label: "50", value: 50 },
{ label: "100", value: 100 },
{ label: "150", value: 150 },
{ label: "200", value: 200 },
......@@ -423,6 +457,30 @@ const dataBaseTableInfo = ref({
{
label: "编辑表结构", value: "edit", click: (scope) => {
console.log('复制', scope);
getDbDirDetail({
tableGuid: scope.row.tableGuid
}).then((res: any) => {
if (res.code == proxy.$passCode) {
console.log('res', res);
router.push({
name: 'tableCreateExisting',
query: {
execGuid: execGuidInfo.value.execGuid,
foundMode: 1,
database: res.data.database,
databaseChName: res.data.databaseChName,
databaseGuid: res.data.databaseGuid,
tableGuid: scope.row.tableGuid,
tableName: scope.row.tableName,
tableChName: scope.row.tableChName,
description: scope.row.description,
}
});
} else {
proxy.$ElMessage.error(res.msg);
}
})
},
disabled: scope.row.state !== 2 ? false : true
}
......@@ -483,7 +541,7 @@ const classEditFormItems = ref([{
type: 'input',
placeholder: '请选择',
field: 'fieldPrecision',
maxlength: 6,
maxlength: 2,
regexp: /\D/g,
required: true,
clearable: true,
......@@ -708,7 +766,7 @@ const getDataBaseTableData = async (params = {}) => {
dataBaseTableInfo.value.loading = true;
const dataBaseParams = {
pageIndex: 1,
pageSize: 10,
pageSize: 50,
databaseGuid: "",
isDataAsset: '',
execGuid: execGuidInfo.value.execGuid,
......@@ -719,9 +777,8 @@ const getDataBaseTableData = async (params = {}) => {
if (res.code == proxy.$passCode) {
dataBaseTableDataList.value = res.data.records;
dataBaseTableInfo.value.page.rows = res.data.totalRows;
dataBaseTableInfo.value.page.limit = res.data.pageSize
dataBaseTableInfo.value.data = res.data.records;
dataBasePage.value.limit = res.data.pageSize
dataBasePage.value.curr = res.data.pageIndex
} else {
proxy.$ElMessage.error(res.msg);
}
......@@ -746,7 +803,7 @@ const getDataBaseFieldData = async (params = {}) => {
tableFieldsLoading.value = true;
const dataBaseParams = {
pageIndex: 1,
pageSize: 10,
pageSize: 50,
tableGuid: "",
execGuid: execGuidInfo.value.execGuid,
databaseGuid: "",
......@@ -778,8 +835,8 @@ const tableFieldsDataInfo = ref({
{ label: "表中文名", field: "tableChName", width: 140, },
{ label: "数据库名称", field: "database", width: 120 },
{ label: "数据库中文名", field: "databaseChName", width: TableColumnWidth.DATETIME },
{ label: "分类", field: "description", width: 120, align: 'center' },
{ label: "分级", field: "isDataAsset", width: 120, align: 'center' },
{ label: "分类", field: "classifyDetailName", width: 120, align: 'center' },
{ label: "分级", field: "gradeDetailName", width: 120, align: 'center' },
{ label: "标签", field: "label", width: 120, align: 'center' },
],
data: [],
......@@ -857,7 +914,8 @@ const handleSubjectTableCommand = (command: string) => {
name: 'tableCreateFile',
query: {
type: 'tableCreateFile',
foundMode: 2
foundMode: 2,
execGuid: execGuidInfo.value.execGuid,
}
});
} else if (command === 'existingCreate') {
......@@ -894,7 +952,7 @@ const setActiveTab = (tab) => {
activeTab.value = tab;
};
// 模拟后端接口
// 获取查询的数据库名 execTaskSheetList
const getSearchTableList = async (type = 1, dbGuid = '') => {
......@@ -943,30 +1001,37 @@ const onBChange = async () => {
// 导出
const btnClick = async () => {
exportCgDir().then((res: any) => {
download(res, '分类分级目录数据.xlsx', 'excel')
});
};
// 数据库导出
const exportDB = async () => {
exportDbDirTable().then((res: any) => {
download(res, '数据库目录数据.xlsx', 'excel')
});
}
// 分类选择
const treeSelectNodeChange = (node, item) => {
console.log('treeSelectNodeChange', node, item);
const { refGradeGuid } = node;
getGradeData(refGradeGuid);
}
</script>
<template>
<div class="classification-template-content">
<div class="v-table-tools">
<el-select v-model="selectedA" placeholder="选择数据库名" @change="onAChange" style="width: 140px; margin-right: 8px"
clearable>
:clearable="false">
<el-option v-for="item in optionsA" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" />
</el-select>
<el-select v-model="selectedB" placeholder="选择表名" :disabled="!selectedA" @change="onBChange"
style="width: 140px; margin-right: 8px" clearable>
style="width: 140px; margin-right: 8px" :clearable="false">
<el-option v-for="item in optionsB" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" />
</el-select>
<el-select v-model="selectedC" placeholder="选择字段名" :disabled="!selectedB" style="width: 140px;margin-right: 8px"
clearable>
:clearable="false">
<el-option v-for="item in optionsC" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" />
</el-select>
<TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch"
......@@ -1078,7 +1143,7 @@ const treeSelectNodeChange = (node, item) => {
</template>
</el-dropdown>
</div>
<el-button>导出</el-button>
<el-button @click="exportDB">导出</el-button>
<el-button>查看已生产报告</el-button>
<el-button>查看质量规则</el-button>
</div>
......@@ -1111,6 +1176,7 @@ const treeSelectNodeChange = (node, item) => {
.v-table-tools {
display: flex;
align-items: center;
flex-wrap: wrap;
padding: 8px 12px;
}
......@@ -1225,21 +1291,21 @@ const treeSelectNodeChange = (node, item) => {
.table_panel_wrap {
width: 100%;
height: calc(100% - 175px);
height: calc(100% - 117px);
min-height: 210px;
overflow: visible;
}
.table_panel_wrap_database {
width: 100%;
height: calc(100% - 215px);
height: calc(100% - 155px);
min-height: 210px;
overflow: visible;
}
.table_field {
width: 100%;
height: calc(100% - 180px);
height: calc(100% - 150px);
min-height: 210px;
overflow: visible;
}
......
......@@ -5,7 +5,7 @@
<script lang="ts" setup name="configureRules">
import { ref } from "vue";
import router from "@/router";
import { getBizRuleConfigDetail, updateBizRuleConfig } from '@/api/modules/dataInventory'
import { getBizRuleConfigDetail, saveBizRuleConfig, } from '@/api/modules/dataInventory'
const { proxy } = getCurrentInstance() as any;
const bizRuleConfigData = ref<any>()
const getBizRuleConfigDetailData = async () => {
......@@ -52,85 +52,73 @@ const editableFields = {
}
const tableFieldsLoading = ref(false)
// 当前选中的行
const selectedRows = ref([]);
// 监听选中行
// 监听选中行变化
const selectionFieldsChange = (selection) => {
console.log('selection', selection)
selectedRows.value = selection;
};
// 上移功能
// 上移操作
const moveUp = () => {
// 1. 找到选中行在 tableData 中的索引
const selectedIds = selectedRows.value.map((row: any) => row.id);
// 2. 遍历选中行,按顺序上移
for (let i = 0; i < tableData.value.length; i++) {
const currentRow = tableData.value[i];
// 如果当前行被选中,且不是第一行,则交换位置
if (selectedIds.includes(currentRow.id) && i > 0) {
const previousRow = tableData.value[i - 1];
// 如果上一行没有被选中,交换位置
if (!selectedIds.includes(previousRow.id)) {
[tableData.value[i], tableData.value[i - 1]] = [tableData.value[i - 1], tableData.value[i]];
}
if (selectedRows.value.length === 0) {
proxy.$message.warning("请选择数据!");
return;
}
selectedRows.value.forEach((row: any) => {
const index = tableData.value.findIndex((item) => item.guid === row.guid);
if (index > 0) {
[tableData.value[index - 1], tableData.value[index]] = [
tableData.value[index],
tableData.value[index - 1],
];
}
});
};
// 下移功能
// 下移操作
const moveDown = () => {
// 1. 找到选中行在 tableData 中的索引
const selectedIds = selectedRows.value.map((row: any) => row.id);
// 2. 遍历选中行,倒序下移
for (let i = tableData.value.length - 1; i >= 0; i--) {
const currentRow = tableData.value[i];
// 如果当前行被选中,且不是最后一行,则交换位置
if (selectedIds.includes(currentRow.id) && i < tableData.value.length - 1) {
const nextRow = tableData.value[i + 1];
// 如果下一行没有被选中,交换位置
if (!selectedIds.includes(nextRow.id)) {
[tableData.value[i], tableData.value[i + 1]] = [tableData.value[i + 1], tableData.value[i]];
}
if (selectedRows.value.length === 0) {
proxy.$message.warning("请选择数据!");
return;
}
// 倒序遍历选中行
[...selectedRows.value].reverse().forEach((row: any) => {
const index = tableData.value.findIndex((item) => item.guid === row.guid);
if (index < tableData.value.length - 1) {
[tableData.value[index], tableData.value[index + 1]] = [
tableData.value[index + 1],
tableData.value[index],
];
}
});
};
// 编辑行
const editRow = (row) => {
if (!row.isEdit) {
// 编辑fieldLengthCondition
if (row.fieldLengthCondition) {
const [symbol, value] = row.fieldLengthCondition.split('#');
row.lengthSymbol = symbol; // 初始化符号部分
row.lengthValue = value; // 初始化数值部分
} else {
row.lengthSymbol = ''; // 默认值
row.lengthValue = ''; // 默认值
const arr = row.fieldLengthCondition.split('#')
row.lengthSymbol = arr[0]
row.lengthValue = arr[1]
}
//编辑fieldValueRange
if (row.fieldValueRange) {
const [start, end] = row.fieldValueRange.split('-');
row.rangeStart = start; // 初始化符号部分
row.rangeEnd = end; // 初始化数值部分
} else {
row.rangeStart = ''; // 默认值
row.rangeEnd = ''; // 默认值
const arr = row.fieldValueRange.split('#')
row.rangeStart = arr[0]
row.rangeEnd = arr[1]
}
row.isEdit = true; // 进入编辑模式
}
};
// 保存数据
const saveRow = (row) => {
row.fieldLengthCondition = `${row.lengthSymbol}#${row.lengthValue}`;
row.fieldValueRange = [row.rangeStart || '', row.rangeEnd || ''];
if (row.lengthSymbol && row.lengthValue) {
row.fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue
}
if (row.rangeStart && row.rangeEnd) {
row.fieldValueRange = row.rangeStart + '#' + row.rangeEnd
}
row.isEdit = false
}
......@@ -234,6 +222,7 @@ const saveData = async () => {
const obj = {
guid: router.currentRoute.value.query.tableGuid,
fieldGuid: item.fieldGuid,
execGuid: router.currentRoute.value.query.execGuid,
fieldLengthCondition: item.fieldLengthCondition,
fieldPrecision: item.fieldPrecision,
dictionaryGuid: item.dictionaryGuid,
......@@ -245,7 +234,7 @@ const saveData = async () => {
})
console.log('finalParams', inParams)
const res: any = await updateBizRuleConfig(inParams)
const res: any = await saveBizRuleConfig(inParams)
if (res.code === proxy.$passCode) {
proxy.$message.success('修改配置规则成功!')
router.back()
......@@ -323,7 +312,8 @@ const cancel = () => {
<!-- 长度列 fieldLengthCondition: '>#10',-->
<el-table-column prop="fieldLengthCondition" label="长度" width="240" align="center">
<template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.fieldLengthCondition || '--' }}</span>
<span v-if="!scope.row.isEdit">{{ scope.row.fieldLengthCondition
? scope.row.fieldLengthCondition.replace('#', '') : '--' }}</span>
<div v-else>
<el-select v-model="scope.row.lengthSymbol" placeholder="请选择" style="width: 50%;margin-right: 8px;">
<el-option label="大于" value=">"></el-option>
......@@ -334,21 +324,6 @@ const cancel = () => {
</div>
</template>
</el-table-column>
<!-- 精度列 -->
<!-- <el-table-column prop="fieldPrecision" label="精度" width="240" align="center">
<template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.fieldPrecision || '--' }}</span>
<div v-else>
<el-select v-model="scope.row.fieldPrecision" placeholder="请选择" style="width: 50%;margin-right: 8px;">
<el-option label="<=500" value="<=500"></el-option>
<el-option label=">500" value=">500"></el-option>
</el-select>
<el-input v-model="scope.row.precisionValue" placeholder="请输入" style="width: 45%;" />
</div>
</template>
</el-table-column> -->
<!-- 精度(可编辑)fieldPrecision -->
<el-table-column prop="fieldPrecision" label="精度" width="120" align="center">
<template #default="scope">
<span v-if="!scope.row.isEdit || !editableFields.fieldPrecision">{{
......@@ -393,7 +368,8 @@ const cancel = () => {
<template #default="scope">
<!-- 非编辑模式,展示取值范围 -->
<span v-if="!scope.row.isEdit">
{{ scope.row.fieldValueRange ? scope.row.fieldValueRange.join('-') : '--' }}
{{ scope.row.fieldValueRange
? scope.row.fieldValueRange.replace('#', '-') : '--' }}
</span>
<!-- 编辑模式,显示两个输入框 -->
<div v-else style="display: flex; gap: 5px; align-items: center;">
......
......@@ -6,8 +6,7 @@
import TableTools from '@/components/Tools/table_tools.vue';
import { getGradeList } from "@/api/modules/dataInventory";
import { getLabelList, getClassifyGradeTreeList, saveLabel, getLabelPageList, deleteLabel, updateLabel } from "@/api/modules/dataLabel";
import { CirclePlus, Delete } from "@element-plus/icons-vue";
import { CirclePlus, Delete, Warning } from "@element-plus/icons-vue";
const { proxy } = getCurrentInstance() as any;
......@@ -78,8 +77,8 @@ const getLabelPageData = async () => {
refCount.value++;
tableInfo.value.loading = true;
const params = {
pageIndex: page.value.curr,
pageSize: page.value.limit,
pageIndex: 1,
pageSize: 50,
classifyGuid: classifyGuid.value,
detailGuid: classifyDetailGuid.value
}
......@@ -152,6 +151,10 @@ const findTopParentNode = (node: any) => {
if (isLastLayer.value) {
atGradeinfo.value = node.data;
}
if (!node.parent.parent) {
findNodeDetails.value = node.data;
return;
}
// 递归向上查找符合条件的祖先节点
const findCParent = (currentNode: any): any => {
......@@ -174,7 +177,7 @@ const findTopParentNode = (node: any) => {
const nodeClick = (data, node) => {
console.log('nodeClick', data, node);
findTopParentNode(node);
newCreateGradeFormItems.value[1].options = transformDataForTree([findNodeDetails.value])
......@@ -208,7 +211,7 @@ const page = ref({
curr: 1,
sizes: [
{ label: "10", value: 10 },
{ label: "20", value: 20 },
{ label: "50", value: 50 },
{ label: "100", value: 100 },
{ label: "150", value: 150 },
{ label: "200", value: 200 },
......@@ -227,7 +230,7 @@ const tableInfo = ref({
return tempInfo.join('/')
},
},
{ label: "分级", field: "gradeDetailName", width: 140 },
{ label: "分级", field: "gradeDetailName", width: 80 },
{
label: '状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '停用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center'
},
......@@ -243,7 +246,7 @@ const tableInfo = ref({
actionInfo: {
label: "操作",
type: "btn",
width: 300,
width: 120,
fixed: 'right',
btns: [
{
......@@ -264,6 +267,10 @@ const tableInfo = ref({
item.default = scope.row[item.field];
item.disabled = false;
});
matchChValue.value.value = scope.row.matchChValue;
matchChValue.value.disabled = false;
matchEnValue.value.value = scope.row.matchEnValue;
matchEnValue.value.disabled = false;
if (scope.row.vagueMatchRule) {
// formRows进行回显
formRows.value = scope.row.vagueMatchRule.map((item) => ({
......@@ -374,6 +381,10 @@ const tableBtnClick = async (scope, value) => {
item.default = scope.row[item.field];
item.disabled = true;
});
matchChValue.value.value = scope.row.matchChValue;
matchChValue.value.disabled = true;
matchEnValue.value.value = scope.row.matchEnValue;
matchEnValue.value.disabled = true;
if (scope.row.vagueMatchRule) {
// formRows进行回显
formRows.value = scope.row.vagueMatchRule.map((item) => ({
......@@ -444,34 +455,34 @@ const newCreateGradeFormItems = ref<any>([{
required: true,
block: true,
},
// {
// label: ' ',
// type: 'label',
// default: '规则配置',
// block: true,
// col: 'title-label'
// },
{
label: '精确匹配',
type: 'textarea',
maxlength: 260,
placeholder: '请输入字段中文,中间用英文“,”分号隔开',
field: 'matchChValue',
default: '',
clearable: true,
required: false,
},
{
label: '',
type: 'textarea',
maxlength: 260,
placeholder: '请输入字段中文,中间用英文“,”分号隔开',
field: 'matchEnValue',
default: '',
clearable: true,
required: false,
}
// {
// label: ' ',
// type: 'label',
// default: '规则配置',
// block: true,
// col: 'title-label'
// },
// {
// label: '精确匹配',
// type: 'textarea',
// maxlength: 200,
// placeholder: '请输入字段中文,中间用英文“,”分号隔开',
// field: 'matchChValue',
// default: '',
// clearable: true,
// required: false,
// },
// {
// label: '',
// type: 'textarea',
// maxlength: 200,
// placeholder: '请输入字段中文,中间用英文“,”分号隔开',
// field: 'matchEnValue',
// default: '',
// clearable: true,
// required: false,
// }
]);
const newCreateGradeFormRules = ref({
......@@ -526,7 +537,9 @@ const newCreateGradeStandardDialogInfo = ref({
...info,
classifyGuid: classifyGuid.value,
gradeGuid: tempRefGradeGuid.value,
vagueMatchRule: tempParams
vagueMatchRule: tempParams,
matchChValue: matchChValue.value.value,
matchEnValue: matchEnValue.value.value
}
console.log('submit', params);
const res: any = await saveLabel(params);
......@@ -554,6 +567,8 @@ const newCreateGradeStandardDialogInfo = ref({
vagueMatchRule: tempParams,
classifyGuid: classifyGuid.value,
gradeGuid: tempRefGradeGuid.value,
matchChValue: matchChValue.value.value,
matchEnValue: matchEnValue.value.value
}
console.log('submit', params);
const res: any = await updateLabel(params);
......@@ -579,6 +594,10 @@ const addNewLabel = async () => {
item.default = '';
item.disabled = false;
});
matchChValue.value.value = '';
matchChValue.value.disabled = false;
matchEnValue.value.value = '';
matchEnValue.value.disabled = false;
formRows.value = [{ matchValue: '', position: '', name: '', disabled: false }];
//
......@@ -653,8 +672,8 @@ const searchClass = async (val: any, clear: boolean = false) => {
if (val?.labelName?.length !== 0 || refCount.value >= 1) {
tableInfo.value.loading = true;
const params = {
pageIndex: page.value.curr,
pageSize: page.value.limit,
pageIndex: 1,
pageSize: 50,
guids: guids.value,
}
const res: any = await getLabelPageList(params);
......@@ -691,8 +710,6 @@ const handleSelectChange = async (val, row, info) => {
newCreateGradeFormItems.value[2].default = matchedGrade.guid;
newCreateGradeFormItems.value[0].default = tempFormData.value.label;
newCreateGradeFormItems.value[1].default = tempFormData.value.classifyDetailGuid;
newCreateGradeFormItems.value[3].default = tempFormData.value.matchChValue;
newCreateGradeFormItems.value[4].default = tempFormData.value.matchEnValue;
}
}
};
......@@ -769,9 +786,18 @@ const addRow = () => {
const deleteRow = (index: number) => {
formRows.value.splice(index, 1);
};
const matchChValue = ref({
value: '',
disabled: false
})
const matchEnValue = ref({
value: '',
disabled: false
})
</script>
<template>
<div class="data-label">
<div class="container_wrap full flex">
......@@ -805,13 +831,37 @@ const deleteRow = (index: number) => {
<Dialog_form ref="dialogLabelFormRef" :dialogConfigInfo="newCreateGradeStandardDialogInfo" class="v-dialog-form"
@treeSelectNodeChange='handleTreeSelectNodeChange' @selectChange="handleSelectChange">
<template v-slot:default>
<div class="dim-label">模糊匹配</div>
<div>
<div class="dim-label">
<span class="front">模糊匹配</span>
<el-icon>
<Warning />
</el-icon>
<span class="tip">
精确匹配使用中文;分隔每个规则
</span>
</div>
<div class="v-match">
<el-input v-model="matchChValue.value" :disabled="matchChValue.disabled" maxlength="200"
style="width: 272px;height:94px;" show-word-limit type="textarea" class="no-resize" />
<el-input v-model="matchEnValue.value" :disabled="matchEnValue.disabled" maxlength="200"
style="width: 272px;height:94px;" show-word-limit type="textarea" class="no-resize" />
</div>
</div>
<div class="dim-label" style="margin-top: 16px;">
<span class="front">模糊匹配</span>
<el-icon>
<Warning />
</el-icon>
<span class="tip">
模糊匹配是或的关系,可配置多个模糊匹配规则
</span>
</div>
<!-- 渲染行 -->
<div v-for="(row, index) in formRows" :key="index" class="match-content-wrapper">
<div class="match-content" @mouseenter="handleMouseEnter(index)" @mouseleave="handleMouseLeave()">
<!-- 位置映射下拉框 -->
<el-select v-model="row.name" placeholder="请选语言类型" :disabled=row.disabled class="v-select">
<el-select v-model="row.name" placeholder="请选择中文名/英文名" :disabled=row.disabled class="v-select">
<el-option v-for="option in languageOptions" :key="option.value" :label="option.label"
:value="option.value" />
</el-select>
......@@ -911,6 +961,16 @@ const deleteRow = (index: number) => {
.dim-label {
height: 10px;
display: flex;
align-items: center;
margin-top: 6px;
.front {
margin-right: 8px;
}
.tip {
margin-left: 3px;
}
}
.match-content-wrapper {
......@@ -965,5 +1025,21 @@ const deleteRow = (index: number) => {
overflow: auto;
}
}
.v-match {
display: flex;
justify-content: space-between;
margin-top: 10px;
margin-bottom: 10px;
}
:deep(.no-resize) {
height: 94px;
.el-textarea__inner {
min-height: 94px !important;
resize: none;
}
}
}
</style>
......
......@@ -17,9 +17,10 @@ import {
getDbDirTableSelectList,
getTaskExeTreeList,
getGradeList,
getFieldTypeList,
getNewDataTypeList,
} from "@/api/modules/dataInventory";
import existingTableSelect from "./existingTableSelect.vue";
import { ro } from "element-plus/es/locale";
/** 草稿中未建表时就可以编辑表相关信息。如果建表之后就只能编辑字段。 不能修改字段英文名称,数据库修改英文名就相当于删除再添加。都可以直接跳转到*/
......@@ -59,16 +60,13 @@ const treeSelectProps = {
children: "children",
};
const treeSelectOptions = ref<any>([]);
// 存储引用的refGradeGuid
const refGradeGuid = ref<any>();
const getFieldTree = () => {
getTaskExeTreeList({ execGuid: execGuid.value }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data || [];
classifyList.value = data;
treeSelectOptions.value = data;
// 遍历data,找到refGradeGuid,不用递归,找第一层
} else {
ElMessage.error(res.msg);
}
......@@ -94,7 +92,7 @@ const getFieldTypeData = async () => {
const params = {
dictType: "字段类型"
}
const res: any = await getFieldTypeList(params);
const res: any = await getNewDataTypeList(params);
if (res.code == proxy.$passCode) {
fieldData.value = res.data;
} else {
......@@ -108,7 +106,7 @@ const findRefGradeGuid = (data, targetClassifyDetailGuid) => {
for (const item of data) {
// 判断当前节点是否匹配
if (item.classifyDetailGuid === targetClassifyDetailGuid) {
return item.refGradeGuid; // 找到匹配的,返回 refGradeGuid
return item; // 找到匹配的,返回 refGradeGuid
}
// 如果当前节点有 children,则递归查找子节点
......@@ -121,16 +119,19 @@ const findRefGradeGuid = (data, targetClassifyDetailGuid) => {
}
return null; // 没有找到匹配项时返回 null
};
const refGradeGuid = ref<any>('');
const editRow = (row) => {
// 进入编辑模式时,查找classifyDetailGuid所在的refGradeGuid
let refGradeGuid = findRefGradeGuid(treeSelectOptions.value, row.classifyDetailGuid);
getGradeList({ classifyGradeGuid: refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
refGradeGuid.value = findRefGradeGuid(treeSelectOptions.value, row.classifyDetailGuid);
if (refGradeGuid.value) {
getGradeList({ classifyGradeGuid: refGradeGuid.value.refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
if (res.code === proxy.$passCode) {
row.gradeOptions = res.data.records || [];
} else {
ElMessage.error(res.msg);
}
});
}
// 这个是指定是否能编辑的字段
editableFields.sourceFieldName = false;
row.isEdit = true
......@@ -146,7 +147,14 @@ const handleGradeChange = (row) => {
};
// 保存数据
const saveRow = (row) => {
console.log('保存数据', row)
if (!row.fieldName) {
ElMessage({
type: "error",
message: "字段英文名不能为空!",
});
return;
}
refGradeGuid.value = '';
editableFields.sourceFieldName = true;
row.isEdit = false
}
......@@ -209,20 +217,25 @@ const getNextTableInfo = async (params) => {
const handleClassifyChange = (row) => {
const handleClassifyChange = (row, value) => {
console.log('分类改变', row, value)
if (!row.classifyDetailGuid) {
row.gradeGuid = null;
row.gradeOptions = [];
return;
}
getGradeList({ classifyGradeGuid: row.classifyDetailGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
if (res.code === 200) {
refGradeGuid.value = findRefGradeGuid(treeSelectOptions.value, row.classifyDetailGuid);
console.log('refGradeGuid', refGradeGuid.value)
row.classifyDetailName = refGradeGuid.value.classifyName;
getGradeList({ classifyGradeGuid: refGradeGuid.value.refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
if (res.code === proxy.$passCode) {
row.gradeOptions = res.data.records || [];
} else {
ElMessage.error(res.msg);
}
});
};
const isPrevious = ref(false);
......@@ -258,53 +271,47 @@ const editableFields = {
}
const tableFieldsLoading = ref(false)
// 当前选中的行
const selectedRows = ref([]);
// 监听选中行
// 监听选中行变化
const selectionFieldsChange = (selection) => {
console.log('selection', selection)
selectedRows.value = selection;
};
// 上移功能
// 上移操作
const moveUp = () => {
// 1. 找到选中行在 tableData 中的索引
const selectedIds = selectedRows.value.map((row: any) => row.id);
// 2. 遍历选中行,按顺序上移
for (let i = 0; i < tableDataDetailInfo.value.length; i++) {
const currentRow = tableDataDetailInfo.value[i];
// 如果当前行被选中,且不是第一行,则交换位置
if (selectedIds.includes(currentRow.id) && i > 0) {
const previousRow = tableDataDetailInfo.value[i - 1];
// 如果上一行没有被选中,交换位置
if (!selectedIds.includes(previousRow.id)) {
[tableDataDetailInfo.value[i], tableDataDetailInfo.value[i - 1]] = [tableDataDetailInfo.value[i - 1], tableDataDetailInfo.value[i]];
}
if (selectedRows.value.length === 0) {
proxy.$message.warning("请选择数据!");
return;
}
selectedRows.value.forEach((row: any) => {
const index = tableDataDetailInfo.value.findIndex((item) => item.guid === row.guid);
if (index > 0) {
[tableDataDetailInfo.value[index - 1], tableDataDetailInfo.value[index]] = [
tableDataDetailInfo.value[index],
tableDataDetailInfo.value[index - 1],
];
}
});
};
// 下移功能
// 下移操作
const moveDown = () => {
// 1. 找到选中行在 tableData 中的索引
const selectedIds = selectedRows.value.map((row: any) => row.id);
// 2. 遍历选中行,倒序下移
for (let i = tableDataDetailInfo.value.length - 1; i >= 0; i--) {
const currentRow = tableDataDetailInfo.value[i];
// 如果当前行被选中,且不是最后一行,则交换位置
if (selectedIds.includes(currentRow.id) && i < tableDataDetailInfo.value.length - 1) {
const nextRow = tableDataDetailInfo.value[i + 1];
// 如果下一行没有被选中,交换位置
if (!selectedIds.includes(nextRow.id)) {
[tableDataDetailInfo.value[i], tableDataDetailInfo.value[i + 1]] = [tableDataDetailInfo.value[i + 1], tableDataDetailInfo.value[i]];
}
if (selectedRows.value.length === 0) {
proxy.$message.warning("请选择数据!");
return;
}
// 倒序遍历选中行
[...selectedRows.value].reverse().forEach((row: any) => {
const index = tableDataDetailInfo.value.findIndex((item) => item.guid === row.guid);
if (index < tableDataDetailInfo.value.length - 1) {
[tableDataDetailInfo.value[index], tableDataDetailInfo.value[index + 1]] = [
tableDataDetailInfo.value[index + 1],
tableDataDetailInfo.value[index],
];
}
});
};
......@@ -336,6 +343,7 @@ const batchDelete = () => {
// 新增一行
const addRow = () => {
refGradeGuid.value = '';
tableDataDetailInfo.value.push({
id: tableDataDetailInfo.value.length + 1,
fieldName: '',
......@@ -349,6 +357,8 @@ const addRow = () => {
dictionaryGuid: '',
isEdit: true,
gradeOptions: [],
classifyDetailName: '',
gradeDetailName: '',
})
}
......@@ -651,7 +661,19 @@ const createNewSql = () => {
newCreateSqlDialogInfo.value.visible = true;
}
const inputLengthKeyUp = (regexp, scope, field, max: any = null, min: any = null) => {
scope.row[field] = scope.row[field].replace(regexp, '');
if (field == 'fieldLength' && scope.row.dataType == 'decimal') {
max = 65;
}
/** 最大值设置2000 */
if (max && scope.row[field] > max) {
scope.row[field] = max;
}
if (min !== null && scope.row[field] != '' && scope.row[field] <= min) {
scope.row[field] = min;
}
}
</script>
<template>
......@@ -734,7 +756,8 @@ const createNewSql = () => {
<span v-if="!scope.row.isEdit || !editableFields.fieldName">{{ scope.row.fieldName ?
scope.row.fieldName
: '--' }}</span>
<el-input v-else v-model="scope.row.fieldName" placeholder="请输入" />
<el-input v-else v-model="scope.row.fieldName" placeholder="必填"
@input="inputLengthKeyUp(/[^a-zA-Z0-9_]/g, scope, 'fieldName')" />
</template>
</el-table-column>
<!-- 源数据库 -->
......@@ -784,21 +807,36 @@ const createNewSql = () => {
<!-- 长度(可编辑) -->
<el-table-column prop="fieldLength" label="长度" width="120" align="center">
<template #default="scope">
<span v-if="!scope.row.isEdit || !editableFields.fieldLength">{{ scope.row.fieldLength ?
scope.row.fieldLength
: '--' }}</span>
<el-input v-else v-model="scope.row.fieldLength" placeholder="请输入长度" />
<!-- 非编辑状态 -->
<span v-if="!scope.row.isEdit">
{{ ['varchar', 'decimal', 'char'].includes(scope.row.fieldType) ? scope.row.fieldLength || '--' : '--'
}}
</span>
<!-- 编辑状态 -->
<div v-else>
<el-input v-if="['varchar', 'decimal', 'char'].includes(scope.row.fieldType)"
v-model="scope.row.fieldLength" placeholder="请输入长度"
@input="inputLengthKeyUp(/\D/g, scope, 'fieldLength', 2000, 1)" />
<span v-else>--</span>
</div>
</template>
</el-table-column>
<!-- 精度(可编辑)fieldPrecision -->
<!-- 精度(可编辑) -->
<el-table-column prop="fieldPrecision" label="精度" width="120" align="center">
<template #default="scope">
<span v-if="!scope.row.isEdit || !editableFields.fieldPrecision">{{ scope.row.fieldPrecision ?
scope.row.fieldPrecision : '--' }}</span>
<el-input v-else v-model="scope.row.fieldPrecision" placeholder="请输入精度" />
<!-- 非编辑状态 -->
<span v-if="!scope.row.isEdit">
{{ scope.row.fieldType === 'decimal' ? scope.row.fieldPrecision || '--' : '--' }}
</span>
<!-- 编辑状态 -->
<div v-else>
<el-input v-if="scope.row.fieldType === 'decimal'" v-model="scope.row.fieldPrecision"
placeholder="请输入精度" @input="inputLengthKeyUp(/\D/g, scope, 'fieldPrecision', 30, 1)" />
<span v-else>--</span>
</div>
</template>
</el-table-column>
<!-- 关联字典(可编辑)el-tree-select 形式下拉形式 -->
<el-table-column prop="dictionaryGuid" label="关联字典" width="150" align="center">
<template #default="scope">
......@@ -839,7 +877,7 @@ const createNewSql = () => {
<div v-if="scope.row.isEdit">
<el-tree-select v-model="scope.row.classifyDetailGuid" :data="treeSelectOptions"
:props="treeSelectProps" placeholder="请选择分类" clearable filterable
@change="handleClassifyChange(scope.row)">
@change="(value) => handleClassifyChange(scope.row, value)">
</el-tree-select>
</div>
<!-- 否则直接显示分类名称 -->
......
......@@ -33,6 +33,7 @@ import {
getSubjectTableDetail,
checkSubjectTableData
} from "@/api/modules/dataCatalogService";
import { getFidldEnName, getGradeList, getNewDataTypeList, getTaskExeTreeList } from "@/api/modules/dataInventory";
import { useDefault } from "@/hooks/useDefault";
import uploadExcelFile from "./components/uploadExcelFile.vue";
......@@ -47,6 +48,7 @@ const isDimTable = route.query.isDim;
const subjectDomainGuid: any = ref(route.query.domainGuid);
const fullPath = route.fullPath;
const standardSetGuids = ref([]);
const execGuid = ref(route.query.execGuid);
//记录已入库的表创建信息。
const originTableCreateInfo = ref({});
......@@ -111,7 +113,7 @@ const uploadFileRef = ref();
const getSubjectField = () => {
tableFieldsLoading.value = true;
getSubjectFieldByFile(fileTableFields.value.map(f => f.chName), tableCreateInfo.value.tableData[0].subjectDomainGuid).then((res: any) => {
getFidldEnName(fileTableFields.value.map(f => f.chName)).then((res: any) => {
tableFieldsLoading.value = false;
if (res.code == proxy.$passCode) {
tableCreateInfo.value.tableFields = res.data?.map((field, i) => {
......@@ -127,6 +129,72 @@ const getSubjectField = () => {
});
}
// 定义分类选择器的属性
const treeSelectProps = {
label: "classifyName",
value: "classifyDetailGuid",
children: "children",
};
const treeSelectOptions = ref<any>([]);
const getFieldTree = () => {
getTaskExeTreeList({ execGuid: execGuid.value }).then((res: any) => {
if (res.code == proxy.$passCode) {
treeSelectOptions.value = res.data || [];
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
ElMessage.error('获取分类树形数据失败');
})
}
const handleClassifyChange = (row, value) => {
// 查找选中的节点
const selectedNode = getTreeNode(treeSelectOptions.value, value);
if (selectedNode) {
getGradeList({ classifyGradeGuid: selectedNode.refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
if (res.code === proxy.$passCode) {
row.gradeOptions = res.data.records || [];
} else {
ElMessage.error(res.msg);
}
});
console.log("选中的节点信息:", selectedNode);
row.classifyName = selectedNode.classifyName; // 假设树节点的 `label` 是分类名
} else {
console.error("未找到对应的节点");
row.classifyName = ""; // 重置分类名
}
};
const getTreeNode = (tree, value) => {
for (const node of tree) {
if (node.classifyDetailGuid === value) {
return node; // 找到对应节点
}
if (node.children) {
const found = getTreeNode(node.children, value);
if (found) return found; // 如果子节点中找到,返回子节点
}
}
return null; // 如果未找到,返回 null
};
const handleGradeChange = (row) => {
console.log('分级改变', row)
const gradeOptions = row.gradeOptions || [];
const matchedItem = gradeOptions.find((item) => item.guid === row.gradeDetailGuid);
if (matchedItem) {
row.gradeDetailName = matchedItem.name;
}
};
// 分级的数据props
const gradeSelectProps = {
value: 'guid',
label: 'name',
}
const nextStep = () => {
uploadFileRef.value.fileFormRef.ruleFormRef.validate((valid) => {
if (valid) {
......@@ -156,6 +224,7 @@ const nextStep = () => {
if (!tableCreateInfo.value.tableFields.length) {
getSubjectField();
}
getFieldTree();
}
});
};
......@@ -478,7 +547,10 @@ const getDimListData = () => {
};
const getFieldTypeList = () => {
getDataTypeList().then((res: any) => {
const params = {
dictType: "字段类型"
}
getNewDataTypeList(params).then((res: any) => {
fieldTypes.value = [];
if (res.code == proxy.$passCode) {
fieldTypes.value = res.data || [];
......@@ -973,14 +1045,14 @@ const handleFieldClickEdit = (scope) => {
//点击保存按钮
const handleFieldClickSave = (scope) => {
if (isOpenStandard.value && !scope.row.fieldStandardCode) {
ElMessage({
type: "error",
message: "该主题域开启了字段标准,当前行字段标准不能为空!",
});
return;
}
if (!scope.row.enName) {
// if (isOpenStandard.value && !scope.row.fieldStandardCode) {
// ElMessage({
// type: "error",
// message: "该主题域开启了字段标准,当前行字段标准不能为空!",
// });
// return;
// }
if (!scope.row.fieldName) {
ElMessage({
type: "error",
message: "字段英文名不能为空!",
......@@ -1130,13 +1202,13 @@ const saveTable = () => {
});
return;
}
if (!tableData.dataServerName) {
ElMessage({
type: "error",
message: "数据源不能为空!",
});
return;
}
// if (!tableData.dataServerName) {
// ElMessage({
// type: "error",
// message: "数据源不能为空!",
// });
// return;
// }
if (tableData.dataServerName.indexOf('-') > -1) {
ElMessage.error('数据库表名称不能包含中划线,可以改为下划线!');
return;
......@@ -1179,26 +1251,26 @@ const saveTable = () => {
const regex = /^[a-zA-Z]/;
let index = 1;
for (const field of tableFields) {
if (!field.enName) {
if (!field.fieldName) {
ElMessage.error(`第 ${index} 个字段的英文名称不能为空!`);
return;
}
if (!regex.test(field.enName)) {
if (!regex.test(field.fieldName)) {
ElMessage.error(`第 ${index} 个字段的英文名称必须以英文字符开头`);
return;
}
if (enNames.indexOf(field.enName) > -1) {
ElMessage.error(`字段的英文名称 ${field.enName} 不能重复!`);
if (enNames.indexOf(field.fieldName) > -1) {
ElMessage.error(`字段的英文名称 ${field.fieldName} 不能重复!`);
return;
}
if (chNames.indexOf(field.chName) > -1) {
ElMessage.error(`字段的英文名称 ${field.chName} 不能重复!`);
return;
}
if (isOpenStandard.value && !field.fieldStandardCode) {
ElMessage.error(`开启了字段强标准,第 ${index} 个字段的标准不能为空!`);
if (chNames.indexOf(field.fieldChName) > -1) {
ElMessage.error(`字段的英文名称 ${field.fieldChName} 不能重复!`);
return;
}
// if (isOpenStandard.value && !field.fieldStandardCode) {
// ElMessage.error(`开启了字段强标准,第 ${index} 个字段的标准不能为空!`);
// return;
// }
if (field.dataType === "decimal" && (!field.fieldPrecision && field.fieldPrecision != 0)) {
ElMessage.error(`第 ${index} 个字段的字段类型为浮点型时,精度不能为空`);
return;
......@@ -1505,7 +1577,7 @@ const tableSelectFields = computed(() => {
<el-input v-model.trim="scope.row['chName']" placeholder="必填" :maxlength="50" />
</template>
</el-table-column>
<el-table-column prop="subjectDomain" label="主题域" width="180px" align="left" show-overflow-tooltip>
<!-- <el-table-column prop="subjectDomain" label="主题域" width="180px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-input disabled v-model.trim="scope.row['subjectDomain']" />
</template>
......@@ -1576,7 +1648,7 @@ const tableSelectFields = computed(() => {
:value="opt['paramValue']" />
</el-select>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column prop="description" label="描述" width="220px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-input v-model.trim="scope.row['description']" />
......@@ -1631,22 +1703,21 @@ const tableSelectFields = computed(() => {
<span v-else>{{ scope.row["fieldStandardName"] || "--" }}</span>
</template>
</el-table-column>
<el-table-column prop="chName" label="目标字段名" width="150px" align="left" show-overflow-tooltip>
<el-table-column prop="fieldChName" label="目标字段名" width="150px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-input v-if="scope.row['isEdit'] && !isOpenStandard"
:placeholder="fieldStandardSetGuids?.length ? '输入匹配标准' : ''" v-model.trim="scope.row['chName']"
@change="(v) => handleFieldChineseNameChange(v, scope)" />
<span v-else>{{ scope.row["chName"] || '--' }}</span>
<el-input v-if="scope.row['isEdit']" :placeholder="fieldStandardSetGuids?.length ? '输入匹配标准' : ''"
v-model.trim="scope.row['fieldChName']" @change="(v) => handleFieldChineseNameChange(v, scope)" />
<span v-else>{{ scope.row["fieldChName"] || '--' }}</span>
</template>
</el-table-column>
<el-table-column prop="enName" label="目标字段英文名" width="150px" align="left" show-overflow-tooltip>
<el-table-column prop="fieldName" label="目标字段英文名" width="150px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-input v-if="scope.row['isEdit'] && !isOpenStandard" v-model.trim="scope.row['enName']"
placeholder="必填" @input="inputLengthKeyUp(/[^a-zA-Z0-9_]/g, scope, 'enName')" />
<span v-else>{{ scope.row["enName"] || '--' }}</span>
<el-input v-if="scope.row['isEdit']" v-model.trim="scope.row['fieldName']" placeholder="必填"
@input="inputLengthKeyUp(/[^a-zA-Z0-9_]/g, scope, 'fieldName')" />
<span v-else>{{ scope.row["fieldName"] || '--' }}</span>
</template>
</el-table-column>
<el-table-column prop="fileFieldName" label="文件字段名" width="150px" align="left" show-overflow-tooltip>
<!-- <el-table-column prop="fileFieldName" label="文件字段名" width="150px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-select v-if="scope.row['isEdit']" v-model="scope.row['fileFieldName']" clearable filterable
placeholder="请选择">
......@@ -1655,13 +1726,13 @@ const tableSelectFields = computed(() => {
</el-select>
<span v-else>{{ scope.row['fileFieldName'] || "--" }}</span>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column prop="dataType" label="字段类型" width="120px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-select v-if="scope.row['isEdit'] && !isOpenStandard" v-model="scope.row['dataType']"
<el-select v-if="scope.row['isEdit']" v-model="scope.row['dataType']"
@change="(val) => dataTypeChange(val, scope)" placeholder="请选择">
<el-option v-for="opt in fieldTypes" :key="opt['paramValue']" :label="opt['paramName']"
:value="opt['paramValue']" />
<el-option v-for="opt in fieldTypes" :key="opt['value']" :label="opt['label']"
:value="opt['value']" />
</el-select>
<span v-else>{{ fieldTypes.find(f => f.paramValue === scope.row["dataType"])?.paramName || "--"
}}</span>
......@@ -1670,7 +1741,7 @@ const tableSelectFields = computed(() => {
<el-table-column prop="fieldLength" label="长度" width="115px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-input
v-if="scope.row['isEdit'] && !isOpenStandard && (scope.row['dataType'] == 'varchar' || scope.row['dataType'] == 'decimal' || scope.row['dataType'] == 'char')"
v-if="scope.row['isEdit'] && (scope.row['dataType'] == 'varchar' || scope.row['dataType'] == 'decimal' || scope.row['dataType'] == 'char')"
v-model.trim="scope.row['fieldLength']" placeholder="必填"
@input="inputLengthKeyUp(/\D/g, scope, 'fieldLength', 2000, 1)" />
<span v-else>{{ scope.row["fieldLength"] == null ? '--' : scope.row["fieldLength"] }}</span>
......@@ -1678,7 +1749,7 @@ const tableSelectFields = computed(() => {
</el-table-column>
<el-table-column prop="fieldPrecision" label="精度" width="115px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-input v-if="scope.row['isEdit'] && !isOpenStandard && scope.row['dataType'] == 'decimal'"
<el-input v-if="scope.row['isEdit'] && scope.row['dataType'] == 'decimal'"
v-model.trim="scope.row['fieldPrecision']" placeholder="必填"
@input="inputLengthKeyUp(/\D/g, scope, 'fieldPrecision', 30, 1)" />
<span v-else>{{ scope.row["fieldPrecision"] == null ? '--' : scope.row["fieldPrecision"] }}</span>
......@@ -1734,11 +1805,43 @@ const tableSelectFields = computed(() => {
<span v-else>{{ scope.row["notNull"] || '--' }}</span>
</template>
</el-table-column>
<el-table-column prop="defaultValue" label="默认值" width="205px" align="left" show-overflow-tooltip>
<!-- 分类 -->
<el-table-column prop="classifyDetailGuid" label="分类" width="120px" align="center" show-overflow-tooltip>
<template #default="scope">
<tableDefaultValue :scope="scope" :dbType="dbType"></tableDefaultValue>
<!-- 如果当前行是编辑状态,显示 tree-select -->
<div v-if="scope.row.isEdit">
<el-tree-select v-if="scope.row['isEdit']" v-model="scope.row['classifyDetailGuid']" placeholder="请选择"
:data="treeSelectOptions" :props="treeSelectProps" clearable filterable
@change="(value) => handleClassifyChange(scope.row, value)">
</el-tree-select>
</div>
<!-- 显示treeSelectOptions classifyDetailGuid所在itemclassifyName-->
<div v-else>{{ scope.row.classifyName || '--' }}</div>
</template>
</el-table-column>
<!-- 分级 -->
<el-table-column prop="gradeDetailGuid" label="分级" width="120" align="center" show-overflow-tooltip>
<template #default="scope">
<div v-if="scope.row.isEdit">
<el-select v-if="scope.row['isEdit']" v-model="scope.row['gradeDetailGuid']" placeholder="请选择分级"
clearable filterable :props="gradeSelectProps" @change="handleGradeChange(scope.row)">
<el-option v-for="(item, index) in scope.row.gradeOptions || []" :key="index" :label="item.name"
:value="item.guid"></el-option>
</el-select>
</div>
<div v-else>
{{ scope.row.gradeDetailName || '--' }}
</div>
</template>
</el-table-column>
<!-- <el-table-column prop="defaultValue" label="默认值" width="205px" align="left" show-overflow-tooltip>
<template #default="scope">
<tableDefaultValue :scope="scope" :dbType="dbType"></tableDefaultValue>
</template>
</el-table-column> -->
<el-table-column label="操作" width="100px" align="left" fixed="right" show-overflow-tooltip>
<template #default="scope">
<span class="text_btn" v-if="!scope.row['isEdit']" @click="handleFieldClickEdit(scope)"
......
......@@ -87,8 +87,8 @@ const tabsInfo = ref({
activeName: 'gradeStandard',
tabs: [
// { label: '分类分级模板', name: 'classTemplate' },
{ label: '分级标准', name: 'gradeStandard' },
{ label: '分类标准', name: 'classStandard' },
{ label: '分级规则', name: 'gradeStandard' },
{ label: '分类规则', name: 'classStandard' },
]
});
......@@ -106,7 +106,7 @@ const classSearchItemList = ref([
field: 'classStandardName',
default: '',
maxlength: 50,
placeholder: '分类标准名称',
placeholder: '分类名称',
clearable: true,
visible: true
}
......
......@@ -104,7 +104,7 @@ const tableInfo = ref({
actionInfo: {
label: "操作",
type: "btn",
width: 230,
width: 210,
fixed: 'right',
btns: (scope) => {
const row = scope.row
......@@ -114,7 +114,7 @@ const tableInfo = ref({
} else {
btnsArr.splice(0, 0, { label: "立即执行", value: "carry", disabled: row.taskState === 0 || row.execState == 1 })
}
btnsArr.push({ label: "编辑", value: "edit", disabled: row.taskState === 1 || row.isCarry || row.execState == 1 });
// btnsArr.push({ label: "编辑", value: "edit", disabled: row.taskState === 1 || row.isCarry || row.execState == 1 });
btnsArr.push({ label: "删除", value: "delete", disabled: row.isCarry || row.taskState === 1 || row.execState == 1 });
btnsArr.push({ label: "执行日志", value: "log" });
return btnsArr
......@@ -472,18 +472,19 @@ const setDetailInfo = (row) => {
}
const getDataSourceList = () => {
getDatabase({ connectStatus: 1 }).then((res: any) => {
if (res.code == proxy.$passCode) {
dataSourceList.value = res.data || [];
formItems.value[1].options = dataSourceList.value;
searchItemList.value[1].options = dataSourceList.value;
} else {
proxy.$ElMessage({
type: "error",
message: res.msg,
});
}
})
// TODO
// getDatabase({ connectStatus: 1 }).then((res: any) => {
// if (res.code == proxy.$passCode) {
// dataSourceList.value = res.data || [];
// formItems.value[1].options = dataSourceList.value;
// searchItemList.value[1].options = dataSourceList.value;
// } else {
// proxy.$ElMessage({
// type: "error",
// message: res.msg,
// });
// }
// })
}
const radioGroupChange = (val, info) => {
......@@ -597,7 +598,7 @@ onBeforeMount(() => {
<!-- 头部搜索 -->
<TableTools :searchItems="searchItemList" :searchId="'data-source-search'" @search="toSearch" :init="false" />
<div class="tools_btns">
<el-button type="primary" @click="loadDrawer">新建</el-button>
<!-- <el-button type="primary" @click="loadDrawer">新建</el-button> -->
<el-button @click="importMeta">导入</el-button>
</div>
</div>
......
......@@ -61,7 +61,7 @@ const tabsInfo = ref({
tabs: [
{ label: '基础信息', name: 'first' },
// / { label: '数据血缘', name: 'second' },
{ label: '变更记录', name: 'third' }
//{ label: '变更记录', name: 'third' }
]
})
/** 切换布局 */
......@@ -191,13 +191,14 @@ const tabsPaneMap = ref({
type: 'table',
tableInfo: fieldTableInfo.value,
show: true
}, {
title: '索引信息',
type: 'table',
isIndex: true,
tableInfo: indexTableInfo.value,
show: true
},
// {
// title: '索引信息',
// type: 'table',
// isIndex: true,
// tableInfo: indexTableInfo.value,
// show: true
// },
],
second: [
{
......@@ -309,10 +310,10 @@ const lineageDataLoading = ref(true);
const getDetailInfo = () => {
getSheetDetail()
getSheetField()
getSheetKeys()
// getSheetKeys()
logPage.value.curr = 1
getSheetLog();
getTableLineageMap();
//getSheetLog();
// getTableLineageMap();
}
const getSheetDetail = () => {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!