93c44ebe by lxs

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

2 parents 7baee977 f9a212b4
......@@ -242,14 +242,14 @@ export const getParamsList = () => request({
/** 获取参数类型列表 */
export const getDamTypesList = () => request({
url:`${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-list`,
url:`${import.meta.env.VITE_APP_DATA_SOURCE_URL}/data-dict/get-data-list`,
method: 'post',
data: { paramCode: "DAM-TYPE" }
})
/** 获取所属主题的四级参数类型列表 */
export const getSubjectDoaminList = () => request({
url:`${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-tree`,
url:`${import.meta.env.VITE_APP_DATA_SOURCE_URL}/data-dict/get-data-tree`,
method: 'post',
data: { paramCode: "SUBJECT-DOMAIN" }
})
......@@ -262,85 +262,85 @@ export const getDataTypeList = () => request({
})
export const getDamCatalogTable = (params) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/page-list`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/page-list`,
method: 'post',
data: params
})
/** 删除数据资产目录 */
export const registerCatalogDelete = (params) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/delete`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/delete`,
method: 'delete',
data: params
});
/** 保存数据资产目录 */
export const registerCatalogSave = (params) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/save`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/save`,
method: 'post',
data: params
});
/** 验证资产名称是否存在 */
export const existDamName = (params) => request({
url:`${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/exists?damName=${params}`,
url:`${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/exists?damName=${params}`,
method: 'get'
});
/** 获取资产目录基本信息的详情 */
export const getRegisterCatalogDetail = (guid) => request({
url:`${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/detail?guid=${guid}`,
url:`${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/detail?guid=${guid}`,
method: 'get'
});
/** 获取资产目录表的详情 */
export const getRegisterCatalogTableDetail = (subjectGuid) => request({
url:`${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/get-table-detail?subjectGuid=${subjectGuid}`,
url:`${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/get-table-detail?subjectGuid=${subjectGuid}`,
method: 'get'
});
/** 编辑资产目录基本信息 */
export const registerCatalogUpdate = (params) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/update`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/update`,
method: 'post',
data: params
});
/** 新增资产目录表 */
export const registerCatalogTableSave = (params) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/add-table`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/add-table`,
method: 'post',
data: params
});
/** 编辑资产目录表 */
export const registerCatalogTableUpdate = (params) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/update-table`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/update-table`,
method: 'post',
data: params
});
/** 删除资产目录表 */
export const registerCatalogTableDelete = (params) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/remove-table?damGuid=${params.damGuid}&subjectGuid=${params.subjectGuid}`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/remove-table?damGuid=${params.damGuid}&subjectGuid=${params.subjectGuid}`,
method: 'post'
});
/** 获取资产目录表 */
export const getRegisterCatalogTableList = (damGuid) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/get-table-list?damGuid=${damGuid}`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/get-table-list?damGuid=${damGuid}`,
method: 'get'
});
/** 查看资产表数据 */
export const queryData = (subjectGuid) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/preview-data/${subjectGuid}`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/preview-data/${subjectGuid}`,
method: 'get'
});
/** 验证新增和编辑资产表 */
export const checkDamTableChange = (params) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/check-table-change`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/check-table-change`,
method: 'post',
data: params
});
......@@ -349,14 +349,14 @@ export const checkDamTableChange = (params) => request({
/** ------------------ 公示异议处理 -------------------------------- */
/** 获取异议列表数据 */
export const getDissentList = (params) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-dissent-handle/page-list`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-dissent-handle/page-list`,
method: 'post',
data: params
})
/** 更新异议处理 */
export const updateDissentState = (params) => request({
url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-dissent-handle/update-state`,
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-dissent-handle/update-state`,
method: 'post',
data: params
})
......
......@@ -7,9 +7,10 @@ export const getHomeServiceInfo = () => request({
})
/** 获取首页资产统计信息 */
export const getStatisticsInfo = () => request({
export const getStatisticsInfo = (data) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/company/statistics-info`,
method: 'get',
method: 'post',
data
})
/** 获取首页资产登记情况 */
......@@ -20,9 +21,10 @@ export const getRegisterInfo = (params) => request({
})
/** 获取首页资产质量情况 */
export const getQualityInfo = () => request({
export const getQualityInfo = (data) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/company/quality-info`,
method: 'get',
method: 'post',
data
})
/** 获取首页资产交易情况 */
......@@ -40,43 +42,50 @@ export const getFinanceInfo = (params) => request({
})
/** 获取资产证件照url */
export const getRegisterUrl = () => request({
export const getRegisterUrl = (data) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/company/list-doc-url`,
method: 'get',
method: 'post',
data
})
/** 获取资产行业类型分布 */
export const getIndustryInfo = () => request({
export const getIndustryInfo = (data) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/industry-statistics`,
method: 'get',
method: 'post',
data
})
/** 获取平台授信主体金额分布 */
export const getCreditMoneyInfo = () => request({
export const getCreditMoneyInfo = (data) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/credit-money-statistics`,
method: 'get',
method: 'post',
data
})
/** 获取平台资产统计信息 */
export const getPlatformStatisticsInfo = () => request({
export const getPlatformStatisticsInfo = (data) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/statistics-info`,
method: 'get',
method: 'post',
data
})
/** 获取平台服务企业地区分布 */
export const getPlatformService = () => request({
export const getPlatformService = (data) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/service-statistics`,
method: 'get',
method: 'post',
data
})
/** 获取平台服务企业地区分布-按省 */
export const getPlatformProvinceService = () => request({
export const getPlatformProvinceService = (data) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/service-statistics-province`,
method: 'get',
method: 'post',
data
})
/** 获取平台数据资产登记趋势 */
export const getPlatformMonth = () => request({
export const getPlatformMonth = (data) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/register-month-statistics`,
method: 'get',
method: 'post',
data
})
......
......@@ -142,7 +142,7 @@ export const getTableFieldLineage = (params) => request({
/** 获取表的所有字段血缘数据 */
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_PLAN_BASEURL}/lineage/lineage-query-field?databaseName=${params.databaseName}&tableName=${params.tableName}&tableGuid=${params.tableGuid}`,
method: 'get',
})
......
......@@ -33,6 +33,7 @@ import { download } from "@/utils/common";
import { getLabelList } from "@/api/modules/dataLabel";
const currentPath = ref<string[]>([]);
const currentDatabasePath = ref<string[]>([]);
const { proxy } = getCurrentInstance() as any;
const route = useRoute();
// 分级引用refGradeGuid
......@@ -48,14 +49,20 @@ const getCgDirTreeData = async () => {
}
const res: any = await getTaskExeTreeList(params);
if (res.code == proxy.$passCode) {
CgDirTreeList.value = res.data;
treeInfo.value.data = res.data;
currentPath.value = [res.data[0].classifyName];
treeInfo.value.expandedKey.push(res.data[0].classifyDetailGuid);
treeInfo.value.currentNodeKey = res.data[0].classifyDetailGuid;
classifyDetailGuidInfo.value = res.data[0].classifyDetailGuid;
searchItemList.value[1].options = res.data;
refGradeGuid.value = res.data[0].refGradeGuid;
const transformedData: any = [{
classifyDetailGuid: execGuidInfo.value.guid, // 新增字段 GUID
classifyName: execGuidInfo.value.cgDirName, // 新增字段目录名称
children: res.data, // 将原始数据放入 children
}];
CgDirTreeList.value = transformedData;
treeInfo.value.data = transformedData;
currentPath.value = [transformedData[0].classifyName];
treeInfo.value.expandedKey.push(transformedData[0].classifyDetailGuid);
treeInfo.value.currentNodeKey = transformedData[0].classifyDetailGuid;
// classifyDetailGuidInfo.value = res.data[0].classifyDetailGuid;
searchItemList.value[0].options = res.data || [];
refGradeGuid.value = res.data[0].refGradeGuid || '';
treeInfo.value.loading = false;
} else {
proxy.$ElMessage.error(res.msg);
......@@ -126,7 +133,7 @@ onMounted(async () => {
});
getDictionaryList();
getSearchTableList();
getLabelListData();
// getLabelListData();
getGradeData(refGradeGuid.value);
})
......@@ -151,30 +158,23 @@ const treeInfo = ref<any>({
loading: false
});
const addStandardSet = () => {
console.log('addStandardSet');
}
// 右侧上方搜索tab配置
const searchItemList = ref([
{
label: '标签',
type: 'select',
maxlength: 19,
placeholder: '选择标签',
field: 'labelName',
default: '',
options: [],
props: {
label: 'label',
value: 'guid',
},
clearable: true,
filterable: true,
},
// {
// label: '标签',
// type: 'select',
// maxlength: 19,
// placeholder: '选择标签',
// field: 'labelName',
// default: '',
// options: [],
// props: {
// label: 'label',
// value: 'guid',
// },
// clearable: true,
// filterable: true,
// },
{
label: "",
placeholder: '分类',
......@@ -192,7 +192,8 @@ const searchItemList = ref([
block: false,
filterable: false,
clearable: true,
required: false
required: false,
visible: true,
}, {
label: '分级',
type: 'select',
......@@ -206,6 +207,7 @@ const searchItemList = ref([
value: 'guid',
},
clearable: true,
visible: true,
},
])
......@@ -261,12 +263,16 @@ const toSearch = (val: any, clear: boolean = false) => {
const nodeClick = async (data: any) => {
console.log('nodeClick', data);
console.log('nodeClick', data, levelGuidInfo.value);
const { guid, classifyDetailGuid, refGradeGuid } = data
classifyDetailGuidInfo.value = classifyDetailGuid;
// getGradeData(refGradeGuid);
searchItemList.value[1].default = data.classifyName;
if (data.classifyName === execGuidInfo.value.cgDirName) {
searchItemList.value[0].default = '';
} else {
searchItemList.value[0].default = data.classifyName;
}
searchItemList.value[1].default = levelGuidInfo.value || '';
await getCgDirFieldPage({
execGuid: execGuidInfo.value.execGuid,
classifyDetail: classifyDetailGuid,
......@@ -302,20 +308,20 @@ 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 || [];
searchItemList.value[1].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);
}
}
// 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);
......@@ -354,12 +360,12 @@ const tableInfo = ref({
}
},
{ label: "分级", field: "gradeDetailName", width: 80 },
{ label: "标签", field: "label", width: 140 },
{ 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' },
{ label: "数据库中文名", field: "databaseChName", width: 120, align: 'center' },
// { label: "标签", field: "label", width: 140 },
// { label: "规则", field: "ruleDetail", width: 180 },
{ label: "表名", field: "tableName", width: 120, align: 'left' },
{ label: "表中文名", field: "tableChName", width: 120, align: 'left' },
{ label: "数据库名", field: "database", width: 120, align: 'left' },
{ label: "数据库中文名", field: "databaseChName", width: 120, align: 'left' },
],
data: [],
......@@ -486,7 +492,7 @@ const dataBaseTableInfo = ref({
return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表';
}
},
{ label: "任务修改人", field: "taskUpdateUserName", width: 100 },
{ label: "修改人", field: "taskUpdateUserName", width: 100 },
{ 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' },
......@@ -831,6 +837,12 @@ const handleClick = (tab: any) => {
activeName.value = tab.props.name;
if (tab.props.name === 'second') {
classifyDetailGuidInfo.value = '';
if (activeTab.value === 'table') {
searchItemList.value[0].visible = false;
searchItemList.value[1].visible = false;
searchItemList.value[0].default = '';
searchItemList.value[1].default = '';
}
selectedA.value = null;
selectedB.value = null;
selectedC.value = null;
......@@ -842,6 +854,10 @@ const handleClick = (tab: any) => {
getDataBaseFieldData();
getDbDirTableSelectData(1, {});
} else {
searchItemList.value[0].visible = true;
searchItemList.value[1].visible = true;
searchItemList.value[0].default = '';
searchItemList.value[1].default = '';
selectedA.value = null;
selectedB.value = null;
selectedC.value = null;
......@@ -865,6 +881,18 @@ const getDataBaseTreeData = async () => {
// 更新到绑定的响应式数据
dataBaseTreeData.value = dataArray;
dataBaseTreeInfo.value.data = dataArray;
dataBaseTreeInfo.value.expandedKey.push(dataArray[0].guid);
dataBaseTreeInfo.value.currentNodeKey = dataArray[0].guid;
dataBaseGuid.value = dataArray[0].databaseGuid;
currentDatabasePath.value = [dataArray[0].name];
console.log('dataArray', dataArray);
if (dataArray[0].dicType === 1) {
isShowCreateBtn.value = true;
}
if (dataArray[0].dicType === 2) {
isShowCreateBtn.value = false;
}
dataBaseTreeInfo.value.loading = false;
} else {
proxy.$ElMessage.error(res.msg);
......@@ -990,9 +1018,9 @@ const tableFieldsDataInfo = ref({
{ label: "表中文名", field: "tableChName", width: 140, },
{ label: "数据库名称", field: "database", width: 120 },
{ label: "数据库中文名", field: "databaseChName", width: TableColumnWidth.DATETIME },
{ label: "分类", field: "classifyDetailName", width: 120, align: 'center' },
{ label: "分级", field: "gradeDetailName", width: 120, align: 'center' },
{ label: "标签", field: "label", width: 120, align: 'center' },
{ label: "分类", field: "classifyDetailName", width: 120, align: 'left' },
{ label: "分级", field: "gradeDetailName", width: 120, align: 'left' },
// { label: "标签", field: "label", width: 120, align: 'center' },
],
data: [],
page: {
......@@ -1009,7 +1037,7 @@ const tableFieldsDataInfo = ref({
const showTableOrDatabase = ref(true);
const isShowCreateBtn = ref(false);
const isShowCreateBtn = ref(true);
// 定义tableGuid
const tableGuid = ref('');
const dataBaseGuid = ref('');
......@@ -1017,11 +1045,23 @@ const dataBaseInfo = ref<any>({});
const dataBasenodeClick = (data: any) => {
isShowCreateBtn.value = false;
console.log('dataBasenodeClick', data);
console.log('dataBasenodeClick', data, dataBaseTreeData.value);
const path = findDDatabasePath(dataBaseTreeData.value, data.guid);
console.log('path', path);
if (path) {
currentDatabasePath.value = path;
} else {
console.error('未找到路径');
}
if (data.databaseGuid) {
dataBaseInfo.value = data;
dataBaseGuid.value = data.databaseGuid;
if (data.dicType == '2') {
isShowCreateBtn.value = false;
}
if (data.dicType == '1') {
isShowCreateBtn.value = true;
}
tableGuid.value = '';
getDataBaseFieldData({
databaseGuid: data.databaseGuid
......@@ -1047,8 +1087,24 @@ const dataBasenodeClick = (data: any) => {
showTableOrDatabase.value = false;
return;
}
}
const findDDatabasePath = (data: any[], targetGuid: string, path: string[] = []) => {
for (const item of data) {
path.push(item.name); // 添加当前节点名称
if (item.guid === targetGuid) {
return path; // 找到目标节点,返回路径
}
if (item.children && item.children.length > 0) {
const result = findDDatabasePath(item.children, targetGuid, path);
if (result) return result; // 子节点找到目标节点,返回路径
}
path.pop(); // 回溯,移除当前节点
}
return null; // 未找到目标节点
};
const nodeSelectChange = (data: any) => {
console.log('nodeSelectChange', data);
}
......@@ -1087,14 +1143,17 @@ const isShowClassifyTip = ref(true);
const isShowDatabaseTip = ref(true);
const addIsShowClassifyTip = () => {
isShowClassifyTip.value = false;
tipHeight.value = 83;
}
const tipHeight = ref(200);
const tipHeight1 = ref(165);
const tipHeight = ref(135);
const tipHeight1 = ref(170);
const tipHeight2 = ref(130);
const addIsShowDatabaseTip = () => {
isShowDatabaseTip.value = false;
tipHeight.value = 148;
tipHeight1.value = 103;
tipHeight1.value = 118;
tipHeight2.value = 78;
}
// 表信息和字段信息切换
......@@ -1104,12 +1163,20 @@ const setActiveTab = (tab) => {
console.log('setActiveTab', tab);
activeTab.value = tab;
if (tab === 'word' && activeName.value === 'second') {
searchItemList.value[0].visible = true;
searchItemList.value[1].visible = true;
searchItemList.value[0].default = '';
searchItemList.value[1].default = '';
isShowWordSearch.value = false;
optionsA.value = [];
optionsB.value = [];
optionsC.value = [];
getDbDirFieldSelectData(1);
} else {
searchItemList.value[0].visible = false;
searchItemList.value[1].visible = false;
searchItemList.value[0].default = '';
searchItemList.value[1].default = '';
isShowWordSearch.value = true;
optionsA.value = [];
optionsB.value = [];
......@@ -1292,9 +1359,11 @@ const levelGuidInfo = ref('');
// 标签选择
const selectChange = (val, row, info) => {
console.log('selectChange', val, row, info);
if (info.classifyName == undefined) {
classifyDetailGuidInfo.value = '';
}
if (info) {
labelGuidInfo.value = info.labelName;
classifyDetailGuidInfo.value = info.classifyName;
levelGuidInfo.value = info.levelName;
}
}
......@@ -1347,7 +1416,7 @@ const treeSelectNodeClick = (node, item) => {
<div class="aside_wrap">
<el-tabs v-model="activeName" class="v-tabs" @tab-click="handleClick">
<el-tab-pane label="分类分级目录" name="first">
<Tree :treeInfo="treeInfo" @nodeClick="nodeClick" @itemMenuClick="handleTreeItemMenuClick" />
<Tree :treeInfo="treeInfo" @nodeClick="nodeClick" />
<!-- <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" /> -->
</el-tab-pane>
<el-tab-pane label="数据库目录" name="second">
......@@ -1382,7 +1451,7 @@ const treeSelectNodeClick = (node, item) => {
<el-button @click="batchControlRules">批量配置业务规则</el-button>
</div>
</div>
<div class="table_panel_wrap">
<div class="table_panel_wrap" :style="{ height: `calc(100% - ${tipHeight}px)` }">
<Table :tableInfo="tableInfo" @tablePageChange="tablePageChange"
@tableCheckboxSelectChange="tableCheckboxSelectChange"
@tableCheckboxAllSelectChange="tableCheckboxAllSelectChange" />
......@@ -1403,7 +1472,12 @@ const treeSelectNodeClick = (node, item) => {
不再提醒
</el-button>
</div>
<div>全部</div>
<div class="path">
<span v-for="(item, index) in currentDatabasePath" :key="index" class="path-item">
<span :class="{ 'bold': index === currentDatabasePath.length - 1 }">{{ item }}</span>
<span v-if="index < currentDatabasePath.length - 1">/</span>
</span>
</div>
<div class="tab-btn">
内容信息:
<div v-if="showTableOrDatabase" class="table" :class="{ active: activeTab === 'table' }"
......@@ -1457,11 +1531,13 @@ const treeSelectNodeClick = (node, item) => {
<el-checkbox v-model="checked" label="仅看规划数据资产表" size="large" @change="changeCheck" />
</div>
</div>
<div class="table_panel_wrap_database" v-if="!tableGuid && activeTab === 'table'">
<div class="table_panel_wrap_database" :style="{ height: `calc(100% - ${tipHeight1}px)` }"
v-if="!tableGuid && activeTab === 'table'">
<Table :tableInfo="dataBaseTableInfo" @tablePageChange="dataBaseTablePageChange"
@tableSwitchBeforeChange="tableSwitchBeforeChange" />
</div>
<div class="table_field" v-if="tableGuid || activeTab === 'word'">
<div class="table_field" :style="{ height: `calc(100% - ${tipHeight2}px)` }"
v-if="tableGuid || activeTab === 'word'">
<Table :tableInfo="tableFieldsDataInfo" @tablePageChange="dataFieldTablePageChange" />
</div>
</div>
......@@ -1600,7 +1676,6 @@ const treeSelectNodeClick = (node, item) => {
.table_panel_wrap {
width: 100%;
height: calc(100% - 130px);
min-height: 210px;
overflow: visible;
}
......
......@@ -155,8 +155,14 @@ const batchDelete = () => {
selectedRows.value = [];
};
// 暂存编辑的行数据
const tempRowData = ref<any>();
// 编辑行
const editRow = (row) => {
console.log('编辑:', row);
// 暂存编辑前的数据
tempRowData.value = { ...row };
if (row.fieldLengthCondition) {
const arr = row.fieldLengthCondition.split('#')
row.lengthSymbol = arr[0]
......@@ -307,6 +313,15 @@ const cancel = () => {
});
}
// 点击取消
const cancelEdit = (row) => {
console.log('取消编辑:', row);
// 可在此恢复原始数据逻辑,如果需要
Object.assign(row, tempRowData.value);
row.isEdit = false; // 退出编辑状态
}
</script>
<template>
<div class="configure-rules">
......@@ -323,11 +338,11 @@ const cancel = () => {
<el-table-column prop="description" label="描述" width="180" show-overflow-tooltip />
</el-table>
</div>
<div class="btn-area">
<!-- <div class="btn-area">
<el-button @click="moveUp">上移</el-button>
<el-button @click="moveDown">下移</el-button>
<el-button @click="batchDelete">批量删除</el-button>
</div>
</div> -->
<div class="bottom_table">
<el-table :data="tableData" v-loading="tableFieldsLoading" :highlight-current-row="true" stripe border
height="100%" row-key="guid" @selection-change="selectionFieldsChange" tooltip-effect="light" :style="{
......@@ -351,9 +366,9 @@ const cancel = () => {
</template>
</el-table-column>
<!-- 分类(不可编辑)classifyName -->
<el-table-column prop="classifyName" label="分类" width="80" show-overflow-tooltip>
<el-table-column prop="classifyDetailName" label="分类" width="120" show-overflow-tooltip>
<template #default="scope">
{{ scope.row.classifyName ? scope.row.classifyName : '--' }}
{{ scope.row.classifyDetailName ? scope.row.classifyDetailName : '--' }}
</template>
</el-table-column>
<!-- 分级(不可编辑) -->
......@@ -383,6 +398,8 @@ const cancel = () => {
<el-option label="大于" value=">"></el-option>
<el-option label="等于" value="="></el-option>
<el-option label="小于" value="<"></el-option>
<el-option label="大于等于" value=">="></el-option>
<el-option label="小于等于" value="<="></el-option>
</el-select>
<el-input v-model="scope.row.lengthValue" placeholder="请输入" style="width: 45%;" />
</div>
......@@ -411,7 +428,8 @@ const cancel = () => {
<!-- 数据是否唯一(可编辑) -->
<el-table-column prop="isUnique" label="数据是否唯一" width="150" align="center">
<template #default="scope">
<span v-if="!scope.row.isEdit || !editableFields.isUnique">{{ scope.row.isUnique ? scope.row.isUnique : '--'
<span v-if="!scope.row.isEdit || !editableFields.isUnique">{{ scope.row.isUnique ? (scope.row.isUnique ===
'Y' ? '是' : '否') : '--'
}}</span>
<el-select v-else v-model="scope.row.isUnique" placeholder="请选择">
<el-option label="是" value="Y" />
......@@ -420,10 +438,11 @@ const cancel = () => {
</template>
</el-table-column>
<!-- 是否必填(可编辑) -->
<el-table-column prop="isRequired" label="是否必填" width="120" align="center">
<el-table-column prop="notNull" label="是否必填" width="120" align="center">
<template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.isRequired ? scope.row.isRequired : '--' }}</span>
<el-select v-else v-model="scope.row.isRequired" placeholder="请选择">
<span v-if="!scope.row.isEdit">{{ scope.row.notNull ? (scope.row.notNull === 'Y' ? '是' : '否') : '--'
}}</span>
<el-select v-else v-model="scope.row.notNull" placeholder="请选择">
<el-option label="是" value="Y" />
<el-option label="否" value="N" />
</el-select>
......@@ -448,14 +467,17 @@ const cancel = () => {
</el-table-column>
<!-- 操作列 -->
<el-table-column label="操作" width="100" align="center" fixed="right">
<el-table-column label="操作" width="120" align="center" fixed="right">
<template #default="scope">
<span class="text_btn" v-if="!scope.row.isEdit" @click="editRow(scope.row)">编辑</span>
<span class="text_btn" v-else @click="saveRow(scope.row)">保存</span>
<span v-else>
<span class="text_btn" @click="saveRow(scope.row)">保存</span>
<el-divider direction="vertical" />
<span class="text_btn" @click="deleteRow(scope.$index)">删除</span>
<span class="text_btn" @click="cancelEdit(scope.row)">取消</span>
</span>
</template>
</el-table-column>
</el-table>
</div>
<div class="botton_btn">
......@@ -485,7 +507,7 @@ const cancel = () => {
:deep(.bottom_table) {
margin-top: 12px;
height: calc(100% - 150px);
height: calc(100% - 115px);
overflow-y: auto;
.el-table td.el-table__cell {
......
......@@ -320,7 +320,7 @@ watch(
if (val?.length && !currDatasourceSelect.value?.tableName) {
currDatasourceSelect.value = val[0];
}
emits("datasourceSelectedChange", val, databaseGuid.value);
emits("datasourceSelectedChange", val, currDatasourceSelect.value);
},
{
deep: true,
......@@ -361,9 +361,9 @@ const getTextAlign = (field) => {
<el-table-column type="selection" :width="22" align="center" />
<el-table-column prop="tableName" label="名称" width="100px" align="left" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="tableComment" label="表注释" width="60px" align="left" show-overflow-tooltip>
<el-table-column prop="tableChName" label="表中文名称" width="80px" align="left" show-overflow-tooltip>
<template #default="scope">
<span>{{ scope.row['tableComment'] ?? '--' }}</span>
<span>{{ scope.row['tableChName'] ?? '--' }}</span>
</template>
</el-table-column>
</el-table>
......@@ -497,7 +497,7 @@ const getTextAlign = (field) => {
height: calc(100% - 80px);
.content-left {
width: 200px;
width: 220px;
border-right: 1px solid #d9d9d9;
.title-left {
......@@ -532,7 +532,7 @@ const getTextAlign = (field) => {
}
.content-right {
width: calc(100% - 200px);
width: calc(100% - 220px);
.title-right {
height: 44px;
......
......@@ -217,10 +217,12 @@ const stepsInfo = ref({
});
// 保存选中的库表信息
const selectedDatabaseTableInfo = ref<any>([]);
const datasourceSelectedRows: Ref<any> = ref([]);
// 记录数据库databaseGuid
const handlDsSelectedChange = (v, guid) => {
const handlDsSelectedChange = (v, curr) => {
selectedDatabaseTableInfo.value = curr || '';
datasourceSelectedRows.value = v || [];
const params: any = [];
v.forEach((item) => {
......@@ -245,6 +247,9 @@ const nextStep = async () => {
});
return;
}
tableDataInfo.value[0].tableName = selectedDatabaseTableInfo.value.tableName;
tableDataInfo.value[0].tableChName = selectedDatabaseTableInfo.value.tableChName;
getFieldTree();
stepsInfo.value.step = 1;
};
......@@ -315,6 +320,7 @@ const editableFields = {
classifyDetailGuid: true, // 分类可编辑
fieldType: true, // 字段类型可编辑
fieldChName: true, // 字段中文名可编辑
sourceFieldChName: true, // 源字段中文名可编辑
}
const tableFieldsLoading = ref(false)
......@@ -622,45 +628,45 @@ const submit = async () => {
console.log('提交', tableDataDetailInfo.value, tableDataInfo.value)
saveBtn.value = true
// 校验表格数据是否填写完整
if (!checkTableData(tableDataDetailInfo.value)) {
saveBtn.value = false
return
}
// 如果提交时没有 guid 则为新增type 0,否则为修改 type 1, 也要传参
if (!editInfoData.value.guid) {
try {
await saveOrUpdate({
tableName: tableDataInfo.value[0].tableName,
tableChName: tableDataInfo.value[0].tableChName,
databaseGuid: route.query.databaseGuid || '',
database: route.query.database || '',
databaseChName: route.query.databaseChName || '',
foundMode: route.query.foundMode,
isDraft: 'N',
}, 0)
saveBtn.value = false
} catch (error) {
saveBtn.value = false
}
} else {
// 修改 saveOrUpdate({}, 1)
try {
await saveOrUpdate({
guid: editInfoData.value.guid,
tableName: tableDataInfo.value[0].tableName,
tableChName: tableDataInfo.value[0].tableChName,
databaseGuid: editInfoData.value.databaseGuid || '',
database: editInfoData.value.database || '',
databaseChName: editInfoData.value.databaseChName || '',
foundMode: editInfoData.value.foundMode,
isDraft: 'N',
tableGuid: route.query.tableGuid,
}, 1)
saveBtn.value = false
} catch (error) {
saveBtn.value = false
}
}
// if (!checkTableData(tableDataDetailInfo.value)) {
// saveBtn.value = false
// return
// }
// // 如果提交时没有 guid 则为新增type 0,否则为修改 type 1, 也要传参
// if (!editInfoData.value.guid) {
// try {
// await saveOrUpdate({
// tableName: tableDataInfo.value[0].tableName,
// tableChName: tableDataInfo.value[0].tableChName,
// databaseGuid: route.query.databaseGuid || '',
// database: route.query.database || '',
// databaseChName: route.query.databaseChName || '',
// foundMode: route.query.foundMode,
// isDraft: 'N',
// }, 0)
// saveBtn.value = false
// } catch (error) {
// saveBtn.value = false
// }
// } else {
// // 修改 saveOrUpdate({}, 1)
// try {
// await saveOrUpdate({
// guid: editInfoData.value.guid,
// tableName: tableDataInfo.value[0].tableName,
// tableChName: tableDataInfo.value[0].tableChName,
// databaseGuid: editInfoData.value.databaseGuid || '',
// database: editInfoData.value.database || '',
// databaseChName: editInfoData.value.databaseChName || '',
// foundMode: editInfoData.value.foundMode,
// isDraft: 'N',
// tableGuid: route.query.tableGuid,
// }, 1)
// saveBtn.value = false
// } catch (error) {
// saveBtn.value = false
// }
// }
}
......@@ -951,7 +957,7 @@ onActivated(() => {
<!-- 排序列(不可编辑) -->
<el-table-column type="index" label="排序" width="80" align="center" />
<!-- 字段中文名(可编辑)fieldChName -->
<el-table-column prop="fieldChName" label="目标字段中文名" width="150">
<el-table-column prop="fieldChName" label="目标字段中文名" width="150" show-overflow-tooltip>
<!-- 可以编辑 -->
<template #default="scope">
<span v-if="!scope.row.isEdit || !editableFields.fieldChName">{{ scope.row.fieldChName ?
......@@ -962,7 +968,7 @@ onActivated(() => {
</el-table-column>
<!-- 字段英文名(可编辑) -->
<el-table-column prop="fieldName" label="目标字段英文名" width="150">
<el-table-column prop="fieldName" label="目标字段英文名" width="150" show-overflow-tooltip>
<template #default="scope">
<span v-if="!scope.row.isEdit || !editableFields.fieldName">{{ scope.row.fieldName ?
scope.row.fieldName
......@@ -972,31 +978,31 @@ onActivated(() => {
</template>
</el-table-column>
<!-- 源数据库 -->
<el-table-column prop="databaseChName" label="源数据库" width="150">
<el-table-column prop="sourceDatabase" label="源数据库" width="150" show-overflow-tooltip>
<template #default="scope">
{{ scope.row.databaseChName ? scope.row.databaseChName : '--' }}
{{ scope.row.sourceDatabase ? scope.row.sourceDatabase : '--' }}
</template>
</el-table-column>
<!-- 源数据表 -->
<el-table-column prop="tableName" label="源数据表" width="150">
<el-table-column prop="sourceTableName" label="源数据表" width="150" show-overflow-tooltip>
<template #default="scope">
{{ scope.row.tableName ? scope.row.tableName : '--' }}
{{ scope.row.sourceTableName ? scope.row.sourceTableName : '--' }}
</template>
</el-table-column>
<!-- 源字段中文 -->
<el-table-column prop="fieldChName" label="源字段中文" width="150">
<el-table-column prop="sourceFieldName" label="源字段中文" width="150" show-overflow-tooltip>
<template #default="scope">
{{ scope.row.fieldChName ? scope.row.fieldChName : '--' }}
{{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }}
</template>
</el-table-column>
<!-- 源字段英文 -->
<el-table-column prop="fieldName" label="源字段英文" width="150">
<el-table-column prop="sourceFieldChName" label="源字段英文" width="150" show-overflow-tooltip>
<template #default="scope">
<!-- {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} -->
<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="请输入长度" />
<span v-if="!scope.row.isEdit || !editableFields.sourceFieldChName">{{ scope.row.sourceFieldChName ?
scope.row.sourceFieldChName : '--' }}</span>
<el-input v-else v-model="scope.row.sourceFieldChName" placeholder="请输入长度" />
</template>
</el-table-column>
<!-- 源端字段 fieldType fieldTypeProps-->
......@@ -1016,7 +1022,7 @@ onActivated(() => {
</el-table-column>
<!-- 长度(可编辑) -->
<el-table-column prop="fieldLength" label="长度" width="120" align="center">
<el-table-column prop="fieldLength" label="长度" width="120" align="left">
<template #default="scope">
<!-- 非编辑状态 -->
<span v-if="!scope.row.isEdit">
......@@ -1034,7 +1040,7 @@ onActivated(() => {
</el-table-column>
<!-- 精度(可编辑) -->
<el-table-column prop="fieldPrecision" label="精度" width="120" align="center">
<el-table-column prop="fieldPrecision" label="精度" width="120" align="left">
<template #default="scope">
<!-- 非编辑状态 -->
<span v-if="!scope.row.isEdit">
......@@ -1049,7 +1055,7 @@ onActivated(() => {
</template>
</el-table-column>
<!-- 关联字典(可编辑)el-tree-select 形式下拉形式 -->
<el-table-column prop="dictionaryGuid" label="关联字典" width="150" align="center">
<el-table-column prop="dictionaryGuid" label="关联字典" width="150" align="left">
<template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.dictionaryGuid
? dictionaryList.find((item: any) => item.guid === scope.row.dictionaryGuid)?.chName : '--' }}</span>
......@@ -1061,11 +1067,11 @@ onActivated(() => {
</el-table-column>
<!-- 数据是否唯一(可编辑) -->
<el-table-column prop="isPrimary" label="是否主键" width="150" align="center">
<el-table-column prop="isPrimary" label="是否主键" width="150" align="left">
<template #default="scope">
<span v-if="!scope.row.isEdit || !editableFields.isPrimary">{{ scope.row.isPrimary ? scope.row.isPrimary
:
'--' }}</span>
<span v-if="!scope.row.isEdit || !editableFields.isPrimary">{{ scope.row.isPrimary ?
(scope.row.isPrimary ===
'Y' ? '是' : '否') : '--' }}</span>
<el-select v-else v-model="scope.row.isPrimary" placeholder="请选择">
<el-option label="Y" value="Y" />
<el-option label="N" value="N" />
......@@ -1073,10 +1079,11 @@ onActivated(() => {
</template>
</el-table-column>
<!-- 是否必填(可编辑) -->
<el-table-column prop="isNotNull" label="是否必填" width="120" align="center">
<el-table-column prop="notNull" label="是否必填" width="120" align="left">
<template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.isNotNull ? scope.row.isNotNull : '--' }}</span>
<el-select v-else v-model="scope.row.isNotNull" placeholder="请选择">
<span v-if="!scope.row.isEdit">{{ scope.row.notNull ? (scope.row.notNull ===
'Y' ? '是' : '否') : '--' }}</span>
<el-select v-else v-model="scope.row.notNull" placeholder="请选择">
<el-option label="Y" value="Y" />
<el-option label="N" value="N" />
</el-select>
......@@ -1101,7 +1108,7 @@ onActivated(() => {
</template>
</el-table-column>
<!-- 分级(不可编辑) -->
<el-table-column prop="gradeDetailGuid" label="分级" width="120" align="center">
<el-table-column prop="gradeDetailGuid" label="分级" width="120" align="left">
<template #default="scope">
<div v-if="scope.row.isEdit">
<el-select v-model="scope.row.gradeDetailGuid" placeholder="请选择分级" clearable filterable
......
......@@ -1010,7 +1010,7 @@ const getTableFieldLineageMap = () => {
const getAllTableFieldLineageMap = () => {
lineageLoading.value = true;
isFieldLineage.value = true;
getTableAllFieldLineage({ databaseName: lastClickNode.value.databaseName, tableName: lastClickNode.value.tableName }).then((res: any) => {
getTableAllFieldLineage({ databaseName: lastClickNode.value.databaseName, tableName: lastClickNode.value.tableName, tableGuid: lastClickNode.value.guid }).then((res: any) => {
if (res.code == proxy.$passCode) {
let data1 = res.data || [];
lineageData.value = data1;
......
......@@ -722,7 +722,7 @@ const getTableLineageMap = () => {
const getAllTableFieldLineageMap = () => {
lineageDataLoading.value = true;
isFieldLineage.value = true;
getTableAllFieldLineage({ databaseName: sheetInfo.value.databaseName, tableName: sheetInfo.value.tableName }).then((res: any) => {
getTableAllFieldLineage({ databaseName: sheetInfo.value.databaseName, tableName: sheetInfo.value.tableName, tableGuid: sheetInfo.value.guid }).then((res: any) => {
if (res.code == proxy.$passCode) {
let data1 = res.data || [];
lineageData.value = data1;
......@@ -802,8 +802,8 @@ const handleLineageSwitchChange = (val) => {
<LineageGraph ref="lineageGraph" v-if="lineageData.length" layout="vertical" :lineageData="lineageData"
:is-field-lineage="isFieldLineage" :primary-table="sheetInfo.tableName" :is-detail="true"
:primaryDatabase="sheetInfo.databaseName" :isEdit="true" @handleSave="handleSave"
@tableContextMenu="handleTableContextMenu" @handleToggle="handleToggle" :isToggle="isToggle" @handleChOrEn=handleChOrEn :isCh="isCh"
@handleRefres="handleRefres" @handleEdit="handleEdit"
@tableContextMenu="handleTableContextMenu" @handleToggle="handleToggle" :isToggle="isToggle"
@handleChOrEn=handleChOrEn :isCh="isCh" @handleRefres="handleRefres" @handleEdit="handleEdit"
@handleLineageSwitchChange="handleLineageSwitchChange" />
</div>
......
......@@ -229,6 +229,8 @@ const getAssetTableData = () => {
getRegisterInfo({
pageSize: 200,
pageIndex: 1,
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
assetTableInfo.value.loading1 = false;
if (res.code == proxy.$passCode) {
......@@ -291,6 +293,9 @@ const getTradeTableData = () => {
getDaTradeInfo({
pageSize: 200,
pageIndex: 1,
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
tradeTableInfo.value.loading1 = false;
if (res.code == proxy.$passCode) {
......@@ -368,6 +373,8 @@ const getFinancingTableData = () => {
getFinanceInfo({
pageSize: 200,
pageIndex: 1,
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
financingTableInfo.value.loading1 = false;
if (res.code == proxy.$passCode) {
......@@ -408,22 +415,44 @@ const assetTableRef = ref();
const rolltimer = ref();
onBeforeMount(() => {
if (userData.tenantType != 1) {
if (userData.tenantType == 1) {
// 获取数据表格
getAssetTableData();
// 获取统计信息
fetchStatisticsInfo();
// 获取质量饼图数据
fetchQualityInfo();
// 获取交易和融资数据
getTradeTableData();
getFinancingTableData();
// 获取注册文档数据
fetchRegisterUrl();
}
});
// 获取统计信息
function fetchStatisticsInfo() {
statisticsInfoLoading.value = true;
getStatisticsInfo().then((res: any) => {
getStatisticsInfo({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
statisticsInfoLoading.value = false;
if (res.code == proxy.$passCode) {
let data = res.data || {};
const data = res.data || {};
registerNum.value = changeNum(data.registerNum ?? 0);
costAssessNum.value = changeNum(data.costAssessNum ?? 0);
qualityAssessNum.value = changeNum(data.qualityAssessNum ?? 0);
cardList.value.forEach((card) => {
if (card.name == 'assessmentMoney') {
if (card.name === 'assessmentMoney') {
card.value = changeNum((data[card.name] ?? 0) / 10000, 2, true);
} else if (card.name == "lastIntableTime") {
card.value = data[card.name] ?? "--";
} else if (card.name == "dataScale") {
} else if (card.name === 'lastIntableTime') {
card.value = data[card.name] ?? '--';
} else if (card.name === 'dataScale') {
card.value = changeNum(data[card.name] ?? 0, 2, true);
} else {
card.value = changeNum(data[card.name] ?? 0);
......@@ -433,70 +462,61 @@ onBeforeMount(() => {
ElMessage.error(res.msg);
}
});
}
// 获取质量信息
function fetchQualityInfo() {
qualityPieLoading.value = true;
getQualityInfo().then((res: any) => {
getQualityInfo({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
qualityPieLoading.value = false;
// qualityPieChart = echarts.init(document.getElementById("pie-quality"));
if (res.code == proxy.$passCode) {
qualityPieData.value = res.data || [];
let sum = qualityPieData.value
.map((d) => d.value)
.reduce(function (prev, curr, idx, arr) {
return prev + curr;
});
qualityPieData.value.forEach(v => {
v.percent = changeNum((v.value / sum) * 100, 2, true) + '%';
});
const qualityData = res.data || [];
const sum = qualityData.reduce((acc, item) => acc + item.value, 0);
qualityPieData.value = qualityData.map((item) => ({
...item,
percent: changeNum((item.value / sum) * 100, 2, true) + '%',
}));
} else {
ElMessage.error(res.msg);
}
});
getTradeTableData();
getFinancingTableData();
}
// 获取注册文档 URL
function fetchRegisterUrl() {
docUrlLoading.value = true;
getRegisterUrl().then((res: any) => {
getRegisterUrl({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
docUrlLoading.value = false;
if (res.code == proxy.$passCode) {
let data = docData.value = res.data || [];
const data = res.data || [];
if (data.length) {
let ps: any = [];
for (const d of data) {
d.documentTypeDesc = d.documentType == 1 ? 'A证' : (d.documentType == 2 ? 'B证' : 'C证');
ps.push(
getImageContent(d.documentFile[0]).then((res: any) => {
if (res) {
return URL.createObjectURL(res);
}
})
);
}
Promise.all(ps).then((res: any[]) => {
console.log(res);
docUrl.value = res;
docUrlList.value = res.flatMap((value, index, array) => {
return [
array.slice(index, index + 1).map((a) => {
return { url: a };
}),
];
const promises = data.map((d) => {
d.documentTypeDesc = d.documentType === 1 ? 'A证' : d.documentType === 2 ? 'B证' : 'C证';
return getImageContent(d.documentFile[0]).then((res: any) => (res ? URL.createObjectURL(res) : null));
});
docUrlLoading.value = false;
Promise.all(promises).then((urls: any[]) => {
docUrl.value = urls;
docUrlList.value = urls.map((url) => [{ url }]);
nextTick(() => {
processImgDesc();
});
});
} else {
docUrl.value = [];
docData.value = [];
docUrlList.value = [];
docUrlLoading.value = false;
}
} else {
docUrlLoading.value = false;
ElMessage.error(res.msg);
}
});
}
});
}
const processImgDesc = () => {
let domImg = document.getElementById('register-img');
......@@ -600,15 +620,35 @@ watch(
);
const startTime = ref()
const endTime = ref()
const handleChangeTime = (val) => {
console.log(val)
startTime.value = val[0]
endTime.value = val[1]
// 获取数据表格
getAssetTableData();
// 获取统计信息
fetchStatisticsInfo();
// 获取质量饼图数据
fetchQualityInfo();
// 获取交易和融资数据
getTradeTableData();
getFinancingTableData();
// 获取注册文档数据
fetchRegisterUrl();
}
</script>
<template>
<div style="width: 100%;height: 100%">
<div class="right-filter-main" v-if="userData.tenantType != 1">
<div class="right-filter-main" v-if="userData.tenantType == 1">
<div class="right-filter">
<div class="filter-btns">
<div class="btn" :class="{ 'is-active': filterDate == 'today' }" @click="handleFilterClick('today')">今日</div>
......@@ -622,7 +662,7 @@ const handleChangeTime = (val) => {
ref="datePickerRef" />
</div>
</div>
<div v-if="userData.tenantType != 1" class="main-content">
<div v-if="userData.tenantType == 1" class="main-content">
<div class="one-row">
<div class="row-per">
<div class="header">
......@@ -778,7 +818,7 @@ const handleChangeTime = (val) => {
</div>
</div>
<!-- <platformIndex v-else-if="userData.tenantType != 1" /> -->
<platformIndexNewBigScreen v-else-if="userData.tenantType == 1" />
<platformIndexNewBigScreen v-else-if="userData.tenantType != 1" />
<div v-else class="main-placeholder">
<img width="210" height="100" src="../../public/swzl_logo.png" />
</div>
......
......@@ -135,6 +135,8 @@ const getFinancingTableData = () => {
getFinanceInfo({
pageSize: 500,
pageIndex: 1,
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
financingTableInfo.value.loading1 = false;
if (res.code == proxy.$passCode) {
......@@ -151,7 +153,10 @@ const statisticsInfoLoading = ref(false);
onBeforeMount(() => {
getFinancingTableData();
statisticsInfoLoading.value = true;
getPlatformStatisticsInfo().then((res: any) => {
getPlatformStatisticsInfo({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
statisticsInfoLoading.value = false;
if (res.code == proxy.$passCode) {
let data = res.data || {};
......@@ -961,7 +966,10 @@ const bindPieAction = (chart, data) => {
onMounted(() => {
industryPieChart = echarts.init(document.getElementById("pie-industry"));
industryPieLoading.value = true;
getIndustryInfo().then((res: any) => {
getIndustryInfo({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
industryPieLoading.value = false;
if (res.code == proxy.$passCode) {
industryPieData.value = res.data?.homeGraphStatistics || [];
......@@ -977,7 +985,10 @@ onMounted(() => {
creditMoneyPieChart = echarts.init(
document.getElementById("pie-creditMoney")
);
getCreditMoneyInfo().then((res: any) => {
getCreditMoneyInfo({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
creditMoneyPieLoading.value = false;
if (res.code == proxy.$passCode) {
creditMoneyPieData.value = res.data || [];
......@@ -991,7 +1002,10 @@ onMounted(() => {
serviceAreaBarLoading.value = true;
serviceAreaBarChart = echarts.init(document.getElementById("bar-area"));
getPlatformService().then((res: any) => {
getPlatformService({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
serviceAreaBarLoading.value = false;
if (res.code == proxy.$passCode) {
serviceAreaBarData.value = res.data || [];
......@@ -1001,7 +1015,10 @@ onMounted(() => {
}
});
getPlatformProvinceService().then((res: any) => {
getPlatformProvinceService({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
if (res.code == proxy.$passCode) {
serviceAreaMapData.value = res.data || [];
} else {
......@@ -1010,7 +1027,10 @@ onMounted(() => {
});
platformMonthBarLoading.value = true;
platformMonthBarChart = echarts.init(document.getElementById("bar-month"));
getPlatformMonth().then((res: any) => {
getPlatformMonth({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
platformMonthBarLoading.value = false;
if (res.code == proxy.$passCode) {
platformMonthBarData.value = res.data || [];
......@@ -1063,8 +1083,111 @@ watch(
);
const startTime = ref()
const endTime = ref()
const handleChangeTime = (val) => {
console.log(val)
startTime.value = val[0];
endTime.value = val[1];
getFinancingTableData();
statisticsInfoLoading.value = true;
getPlatformStatisticsInfo({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
statisticsInfoLoading.value = false;
if (res.code == proxy.$passCode) {
let data = res.data || {};
cardList.value.forEach((card) => {
if (card.name == 'assessmentMoney') {
card.value = changeNum((data[card.name] ?? 0) / 10000, 2, true);
} else if (card.name == "dataScale") {
card.value = changeNum(data[card.name] ?? 0, 2);
} else {
card.value = changeNum(data[card.name] ?? 0);
}
});
} else {
ElMessage.error(res.msg);
}
});
industryPieChart = echarts.init(document.getElementById("pie-industry"));
industryPieLoading.value = true;
getIndustryInfo({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
industryPieLoading.value = false;
if (res.code == proxy.$passCode) {
industryPieData.value = res.data?.homeGraphStatistics || [];
industryPieDataTotal.value = res.data?.totalCompanyNum ?? 0;
setPieChartOption().then(() => {
bindPieAction(industryPieChart, industryPieData.value);
});
} else {
ElMessage.error(res.msg);
}
});
creditMoneyPieLoading.value = true;
creditMoneyPieChart = echarts.init(
document.getElementById("pie-creditMoney")
);
getCreditMoneyInfo({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
creditMoneyPieLoading.value = false;
if (res.code == proxy.$passCode) {
creditMoneyPieData.value = res.data || [];
setCreditPieChartOption().then(() => {
bindPieAction(creditMoneyPieChart, creditMoneyPieData.value);
});
} else {
ElMessage.error(res.msg);
}
});
serviceAreaBarLoading.value = true;
serviceAreaBarChart = echarts.init(document.getElementById("bar-area"));
getPlatformService({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
serviceAreaBarLoading.value = false;
if (res.code == proxy.$passCode) {
serviceAreaBarData.value = res.data || [];
setBarChartOption(serviceAreaBarData.value.slice(0, 5), serviceAreaBarChart);
} else {
ElMessage.error(res.msg);
}
});
getPlatformProvinceService({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
if (res.code == proxy.$passCode) {
serviceAreaMapData.value = res.data || [];
} else {
ElMessage.error(res.msg);
}
});
platformMonthBarLoading.value = true;
platformMonthBarChart = echarts.init(document.getElementById("bar-month"));
getPlatformMonth({
startTime: startTime.value || '',
endTime: endTime.value || '',
}).then((res: any) => {
platformMonthBarLoading.value = false;
if (res.code == proxy.$passCode) {
platformMonthBarData.value = res.data || [];
setAreaChartOption(platformMonthBarData.value, platformMonthBarChart);
} else {
ElMessage.error(res.msg);
}
});
}
</script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!