bc5cc150 by lihua

产品目录前端页面开发

1 parent 721064c5
...@@ -475,6 +475,12 @@ ...@@ -475,6 +475,12 @@
475 .cell { 475 .cell {
476 line-height: 24px; 476 line-height: 24px;
477 477
478 .el-table__expand-icon {
479 background: transparent;
480 border: none;
481 padding: 0px;
482 }
483
478 &>.el-select { 484 &>.el-select {
479 width: calc(var(--el-select-width) - 1px); //解决缩放浏览器会显示提示,由于px小数点造成 485 width: calc(var(--el-select-width) - 1px); //解决缩放浏览器会显示提示,由于px小数点造成
480 } 486 }
......
...@@ -154,7 +154,7 @@ const handleTreeSelectChange = (nodeObj, node, treeNode, event) => { ...@@ -154,7 +154,7 @@ const handleTreeSelectChange = (nodeObj, node, treeNode, event) => {
154 const nodeCheck = (nodeObj, checkedObj) => { 154 const nodeCheck = (nodeObj, checkedObj) => {
155 checkedNodes.value = checkedObj.checkedNodes 155 checkedNodes.value = checkedObj.checkedNodes
156 checkedKeys.value = checkedObj.checkedKeys 156 checkedKeys.value = checkedObj.checkedKeys
157 emits('nodeCheck', checkedObj, props.treeInfo.id) 157 emits('nodeCheck', checkedObj, props.treeInfo.id, nodeObj)
158 } 158 }
159 159
160 const handleItemMenuClick = (node, type) => { 160 const handleItemMenuClick = (node, type) => {
......
...@@ -354,6 +354,39 @@ const routes: RouteRecordRaw[] = [ ...@@ -354,6 +354,39 @@ const routes: RouteRecordRaw[] = [
354 }, 354 },
355 }, 355 },
356 ] 356 ]
357 },
358 {
359 path: '/data-product/product-catalog',
360 component: Layout,
361 meta: {
362 title: '产品目录',
363 icon: 'sidebar-videos',
364 },
365 children: [
366 {
367 path: '',
368 name: 'productCatalogManage',
369 component: () => import('@/views/data_asset/productCatalogManage.vue'),
370 meta: {
371 title: '',
372 sidebar: false,
373 breadcrumb: false,
374 cache: true
375 },
376 },
377 {
378 path: 'product-register-catalog-detail',
379 name: 'productSortCatalogDetail',
380 component: () => import('@/views/data_asset/registerCatalogDetail.vue'),
381 meta: {
382 title: '产品详情-',
383 sidebar: false,
384 breadcrumb: false,
385 cache: true,
386 reuse: true
387 }
388 },
389 ]
357 } 390 }
358 ] 391 ]
359 export default routes 392 export default routes
......
1 <template>
2 <div class="container_wrap full flex">
3 <div class="aside_wrap">
4 <div class="aside_title">产品分类</div>
5 <Tree ref="treeRef" :treeInfo="treeInfo" @nodeCheck="handleTreeNodeChange" />
6 </div>
7 <div class="main_wrap">
8 <div class="header-bg">
9 <el-input v-model.trim="page.searchKey" size="large" placeholder="请输入关键字搜索" :prefix-icon="Search"
10 @blur="toSearch(true, true)" @keyup.enter.native="searchEnterFun" clearable />
11 </div>
12 <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange"
13 style="height: calc(100% - 96px);margin: 16px 16px 0px;" />
14 </div>
15 </div>
16 </template>
17
18 <script lang="ts" setup name="productCatalogManage">
19 import { commonPageConfig } from '@/components/PageNav';
20 import { Search } from '@element-plus/icons-vue';
21 import {
22 getDamTypesList
23 } from "@/api/modules/dataAsset";
24 import { USERROLE } from '@/utils/enum';
25
26 const router = useRouter();
27 const route = useRoute();
28 const { proxy } = getCurrentInstance() as any;
29 const dataSourceList = ref([{ //如果是授权数据则不能选择其余的
30 value: 1,
31 label: '授权数据',
32 }, {
33 value: 2,
34 label: '自有数据',
35 },
36 {
37 value: 3,
38 label: '购买数据',
39 },
40 {
41 value: 4,
42 label: '其他来源',
43 }]);
44
45 /** 是否是数据使用方 */
46 const isDataUse = computed(() => {
47 return localStorage.getItem('userRole') == USERROLE.USE;
48 })
49
50 const treeRef = ref();
51
52 const treeInfo = ref({
53 id: "data-product-tree",
54 filter: true,
55 queryValue: "",
56 queryPlaceholder: "请输入关键字搜索",
57 showCheckbox: true,
58 checkStrictly: false,
59 props: {
60 label: "label",
61 value: "value",
62 children: 'childDictList'
63 },
64 nodeKey: 'value',
65 expandOnNodeClick: false,
66 data: <any>[],
67 loading: false
68 });
69
70 //记录每次点击的节点。
71 const handleTreeNodeChange = (checkedObj, id, nodeObj) => {
72 debugger
73 let treeRefs = treeRef.value.treeRef;
74 let checkedKeys = checkedObj.checkedObj || [];//全勾选的所有节点。
75 let halfCheckedKeys = checkedObj.halfCheckedKeys || [];//半勾选的节点。
76 //思路,一个个的分类判断是否在半勾选,如果是,就将其勾选的子节点获取出来。
77 /** 先damType */
78 if (halfCheckedKeys.includes('damType')) {
79 // 获取出来勾选的子节点。
80 treeRefs.getNode("damType").childNodes?.filter(c=> c.checked == true);
81 } //如果是全选,则不需要处理传参。
82 /** 数据来源 */
83 if (halfCheckedKeys.includes('dataSources')) {
84
85 }
86 /** 行业分类 */
87 /** 机构分类 */
88 /** 复杂的领域及应用场景。 */
89 if (halfCheckedKeys.includes('domain')) {
90 //计算领域下勾选的子节点。同时判断医疗健康和工业制造。
91 }
92 }
93
94 const page = ref({
95 ...commonPageConfig,
96 searchKey: '',
97 });
98
99 const oldKeyWord = ref(""); //记录上次输入的关键字,若是输入值未变化,则失去焦点时不用触发搜索。
100 const isEnter = ref(false);
101
102 /** 触发搜索查询 */
103 const toSearch = (clear: boolean = true, isBlur: boolean = false) => {
104 if (clear) {
105 page.value.curr = 1
106 }
107 if (isBlur && !isEnter.value && oldKeyWord.value === page.value.searchKey) {
108 return;
109 }
110 isEnter.value = false;
111 oldKeyWord.value = page.value.searchKey;
112 getSearchData(clear);
113 }
114
115 const searchEnterFun = (event) => {
116 isEnter.value = true;
117 event.target?.blur();
118 }
119
120 /** 查询表格数据 */
121 const getSearchData = (clear = false) => {
122
123 }
124
125 const tableInfo = ref({
126 id: 'contract-table',
127 rowKey: 'guid',
128 loading: false,
129 fields: [{ label: "序号", type: "index", width: 56, align: "center" },
130 {
131 label: "数据产品名称", field: "dataProductName", width: 160, type: "text_btn", columClass: 'text_btn', value: "detail", disabled: (scope) => {
132 return scope.row.contractStatus == '06';
133 }, click: (scope) => {
134 if (scope.row.contractStatus == '06') {
135 return;
136 }
137 router.push({
138 name: 'productSortCatalogDetail',
139 query: {
140 guid: scope.row.dataProductGuid,
141 type: 'detail',
142 foundMode: 'use',
143 name: scope.row.dataProductName,
144 }
145 });
146 }
147 },
148 { label: "产品类型", field: "damTypeName", width: 100 },
149 { label: "应用场景", field: "scenarioName", width: 120 },
150 { label: "行业分类", field: "industryName", width: 140 },
151 { label: "机构分类", field: "institutionTypeName", width: 120 },
152 {
153 label: "数据来源", field: "dataSources", width: 100, getName: (scope) => {
154 return scope.row.dataSources && dataSourceList.value.find(i => i.value == scope.row.dataSources)?.label || '--'
155 }
156 },
157 { label: "上架时间", field: "listingTime", width: 170 },
158 ],
159 data: [{}],
160 page: {
161 type: "normal",
162 rows: 0,
163 ...page.value,
164 },
165 actionInfo: {
166 label: "操作",
167 type: "btn",
168 show: isDataUse.value,
169 width: 120,
170 btns: (scope) => {
171 return [{
172 value: 'approve', label: "数据申请", click: (scope) => { //TODO,是否申请过的不能再申请?
173
174 }
175 }]
176 }
177 }
178 });
179
180 const tablePageChange = (info) => {
181 page.value.curr = Number(info.curr);
182 page.value.limit = Number(info.limit);
183 tableInfo.value.page.curr = page.value.curr;
184 tableInfo.value.page.limit = page.value.limit;
185 getSearchData();
186 };
187
188 const damTypes: any = ref([]);
189 /** 所属主题多级列表 */
190 const subjectDomainListData: any = ref([]);
191 /** 行业分类类型列表 */
192 const industryDictList: any = ref([]);
193 /** 领域字典列表 */
194 const domainDictList: any = ref([]);
195 /** 机构类型字典列表 */
196 const institutionTypeDictList: any = ref([]);
197 /** 所属科室下拉列表 */
198 const medDepartmentCodeList: any = ref([]);
199
200 onBeforeMount(() => {
201 treeInfo.value.loading = true;
202 let psAll: any[] = [];
203 psAll.push(getDamTypesList({
204 dictType: "资产类型",
205 }).then((res: any) => {
206 if (res.code == proxy.$passCode) {
207 damTypes.value = res.data || [];
208 } else {
209 proxy.$ElMessage.error(res.msg);
210 }
211 }))
212 psAll.push(getDamTypesList({
213 dictType: "行业分类",
214 level: 1
215 }).then((res: any) => {
216 if (res.code == proxy.$passCode) {
217 industryDictList.value = res.data || [];
218 } else {
219 proxy.$ElMessage.error(res.msg);
220 }
221 }))
222 psAll.push(getDamTypesList({ dictType: '领域' }).then((res: any) => {
223 if (res.code == proxy.$passCode) {
224 domainDictList.value = res.data || [];
225 } else {
226 proxy.$ElMessage.error(res.msg);
227 }
228 }));
229 psAll.push(getDamTypesList({
230 dictType: "组织机构性质",
231 }).then((res: any) => {
232 if (res.code == proxy.$passCode) {
233 institutionTypeDictList.value = res.data || [];
234 } else {
235 proxy.$ElMessage.error(res.msg);
236 }
237 }))
238 psAll.push(getDamTypesList({
239 dictType: "数据资产目录主题名称",
240 }).then((res: any) => {
241 if (res.code == proxy.$passCode) {
242 subjectDomainListData.value = res.data?.find(d => d.value == '1')?.childDictList || [];
243 } else {
244 proxy.$ElMessage.error(res.msg);
245 }
246 }))
247
248 psAll.push(getDamTypesList({
249 dictType: "科室",
250 }).then((res: any) => {
251 if (res.code == proxy.$passCode) {
252 medDepartmentCodeList.value = res.data || [];
253 } else {
254 proxy.$ElMessage.error(res.msg);
255 }
256 }));
257
258 Promise.all(psAll).then(() => {
259 treeInfo.value.loading = false;
260 treeInfo.value.data = [];
261 treeInfo.value.data.push({
262 value: 'damType',
263 label: '产品类型',
264 childDictList: damTypes.value
265 });
266 let item = domainDictList.value.find(i => i.value == '003');//医疗健康,下级应用场景和所属科室
267 let childDictList = item.childDictList || [];
268 item.childDictList = [{
269 value: 'scenario',
270 label: '应用场景',
271 childDictList: childDictList
272 }];
273 item.childDictList.push({
274 value: 'medDepartmentCode',
275 label: '所属科室',
276 childDictList: medDepartmentCodeList.value
277 });
278 let item4 = domainDictList.value.find(i => i.value == '004'); //工业制造
279 let childDictList4 = item4.childDictList || [];
280 item4.childDictList = [{
281 value: 'scenario',
282 label: '应用场景',
283 childDictList: childDictList4
284 }];
285 item4.childDictList.push({
286 value: 'subjectDomain',
287 label: '所属主题',
288 childDictList: subjectDomainListData.value
289 });
290 treeInfo.value.data.push({
291 value: 'domain',
292 label: '领域及应用场景',
293 childDictList: domainDictList.value //TODO,需要带上主题和科室。
294 });
295 treeInfo.value.data.push({
296 value: 'dataSource',
297 label: '数据来源',
298 childDictList: dataSourceList.value
299 });
300 treeInfo.value.data.push({
301 value: 'industry',
302 label: '行业分类',
303 childDictList: industryDictList.value
304 });
305 treeInfo.value.data.push({
306 value: 'institutionType',
307 label: '机构分类',
308 childDictList: institutionTypeDictList.value
309 });
310 }).catch(() => {
311 treeInfo.value.loading = false;
312 })
313 })
314
315 </script>
316
317 <style lang="scss" scoped>
318 .container_wrap {
319 padding: 0;
320 display: flex;
321 justify-content: space-between;
322
323 .aside_wrap {
324 width: 220px;
325 border-right: 1px solid #d9d9d9;
326 box-shadow: none;
327
328 .aside_title {
329 display: inline-block;
330 }
331 }
332
333 .tree_panel {
334 height: calc(100% - 36px);
335 padding-top: 0;
336
337 :deep(.el-tree) {
338 margin: 0;
339 overflow: hidden auto;
340 }
341 }
342
343 }
344
345 .container_wrap.flex {
346 .main_wrap {
347 padding: 0px;
348 }
349 }
350
351 .header-bg {
352 height: 80px;
353 background-image: url('@/assets/images/product-catalog-bg.png');
354 background-size: cover;
355 /* 背景图覆盖整个元素 */
356 background-position: center;
357 /* 背景图居中 */
358 background-repeat: no-repeat;
359
360 display: flex;
361 align-items: center;
362 justify-content: center;
363
364 .el-input {
365 width: 60%;
366 }
367 }
368 </style>
...\ No newline at end of file ...\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!