923dcb90 by xukangle

Merge branch 'dev_20241202_xukangle' into develop

2 parents 2549571b f278ba6b
......@@ -36,6 +36,9 @@ VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory
# 数据字典接口地址
VITE_APP_CONFIG_URL = 'ms-daop-configure-service'
# 文件上传下载接口地址
VITE_APP_COMMON_URL = 'ms-daop-common-service'
#门户接口
VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal
......
......@@ -644,15 +644,46 @@ export const getDbDirFieldPageList = (data) => request({
data
})
/**
* 数据库目录-表联动查询
* @param data
* @returns
* @path /db-dir/table/select-list
*/
export const getDbDirTableSelectList = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/select-list`,
method: 'post',
data
})
/** 获取已有字段信息 */
export const getDsTableStructure= (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guid`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guid?tableGuid=${data.tableGuid}&execGuid=${data.execGuid}`,
method: 'post',
data
});
/** 获取已有数据库目录字段信息 入参是数组 */
export const getDsTableStructures= (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guids`,
method: 'post',
data
});
/**
* 数据库目录-字段查询分类分级
* @param {Object}
* @path /db-dir/field/get-classify-and-grade
*/
export const getDbDirFieldClassifyAndGrade = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/get-classify-and-grade`,
method: 'post',
data
})
/** 根据选择的连接池获取表列表 */
export const getDsTableByDs = (params) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/list-by-datasource-guid`,
......
import request from "@/utils/request";
//获取下载签名
export const getDownFileSignByUrl = (params) => {
return request({
url: `${
import.meta.env.VITE_APP_COMMON_URL
}/obs/generate-download-file-signature?fileName=${params.fileName}`,
method: "get",
});
};
//obs下载
export const obsDownloadRequest = (params) => {
return request({
withCredentials: false,
headers: params.actualSignedRequestHeaders
? {
"Content-Type": params.actualSignedRequestHeaders["Content-Type"],
}
: {},
validateStatus: function (status) {
return status >= 200;
},
url: params.signedUrl,
responseType: "blob",
maxRedirects: 0,
data: { unused: 0 },
method: "get",
});
};
//获取上传签名
export const getUpFileSignByUrl = (params) => {
return request({
url: `${
import.meta.env.VITE_APP_COMMON_URL
}/obs/generate-file-signature?fileName=${params.fileName}`,
method: "get",
});
};
//obs上传
export const obsUploadRequest = (params) => {
return request({
withCredentials: false,
headers: params.actualSignedRequestHeaders ? {
"Content-Type": params.actualSignedRequestHeaders[
"Content-Type"
]
} : {},
validateStatus: function (status) {
return status >= 200;
},
url: params.signedUrl,
method: "put",
data: params.file,
});
};
export const getImageContent = (params) => request({
url: `${import.meta.env.VITE_APP_COMMON_URL}/obs/view-pic?filePath=${params.split("?")[0]}`,
method: 'get',
responseType: 'blob'
});
......@@ -19,10 +19,15 @@ import Schedule from "../Schedule/index.vue";
import { setFormFields, setItemsDisabled, getDownloadUrl, download } from '@/utils/common';
import { ElMessage, ElMessageBox } from 'element-plus';
import useUserStore from "@/store/modules/user";
// import {
// getFileUrl,
// getImageContent
// } from '@/api/modules/queryService';
import {
getFileUrl,
getImageContent
} from '@/api/modules/queryService';
getImageContent,
getUpFileSignByUrl,
obsUploadRequest
} from "@/api/modules/obsSerivice";
import { Editor, EditorExpose } from '@/components/Editor'
const userStore = useUserStore()
......@@ -444,29 +449,35 @@ const uploadFile = (file, item) => {
return Promise.resolve();
}
ruleFormRef.value?.clearValidate([item.field]);
let formData = new FormData();
formData.append('file', file.file);
formData.append('fileName', file.file.name);
return getFileUrl(formData)
// let formData = new FormData();
// formData.append('file', file.file);
// formData.append('fileName', file.file.name);
return getUpFileSignByUrl({ fileName: file.file.name })
.then((res: any) => {
if (res.code == '00000') {
let fileItem = {
name: file.file.name,
url: res.data,
file: file.file
};
if (item.limit === 1) {
formInline.value[item.field] = [fileItem];
obsUploadRequest({
signedUrl: res.data.signedUrl,
file: file.file,
actualsignedRequestHeaders: res.data.actualsignedRequestHeaders
}).then(() => {
if (res.code == '00000') {
let fileItem = {
name: file.file.name,
url: res.data.signedUrl,
file: file.file
};
if (item.limit === 1) {
formInline.value[item.field] = [fileItem];
} else {
formInline.value[item.field].push(fileItem);
}
ruleFormRef.value?.validateField([item.field]);
ElMessage.success('上传成功');
emits("uploadFileChange", formInline.value[item.field]);
} else {
formInline.value[item.field].push(fileItem);
uploadRef.value['ref' + item.field].handleRemove(file);
ElMessage.error('上传失败,请重新上传!');
}
ruleFormRef.value?.validateField([item.field]);
ElMessage.success('上传成功');
emits("uploadFileChange", formInline.value[item.field]);
} else {
uploadRef.value['ref' + item.field].handleRemove(file);
ElMessage.error('上传失败,请重新上传!');
}
})
})
.catch(() => {
uploadRef.value['ref' + item.field].handleRemove(file);
......
......@@ -206,7 +206,7 @@ export const getDbDirTreeList = {
return {
code: '00000',
message: '成功',
'data|10-30': [{
'data|10-30': {
cgDirName: '@cword(3, 5)',
'children|1-3': [{
databaseGuid: '@guid',
......@@ -218,7 +218,7 @@ export const getDbDirTreeList = {
tableChName: '@cword(3, 5)'
}]
}]
}]
}
}
}
}
......@@ -616,8 +616,221 @@ export const createTableSql = {
}
}
/** 获取已有数据库目录字段信息 入参是数组
export const getDsTableStructures= (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guids`,
method: 'post',
data
});
* "data": [
{
"guid": "string",
"sourceTableName": "string",
"sourceDatabase": "string",
"sourceFieldName": "string",
"sourceFieldChName": "string",
"fieldGuid": "string",
"fieldName": "string",
"fieldChName": "string",
"fieldType": "string",
"fieldLength": 0,
"fieldPrecision": 0,
"dimGuid": "string",
"dictionaryGuid": "string",
"sortValue": 0,
"isPrimary": "string",
"isFk": "string",
"isNotNull": "string",
"classifyDetailGuid": "string",
"classifyDetailName": "string",
"gradeDetailGuid": "string",
"gradeDetailName": "string"
}
],
*/
// 模拟 getDsTableStructures 接口
export const getDsTableStructures = {
url: '/mock/db-dir/field/list-by-table-guids',
method: 'post',
response: ({ body }: { body: any }) => {
return {
code: '00000',
message: '成功',
'data|2-5': [
{
guid: '@guid',
sourceTableName: '@cword(3, 5)',
sourceDatabase: '@cword(3, 5)',
sourceFieldName: '@cword(3, 5)',
sourceFieldChName: '@cword(3, 5)',
fieldGuid: '@guid',
fieldName: '@cword(3, 5)',
fieldChName: '@cword(3, 5)',
fieldType: '@cword(3, 5)',
fieldLength: '@integer(1, 100)',
fieldPrecision: '@integer(1, 100)',
dimGuid: '@guid',
dictionaryGuid: '@guid',
sortValue: '@integer(1, 100)',
isPrimary: 'Y',
isFk: 'Y',
isNotNull: 'Y',
classifyDetailGuid: () => {
return Math.floor(Math.random() * 2) + 3; // 随机生成 3 或 4
},
classifyDetailName: '@cword(3, 5)',
gradeDetailGuid: '@guid',
gradeDetailName: '@cword(3, 5)'
}
]
};
}
};
// 模拟 getGradeDetails 接口
export const getGradeDetails = {
url: '/mock/grade-details',
method: 'post',
response: ({ body }: { body: any }) => {
return {
code: '00000',
message: '成功',
data: [{
}]
};
}
};
let currentGuid = 2;
// 模拟 getTaskExeTreeList 接口
export const getTaskExeTreeList = {
url: '/mock/cg-task-exec/classify/tree-list',
method: 'get',
response: ({ body }: { body: any }) => {
return {
code: '00000',
message: '成功',
data: [{
"guid": 1,
"classifyName": "听参我完",
"parentGuid": 1,
"gradeGuid":1,
"parentGuids": [
"39Ec3B98-EA2F-f5FF-Fc3b-EfAfe1fce91C",
"14be757b-8f0e-3DB9-5AaE-8cfeC18B2322"
],
"children": [
{
"classifyName": "素新议白",
"parentGuid": 4,
"gradeGuid":2,
"parentGuids": [
"de6A2ED4-Dc2f-DBf2-4d14-ceD8fd5BBa7C"
],
"children": [
{
"classifyName": "置表京革",
"parentGuid": 5,
"gradeGuid":3,
"parentGuids": [
"E2FAe9b2-3bc3-B6f7-f99a-964C6ae9dFCE",
"18EA10f2-7f1a-4ADA-cEba-d1dF44ED74cB"
],
"guid": 3
}
],
"guid": 10
}
],
},
{
"guid": 7,
"classifyName": "大头儿子",
"parentGuid": 1,
"gradeGuid":4,
"parentGuids": [
"39Ec3B98-EA2F-f5FF-Fc3b-EfAfe1fce91C",
"14be757b-8f0e-3DB9-5AaE-8cfeC18B2322"
],
"children": [
{
"classifyName": "小头把把",
"parentGuid": 4,
"gradeGuid":5,
"parentGuids": [
"de6A2ED4-Dc2f-DBf2-4d14-ceD8fd5BBa7C"
],
"children": [
{
"classifyName": "喜羊羊",
"parentGuid": 5,
"gradeGuid":6,
"parentGuids": [
"E2FAe9b2-3bc3-B6f7-f99a-964C6ae9dFCE",
"18EA10f2-7f1a-4ADA-cEba-d1dF44ED74cB"
],
"guid": 9
}
],
"guid": 8
}
],
},
]
};
}
};
// 模拟 getGradeList 分级接口 用于获取分级列表
export const getGradeList = {
url: '/mock/grade/page-list',
method: 'post',
response: ({ body }: { body: any }) => {
return {
code: '00000',
message: '成功',
data: {
records:[{
"guid": '1',
"name": "一级",
"parentGuid": 0,
},
{
"guid": '2',
"name": "二级",
"parentGuid": 1,
},
{
"guid": '3',
"name": "三级",
"parentGuid": 2,
},
{
"guid": '4',
"name": "四级",
"parentGuid": 3,
},
{
"guid": '5',
"name": "五级",
"parentGuid": 4,
},
{
"guid": '6',
"name": "六级",
"parentGuid": 5,
},
]
}}
}
};
export default [getCgDirTreeList,getCgDirFieldPageList,
getDictionary,saveBizRuleConfig, getDbDirTreeList,
getDbDirTablePageList,getDbDirDataSourceList,getDsTableByDs,
getDsTableStructure,getDbDirFieldPageList,getBizRuleConfigDetail,
updateBizRuleConfig,saveDbDirTable,createTableSql,updateDbDirTable] as MockMethod[]
updateBizRuleConfig,saveDbDirTable,createTableSql,updateDbDirTable,getDsTableStructures,getGradeDetails,getTaskExeTreeList,getGradeList] as MockMethod[]
......
......@@ -6,10 +6,9 @@
import { ref, onMounted } from "vue";
import useUserStore from "@/store/modules/user";
import { useValidator } from '@/hooks/useValidator';
import { TableColumnWidth } from '@/utils/enum';
import G6 from '@antv/g6';
import { IGroup, ModelConfig } from '@antv/g6';
import { getClassifyGradList, getClassifyTreeList, getGradeList, saveClassify, updateClassify, deleteClassify } from "@/api/modules/dataInventory";
import { getClassifyGradList, getClassifyTreeList, getGradeList, saveClassify, updateClassify, deleteClassify, updateClassifyGrad } from "@/api/modules/dataInventory";
const { required, orderNum } = useValidator();
......@@ -30,19 +29,43 @@ const classStandardFormItems = ref([{
field: 'classStandardName',
default: router.currentRoute.value.query.classStandardName,
clearable: true,
disabled: true,
disabled: false,
required: true
}, {
// label: '分级标准',
// type: 'input',
// placeholder: '请选择',
// field: 'gradeStandard',
// default: '',
// required: true,
// filterable: true,
// clearable: true,
// disabled: false,
// visible: true,
label: '分级标准',
type: 'input',
type: 'select',
placeholder: '请选择',
field: 'gradeStandard',
options: [],
props: {
label: "name",
value: "guid",
},
filterable: true,
clearable: true,
default: '',
required: true,
filterable: true,
block: false,
},
{
label: '分类描述',
type: 'textarea',
placeholder: '请输入',
field: 'description',
default: '',
clearable: true,
disabled: true,
visible: true,
required: false,
block: true
}]);
// 定义层级映射1->一级,2->二级,3->三级,4->四级
......@@ -77,7 +100,7 @@ const tableInfo = ref({
{
label: "最低安全级别参考", field: "name", width: 140, getName: (scope) => {
let dataGrade = scope.row.dataGrade;
return dataGrade + '级';
return dataGrade ? dataGrade + '级' : '--';
}
},
{ label: "修改人", field: "updateUserName", width: 140 },
......@@ -165,7 +188,7 @@ const classEditFormItems = ref([{
type: 'select',
placeholder: '请选择',
field: 'gradeGuid',
default: 1,
default: '',
options: [], //TODO
props: {
label: "name",
......@@ -322,7 +345,9 @@ const drawerBtnClick = async (btn, info) => {
const params = {
...info,
classifyGradeGuid: router.currentRoute.value.query.guid,
guid: currTableInfo.value.guid
guid: currTableInfo.value.guid,
gradeGuid: info.gradeGuid || '',
parentGuid: info.parentGuid || '',
}
const res: any = await updateClassify(params);
if (res.code == proxy.$passCode) {
......@@ -350,8 +375,10 @@ const getClassifyGradListData = async () => {
const res: any = await getClassifyGradList(refGradePageParams.value);
if (res.code == proxy.$passCode) {
classifyGradListData.value = res.data.records || [];
const gradeName = findStandardName(router.currentRoute.value.query.refGradeGuid as any);
classStandardFormItems.value[1].default = gradeName;
classStandardFormItems.value[1].options = classifyGradListData.value;
// const gradeName = findStandardName(router.currentRoute.value.query.refGradeGuid as any);
classStandardFormItems.value[1].default = router.currentRoute.value.query.refGradeGuid;
classStandardFormItems.value[2].default = router.currentRoute.value.query.description;
} else {
proxy.$ElMessage.error(res.msg);
}
......@@ -445,6 +472,39 @@ const newCreateClass = () => {
})
}
const saveLoading = ref(false);
const saveUpdate = async () => {
console.log(formRef.value.formInline);
if (!formRef.value.formInline.classStandardName) {
proxy.$ElMessage.error('分类名称不能为空');
return;
}
if (!formRef.value.formInline.gradeStandard) {
proxy.$ElMessage.error('分级标准不能为空');
return;
}
saveLoading.value = true;
const params = {
guid: router.currentRoute.value.query.guid,
name: formRef.value.formInline.classStandardName,
refGradeGuid: formRef.value.formInline.gradeStandard,
type: 'C',
description: formRef.value.formInline.description
}
console.log(params);
const res: any = await updateClassifyGrad(params);
if (res.code == proxy.$passCode) {
proxy.$ElMessage.success('修改成功');
router.push({
name: 'templateConfig'
});
saveLoading.value = false;
} else {
proxy.$ElMessage.error(res.msg);
}
}
/** 导入分类。 */
const importClass = () => {
......@@ -778,6 +838,7 @@ onMounted(() => {
</div>
<div class="bottom_tool_wrap">
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="saveUpdate" :loading="saveLoading">保存修改</el-button>
</div>
<Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" ref="drawerRef" />
</div>
......@@ -824,11 +885,11 @@ onMounted(() => {
}
.shape-main {
height: calc(100% - 58px);
height: calc(100% - 160px);
}
.table_panel {
height: calc(100% - 58px) !important;
height: calc(100% - 160px) !important;
}
.node-details-popup {
......
......@@ -6,8 +6,11 @@
import router from "@/router";
import { ref } from "vue";
import { saveGrade, getGradeList, deleteGrade, getLargeCategoryList, updateGrade } from '@/api/modules/dataInventory';
import { saveGrade, getGradeList, deleteGrade, getLargeCategoryList, updateGrade, updateClassifyGrad } from '@/api/modules/dataInventory';
import useUserStore from "@/store/modules/user";
const userStore = useUserStore();
const route = useRoute();
const fullPath = route.query.fullPath;
onBeforeMount(() => {
getGradeListData();
getDataGrade();
......@@ -16,7 +19,6 @@ onBeforeMount(() => {
// 获取分级列表
const getGradeListData = async () => {
console.log('调用了吗~~~');
tableInfo.value.loading = true;
const params = {
pageIndex: 1,
......@@ -111,7 +113,8 @@ const tableInfo = ref({
id: "data-class-standard-table",
multiple: true,
fields: [
{ label: "序号", field: 'orderNum', width: 56, align: "center" },
{ label: "序号", type: 'index', width: 56, align: "center" },
{ label: "排序", field: 'orderNum', width: 56, align: "center" },
{
label: "数据级别", field: "dataGrade", width: 120, getName: (scope) => {
let dataGrade = scope.row.dataGrade;
......@@ -124,7 +127,7 @@ const tableInfo = ref({
return classDataRef.value.find((item: any) => item.value === dataClassify)?.label;
}
},
{ label: "分级描述", field: "gradeDesc", align: "left", width: 480 },
{ label: "分级描述", field: "gradeDesc", align: "left" },
],
actionInfo: {
......@@ -328,18 +331,80 @@ const newStandard = () => {
newCreateGradeFormItems.value.forEach(item => item.default = '');
}
const formRef = ref<any>();
const classStandardFormItems = ref([{
label: '分级名称',
type: 'input',
maxlength: 50,
placeholder: '请输入',
field: 'name',
default: router.currentRoute.value.query.classClassifyGradName,
block: false,
clearable: true,
required: true
}]);
const saveLoading = ref(false);
const saveUpdate = async () => {
console.log(formRef.value.formInline);
if (!formRef.value.formInline.name) {
proxy.$ElMessage.error('分级名称不能为空');
return;
}
saveLoading.value = true;
const params = {
guid: router.currentRoute.value.query.guid,
name: formRef.value.formInline.name,
type: 'G',
}
console.log(params);
const res: any = await updateClassifyGrad(params);
if (res.code == proxy.$passCode) {
proxy.$ElMessage.success('修改成功');
router.push({
name: 'templateConfig'
});
saveLoading.value = false;
} else {
proxy.$ElMessage.error(res.msg);
}
}
const cancel = () => {
proxy.$openMessageBox("当前页面尚未保存,确定放弃修改吗?", () => {
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
router.push({
name: 'templateConfig'
});
}, () => {
proxy.$ElMessage.info("已取消");
});
}
</script>
<template>
<div class="container_wrap" v-loading="fullscreenLoading">
<div class="container_wrap">
<div class="content_main">
<div class="table-top-btns">
<el-button type="primary" @click="newStandard">新增标准</el-button>
<el-button @click="batchRemobe">批量删除</el-button>
</div>
<Table ref="tableRef" :tableInfo="tableInfo" @tableSelectionChange="onTableSelectChange" />
<ContentWrap id="id-baseInfo" title="基础信息" description="" style="margin-top: 8px;">
<Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" />
</ContentWrap>
<ContentWrap id="id-grade-info" title="分级标准" class="detail-content" description="" style="margin-top: 8px;">
<div class="content" v-loading="fullscreenLoading">
<div class="table-top-btns">
<el-button type="primary" @click="newStandard">新增标准</el-button>
<el-button @click="batchRemobe">批量删除</el-button>
</div>
<Table ref="tableRef" :tableInfo="tableInfo" @tableSelectionChange="onTableSelectChange" />
</div>
</ContentWrap>
</div>
<div class="bottom_tool_wrap">
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="saveUpdate" :loading="saveLoading">保存修改</el-button>
</div>
<Dialog_form :dialogConfigInfo="newCreateGradeStandardDialogInfo" />
</div>
......@@ -351,11 +416,48 @@ const newStandard = () => {
.content_main {
height: calc(100% - 44px);
padding: 17px 16px 10px 16px;
padding: 10px 16px;
.table-top-btns {
display: flex;
margin-bottom: 12px;
}
}
.bottom_tool_wrap {
height: 44px;
padding: 0 16px;
border-top: 1px solid #d9d9d9;
display: flex;
justify-content: center;
align-items: center;
}
:deep(.detail-content) {
.el-card__body {
height: calc(100% - 50px) !important;
.card-body-content {
height: 100%;
}
}
}
.tools_btns {
position: relative;
margin-bottom: 16px;
.show-change-btn {
position: absolute;
right: 0px;
}
}
.shape-main {
height: calc(100% - 40px);
}
.table_panel {
height: calc(100% - 40px) !important;
}
</style>
......
......@@ -90,6 +90,10 @@ const getExecGuid = async () => {
}
//
onMounted(() => {
getCgDirTreeData();
getCgDirFieldPage();
......@@ -364,9 +368,9 @@ const dataBaseTableInfo = ref({
fixedSelection: true,
fields: [
{ label: "序号", type: "index", width: 56, align: "center" },
{ label: "数据源", field: "cgDirName", width: 140 },
{ label: "表名称", field: "tableName", width: 180 },
{ label: "数据库表", field: "tableChName", width: 120 },
{ label: "数据源", field: "databaseChName", width: 140 },
{ label: "表名称", field: "tableChName", width: 180 },
{ label: "数据库表", field: "tableName", width: 120 },
{
label: "新建方式", field: "foundMode", width: 140, getName: (scope) => {
let dataGrade = scope.row.foundMode;
......@@ -380,7 +384,7 @@ const dataBaseTableInfo = ref({
return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表';
}
},
{ label: "任务修改人", field: "damName", width: 120 },
{ label: "任务修改人", field: "updateUserName", width: 120 },
{ label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
{ label: "描述", field: "description", width: 120, align: 'center' },
{ label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center' },
......@@ -397,31 +401,35 @@ const dataBaseTableInfo = ref({
type: "btn",
width: 300,
fixed: 'right',
btns: [
{
label: "配置业务规则", value: "edit", click: (scope) => {
console.log('编辑', scope);
// 路由跳转configure-rules
router.push({
name: 'configureRules',
query: {
cgDirName: scope.row.cgDirName,
tableName: scope.row.tableName,
tableChName: scope.row.tableChName,
tableGuid: scope.row.tableGuid,
description: scope.row.description,
execGuid: execGuidInfo.value.execGuid
}
});
btns: (scope) => {
return [
{
label: "配置业务规则", value: "edit", click: (scope) => {
console.log('编辑', scope);
// 路由跳转configure-rules
router.push({
name: 'configureRules',
query: {
cgDirName: scope.row.cgDirName,
tableName: scope.row.tableName,
tableChName: scope.row.tableChName,
tableGuid: scope.row.tableGuid,
description: scope.row.description,
execGuid: execGuidInfo.value.execGuid
}
});
}
},
{
label: "编辑表结构", value: "edit", click: (scope) => {
console.log('复制', scope);
},
disabled: scope.row.state !== 2 ? false : true
}
},
]
}
{
label: "编辑表结构", value: "copy", click: (scope) => {
console.log('复制', scope);
}
}
]
},
loading: false
......@@ -687,7 +695,7 @@ const getDataBaseTableData = async (params = {}) => {
pageIndex: 1,
pageSize: 10,
databaseGuid: "",
isDataAsset: checked.value ? 'Y' : 'N',
isDataAsset: '',
execGuid: execGuidInfo.value.execGuid,
};
const finalParams = { ...dataBaseParams, ...params };
......@@ -727,7 +735,9 @@ const getDataBaseFieldData = async (params = {}) => {
tableGuid: "",
execGuid: execGuidInfo.value.execGuid,
databaseGuid: "",
isDataAsset: checked.value ? 'Y' : 'N',
isDataAsset: '',
fieldName: '',
gradeDetailName: '',
};
const finalParams = { ...dataBaseParams, ...params };
......@@ -773,11 +783,14 @@ const tableFieldsDataInfo = ref({
const showTableOrDatabase = ref(true);
const isShowCreateBtn = ref(false);
// 定义tableGuid
const tableGuid = ref('');
const dataBaseGuid = ref('');
const dataBaseInfo = ref<any>({});
const dataBasenodeClick = (data: any) => {
isShowCreateBtn.value = false;
console.log('dataBasenodeClick', data);
if (data.cgDirName) {
tableGuid.value = '';
......@@ -786,7 +799,9 @@ const dataBasenodeClick = (data: any) => {
getDataBaseTableData();
}
if (data.databaseGuid) {
dataBaseInfo.value = data;
dataBaseGuid.value = data.databaseGuid;
isShowCreateBtn.value = true;
tableGuid.value = '';
getDataBaseFieldData({
databaseGuid: data.databaseGuid
......@@ -801,9 +816,9 @@ const dataBasenodeClick = (data: any) => {
getDataBaseFieldData({
tableGuid: data.tableGuid
});
getDataBaseTableData({
tableGuid: data.tableGuid
});
// getDataBaseTableData({
// tableGuid: data.tableGuid
// });
}
if (data.databaseGuid || data.cgDirName) {
......@@ -826,7 +841,8 @@ const handleSubjectTableCommand = (command: string) => {
router.push({
name: 'tableCreateFile',
query: {
type: 'tableCreateFile'
type: 'tableCreateFile',
foundMode: 2
}
});
} else if (command === 'existingCreate') {
......@@ -834,7 +850,11 @@ const handleSubjectTableCommand = (command: string) => {
router.push({
name: 'tableCreateExisting',
query: {
execGuid: execGuidInfo.value.execGuid
execGuid: execGuidInfo.value.execGuid,
foundMode: 1,
database: dataBaseInfo.value.database,
databaseChName: dataBaseInfo.value.databaseChName,
databaseGuid: dataBaseInfo.value.databaseGuid,
}
});
}
......@@ -1033,7 +1053,7 @@ loadOptionsA();
<div class="btns-area" v-if="!tableGuid && activeTab === 'table'">
<div class="left-btns">
<div class="dropdown_btn">
<div class="dropdown_btn" v-if="isShowCreateBtn">
<el-dropdown popper-class="table-create-menu" @command="handleSubjectTableCommand"
placement="bottom-start" trigger="click">
<span class="el-dropdown-link">
......
......@@ -6,7 +6,6 @@
import { ref } from "vue";
import router from "@/router";
import { getBizRuleConfigDetail, updateBizRuleConfig } from '@/api/modules/dataInventory'
const { proxy } = getCurrentInstance() as any;
const bizRuleConfigData = ref<any>()
const getBizRuleConfigDetailData = async () => {
......@@ -105,9 +104,25 @@ const moveDown = () => {
// 编辑行
const editRow = (row) => {
if (!row.isEdit) {
const [symbol, value] = row.fieldLengthCondition.split('#');
row.lengthSymbol = symbol; // 初始化符号部分
row.lengthValue = value; // 初始化数值部分
// 编辑fieldLengthCondition
if (row.fieldLengthCondition) {
const [symbol, value] = row.fieldLengthCondition.split('#');
row.lengthSymbol = symbol; // 初始化符号部分
row.lengthValue = value; // 初始化数值部分
} else {
row.lengthSymbol = ''; // 默认值
row.lengthValue = ''; // 默认值
}
//编辑fieldValueRange
if (row.fieldValueRange) {
const [start, end] = row.fieldValueRange.split('-');
row.rangeStart = start; // 初始化符号部分
row.rangeEnd = end; // 初始化数值部分
} else {
row.rangeStart = ''; // 默认值
row.rangeEnd = ''; // 默认值
}
row.isEdit = true; // 进入编辑模式
}
};
......@@ -115,6 +130,7 @@ const editRow = (row) => {
// 保存数据
const saveRow = (row) => {
row.fieldLengthCondition = `${row.lengthSymbol}#${row.lengthValue}`;
row.fieldValueRange = [row.rangeStart || '', row.rangeEnd || ''];
row.isEdit = false
}
......@@ -213,19 +229,23 @@ const saveData = async () => {
"isNotNull": "string",
"fieldValueRange": "string"
*/
const params = tableData.value.map((item: any) => {
return {
guid: item.guid,
const inParams = [] as any
tableData.value.forEach((item: any) => {
const obj = {
guid: router.currentRoute.value.query.tableGuid,
fieldGuid: item.fieldGuid,
fieldLengthCondition: item.fieldLengthCondition,
fieldPrecision: item.fieldPrecision,
dictionaryGuid: item.dictionaryGuid,
isUnique: item.isUnique,
isNotNull: item.isNotNull,
isNotNull: item.isRequired,
fieldValueRange: item.fieldValueRange
}
inParams.push(obj)
})
const res: any = await updateBizRuleConfig(params)
console.log('finalParams', inParams)
const res: any = await updateBizRuleConfig(inParams)
if (res.code === proxy.$passCode) {
proxy.$message.success('修改配置规则成功!')
router.back()
......@@ -270,29 +290,29 @@ const cancel = () => {
<!-- 排序列(不可编辑) -->
<el-table-column type="index" label="排序" width="80" align="center" />
<!-- 字段中文名(不可编辑)fieldChName -->
<el-table-column prop="fieldName" label="字段中文名" width="120">
<el-table-column prop="fieldChName" label="字段中文名" width="120">
<template #default="scope">
{{ scope.row.fieldName ? scope.row.fieldName : '--' }}
{{ scope.row.fieldChName ? scope.row.fieldChName : '--' }}
</template>
</el-table-column>
<!-- 字段英文名(不可编辑) -->
<el-table-column prop="fieldEnglish" label="字段英文名" width="120">
<el-table-column prop="fieldName" label="字段英文名" width="120">
<template #default="scope">
{{ scope.row.fieldEnglish ? scope.row.fieldEnglish : '--' }}
{{ scope.row.fieldName ? scope.row.fieldName : '--' }}
</template>
</el-table-column>
<!-- 分类(不可编辑)classifyName -->
<el-table-column prop="fieldEnglish" label="分类" width="120">
<!-- <el-table-column prop="fieldEnglish" label="分类" width="120">
<template #default="scope">
{{ scope.row.fieldEnglish ? scope.row.fieldEnglish : '--' }}
</template>
</el-table-column>
</el-table-column> -->
<!-- 分级(不可编辑) -->
<el-table-column prop="gradeDetailName" label="分级" width="120" align="center">
<!-- <el-table-column prop="gradeDetailName" label="分级" width="120" align="center">
<template #default="scope">
{{ scope.row.gradeDetailName ? scope.row.gradeDetailName : '--' }}
</template>
</el-table-column>
</el-table-column> -->
<!-- 字段类型fieldType (不可编辑) -->
<el-table-column prop="fieldType" label="字段类型" width="150" align="center">
<template #default="scope">
......@@ -367,11 +387,20 @@ const cancel = () => {
</el-select>
</template>
</el-table-column>
<!-- 字段取值范围 fieldValueRange(可编辑)-->
<el-table-column prop="fieldValueRange" label="字段取值范围" width="150" align="center">
<el-table-column prop="fieldValueRange" label="字段取值范围" width="260" align="center">
<template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.fieldValueRange ? scope.row.fieldValueRange : '--' }}</span>
<el-input v-else v-model="scope.row.fieldValueRange" placeholder="请输入字段取值范围" />
<!-- 非编辑模式,展示取值范围 -->
<span v-if="!scope.row.isEdit">
{{ scope.row.fieldValueRange ? scope.row.fieldValueRange.join('-') : '--' }}
</span>
<!-- 编辑模式,显示两个输入框 -->
<div v-else style="display: flex; gap: 5px; align-items: center;">
<el-input v-model="scope.row.rangeStart" placeholder="最小值" style="width: 45%;" type="number" />
<span>-</span>
<el-input v-model="scope.row.rangeEnd" placeholder="最大值" style="width: 45%;" type="number" />
</div>
</template>
</el-table-column>
......
......@@ -196,13 +196,16 @@ const getPreviewData = () => {
const getTableStructure = () => {
let tableName = currDatasourceSelect.value.tableName;
console.log('tableName', currDatasourceSelect.value);
currDsTableStructureLoading.value = true;
currDsTableStructure.value = [];
getDsTableStructure({
tableName: tableName,
dataSourceGuid: databaseInfo.value.guid,
database: databaseInfo.value.databaseNameEn,
databaseType: databaseInfo.value.databaseType
// tableName: tableName,
// dataSourceGuid: databaseInfo.value.guid,
// database: databaseInfo.value.databaseNameEn,
// databaseType: databaseInfo.value.databaseType,
tableGuid: currDatasourceSelect.value.tableGuid,
execGuid: props.execGuid
}).then((res: any) => {
currDsTableStructureLoading.value = false;
if (res.code == proxy.$passCode) {
......@@ -318,7 +321,7 @@ watch(
if (val?.length && !currDatasourceSelect.value?.tableName) {
currDatasourceSelect.value = val[0];
}
emits("datasourceSelectedChange", val);
emits("datasourceSelectedChange", val, databaseGuid.value);
},
{
deep: true,
......
......@@ -149,6 +149,7 @@ const handleClassDataEdit = (params) => {
// 配置分类
const handleClassDataClick = (item, des = '') => {
console.log(item, 'i111tem');
// 获取分级标准
router.push({
name: 'classStandardEdit',
......@@ -156,7 +157,8 @@ const handleClassDataClick = (item, des = '') => {
guid: item.guid,
type: des === '' ? '配置' : des,
classStandardName: item.name,
refGradeGuid: item.refGradeGuid
refGradeGuid: item.refGradeGuid,
description: item.description
}
});
}
......@@ -248,6 +250,7 @@ const newCreateClassStandardDialogInfo = ref({
newCreateClassStandardDialogInfo.value.visible = false;
},
submit: async (btn, info) => {
if (newCreateClassStandardDialogInfo.value.title === '新增分类') {
newCreateClassStandardDialogInfo.value.submitBtnLoading = true;
const params = {
......@@ -263,6 +266,22 @@ const newCreateClassStandardDialogInfo = ref({
type: 'success',
message: '新增分类成功'
})
nextTick(() => {
// 拿到新增的分类数据,跳转到配置页面
const item = classListData.value.find(item => item.name === info.classStandardName);
console.log(item, 'item---------------');
if (item) {
const params = {
name: item.name,
guid: item.guid,
refGradeGuid: item.refGradeGuid,
description: item.description
}
handleClassDataClick(params, '');
}
})
newCreateClassStandardDialogInfo.value.submitBtnLoading = false;
newCreateClassStandardDialogInfo.value.visible = false;
} else {
......@@ -343,7 +362,7 @@ const newCreateGradeStandardDialogInfo = ref({
await getClassifyGradListData();
proxy.$ElMessage({
type: 'success',
message: '新增分成功'
message: '新增分成功'
})
// 拿到新增的分级数据,跳转到配置页面
......@@ -372,7 +391,7 @@ const newCreateGradeStandardDialogInfo = ref({
getClassifyGradListData();
proxy.$ElMessage({
type: 'success',
message: '修改分成功'
message: '修改分成功'
})
newCreateGradeStandardDialogInfo.value.visible = false;
} else {
......@@ -437,6 +456,7 @@ const handleClassifyGradDataClick = (item) => {
}
const newCreateGrade = () => {
newCreateGradeStandardDialogInfo.value.submitBtnLoading = false;
newCreateGradeStandardDialogInfo.value.visible = true;
newCreateGradeFormItems.value.forEach(item => item.default = '');
}
......@@ -539,7 +559,7 @@ const newCreateGrade = () => {
</template>
<div class="levitation-ul">
<span class="levitation-li" @click="handleClassDataClick(item)">配置</span>
<span class="levitation-li" @click="handleClassDataEdit(item)">编辑</span>
<!-- <span class="levitation-li" @click="handleClassDataEdit(item)">编辑</span> -->
<span class="levitation-li" @click="handleClassDataDel(item)">删除</span>
</div>
</el-popover>
......@@ -572,7 +592,7 @@ const newCreateGrade = () => {
</template>
<div class="levitation-ul">
<span class="levitation-li" @click="handleClassifyGradDataClick(item)">配置</span>
<span class="levitation-li" @click="handleClassifyGradDataEdit(item)">编辑</span>
<!-- <span class="levitation-li" @click="handleClassifyGradDataEdit(item)">编辑</span> -->
<span class="levitation-li" @click="handleClassifyGradDataDel(item)">删除</span>
</div>
</el-popover>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!