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({ ...@@ -242,14 +242,14 @@ export const getParamsList = () => request({
242 242
243 /** 获取参数类型列表 */ 243 /** 获取参数类型列表 */
244 export const getDamTypesList = () => request({ 244 export const getDamTypesList = () => request({
245 url:`${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-list`, 245 url:`${import.meta.env.VITE_APP_DATA_SOURCE_URL}/data-dict/get-data-list`,
246 method: 'post', 246 method: 'post',
247 data: { paramCode: "DAM-TYPE" } 247 data: { paramCode: "DAM-TYPE" }
248 }) 248 })
249 249
250 /** 获取所属主题的四级参数类型列表 */ 250 /** 获取所属主题的四级参数类型列表 */
251 export const getSubjectDoaminList = () => request({ 251 export const getSubjectDoaminList = () => request({
252 url:`${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-tree`, 252 url:`${import.meta.env.VITE_APP_DATA_SOURCE_URL}/data-dict/get-data-tree`,
253 method: 'post', 253 method: 'post',
254 data: { paramCode: "SUBJECT-DOMAIN" } 254 data: { paramCode: "SUBJECT-DOMAIN" }
255 }) 255 })
...@@ -262,85 +262,85 @@ export const getDataTypeList = () => request({ ...@@ -262,85 +262,85 @@ export const getDataTypeList = () => request({
262 }) 262 })
263 263
264 export const getDamCatalogTable = (params) => request({ 264 export const getDamCatalogTable = (params) => request({
265 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/page-list`, 265 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/page-list`,
266 method: 'post', 266 method: 'post',
267 data: params 267 data: params
268 }) 268 })
269 269
270 /** 删除数据资产目录 */ 270 /** 删除数据资产目录 */
271 export const registerCatalogDelete = (params) => request({ 271 export const registerCatalogDelete = (params) => request({
272 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/delete`, 272 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/delete`,
273 method: 'delete', 273 method: 'delete',
274 data: params 274 data: params
275 }); 275 });
276 276
277 /** 保存数据资产目录 */ 277 /** 保存数据资产目录 */
278 export const registerCatalogSave = (params) => request({ 278 export const registerCatalogSave = (params) => request({
279 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/save`, 279 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/save`,
280 method: 'post', 280 method: 'post',
281 data: params 281 data: params
282 }); 282 });
283 283
284 /** 验证资产名称是否存在 */ 284 /** 验证资产名称是否存在 */
285 export const existDamName = (params) => request({ 285 export const existDamName = (params) => request({
286 url:`${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/exists?damName=${params}`, 286 url:`${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/exists?damName=${params}`,
287 method: 'get' 287 method: 'get'
288 }); 288 });
289 289
290 /** 获取资产目录基本信息的详情 */ 290 /** 获取资产目录基本信息的详情 */
291 export const getRegisterCatalogDetail = (guid) => request({ 291 export const getRegisterCatalogDetail = (guid) => request({
292 url:`${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/detail?guid=${guid}`, 292 url:`${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/detail?guid=${guid}`,
293 method: 'get' 293 method: 'get'
294 }); 294 });
295 295
296 /** 获取资产目录表的详情 */ 296 /** 获取资产目录表的详情 */
297 export const getRegisterCatalogTableDetail = (subjectGuid) => request({ 297 export const getRegisterCatalogTableDetail = (subjectGuid) => request({
298 url:`${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/get-table-detail?subjectGuid=${subjectGuid}`, 298 url:`${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/get-table-detail?subjectGuid=${subjectGuid}`,
299 method: 'get' 299 method: 'get'
300 }); 300 });
301 301
302 /** 编辑资产目录基本信息 */ 302 /** 编辑资产目录基本信息 */
303 export const registerCatalogUpdate = (params) => request({ 303 export const registerCatalogUpdate = (params) => request({
304 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/update`, 304 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/update`,
305 method: 'post', 305 method: 'post',
306 data: params 306 data: params
307 }); 307 });
308 308
309 /** 新增资产目录表 */ 309 /** 新增资产目录表 */
310 export const registerCatalogTableSave = (params) => request({ 310 export const registerCatalogTableSave = (params) => request({
311 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/add-table`, 311 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/add-table`,
312 method: 'post', 312 method: 'post',
313 data: params 313 data: params
314 }); 314 });
315 315
316 /** 编辑资产目录表 */ 316 /** 编辑资产目录表 */
317 export const registerCatalogTableUpdate = (params) => request({ 317 export const registerCatalogTableUpdate = (params) => request({
318 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/update-table`, 318 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/update-table`,
319 method: 'post', 319 method: 'post',
320 data: params 320 data: params
321 }); 321 });
322 322
323 /** 删除资产目录表 */ 323 /** 删除资产目录表 */
324 export const registerCatalogTableDelete = (params) => request({ 324 export const registerCatalogTableDelete = (params) => request({
325 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/remove-table?damGuid=${params.damGuid}&subjectGuid=${params.subjectGuid}`, 325 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/remove-table?damGuid=${params.damGuid}&subjectGuid=${params.subjectGuid}`,
326 method: 'post' 326 method: 'post'
327 }); 327 });
328 328
329 /** 获取资产目录表 */ 329 /** 获取资产目录表 */
330 export const getRegisterCatalogTableList = (damGuid) => request({ 330 export const getRegisterCatalogTableList = (damGuid) => request({
331 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/get-table-list?damGuid=${damGuid}`, 331 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/get-table-list?damGuid=${damGuid}`,
332 method: 'get' 332 method: 'get'
333 }); 333 });
334 334
335 /** 查看资产表数据 */ 335 /** 查看资产表数据 */
336 export const queryData = (subjectGuid) => request({ 336 export const queryData = (subjectGuid) => request({
337 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/preview-data/${subjectGuid}`, 337 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/preview-data/${subjectGuid}`,
338 method: 'get' 338 method: 'get'
339 }); 339 });
340 340
341 /** 验证新增和编辑资产表 */ 341 /** 验证新增和编辑资产表 */
342 export const checkDamTableChange = (params) => request({ 342 export const checkDamTableChange = (params) => request({
343 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/check-table-change`, 343 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-catalog-table/check-table-change`,
344 method: 'post', 344 method: 'post',
345 data: params 345 data: params
346 }); 346 });
...@@ -349,14 +349,14 @@ export const checkDamTableChange = (params) => request({ ...@@ -349,14 +349,14 @@ export const checkDamTableChange = (params) => request({
349 /** ------------------ 公示异议处理 -------------------------------- */ 349 /** ------------------ 公示异议处理 -------------------------------- */
350 /** 获取异议列表数据 */ 350 /** 获取异议列表数据 */
351 export const getDissentList = (params) => request({ 351 export const getDissentList = (params) => request({
352 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-dissent-handle/page-list`, 352 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-dissent-handle/page-list`,
353 method: 'post', 353 method: 'post',
354 data: params 354 data: params
355 }) 355 })
356 356
357 /** 更新异议处理 */ 357 /** 更新异议处理 */
358 export const updateDissentState = (params) => request({ 358 export const updateDissentState = (params) => request({
359 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-dissent-handle/update-state`, 359 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-dissent-handle/update-state`,
360 method: 'post', 360 method: 'post',
361 data: params 361 data: params
362 }) 362 })
......
...@@ -7,9 +7,10 @@ export const getHomeServiceInfo = () => request({ ...@@ -7,9 +7,10 @@ export const getHomeServiceInfo = () => request({
7 }) 7 })
8 8
9 /** 获取首页资产统计信息 */ 9 /** 获取首页资产统计信息 */
10 export const getStatisticsInfo = () => request({ 10 export const getStatisticsInfo = (data) => request({
11 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/company/statistics-info`, 11 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/company/statistics-info`,
12 method: 'get', 12 method: 'post',
13 data
13 }) 14 })
14 15
15 /** 获取首页资产登记情况 */ 16 /** 获取首页资产登记情况 */
...@@ -20,9 +21,10 @@ export const getRegisterInfo = (params) => request({ ...@@ -20,9 +21,10 @@ export const getRegisterInfo = (params) => request({
20 }) 21 })
21 22
22 /** 获取首页资产质量情况 */ 23 /** 获取首页资产质量情况 */
23 export const getQualityInfo = () => request({ 24 export const getQualityInfo = (data) => request({
24 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/company/quality-info`, 25 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/company/quality-info`,
25 method: 'get', 26 method: 'post',
27 data
26 }) 28 })
27 29
28 /** 获取首页资产交易情况 */ 30 /** 获取首页资产交易情况 */
...@@ -40,43 +42,50 @@ export const getFinanceInfo = (params) => request({ ...@@ -40,43 +42,50 @@ export const getFinanceInfo = (params) => request({
40 }) 42 })
41 43
42 /** 获取资产证件照url */ 44 /** 获取资产证件照url */
43 export const getRegisterUrl = () => request({ 45 export const getRegisterUrl = (data) => request({
44 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/company/list-doc-url`, 46 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/company/list-doc-url`,
45 method: 'get', 47 method: 'post',
48 data
46 }) 49 })
47 50
48 /** 获取资产行业类型分布 */ 51 /** 获取资产行业类型分布 */
49 export const getIndustryInfo = () => request({ 52 export const getIndustryInfo = (data) => request({
50 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/industry-statistics`, 53 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/industry-statistics`,
51 method: 'get', 54 method: 'post',
55 data
52 }) 56 })
53 57
54 /** 获取平台授信主体金额分布 */ 58 /** 获取平台授信主体金额分布 */
55 export const getCreditMoneyInfo = () => request({ 59 export const getCreditMoneyInfo = (data) => request({
56 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/credit-money-statistics`, 60 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/credit-money-statistics`,
57 method: 'get', 61 method: 'post',
62 data
58 }) 63 })
59 64
60 /** 获取平台资产统计信息 */ 65 /** 获取平台资产统计信息 */
61 export const getPlatformStatisticsInfo = () => request({ 66 export const getPlatformStatisticsInfo = (data) => request({
62 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/statistics-info`, 67 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/statistics-info`,
63 method: 'get', 68 method: 'post',
69 data
64 }) 70 })
65 71
66 /** 获取平台服务企业地区分布 */ 72 /** 获取平台服务企业地区分布 */
67 export const getPlatformService = () => request({ 73 export const getPlatformService = (data) => request({
68 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/service-statistics`, 74 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/service-statistics`,
69 method: 'get', 75 method: 'post',
76 data
70 }) 77 })
71 78
72 /** 获取平台服务企业地区分布-按省 */ 79 /** 获取平台服务企业地区分布-按省 */
73 export const getPlatformProvinceService = () => request({ 80 export const getPlatformProvinceService = (data) => request({
74 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/service-statistics-province`, 81 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/service-statistics-province`,
75 method: 'get', 82 method: 'post',
83 data
76 }) 84 })
77 85
78 /** 获取平台数据资产登记趋势 */ 86 /** 获取平台数据资产登记趋势 */
79 export const getPlatformMonth = () => request({ 87 export const getPlatformMonth = (data) => request({
80 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/register-month-statistics`, 88 url: `${import.meta.env.VITE_API_NEW_PORTAL}/home/platform/register-month-statistics`,
81 method: 'get', 89 method: 'post',
90 data
82 }) 91 })
......
...@@ -142,7 +142,7 @@ export const getTableFieldLineage = (params) => request({ ...@@ -142,7 +142,7 @@ export const getTableFieldLineage = (params) => request({
142 142
143 /** 获取表的所有字段血缘数据 */ 143 /** 获取表的所有字段血缘数据 */
144 export const getTableAllFieldLineage = (params) => request({ 144 export const getTableAllFieldLineage = (params) => request({
145 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/lineage-query-field?databaseName=${params.databaseName}&tableName=${params.tableName}`, 145 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/lineage-query-field?databaseName=${params.databaseName}&tableName=${params.tableName}&tableGuid=${params.tableGuid}`,
146 method: 'get', 146 method: 'get',
147 }) 147 })
148 148
......
...@@ -33,6 +33,7 @@ import { download } from "@/utils/common"; ...@@ -33,6 +33,7 @@ import { download } from "@/utils/common";
33 import { getLabelList } from "@/api/modules/dataLabel"; 33 import { getLabelList } from "@/api/modules/dataLabel";
34 34
35 const currentPath = ref<string[]>([]); 35 const currentPath = ref<string[]>([]);
36 const currentDatabasePath = ref<string[]>([]);
36 const { proxy } = getCurrentInstance() as any; 37 const { proxy } = getCurrentInstance() as any;
37 const route = useRoute(); 38 const route = useRoute();
38 // 分级引用refGradeGuid 39 // 分级引用refGradeGuid
...@@ -48,14 +49,20 @@ const getCgDirTreeData = async () => { ...@@ -48,14 +49,20 @@ const getCgDirTreeData = async () => {
48 } 49 }
49 const res: any = await getTaskExeTreeList(params); 50 const res: any = await getTaskExeTreeList(params);
50 if (res.code == proxy.$passCode) { 51 if (res.code == proxy.$passCode) {
51 CgDirTreeList.value = res.data; 52
52 treeInfo.value.data = res.data; 53 const transformedData: any = [{
53 currentPath.value = [res.data[0].classifyName]; 54 classifyDetailGuid: execGuidInfo.value.guid, // 新增字段 GUID
54 treeInfo.value.expandedKey.push(res.data[0].classifyDetailGuid); 55 classifyName: execGuidInfo.value.cgDirName, // 新增字段目录名称
55 treeInfo.value.currentNodeKey = res.data[0].classifyDetailGuid; 56 children: res.data, // 将原始数据放入 children
56 classifyDetailGuidInfo.value = res.data[0].classifyDetailGuid; 57 }];
57 searchItemList.value[1].options = res.data; 58 CgDirTreeList.value = transformedData;
58 refGradeGuid.value = res.data[0].refGradeGuid; 59 treeInfo.value.data = transformedData;
60 currentPath.value = [transformedData[0].classifyName];
61 treeInfo.value.expandedKey.push(transformedData[0].classifyDetailGuid);
62 treeInfo.value.currentNodeKey = transformedData[0].classifyDetailGuid;
63 // classifyDetailGuidInfo.value = res.data[0].classifyDetailGuid;
64 searchItemList.value[0].options = res.data || [];
65 refGradeGuid.value = res.data[0].refGradeGuid || '';
59 treeInfo.value.loading = false; 66 treeInfo.value.loading = false;
60 } else { 67 } else {
61 proxy.$ElMessage.error(res.msg); 68 proxy.$ElMessage.error(res.msg);
...@@ -126,7 +133,7 @@ onMounted(async () => { ...@@ -126,7 +133,7 @@ onMounted(async () => {
126 }); 133 });
127 getDictionaryList(); 134 getDictionaryList();
128 getSearchTableList(); 135 getSearchTableList();
129 getLabelListData(); 136 // getLabelListData();
130 getGradeData(refGradeGuid.value); 137 getGradeData(refGradeGuid.value);
131 138
132 }) 139 })
...@@ -151,30 +158,23 @@ const treeInfo = ref<any>({ ...@@ -151,30 +158,23 @@ const treeInfo = ref<any>({
151 loading: false 158 loading: false
152 }); 159 });
153 160
154
155 const addStandardSet = () => {
156 console.log('addStandardSet');
157 }
158
159
160
161 // 右侧上方搜索tab配置 161 // 右侧上方搜索tab配置
162 const searchItemList = ref([ 162 const searchItemList = ref([
163 { 163 // {
164 label: '标签', 164 // label: '标签',
165 type: 'select', 165 // type: 'select',
166 maxlength: 19, 166 // maxlength: 19,
167 placeholder: '选择标签', 167 // placeholder: '选择标签',
168 field: 'labelName', 168 // field: 'labelName',
169 default: '', 169 // default: '',
170 options: [], 170 // options: [],
171 props: { 171 // props: {
172 label: 'label', 172 // label: 'label',
173 value: 'guid', 173 // value: 'guid',
174 }, 174 // },
175 clearable: true, 175 // clearable: true,
176 filterable: true, 176 // filterable: true,
177 }, 177 // },
178 { 178 {
179 label: "", 179 label: "",
180 placeholder: '分类', 180 placeholder: '分类',
...@@ -192,7 +192,8 @@ const searchItemList = ref([ ...@@ -192,7 +192,8 @@ const searchItemList = ref([
192 block: false, 192 block: false,
193 filterable: false, 193 filterable: false,
194 clearable: true, 194 clearable: true,
195 required: false 195 required: false,
196 visible: true,
196 }, { 197 }, {
197 label: '分级', 198 label: '分级',
198 type: 'select', 199 type: 'select',
...@@ -206,6 +207,7 @@ const searchItemList = ref([ ...@@ -206,6 +207,7 @@ const searchItemList = ref([
206 value: 'guid', 207 value: 'guid',
207 }, 208 },
208 clearable: true, 209 clearable: true,
210 visible: true,
209 }, 211 },
210 ]) 212 ])
211 213
...@@ -261,12 +263,16 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -261,12 +263,16 @@ const toSearch = (val: any, clear: boolean = false) => {
261 263
262 264
263 const nodeClick = async (data: any) => { 265 const nodeClick = async (data: any) => {
264 console.log('nodeClick', data); 266 console.log('nodeClick', data, levelGuidInfo.value);
265 const { guid, classifyDetailGuid, refGradeGuid } = data 267 const { guid, classifyDetailGuid, refGradeGuid } = data
266 classifyDetailGuidInfo.value = classifyDetailGuid; 268 classifyDetailGuidInfo.value = classifyDetailGuid;
267 // getGradeData(refGradeGuid); 269 // getGradeData(refGradeGuid);
268 searchItemList.value[1].default = data.classifyName; 270 if (data.classifyName === execGuidInfo.value.cgDirName) {
269 271 searchItemList.value[0].default = '';
272 } else {
273 searchItemList.value[0].default = data.classifyName;
274 }
275 searchItemList.value[1].default = levelGuidInfo.value || '';
270 await getCgDirFieldPage({ 276 await getCgDirFieldPage({
271 execGuid: execGuidInfo.value.execGuid, 277 execGuid: execGuidInfo.value.execGuid,
272 classifyDetail: classifyDetailGuid, 278 classifyDetail: classifyDetailGuid,
...@@ -302,20 +308,20 @@ const findPath = (data: any[], targetGuid: string, path: string[] = []) => { ...@@ -302,20 +308,20 @@ const findPath = (data: any[], targetGuid: string, path: string[] = []) => {
302 const getGradeData = async (refGradeGuid) => { 308 const getGradeData = async (refGradeGuid) => {
303 const res: any = await getGradeList({ classifyGradeGuid: refGradeGuid, pageIndex: 1, pageSize: -1 }); 309 const res: any = await getGradeList({ classifyGradeGuid: refGradeGuid, pageIndex: 1, pageSize: -1 });
304 if (res.code == proxy.$passCode) { 310 if (res.code == proxy.$passCode) {
305 searchItemList.value[2].options = res.data.records || []; 311 searchItemList.value[1].options = res.data.records || [];
306 } else { 312 } else {
307 proxy.$ElMessage.error(res.msg); 313 proxy.$ElMessage.error(res.msg);
308 } 314 }
309 } 315 }
310 // 获取标签 316 // 获取标签
311 const getLabelListData = async () => { 317 // const getLabelListData = async () => {
312 const res: any = await getLabelList({ label: '' }); 318 // const res: any = await getLabelList({ label: '' });
313 if (res.code == proxy.$passCode) { 319 // if (res.code == proxy.$passCode) {
314 searchItemList.value[0].options = res.data || []; 320 // searchItemList.value[0].options = res.data || [];
315 } else { 321 // } else {
316 proxy.$ElMessage.error(res.msg); 322 // proxy.$ElMessage.error(res.msg);
317 } 323 // }
318 } 324 // }
319 325
320 // btns-area 326 // btns-area
321 const checked = ref(false); 327 const checked = ref(false);
...@@ -354,12 +360,12 @@ const tableInfo = ref({ ...@@ -354,12 +360,12 @@ const tableInfo = ref({
354 } 360 }
355 }, 361 },
356 { label: "分级", field: "gradeDetailName", width: 80 }, 362 { label: "分级", field: "gradeDetailName", width: 80 },
357 { label: "标签", field: "label", width: 140 }, 363 // { label: "标签", field: "label", width: 140 },
358 { label: "规则", field: "ruleDetail", width: 180 }, 364 // { label: "规则", field: "ruleDetail", width: 180 },
359 { label: "表名", field: "tableName", width: 120, align: 'center' }, 365 { label: "表名", field: "tableName", width: 120, align: 'left' },
360 { label: "表中文名", field: "tableChName", width: 120, align: 'center' }, 366 { label: "表中文名", field: "tableChName", width: 120, align: 'left' },
361 { label: "数据库名", field: "database", width: 120, align: 'center' }, 367 { label: "数据库名", field: "database", width: 120, align: 'left' },
362 { label: "数据库中文名", field: "databaseChName", width: 120, align: 'center' }, 368 { label: "数据库中文名", field: "databaseChName", width: 120, align: 'left' },
363 369
364 ], 370 ],
365 data: [], 371 data: [],
...@@ -486,7 +492,7 @@ const dataBaseTableInfo = ref({ ...@@ -486,7 +492,7 @@ const dataBaseTableInfo = ref({
486 return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表'; 492 return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表';
487 } 493 }
488 }, 494 },
489 { label: "任务修改人", field: "taskUpdateUserName", width: 100 }, 495 { label: "修改人", field: "taskUpdateUserName", width: 100 },
490 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME }, 496 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
491 { label: "描述", field: "description", width: 120, align: 'center' }, 497 { label: "描述", field: "description", width: 120, align: 'center' },
492 { label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center' }, 498 { 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) => { ...@@ -831,6 +837,12 @@ const handleClick = (tab: any) => {
831 activeName.value = tab.props.name; 837 activeName.value = tab.props.name;
832 if (tab.props.name === 'second') { 838 if (tab.props.name === 'second') {
833 classifyDetailGuidInfo.value = ''; 839 classifyDetailGuidInfo.value = '';
840 if (activeTab.value === 'table') {
841 searchItemList.value[0].visible = false;
842 searchItemList.value[1].visible = false;
843 searchItemList.value[0].default = '';
844 searchItemList.value[1].default = '';
845 }
834 selectedA.value = null; 846 selectedA.value = null;
835 selectedB.value = null; 847 selectedB.value = null;
836 selectedC.value = null; 848 selectedC.value = null;
...@@ -842,6 +854,10 @@ const handleClick = (tab: any) => { ...@@ -842,6 +854,10 @@ const handleClick = (tab: any) => {
842 getDataBaseFieldData(); 854 getDataBaseFieldData();
843 getDbDirTableSelectData(1, {}); 855 getDbDirTableSelectData(1, {});
844 } else { 856 } else {
857 searchItemList.value[0].visible = true;
858 searchItemList.value[1].visible = true;
859 searchItemList.value[0].default = '';
860 searchItemList.value[1].default = '';
845 selectedA.value = null; 861 selectedA.value = null;
846 selectedB.value = null; 862 selectedB.value = null;
847 selectedC.value = null; 863 selectedC.value = null;
...@@ -865,6 +881,18 @@ const getDataBaseTreeData = async () => { ...@@ -865,6 +881,18 @@ const getDataBaseTreeData = async () => {
865 // 更新到绑定的响应式数据 881 // 更新到绑定的响应式数据
866 dataBaseTreeData.value = dataArray; 882 dataBaseTreeData.value = dataArray;
867 dataBaseTreeInfo.value.data = dataArray; 883 dataBaseTreeInfo.value.data = dataArray;
884 dataBaseTreeInfo.value.expandedKey.push(dataArray[0].guid);
885 dataBaseTreeInfo.value.currentNodeKey = dataArray[0].guid;
886 dataBaseGuid.value = dataArray[0].databaseGuid;
887 currentDatabasePath.value = [dataArray[0].name];
888 console.log('dataArray', dataArray);
889 if (dataArray[0].dicType === 1) {
890 isShowCreateBtn.value = true;
891 }
892 if (dataArray[0].dicType === 2) {
893 isShowCreateBtn.value = false;
894 }
895
868 dataBaseTreeInfo.value.loading = false; 896 dataBaseTreeInfo.value.loading = false;
869 } else { 897 } else {
870 proxy.$ElMessage.error(res.msg); 898 proxy.$ElMessage.error(res.msg);
...@@ -990,9 +1018,9 @@ const tableFieldsDataInfo = ref({ ...@@ -990,9 +1018,9 @@ const tableFieldsDataInfo = ref({
990 { label: "表中文名", field: "tableChName", width: 140, }, 1018 { label: "表中文名", field: "tableChName", width: 140, },
991 { label: "数据库名称", field: "database", width: 120 }, 1019 { label: "数据库名称", field: "database", width: 120 },
992 { label: "数据库中文名", field: "databaseChName", width: TableColumnWidth.DATETIME }, 1020 { label: "数据库中文名", field: "databaseChName", width: TableColumnWidth.DATETIME },
993 { label: "分类", field: "classifyDetailName", width: 120, align: 'center' }, 1021 { label: "分类", field: "classifyDetailName", width: 120, align: 'left' },
994 { label: "分级", field: "gradeDetailName", width: 120, align: 'center' }, 1022 { label: "分级", field: "gradeDetailName", width: 120, align: 'left' },
995 { label: "标签", field: "label", width: 120, align: 'center' }, 1023 // { label: "标签", field: "label", width: 120, align: 'center' },
996 ], 1024 ],
997 data: [], 1025 data: [],
998 page: { 1026 page: {
...@@ -1009,7 +1037,7 @@ const tableFieldsDataInfo = ref({ ...@@ -1009,7 +1037,7 @@ const tableFieldsDataInfo = ref({
1009 1037
1010 1038
1011 const showTableOrDatabase = ref(true); 1039 const showTableOrDatabase = ref(true);
1012 const isShowCreateBtn = ref(false); 1040 const isShowCreateBtn = ref(true);
1013 // 定义tableGuid 1041 // 定义tableGuid
1014 const tableGuid = ref(''); 1042 const tableGuid = ref('');
1015 const dataBaseGuid = ref(''); 1043 const dataBaseGuid = ref('');
...@@ -1017,11 +1045,23 @@ const dataBaseInfo = ref<any>({}); ...@@ -1017,11 +1045,23 @@ const dataBaseInfo = ref<any>({});
1017 1045
1018 const dataBasenodeClick = (data: any) => { 1046 const dataBasenodeClick = (data: any) => {
1019 isShowCreateBtn.value = false; 1047 isShowCreateBtn.value = false;
1020 console.log('dataBasenodeClick', data); 1048 console.log('dataBasenodeClick', data, dataBaseTreeData.value);
1049 const path = findDDatabasePath(dataBaseTreeData.value, data.guid);
1050 console.log('path', path);
1051 if (path) {
1052 currentDatabasePath.value = path;
1053 } else {
1054 console.error('未找到路径');
1055 }
1021 if (data.databaseGuid) { 1056 if (data.databaseGuid) {
1022 dataBaseInfo.value = data; 1057 dataBaseInfo.value = data;
1023 dataBaseGuid.value = data.databaseGuid; 1058 dataBaseGuid.value = data.databaseGuid;
1059 if (data.dicType == '2') {
1060 isShowCreateBtn.value = false;
1061 }
1062 if (data.dicType == '1') {
1024 isShowCreateBtn.value = true; 1063 isShowCreateBtn.value = true;
1064 }
1025 tableGuid.value = ''; 1065 tableGuid.value = '';
1026 getDataBaseFieldData({ 1066 getDataBaseFieldData({
1027 databaseGuid: data.databaseGuid 1067 databaseGuid: data.databaseGuid
...@@ -1047,8 +1087,24 @@ const dataBasenodeClick = (data: any) => { ...@@ -1047,8 +1087,24 @@ const dataBasenodeClick = (data: any) => {
1047 showTableOrDatabase.value = false; 1087 showTableOrDatabase.value = false;
1048 return; 1088 return;
1049 } 1089 }
1090
1050 } 1091 }
1051 1092
1093 const findDDatabasePath = (data: any[], targetGuid: string, path: string[] = []) => {
1094 for (const item of data) {
1095 path.push(item.name); // 添加当前节点名称
1096 if (item.guid === targetGuid) {
1097 return path; // 找到目标节点,返回路径
1098 }
1099 if (item.children && item.children.length > 0) {
1100 const result = findDDatabasePath(item.children, targetGuid, path);
1101 if (result) return result; // 子节点找到目标节点,返回路径
1102 }
1103 path.pop(); // 回溯,移除当前节点
1104 }
1105 return null; // 未找到目标节点
1106 };
1107
1052 const nodeSelectChange = (data: any) => { 1108 const nodeSelectChange = (data: any) => {
1053 console.log('nodeSelectChange', data); 1109 console.log('nodeSelectChange', data);
1054 } 1110 }
...@@ -1087,14 +1143,17 @@ const isShowClassifyTip = ref(true); ...@@ -1087,14 +1143,17 @@ const isShowClassifyTip = ref(true);
1087 const isShowDatabaseTip = ref(true); 1143 const isShowDatabaseTip = ref(true);
1088 const addIsShowClassifyTip = () => { 1144 const addIsShowClassifyTip = () => {
1089 isShowClassifyTip.value = false; 1145 isShowClassifyTip.value = false;
1146 tipHeight.value = 83;
1090 } 1147 }
1091 1148
1092 const tipHeight = ref(200); 1149 const tipHeight = ref(135);
1093 const tipHeight1 = ref(165); 1150 const tipHeight1 = ref(170);
1151 const tipHeight2 = ref(130);
1152
1094 const addIsShowDatabaseTip = () => { 1153 const addIsShowDatabaseTip = () => {
1095 isShowDatabaseTip.value = false; 1154 isShowDatabaseTip.value = false;
1096 tipHeight.value = 148; 1155 tipHeight1.value = 118;
1097 tipHeight1.value = 103; 1156 tipHeight2.value = 78;
1098 } 1157 }
1099 1158
1100 // 表信息和字段信息切换 1159 // 表信息和字段信息切换
...@@ -1104,12 +1163,20 @@ const setActiveTab = (tab) => { ...@@ -1104,12 +1163,20 @@ const setActiveTab = (tab) => {
1104 console.log('setActiveTab', tab); 1163 console.log('setActiveTab', tab);
1105 activeTab.value = tab; 1164 activeTab.value = tab;
1106 if (tab === 'word' && activeName.value === 'second') { 1165 if (tab === 'word' && activeName.value === 'second') {
1166 searchItemList.value[0].visible = true;
1167 searchItemList.value[1].visible = true;
1168 searchItemList.value[0].default = '';
1169 searchItemList.value[1].default = '';
1107 isShowWordSearch.value = false; 1170 isShowWordSearch.value = false;
1108 optionsA.value = []; 1171 optionsA.value = [];
1109 optionsB.value = []; 1172 optionsB.value = [];
1110 optionsC.value = []; 1173 optionsC.value = [];
1111 getDbDirFieldSelectData(1); 1174 getDbDirFieldSelectData(1);
1112 } else { 1175 } else {
1176 searchItemList.value[0].visible = false;
1177 searchItemList.value[1].visible = false;
1178 searchItemList.value[0].default = '';
1179 searchItemList.value[1].default = '';
1113 isShowWordSearch.value = true; 1180 isShowWordSearch.value = true;
1114 optionsA.value = []; 1181 optionsA.value = [];
1115 optionsB.value = []; 1182 optionsB.value = [];
...@@ -1292,9 +1359,11 @@ const levelGuidInfo = ref(''); ...@@ -1292,9 +1359,11 @@ const levelGuidInfo = ref('');
1292 // 标签选择 1359 // 标签选择
1293 const selectChange = (val, row, info) => { 1360 const selectChange = (val, row, info) => {
1294 console.log('selectChange', val, row, info); 1361 console.log('selectChange', val, row, info);
1362 if (info.classifyName == undefined) {
1363 classifyDetailGuidInfo.value = '';
1364 }
1295 if (info) { 1365 if (info) {
1296 labelGuidInfo.value = info.labelName; 1366 labelGuidInfo.value = info.labelName;
1297 classifyDetailGuidInfo.value = info.classifyName;
1298 levelGuidInfo.value = info.levelName; 1367 levelGuidInfo.value = info.levelName;
1299 } 1368 }
1300 } 1369 }
...@@ -1347,7 +1416,7 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1347,7 +1416,7 @@ const treeSelectNodeClick = (node, item) => {
1347 <div class="aside_wrap"> 1416 <div class="aside_wrap">
1348 <el-tabs v-model="activeName" class="v-tabs" @tab-click="handleClick"> 1417 <el-tabs v-model="activeName" class="v-tabs" @tab-click="handleClick">
1349 <el-tab-pane label="分类分级目录" name="first"> 1418 <el-tab-pane label="分类分级目录" name="first">
1350 <Tree :treeInfo="treeInfo" @nodeClick="nodeClick" @itemMenuClick="handleTreeItemMenuClick" /> 1419 <Tree :treeInfo="treeInfo" @nodeClick="nodeClick" />
1351 <!-- <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" /> --> 1420 <!-- <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" /> -->
1352 </el-tab-pane> 1421 </el-tab-pane>
1353 <el-tab-pane label="数据库目录" name="second"> 1422 <el-tab-pane label="数据库目录" name="second">
...@@ -1382,7 +1451,7 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1382,7 +1451,7 @@ const treeSelectNodeClick = (node, item) => {
1382 <el-button @click="batchControlRules">批量配置业务规则</el-button> 1451 <el-button @click="batchControlRules">批量配置业务规则</el-button>
1383 </div> 1452 </div>
1384 </div> 1453 </div>
1385 <div class="table_panel_wrap"> 1454 <div class="table_panel_wrap" :style="{ height: `calc(100% - ${tipHeight}px)` }">
1386 <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange" 1455 <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange"
1387 @tableCheckboxSelectChange="tableCheckboxSelectChange" 1456 @tableCheckboxSelectChange="tableCheckboxSelectChange"
1388 @tableCheckboxAllSelectChange="tableCheckboxAllSelectChange" /> 1457 @tableCheckboxAllSelectChange="tableCheckboxAllSelectChange" />
...@@ -1403,7 +1472,12 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1403,7 +1472,12 @@ const treeSelectNodeClick = (node, item) => {
1403 不再提醒 1472 不再提醒
1404 </el-button> 1473 </el-button>
1405 </div> 1474 </div>
1406 <div>全部</div> 1475 <div class="path">
1476 <span v-for="(item, index) in currentDatabasePath" :key="index" class="path-item">
1477 <span :class="{ 'bold': index === currentDatabasePath.length - 1 }">{{ item }}</span>
1478 <span v-if="index < currentDatabasePath.length - 1">/</span>
1479 </span>
1480 </div>
1407 <div class="tab-btn"> 1481 <div class="tab-btn">
1408 内容信息: 1482 内容信息:
1409 <div v-if="showTableOrDatabase" class="table" :class="{ active: activeTab === 'table' }" 1483 <div v-if="showTableOrDatabase" class="table" :class="{ active: activeTab === 'table' }"
...@@ -1457,11 +1531,13 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1457,11 +1531,13 @@ const treeSelectNodeClick = (node, item) => {
1457 <el-checkbox v-model="checked" label="仅看规划数据资产表" size="large" @change="changeCheck" /> 1531 <el-checkbox v-model="checked" label="仅看规划数据资产表" size="large" @change="changeCheck" />
1458 </div> 1532 </div>
1459 </div> 1533 </div>
1460 <div class="table_panel_wrap_database" v-if="!tableGuid && activeTab === 'table'"> 1534 <div class="table_panel_wrap_database" :style="{ height: `calc(100% - ${tipHeight1}px)` }"
1535 v-if="!tableGuid && activeTab === 'table'">
1461 <Table :tableInfo="dataBaseTableInfo" @tablePageChange="dataBaseTablePageChange" 1536 <Table :tableInfo="dataBaseTableInfo" @tablePageChange="dataBaseTablePageChange"
1462 @tableSwitchBeforeChange="tableSwitchBeforeChange" /> 1537 @tableSwitchBeforeChange="tableSwitchBeforeChange" />
1463 </div> 1538 </div>
1464 <div class="table_field" v-if="tableGuid || activeTab === 'word'"> 1539 <div class="table_field" :style="{ height: `calc(100% - ${tipHeight2}px)` }"
1540 v-if="tableGuid || activeTab === 'word'">
1465 <Table :tableInfo="tableFieldsDataInfo" @tablePageChange="dataFieldTablePageChange" /> 1541 <Table :tableInfo="tableFieldsDataInfo" @tablePageChange="dataFieldTablePageChange" />
1466 </div> 1542 </div>
1467 </div> 1543 </div>
...@@ -1600,7 +1676,6 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1600,7 +1676,6 @@ const treeSelectNodeClick = (node, item) => {
1600 1676
1601 .table_panel_wrap { 1677 .table_panel_wrap {
1602 width: 100%; 1678 width: 100%;
1603 height: calc(100% - 130px);
1604 min-height: 210px; 1679 min-height: 210px;
1605 overflow: visible; 1680 overflow: visible;
1606 } 1681 }
......
...@@ -155,8 +155,14 @@ const batchDelete = () => { ...@@ -155,8 +155,14 @@ const batchDelete = () => {
155 selectedRows.value = []; 155 selectedRows.value = [];
156 }; 156 };
157 157
158 // 暂存编辑的行数据
159 const tempRowData = ref<any>();
160
158 // 编辑行 161 // 编辑行
159 const editRow = (row) => { 162 const editRow = (row) => {
163 console.log('编辑:', row);
164 // 暂存编辑前的数据
165 tempRowData.value = { ...row };
160 if (row.fieldLengthCondition) { 166 if (row.fieldLengthCondition) {
161 const arr = row.fieldLengthCondition.split('#') 167 const arr = row.fieldLengthCondition.split('#')
162 row.lengthSymbol = arr[0] 168 row.lengthSymbol = arr[0]
...@@ -307,6 +313,15 @@ const cancel = () => { ...@@ -307,6 +313,15 @@ const cancel = () => {
307 }); 313 });
308 } 314 }
309 315
316 // 点击取消
317 const cancelEdit = (row) => {
318 console.log('取消编辑:', row);
319 // 可在此恢复原始数据逻辑,如果需要
320 Object.assign(row, tempRowData.value);
321
322 row.isEdit = false; // 退出编辑状态
323 }
324
310 </script> 325 </script>
311 <template> 326 <template>
312 <div class="configure-rules"> 327 <div class="configure-rules">
...@@ -323,11 +338,11 @@ const cancel = () => { ...@@ -323,11 +338,11 @@ const cancel = () => {
323 <el-table-column prop="description" label="描述" width="180" show-overflow-tooltip /> 338 <el-table-column prop="description" label="描述" width="180" show-overflow-tooltip />
324 </el-table> 339 </el-table>
325 </div> 340 </div>
326 <div class="btn-area"> 341 <!-- <div class="btn-area">
327 <el-button @click="moveUp">上移</el-button> 342 <el-button @click="moveUp">上移</el-button>
328 <el-button @click="moveDown">下移</el-button> 343 <el-button @click="moveDown">下移</el-button>
329 <el-button @click="batchDelete">批量删除</el-button> 344 <el-button @click="batchDelete">批量删除</el-button>
330 </div> 345 </div> -->
331 <div class="bottom_table"> 346 <div class="bottom_table">
332 <el-table :data="tableData" v-loading="tableFieldsLoading" :highlight-current-row="true" stripe border 347 <el-table :data="tableData" v-loading="tableFieldsLoading" :highlight-current-row="true" stripe border
333 height="100%" row-key="guid" @selection-change="selectionFieldsChange" tooltip-effect="light" :style="{ 348 height="100%" row-key="guid" @selection-change="selectionFieldsChange" tooltip-effect="light" :style="{
...@@ -351,9 +366,9 @@ const cancel = () => { ...@@ -351,9 +366,9 @@ const cancel = () => {
351 </template> 366 </template>
352 </el-table-column> 367 </el-table-column>
353 <!-- 分类(不可编辑)classifyName --> 368 <!-- 分类(不可编辑)classifyName -->
354 <el-table-column prop="classifyName" label="分类" width="80" show-overflow-tooltip> 369 <el-table-column prop="classifyDetailName" label="分类" width="120" show-overflow-tooltip>
355 <template #default="scope"> 370 <template #default="scope">
356 {{ scope.row.classifyName ? scope.row.classifyName : '--' }} 371 {{ scope.row.classifyDetailName ? scope.row.classifyDetailName : '--' }}
357 </template> 372 </template>
358 </el-table-column> 373 </el-table-column>
359 <!-- 分级(不可编辑) --> 374 <!-- 分级(不可编辑) -->
...@@ -383,6 +398,8 @@ const cancel = () => { ...@@ -383,6 +398,8 @@ const cancel = () => {
383 <el-option label="大于" value=">"></el-option> 398 <el-option label="大于" value=">"></el-option>
384 <el-option label="等于" value="="></el-option> 399 <el-option label="等于" value="="></el-option>
385 <el-option label="小于" value="<"></el-option> 400 <el-option label="小于" value="<"></el-option>
401 <el-option label="大于等于" value=">="></el-option>
402 <el-option label="小于等于" value="<="></el-option>
386 </el-select> 403 </el-select>
387 <el-input v-model="scope.row.lengthValue" placeholder="请输入" style="width: 45%;" /> 404 <el-input v-model="scope.row.lengthValue" placeholder="请输入" style="width: 45%;" />
388 </div> 405 </div>
...@@ -411,7 +428,8 @@ const cancel = () => { ...@@ -411,7 +428,8 @@ const cancel = () => {
411 <!-- 数据是否唯一(可编辑) --> 428 <!-- 数据是否唯一(可编辑) -->
412 <el-table-column prop="isUnique" label="数据是否唯一" width="150" align="center"> 429 <el-table-column prop="isUnique" label="数据是否唯一" width="150" align="center">
413 <template #default="scope"> 430 <template #default="scope">
414 <span v-if="!scope.row.isEdit || !editableFields.isUnique">{{ scope.row.isUnique ? scope.row.isUnique : '--' 431 <span v-if="!scope.row.isEdit || !editableFields.isUnique">{{ scope.row.isUnique ? (scope.row.isUnique ===
432 'Y' ? '是' : '否') : '--'
415 }}</span> 433 }}</span>
416 <el-select v-else v-model="scope.row.isUnique" placeholder="请选择"> 434 <el-select v-else v-model="scope.row.isUnique" placeholder="请选择">
417 <el-option label="是" value="Y" /> 435 <el-option label="是" value="Y" />
...@@ -420,10 +438,11 @@ const cancel = () => { ...@@ -420,10 +438,11 @@ const cancel = () => {
420 </template> 438 </template>
421 </el-table-column> 439 </el-table-column>
422 <!-- 是否必填(可编辑) --> 440 <!-- 是否必填(可编辑) -->
423 <el-table-column prop="isRequired" label="是否必填" width="120" align="center"> 441 <el-table-column prop="notNull" label="是否必填" width="120" align="center">
424 <template #default="scope"> 442 <template #default="scope">
425 <span v-if="!scope.row.isEdit">{{ scope.row.isRequired ? scope.row.isRequired : '--' }}</span> 443 <span v-if="!scope.row.isEdit">{{ scope.row.notNull ? (scope.row.notNull === 'Y' ? '是' : '否') : '--'
426 <el-select v-else v-model="scope.row.isRequired" placeholder="请选择"> 444 }}</span>
445 <el-select v-else v-model="scope.row.notNull" placeholder="请选择">
427 <el-option label="是" value="Y" /> 446 <el-option label="是" value="Y" />
428 <el-option label="否" value="N" /> 447 <el-option label="否" value="N" />
429 </el-select> 448 </el-select>
...@@ -448,14 +467,17 @@ const cancel = () => { ...@@ -448,14 +467,17 @@ const cancel = () => {
448 </el-table-column> 467 </el-table-column>
449 468
450 <!-- 操作列 --> 469 <!-- 操作列 -->
451 <el-table-column label="操作" width="100" align="center" fixed="right"> 470 <el-table-column label="操作" width="120" align="center" fixed="right">
452 <template #default="scope"> 471 <template #default="scope">
453 <span class="text_btn" v-if="!scope.row.isEdit" @click="editRow(scope.row)">编辑</span> 472 <span class="text_btn" v-if="!scope.row.isEdit" @click="editRow(scope.row)">编辑</span>
454 <span class="text_btn" v-else @click="saveRow(scope.row)">保存</span> 473 <span v-else>
474 <span class="text_btn" @click="saveRow(scope.row)">保存</span>
455 <el-divider direction="vertical" /> 475 <el-divider direction="vertical" />
456 <span class="text_btn" @click="deleteRow(scope.$index)">删除</span> 476 <span class="text_btn" @click="cancelEdit(scope.row)">取消</span>
477 </span>
457 </template> 478 </template>
458 </el-table-column> 479 </el-table-column>
480
459 </el-table> 481 </el-table>
460 </div> 482 </div>
461 <div class="botton_btn"> 483 <div class="botton_btn">
...@@ -485,7 +507,7 @@ const cancel = () => { ...@@ -485,7 +507,7 @@ const cancel = () => {
485 507
486 :deep(.bottom_table) { 508 :deep(.bottom_table) {
487 margin-top: 12px; 509 margin-top: 12px;
488 height: calc(100% - 150px); 510 height: calc(100% - 115px);
489 overflow-y: auto; 511 overflow-y: auto;
490 512
491 .el-table td.el-table__cell { 513 .el-table td.el-table__cell {
......
...@@ -320,7 +320,7 @@ watch( ...@@ -320,7 +320,7 @@ watch(
320 if (val?.length && !currDatasourceSelect.value?.tableName) { 320 if (val?.length && !currDatasourceSelect.value?.tableName) {
321 currDatasourceSelect.value = val[0]; 321 currDatasourceSelect.value = val[0];
322 } 322 }
323 emits("datasourceSelectedChange", val, databaseGuid.value); 323 emits("datasourceSelectedChange", val, currDatasourceSelect.value);
324 }, 324 },
325 { 325 {
326 deep: true, 326 deep: true,
...@@ -361,9 +361,9 @@ const getTextAlign = (field) => { ...@@ -361,9 +361,9 @@ const getTextAlign = (field) => {
361 <el-table-column type="selection" :width="22" align="center" /> 361 <el-table-column type="selection" :width="22" align="center" />
362 <el-table-column prop="tableName" label="名称" width="100px" align="left" show-overflow-tooltip> 362 <el-table-column prop="tableName" label="名称" width="100px" align="left" show-overflow-tooltip>
363 </el-table-column> 363 </el-table-column>
364 <el-table-column prop="tableComment" label="表注释" width="60px" align="left" show-overflow-tooltip> 364 <el-table-column prop="tableChName" label="表中文名称" width="80px" align="left" show-overflow-tooltip>
365 <template #default="scope"> 365 <template #default="scope">
366 <span>{{ scope.row['tableComment'] ?? '--' }}</span> 366 <span>{{ scope.row['tableChName'] ?? '--' }}</span>
367 </template> 367 </template>
368 </el-table-column> 368 </el-table-column>
369 </el-table> 369 </el-table>
...@@ -497,7 +497,7 @@ const getTextAlign = (field) => { ...@@ -497,7 +497,7 @@ const getTextAlign = (field) => {
497 height: calc(100% - 80px); 497 height: calc(100% - 80px);
498 498
499 .content-left { 499 .content-left {
500 width: 200px; 500 width: 220px;
501 border-right: 1px solid #d9d9d9; 501 border-right: 1px solid #d9d9d9;
502 502
503 .title-left { 503 .title-left {
...@@ -532,7 +532,7 @@ const getTextAlign = (field) => { ...@@ -532,7 +532,7 @@ const getTextAlign = (field) => {
532 } 532 }
533 533
534 .content-right { 534 .content-right {
535 width: calc(100% - 200px); 535 width: calc(100% - 220px);
536 536
537 .title-right { 537 .title-right {
538 height: 44px; 538 height: 44px;
......
...@@ -217,10 +217,12 @@ const stepsInfo = ref({ ...@@ -217,10 +217,12 @@ const stepsInfo = ref({
217 }); 217 });
218 218
219 219
220 220 // 保存选中的库表信息
221 const selectedDatabaseTableInfo = ref<any>([]);
221 const datasourceSelectedRows: Ref<any> = ref([]); 222 const datasourceSelectedRows: Ref<any> = ref([]);
222 // 记录数据库databaseGuid 223 // 记录数据库databaseGuid
223 const handlDsSelectedChange = (v, guid) => { 224 const handlDsSelectedChange = (v, curr) => {
225 selectedDatabaseTableInfo.value = curr || '';
224 datasourceSelectedRows.value = v || []; 226 datasourceSelectedRows.value = v || [];
225 const params: any = []; 227 const params: any = [];
226 v.forEach((item) => { 228 v.forEach((item) => {
...@@ -245,6 +247,9 @@ const nextStep = async () => { ...@@ -245,6 +247,9 @@ const nextStep = async () => {
245 }); 247 });
246 return; 248 return;
247 } 249 }
250 tableDataInfo.value[0].tableName = selectedDatabaseTableInfo.value.tableName;
251 tableDataInfo.value[0].tableChName = selectedDatabaseTableInfo.value.tableChName;
252
248 getFieldTree(); 253 getFieldTree();
249 stepsInfo.value.step = 1; 254 stepsInfo.value.step = 1;
250 }; 255 };
...@@ -315,6 +320,7 @@ const editableFields = { ...@@ -315,6 +320,7 @@ const editableFields = {
315 classifyDetailGuid: true, // 分类可编辑 320 classifyDetailGuid: true, // 分类可编辑
316 fieldType: true, // 字段类型可编辑 321 fieldType: true, // 字段类型可编辑
317 fieldChName: true, // 字段中文名可编辑 322 fieldChName: true, // 字段中文名可编辑
323 sourceFieldChName: true, // 源字段中文名可编辑
318 } 324 }
319 325
320 const tableFieldsLoading = ref(false) 326 const tableFieldsLoading = ref(false)
...@@ -622,45 +628,45 @@ const submit = async () => { ...@@ -622,45 +628,45 @@ const submit = async () => {
622 console.log('提交', tableDataDetailInfo.value, tableDataInfo.value) 628 console.log('提交', tableDataDetailInfo.value, tableDataInfo.value)
623 saveBtn.value = true 629 saveBtn.value = true
624 // 校验表格数据是否填写完整 630 // 校验表格数据是否填写完整
625 if (!checkTableData(tableDataDetailInfo.value)) { 631 // if (!checkTableData(tableDataDetailInfo.value)) {
626 saveBtn.value = false 632 // saveBtn.value = false
627 return 633 // return
628 } 634 // }
629 // 如果提交时没有 guid 则为新增type 0,否则为修改 type 1, 也要传参 635 // // 如果提交时没有 guid 则为新增type 0,否则为修改 type 1, 也要传参
630 if (!editInfoData.value.guid) { 636 // if (!editInfoData.value.guid) {
631 try { 637 // try {
632 await saveOrUpdate({ 638 // await saveOrUpdate({
633 tableName: tableDataInfo.value[0].tableName, 639 // tableName: tableDataInfo.value[0].tableName,
634 tableChName: tableDataInfo.value[0].tableChName, 640 // tableChName: tableDataInfo.value[0].tableChName,
635 databaseGuid: route.query.databaseGuid || '', 641 // databaseGuid: route.query.databaseGuid || '',
636 database: route.query.database || '', 642 // database: route.query.database || '',
637 databaseChName: route.query.databaseChName || '', 643 // databaseChName: route.query.databaseChName || '',
638 foundMode: route.query.foundMode, 644 // foundMode: route.query.foundMode,
639 isDraft: 'N', 645 // isDraft: 'N',
640 }, 0) 646 // }, 0)
641 saveBtn.value = false 647 // saveBtn.value = false
642 } catch (error) { 648 // } catch (error) {
643 saveBtn.value = false 649 // saveBtn.value = false
644 } 650 // }
645 } else { 651 // } else {
646 // 修改 saveOrUpdate({}, 1) 652 // // 修改 saveOrUpdate({}, 1)
647 try { 653 // try {
648 await saveOrUpdate({ 654 // await saveOrUpdate({
649 guid: editInfoData.value.guid, 655 // guid: editInfoData.value.guid,
650 tableName: tableDataInfo.value[0].tableName, 656 // tableName: tableDataInfo.value[0].tableName,
651 tableChName: tableDataInfo.value[0].tableChName, 657 // tableChName: tableDataInfo.value[0].tableChName,
652 databaseGuid: editInfoData.value.databaseGuid || '', 658 // databaseGuid: editInfoData.value.databaseGuid || '',
653 database: editInfoData.value.database || '', 659 // database: editInfoData.value.database || '',
654 databaseChName: editInfoData.value.databaseChName || '', 660 // databaseChName: editInfoData.value.databaseChName || '',
655 foundMode: editInfoData.value.foundMode, 661 // foundMode: editInfoData.value.foundMode,
656 isDraft: 'N', 662 // isDraft: 'N',
657 tableGuid: route.query.tableGuid, 663 // tableGuid: route.query.tableGuid,
658 }, 1) 664 // }, 1)
659 saveBtn.value = false 665 // saveBtn.value = false
660 } catch (error) { 666 // } catch (error) {
661 saveBtn.value = false 667 // saveBtn.value = false
662 } 668 // }
663 } 669 // }
664 670
665 } 671 }
666 672
...@@ -951,7 +957,7 @@ onActivated(() => { ...@@ -951,7 +957,7 @@ onActivated(() => {
951 <!-- 排序列(不可编辑) --> 957 <!-- 排序列(不可编辑) -->
952 <el-table-column type="index" label="排序" width="80" align="center" /> 958 <el-table-column type="index" label="排序" width="80" align="center" />
953 <!-- 字段中文名(可编辑)fieldChName --> 959 <!-- 字段中文名(可编辑)fieldChName -->
954 <el-table-column prop="fieldChName" label="目标字段中文名" width="150"> 960 <el-table-column prop="fieldChName" label="目标字段中文名" width="150" show-overflow-tooltip>
955 <!-- 可以编辑 --> 961 <!-- 可以编辑 -->
956 <template #default="scope"> 962 <template #default="scope">
957 <span v-if="!scope.row.isEdit || !editableFields.fieldChName">{{ scope.row.fieldChName ? 963 <span v-if="!scope.row.isEdit || !editableFields.fieldChName">{{ scope.row.fieldChName ?
...@@ -962,7 +968,7 @@ onActivated(() => { ...@@ -962,7 +968,7 @@ onActivated(() => {
962 968
963 </el-table-column> 969 </el-table-column>
964 <!-- 字段英文名(可编辑) --> 970 <!-- 字段英文名(可编辑) -->
965 <el-table-column prop="fieldName" label="目标字段英文名" width="150"> 971 <el-table-column prop="fieldName" label="目标字段英文名" width="150" show-overflow-tooltip>
966 <template #default="scope"> 972 <template #default="scope">
967 <span v-if="!scope.row.isEdit || !editableFields.fieldName">{{ scope.row.fieldName ? 973 <span v-if="!scope.row.isEdit || !editableFields.fieldName">{{ scope.row.fieldName ?
968 scope.row.fieldName 974 scope.row.fieldName
...@@ -972,31 +978,31 @@ onActivated(() => { ...@@ -972,31 +978,31 @@ onActivated(() => {
972 </template> 978 </template>
973 </el-table-column> 979 </el-table-column>
974 <!-- 源数据库 --> 980 <!-- 源数据库 -->
975 <el-table-column prop="databaseChName" label="源数据库" width="150"> 981 <el-table-column prop="sourceDatabase" label="源数据库" width="150" show-overflow-tooltip>
976 <template #default="scope"> 982 <template #default="scope">
977 {{ scope.row.databaseChName ? scope.row.databaseChName : '--' }} 983 {{ scope.row.sourceDatabase ? scope.row.sourceDatabase : '--' }}
978 </template> 984 </template>
979 </el-table-column> 985 </el-table-column>
980 <!-- 源数据表 --> 986 <!-- 源数据表 -->
981 <el-table-column prop="tableName" label="源数据表" width="150"> 987 <el-table-column prop="sourceTableName" label="源数据表" width="150" show-overflow-tooltip>
982 <template #default="scope"> 988 <template #default="scope">
983 {{ scope.row.tableName ? scope.row.tableName : '--' }} 989 {{ scope.row.sourceTableName ? scope.row.sourceTableName : '--' }}
984 </template> 990 </template>
985 </el-table-column> 991 </el-table-column>
986 <!-- 源字段中文 --> 992 <!-- 源字段中文 -->
987 <el-table-column prop="fieldChName" label="源字段中文" width="150"> 993 <el-table-column prop="sourceFieldName" label="源字段中文" width="150" show-overflow-tooltip>
988 <template #default="scope"> 994 <template #default="scope">
989 {{ scope.row.fieldChName ? scope.row.fieldChName : '--' }} 995 {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }}
990 </template> 996 </template>
991 </el-table-column> 997 </el-table-column>
992 <!-- 源字段英文 --> 998 <!-- 源字段英文 -->
993 <el-table-column prop="fieldName" label="源字段英文" width="150"> 999 <el-table-column prop="sourceFieldChName" label="源字段英文" width="150" show-overflow-tooltip>
994 <template #default="scope"> 1000 <template #default="scope">
995 <!-- {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} --> 1001 <!-- {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} -->
996 1002
997 <span v-if="!scope.row.isEdit || !editableFields.fieldName">{{ scope.row.fieldName ? 1003 <span v-if="!scope.row.isEdit || !editableFields.sourceFieldChName">{{ scope.row.sourceFieldChName ?
998 scope.row.fieldName : '--' }}</span> 1004 scope.row.sourceFieldChName : '--' }}</span>
999 <el-input v-else v-model="scope.row.fieldName" placeholder="请输入长度" /> 1005 <el-input v-else v-model="scope.row.sourceFieldChName" placeholder="请输入长度" />
1000 </template> 1006 </template>
1001 </el-table-column> 1007 </el-table-column>
1002 <!-- 源端字段 fieldType fieldTypeProps--> 1008 <!-- 源端字段 fieldType fieldTypeProps-->
...@@ -1016,7 +1022,7 @@ onActivated(() => { ...@@ -1016,7 +1022,7 @@ onActivated(() => {
1016 </el-table-column> 1022 </el-table-column>
1017 1023
1018 <!-- 长度(可编辑) --> 1024 <!-- 长度(可编辑) -->
1019 <el-table-column prop="fieldLength" label="长度" width="120" align="center"> 1025 <el-table-column prop="fieldLength" label="长度" width="120" align="left">
1020 <template #default="scope"> 1026 <template #default="scope">
1021 <!-- 非编辑状态 --> 1027 <!-- 非编辑状态 -->
1022 <span v-if="!scope.row.isEdit"> 1028 <span v-if="!scope.row.isEdit">
...@@ -1034,7 +1040,7 @@ onActivated(() => { ...@@ -1034,7 +1040,7 @@ onActivated(() => {
1034 </el-table-column> 1040 </el-table-column>
1035 1041
1036 <!-- 精度(可编辑) --> 1042 <!-- 精度(可编辑) -->
1037 <el-table-column prop="fieldPrecision" label="精度" width="120" align="center"> 1043 <el-table-column prop="fieldPrecision" label="精度" width="120" align="left">
1038 <template #default="scope"> 1044 <template #default="scope">
1039 <!-- 非编辑状态 --> 1045 <!-- 非编辑状态 -->
1040 <span v-if="!scope.row.isEdit"> 1046 <span v-if="!scope.row.isEdit">
...@@ -1049,7 +1055,7 @@ onActivated(() => { ...@@ -1049,7 +1055,7 @@ onActivated(() => {
1049 </template> 1055 </template>
1050 </el-table-column> 1056 </el-table-column>
1051 <!-- 关联字典(可编辑)el-tree-select 形式下拉形式 --> 1057 <!-- 关联字典(可编辑)el-tree-select 形式下拉形式 -->
1052 <el-table-column prop="dictionaryGuid" label="关联字典" width="150" align="center"> 1058 <el-table-column prop="dictionaryGuid" label="关联字典" width="150" align="left">
1053 <template #default="scope"> 1059 <template #default="scope">
1054 <span v-if="!scope.row.isEdit">{{ scope.row.dictionaryGuid 1060 <span v-if="!scope.row.isEdit">{{ scope.row.dictionaryGuid
1055 ? dictionaryList.find((item: any) => item.guid === scope.row.dictionaryGuid)?.chName : '--' }}</span> 1061 ? dictionaryList.find((item: any) => item.guid === scope.row.dictionaryGuid)?.chName : '--' }}</span>
...@@ -1061,11 +1067,11 @@ onActivated(() => { ...@@ -1061,11 +1067,11 @@ onActivated(() => {
1061 </el-table-column> 1067 </el-table-column>
1062 1068
1063 <!-- 数据是否唯一(可编辑) --> 1069 <!-- 数据是否唯一(可编辑) -->
1064 <el-table-column prop="isPrimary" label="是否主键" width="150" align="center"> 1070 <el-table-column prop="isPrimary" label="是否主键" width="150" align="left">
1065 <template #default="scope"> 1071 <template #default="scope">
1066 <span v-if="!scope.row.isEdit || !editableFields.isPrimary">{{ scope.row.isPrimary ? scope.row.isPrimary 1072 <span v-if="!scope.row.isEdit || !editableFields.isPrimary">{{ scope.row.isPrimary ?
1067 : 1073 (scope.row.isPrimary ===
1068 '--' }}</span> 1074 'Y' ? '是' : '否') : '--' }}</span>
1069 <el-select v-else v-model="scope.row.isPrimary" placeholder="请选择"> 1075 <el-select v-else v-model="scope.row.isPrimary" placeholder="请选择">
1070 <el-option label="Y" value="Y" /> 1076 <el-option label="Y" value="Y" />
1071 <el-option label="N" value="N" /> 1077 <el-option label="N" value="N" />
...@@ -1073,10 +1079,11 @@ onActivated(() => { ...@@ -1073,10 +1079,11 @@ onActivated(() => {
1073 </template> 1079 </template>
1074 </el-table-column> 1080 </el-table-column>
1075 <!-- 是否必填(可编辑) --> 1081 <!-- 是否必填(可编辑) -->
1076 <el-table-column prop="isNotNull" label="是否必填" width="120" align="center"> 1082 <el-table-column prop="notNull" label="是否必填" width="120" align="left">
1077 <template #default="scope"> 1083 <template #default="scope">
1078 <span v-if="!scope.row.isEdit">{{ scope.row.isNotNull ? scope.row.isNotNull : '--' }}</span> 1084 <span v-if="!scope.row.isEdit">{{ scope.row.notNull ? (scope.row.notNull ===
1079 <el-select v-else v-model="scope.row.isNotNull" placeholder="请选择"> 1085 'Y' ? '是' : '否') : '--' }}</span>
1086 <el-select v-else v-model="scope.row.notNull" placeholder="请选择">
1080 <el-option label="Y" value="Y" /> 1087 <el-option label="Y" value="Y" />
1081 <el-option label="N" value="N" /> 1088 <el-option label="N" value="N" />
1082 </el-select> 1089 </el-select>
...@@ -1101,7 +1108,7 @@ onActivated(() => { ...@@ -1101,7 +1108,7 @@ onActivated(() => {
1101 </template> 1108 </template>
1102 </el-table-column> 1109 </el-table-column>
1103 <!-- 分级(不可编辑) --> 1110 <!-- 分级(不可编辑) -->
1104 <el-table-column prop="gradeDetailGuid" label="分级" width="120" align="center"> 1111 <el-table-column prop="gradeDetailGuid" label="分级" width="120" align="left">
1105 <template #default="scope"> 1112 <template #default="scope">
1106 <div v-if="scope.row.isEdit"> 1113 <div v-if="scope.row.isEdit">
1107 <el-select v-model="scope.row.gradeDetailGuid" placeholder="请选择分级" clearable filterable 1114 <el-select v-model="scope.row.gradeDetailGuid" placeholder="请选择分级" clearable filterable
......
...@@ -1010,7 +1010,7 @@ const getTableFieldLineageMap = () => { ...@@ -1010,7 +1010,7 @@ const getTableFieldLineageMap = () => {
1010 const getAllTableFieldLineageMap = () => { 1010 const getAllTableFieldLineageMap = () => {
1011 lineageLoading.value = true; 1011 lineageLoading.value = true;
1012 isFieldLineage.value = true; 1012 isFieldLineage.value = true;
1013 getTableAllFieldLineage({ databaseName: lastClickNode.value.databaseName, tableName: lastClickNode.value.tableName }).then((res: any) => { 1013 getTableAllFieldLineage({ databaseName: lastClickNode.value.databaseName, tableName: lastClickNode.value.tableName, tableGuid: lastClickNode.value.guid }).then((res: any) => {
1014 if (res.code == proxy.$passCode) { 1014 if (res.code == proxy.$passCode) {
1015 let data1 = res.data || []; 1015 let data1 = res.data || [];
1016 lineageData.value = data1; 1016 lineageData.value = data1;
......
...@@ -722,7 +722,7 @@ const getTableLineageMap = () => { ...@@ -722,7 +722,7 @@ const getTableLineageMap = () => {
722 const getAllTableFieldLineageMap = () => { 722 const getAllTableFieldLineageMap = () => {
723 lineageDataLoading.value = true; 723 lineageDataLoading.value = true;
724 isFieldLineage.value = true; 724 isFieldLineage.value = true;
725 getTableAllFieldLineage({ databaseName: sheetInfo.value.databaseName, tableName: sheetInfo.value.tableName }).then((res: any) => { 725 getTableAllFieldLineage({ databaseName: sheetInfo.value.databaseName, tableName: sheetInfo.value.tableName, tableGuid: sheetInfo.value.guid }).then((res: any) => {
726 if (res.code == proxy.$passCode) { 726 if (res.code == proxy.$passCode) {
727 let data1 = res.data || []; 727 let data1 = res.data || [];
728 lineageData.value = data1; 728 lineageData.value = data1;
...@@ -802,8 +802,8 @@ const handleLineageSwitchChange = (val) => { ...@@ -802,8 +802,8 @@ const handleLineageSwitchChange = (val) => {
802 <LineageGraph ref="lineageGraph" v-if="lineageData.length" layout="vertical" :lineageData="lineageData" 802 <LineageGraph ref="lineageGraph" v-if="lineageData.length" layout="vertical" :lineageData="lineageData"
803 :is-field-lineage="isFieldLineage" :primary-table="sheetInfo.tableName" :is-detail="true" 803 :is-field-lineage="isFieldLineage" :primary-table="sheetInfo.tableName" :is-detail="true"
804 :primaryDatabase="sheetInfo.databaseName" :isEdit="true" @handleSave="handleSave" 804 :primaryDatabase="sheetInfo.databaseName" :isEdit="true" @handleSave="handleSave"
805 @tableContextMenu="handleTableContextMenu" @handleToggle="handleToggle" :isToggle="isToggle" @handleChOrEn=handleChOrEn :isCh="isCh" 805 @tableContextMenu="handleTableContextMenu" @handleToggle="handleToggle" :isToggle="isToggle"
806 @handleRefres="handleRefres" @handleEdit="handleEdit" 806 @handleChOrEn=handleChOrEn :isCh="isCh" @handleRefres="handleRefres" @handleEdit="handleEdit"
807 @handleLineageSwitchChange="handleLineageSwitchChange" /> 807 @handleLineageSwitchChange="handleLineageSwitchChange" />
808 808
809 </div> 809 </div>
......
...@@ -229,6 +229,8 @@ const getAssetTableData = () => { ...@@ -229,6 +229,8 @@ const getAssetTableData = () => {
229 getRegisterInfo({ 229 getRegisterInfo({
230 pageSize: 200, 230 pageSize: 200,
231 pageIndex: 1, 231 pageIndex: 1,
232 startTime: startTime.value || '',
233 endTime: endTime.value || '',
232 }).then((res: any) => { 234 }).then((res: any) => {
233 assetTableInfo.value.loading1 = false; 235 assetTableInfo.value.loading1 = false;
234 if (res.code == proxy.$passCode) { 236 if (res.code == proxy.$passCode) {
...@@ -291,6 +293,9 @@ const getTradeTableData = () => { ...@@ -291,6 +293,9 @@ const getTradeTableData = () => {
291 getDaTradeInfo({ 293 getDaTradeInfo({
292 pageSize: 200, 294 pageSize: 200,
293 pageIndex: 1, 295 pageIndex: 1,
296 startTime: startTime.value || '',
297 endTime: endTime.value || '',
298
294 }).then((res: any) => { 299 }).then((res: any) => {
295 tradeTableInfo.value.loading1 = false; 300 tradeTableInfo.value.loading1 = false;
296 if (res.code == proxy.$passCode) { 301 if (res.code == proxy.$passCode) {
...@@ -368,6 +373,8 @@ const getFinancingTableData = () => { ...@@ -368,6 +373,8 @@ const getFinancingTableData = () => {
368 getFinanceInfo({ 373 getFinanceInfo({
369 pageSize: 200, 374 pageSize: 200,
370 pageIndex: 1, 375 pageIndex: 1,
376 startTime: startTime.value || '',
377 endTime: endTime.value || '',
371 }).then((res: any) => { 378 }).then((res: any) => {
372 financingTableInfo.value.loading1 = false; 379 financingTableInfo.value.loading1 = false;
373 if (res.code == proxy.$passCode) { 380 if (res.code == proxy.$passCode) {
...@@ -408,22 +415,44 @@ const assetTableRef = ref(); ...@@ -408,22 +415,44 @@ const assetTableRef = ref();
408 const rolltimer = ref(); 415 const rolltimer = ref();
409 416
410 onBeforeMount(() => { 417 onBeforeMount(() => {
411 if (userData.tenantType != 1) { 418 if (userData.tenantType == 1) {
419 // 获取数据表格
412 getAssetTableData(); 420 getAssetTableData();
421
422 // 获取统计信息
423 fetchStatisticsInfo();
424
425 // 获取质量饼图数据
426 fetchQualityInfo();
427
428 // 获取交易和融资数据
429 getTradeTableData();
430 getFinancingTableData();
431
432 // 获取注册文档数据
433 fetchRegisterUrl();
434 }
435 });
436 // 获取统计信息
437 function fetchStatisticsInfo() {
413 statisticsInfoLoading.value = true; 438 statisticsInfoLoading.value = true;
414 getStatisticsInfo().then((res: any) => { 439 getStatisticsInfo({
440 startTime: startTime.value || '',
441 endTime: endTime.value || '',
442 }).then((res: any) => {
415 statisticsInfoLoading.value = false; 443 statisticsInfoLoading.value = false;
416 if (res.code == proxy.$passCode) { 444 if (res.code == proxy.$passCode) {
417 let data = res.data || {}; 445 const data = res.data || {};
418 registerNum.value = changeNum(data.registerNum ?? 0); 446 registerNum.value = changeNum(data.registerNum ?? 0);
419 costAssessNum.value = changeNum(data.costAssessNum ?? 0); 447 costAssessNum.value = changeNum(data.costAssessNum ?? 0);
420 qualityAssessNum.value = changeNum(data.qualityAssessNum ?? 0); 448 qualityAssessNum.value = changeNum(data.qualityAssessNum ?? 0);
449
421 cardList.value.forEach((card) => { 450 cardList.value.forEach((card) => {
422 if (card.name == 'assessmentMoney') { 451 if (card.name === 'assessmentMoney') {
423 card.value = changeNum((data[card.name] ?? 0) / 10000, 2, true); 452 card.value = changeNum((data[card.name] ?? 0) / 10000, 2, true);
424 } else if (card.name == "lastIntableTime") { 453 } else if (card.name === 'lastIntableTime') {
425 card.value = data[card.name] ?? "--"; 454 card.value = data[card.name] ?? '--';
426 } else if (card.name == "dataScale") { 455 } else if (card.name === 'dataScale') {
427 card.value = changeNum(data[card.name] ?? 0, 2, true); 456 card.value = changeNum(data[card.name] ?? 0, 2, true);
428 } else { 457 } else {
429 card.value = changeNum(data[card.name] ?? 0); 458 card.value = changeNum(data[card.name] ?? 0);
...@@ -433,70 +462,61 @@ onBeforeMount(() => { ...@@ -433,70 +462,61 @@ onBeforeMount(() => {
433 ElMessage.error(res.msg); 462 ElMessage.error(res.msg);
434 } 463 }
435 }); 464 });
465 }
466
467 // 获取质量信息
468 function fetchQualityInfo() {
436 qualityPieLoading.value = true; 469 qualityPieLoading.value = true;
437 getQualityInfo().then((res: any) => { 470 getQualityInfo({
471 startTime: startTime.value || '',
472 endTime: endTime.value || '',
473 }).then((res: any) => {
438 qualityPieLoading.value = false; 474 qualityPieLoading.value = false;
439 // qualityPieChart = echarts.init(document.getElementById("pie-quality"));
440 if (res.code == proxy.$passCode) { 475 if (res.code == proxy.$passCode) {
441 qualityPieData.value = res.data || []; 476 const qualityData = res.data || [];
442 let sum = qualityPieData.value 477 const sum = qualityData.reduce((acc, item) => acc + item.value, 0);
443 .map((d) => d.value) 478 qualityPieData.value = qualityData.map((item) => ({
444 .reduce(function (prev, curr, idx, arr) { 479 ...item,
445 return prev + curr; 480 percent: changeNum((item.value / sum) * 100, 2, true) + '%',
446 }); 481 }));
447 qualityPieData.value.forEach(v => {
448 v.percent = changeNum((v.value / sum) * 100, 2, true) + '%';
449 });
450 } else { 482 } else {
451 ElMessage.error(res.msg); 483 ElMessage.error(res.msg);
452 } 484 }
453 }); 485 });
454 getTradeTableData(); 486 }
455 getFinancingTableData(); 487
488 // 获取注册文档 URL
489 function fetchRegisterUrl() {
456 docUrlLoading.value = true; 490 docUrlLoading.value = true;
457 getRegisterUrl().then((res: any) => { 491 getRegisterUrl({
492 startTime: startTime.value || '',
493 endTime: endTime.value || '',
494 }).then((res: any) => {
495 docUrlLoading.value = false;
458 if (res.code == proxy.$passCode) { 496 if (res.code == proxy.$passCode) {
459 let data = docData.value = res.data || []; 497 const data = res.data || [];
460 if (data.length) { 498 if (data.length) {
461 let ps: any = []; 499 const promises = data.map((d) => {
462 for (const d of data) { 500 d.documentTypeDesc = d.documentType === 1 ? 'A证' : d.documentType === 2 ? 'B证' : 'C证';
463 d.documentTypeDesc = d.documentType == 1 ? 'A证' : (d.documentType == 2 ? 'B证' : 'C证'); 501 return getImageContent(d.documentFile[0]).then((res: any) => (res ? URL.createObjectURL(res) : null));
464 ps.push(
465 getImageContent(d.documentFile[0]).then((res: any) => {
466 if (res) {
467 return URL.createObjectURL(res);
468 }
469 })
470 );
471 }
472 Promise.all(ps).then((res: any[]) => {
473 console.log(res);
474 docUrl.value = res;
475 docUrlList.value = res.flatMap((value, index, array) => {
476 return [
477 array.slice(index, index + 1).map((a) => {
478 return { url: a };
479 }),
480 ];
481 }); 502 });
482 docUrlLoading.value = false; 503
504 Promise.all(promises).then((urls: any[]) => {
505 docUrl.value = urls;
506 docUrlList.value = urls.map((url) => [{ url }]);
483 nextTick(() => { 507 nextTick(() => {
484 processImgDesc(); 508 processImgDesc();
485 }); 509 });
486 }); 510 });
487 } else { 511 } else {
488 docUrl.value = []; 512 docUrl.value = [];
489 docData.value = [];
490 docUrlList.value = []; 513 docUrlList.value = [];
491 docUrlLoading.value = false;
492 } 514 }
493 } else { 515 } else {
494 docUrlLoading.value = false;
495 ElMessage.error(res.msg); 516 ElMessage.error(res.msg);
496 } 517 }
497 }); 518 });
498 } 519 }
499 });
500 520
501 const processImgDesc = () => { 521 const processImgDesc = () => {
502 let domImg = document.getElementById('register-img'); 522 let domImg = document.getElementById('register-img');
...@@ -600,15 +620,35 @@ watch( ...@@ -600,15 +620,35 @@ watch(
600 620
601 ); 621 );
602 622
623 const startTime = ref()
624 const endTime = ref()
603 const handleChangeTime = (val) => { 625 const handleChangeTime = (val) => {
604 console.log(val) 626 console.log(val)
627 startTime.value = val[0]
628 endTime.value = val[1]
629 // 获取数据表格
630 getAssetTableData();
631
632 // 获取统计信息
633 fetchStatisticsInfo();
634
635 // 获取质量饼图数据
636 fetchQualityInfo();
637
638 // 获取交易和融资数据
639 getTradeTableData();
640 getFinancingTableData();
641
642 // 获取注册文档数据
643 fetchRegisterUrl();
644
605 } 645 }
606 646
607 </script> 647 </script>
608 648
609 <template> 649 <template>
610 <div style="width: 100%;height: 100%"> 650 <div style="width: 100%;height: 100%">
611 <div class="right-filter-main" v-if="userData.tenantType != 1"> 651 <div class="right-filter-main" v-if="userData.tenantType == 1">
612 <div class="right-filter"> 652 <div class="right-filter">
613 <div class="filter-btns"> 653 <div class="filter-btns">
614 <div class="btn" :class="{ 'is-active': filterDate == 'today' }" @click="handleFilterClick('today')">今日</div> 654 <div class="btn" :class="{ 'is-active': filterDate == 'today' }" @click="handleFilterClick('today')">今日</div>
...@@ -622,7 +662,7 @@ const handleChangeTime = (val) => { ...@@ -622,7 +662,7 @@ const handleChangeTime = (val) => {
622 ref="datePickerRef" /> 662 ref="datePickerRef" />
623 </div> 663 </div>
624 </div> 664 </div>
625 <div v-if="userData.tenantType != 1" class="main-content"> 665 <div v-if="userData.tenantType == 1" class="main-content">
626 <div class="one-row"> 666 <div class="one-row">
627 <div class="row-per"> 667 <div class="row-per">
628 <div class="header"> 668 <div class="header">
...@@ -778,7 +818,7 @@ const handleChangeTime = (val) => { ...@@ -778,7 +818,7 @@ const handleChangeTime = (val) => {
778 </div> 818 </div>
779 </div> 819 </div>
780 <!-- <platformIndex v-else-if="userData.tenantType != 1" /> --> 820 <!-- <platformIndex v-else-if="userData.tenantType != 1" /> -->
781 <platformIndexNewBigScreen v-else-if="userData.tenantType == 1" /> 821 <platformIndexNewBigScreen v-else-if="userData.tenantType != 1" />
782 <div v-else class="main-placeholder"> 822 <div v-else class="main-placeholder">
783 <img width="210" height="100" src="../../public/swzl_logo.png" /> 823 <img width="210" height="100" src="../../public/swzl_logo.png" />
784 </div> 824 </div>
......
...@@ -135,6 +135,8 @@ const getFinancingTableData = () => { ...@@ -135,6 +135,8 @@ const getFinancingTableData = () => {
135 getFinanceInfo({ 135 getFinanceInfo({
136 pageSize: 500, 136 pageSize: 500,
137 pageIndex: 1, 137 pageIndex: 1,
138 startTime: startTime.value || '',
139 endTime: endTime.value || '',
138 }).then((res: any) => { 140 }).then((res: any) => {
139 financingTableInfo.value.loading1 = false; 141 financingTableInfo.value.loading1 = false;
140 if (res.code == proxy.$passCode) { 142 if (res.code == proxy.$passCode) {
...@@ -151,7 +153,10 @@ const statisticsInfoLoading = ref(false); ...@@ -151,7 +153,10 @@ const statisticsInfoLoading = ref(false);
151 onBeforeMount(() => { 153 onBeforeMount(() => {
152 getFinancingTableData(); 154 getFinancingTableData();
153 statisticsInfoLoading.value = true; 155 statisticsInfoLoading.value = true;
154 getPlatformStatisticsInfo().then((res: any) => { 156 getPlatformStatisticsInfo({
157 startTime: startTime.value || '',
158 endTime: endTime.value || '',
159 }).then((res: any) => {
155 statisticsInfoLoading.value = false; 160 statisticsInfoLoading.value = false;
156 if (res.code == proxy.$passCode) { 161 if (res.code == proxy.$passCode) {
157 let data = res.data || {}; 162 let data = res.data || {};
...@@ -961,7 +966,10 @@ const bindPieAction = (chart, data) => { ...@@ -961,7 +966,10 @@ const bindPieAction = (chart, data) => {
961 onMounted(() => { 966 onMounted(() => {
962 industryPieChart = echarts.init(document.getElementById("pie-industry")); 967 industryPieChart = echarts.init(document.getElementById("pie-industry"));
963 industryPieLoading.value = true; 968 industryPieLoading.value = true;
964 getIndustryInfo().then((res: any) => { 969 getIndustryInfo({
970 startTime: startTime.value || '',
971 endTime: endTime.value || '',
972 }).then((res: any) => {
965 industryPieLoading.value = false; 973 industryPieLoading.value = false;
966 if (res.code == proxy.$passCode) { 974 if (res.code == proxy.$passCode) {
967 industryPieData.value = res.data?.homeGraphStatistics || []; 975 industryPieData.value = res.data?.homeGraphStatistics || [];
...@@ -977,7 +985,10 @@ onMounted(() => { ...@@ -977,7 +985,10 @@ onMounted(() => {
977 creditMoneyPieChart = echarts.init( 985 creditMoneyPieChart = echarts.init(
978 document.getElementById("pie-creditMoney") 986 document.getElementById("pie-creditMoney")
979 ); 987 );
980 getCreditMoneyInfo().then((res: any) => { 988 getCreditMoneyInfo({
989 startTime: startTime.value || '',
990 endTime: endTime.value || '',
991 }).then((res: any) => {
981 creditMoneyPieLoading.value = false; 992 creditMoneyPieLoading.value = false;
982 if (res.code == proxy.$passCode) { 993 if (res.code == proxy.$passCode) {
983 creditMoneyPieData.value = res.data || []; 994 creditMoneyPieData.value = res.data || [];
...@@ -991,7 +1002,10 @@ onMounted(() => { ...@@ -991,7 +1002,10 @@ onMounted(() => {
991 1002
992 serviceAreaBarLoading.value = true; 1003 serviceAreaBarLoading.value = true;
993 serviceAreaBarChart = echarts.init(document.getElementById("bar-area")); 1004 serviceAreaBarChart = echarts.init(document.getElementById("bar-area"));
994 getPlatformService().then((res: any) => { 1005 getPlatformService({
1006 startTime: startTime.value || '',
1007 endTime: endTime.value || '',
1008 }).then((res: any) => {
995 serviceAreaBarLoading.value = false; 1009 serviceAreaBarLoading.value = false;
996 if (res.code == proxy.$passCode) { 1010 if (res.code == proxy.$passCode) {
997 serviceAreaBarData.value = res.data || []; 1011 serviceAreaBarData.value = res.data || [];
...@@ -1001,7 +1015,10 @@ onMounted(() => { ...@@ -1001,7 +1015,10 @@ onMounted(() => {
1001 } 1015 }
1002 }); 1016 });
1003 1017
1004 getPlatformProvinceService().then((res: any) => { 1018 getPlatformProvinceService({
1019 startTime: startTime.value || '',
1020 endTime: endTime.value || '',
1021 }).then((res: any) => {
1005 if (res.code == proxy.$passCode) { 1022 if (res.code == proxy.$passCode) {
1006 serviceAreaMapData.value = res.data || []; 1023 serviceAreaMapData.value = res.data || [];
1007 } else { 1024 } else {
...@@ -1010,7 +1027,10 @@ onMounted(() => { ...@@ -1010,7 +1027,10 @@ onMounted(() => {
1010 }); 1027 });
1011 platformMonthBarLoading.value = true; 1028 platformMonthBarLoading.value = true;
1012 platformMonthBarChart = echarts.init(document.getElementById("bar-month")); 1029 platformMonthBarChart = echarts.init(document.getElementById("bar-month"));
1013 getPlatformMonth().then((res: any) => { 1030 getPlatformMonth({
1031 startTime: startTime.value || '',
1032 endTime: endTime.value || '',
1033 }).then((res: any) => {
1014 platformMonthBarLoading.value = false; 1034 platformMonthBarLoading.value = false;
1015 if (res.code == proxy.$passCode) { 1035 if (res.code == proxy.$passCode) {
1016 platformMonthBarData.value = res.data || []; 1036 platformMonthBarData.value = res.data || [];
...@@ -1063,8 +1083,111 @@ watch( ...@@ -1063,8 +1083,111 @@ watch(
1063 1083
1064 ); 1084 );
1065 1085
1086 const startTime = ref()
1087 const endTime = ref()
1088
1066 const handleChangeTime = (val) => { 1089 const handleChangeTime = (val) => {
1067 console.log(val) 1090 startTime.value = val[0];
1091 endTime.value = val[1];
1092 getFinancingTableData();
1093 statisticsInfoLoading.value = true;
1094 getPlatformStatisticsInfo({
1095 startTime: startTime.value || '',
1096 endTime: endTime.value || '',
1097 }).then((res: any) => {
1098 statisticsInfoLoading.value = false;
1099 if (res.code == proxy.$passCode) {
1100 let data = res.data || {};
1101 cardList.value.forEach((card) => {
1102 if (card.name == 'assessmentMoney') {
1103 card.value = changeNum((data[card.name] ?? 0) / 10000, 2, true);
1104 } else if (card.name == "dataScale") {
1105 card.value = changeNum(data[card.name] ?? 0, 2);
1106 } else {
1107 card.value = changeNum(data[card.name] ?? 0);
1108 }
1109 });
1110 } else {
1111 ElMessage.error(res.msg);
1112 }
1113 });
1114
1115 industryPieChart = echarts.init(document.getElementById("pie-industry"));
1116 industryPieLoading.value = true;
1117 getIndustryInfo({
1118 startTime: startTime.value || '',
1119 endTime: endTime.value || '',
1120 }).then((res: any) => {
1121 industryPieLoading.value = false;
1122 if (res.code == proxy.$passCode) {
1123 industryPieData.value = res.data?.homeGraphStatistics || [];
1124 industryPieDataTotal.value = res.data?.totalCompanyNum ?? 0;
1125 setPieChartOption().then(() => {
1126 bindPieAction(industryPieChart, industryPieData.value);
1127 });
1128 } else {
1129 ElMessage.error(res.msg);
1130 }
1131 });
1132 creditMoneyPieLoading.value = true;
1133 creditMoneyPieChart = echarts.init(
1134 document.getElementById("pie-creditMoney")
1135 );
1136 getCreditMoneyInfo({
1137 startTime: startTime.value || '',
1138 endTime: endTime.value || '',
1139 }).then((res: any) => {
1140 creditMoneyPieLoading.value = false;
1141 if (res.code == proxy.$passCode) {
1142 creditMoneyPieData.value = res.data || [];
1143 setCreditPieChartOption().then(() => {
1144 bindPieAction(creditMoneyPieChart, creditMoneyPieData.value);
1145 });
1146 } else {
1147 ElMessage.error(res.msg);
1148 }
1149 });
1150
1151 serviceAreaBarLoading.value = true;
1152 serviceAreaBarChart = echarts.init(document.getElementById("bar-area"));
1153 getPlatformService({
1154 startTime: startTime.value || '',
1155 endTime: endTime.value || '',
1156 }).then((res: any) => {
1157 serviceAreaBarLoading.value = false;
1158 if (res.code == proxy.$passCode) {
1159 serviceAreaBarData.value = res.data || [];
1160 setBarChartOption(serviceAreaBarData.value.slice(0, 5), serviceAreaBarChart);
1161 } else {
1162 ElMessage.error(res.msg);
1163 }
1164 });
1165
1166 getPlatformProvinceService({
1167 startTime: startTime.value || '',
1168 endTime: endTime.value || '',
1169 }).then((res: any) => {
1170 if (res.code == proxy.$passCode) {
1171 serviceAreaMapData.value = res.data || [];
1172 } else {
1173 ElMessage.error(res.msg);
1174 }
1175 });
1176 platformMonthBarLoading.value = true;
1177 platformMonthBarChart = echarts.init(document.getElementById("bar-month"));
1178 getPlatformMonth({
1179 startTime: startTime.value || '',
1180 endTime: endTime.value || '',
1181 }).then((res: any) => {
1182 platformMonthBarLoading.value = false;
1183 if (res.code == proxy.$passCode) {
1184 platformMonthBarData.value = res.data || [];
1185 setAreaChartOption(platformMonthBarData.value, platformMonthBarChart);
1186 } else {
1187 ElMessage.error(res.msg);
1188 }
1189 });
1190
1068 } 1191 }
1069 1192
1070 </script> 1193 </script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!