Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop
Showing
13 changed files
with
1276 additions
and
12 deletions
| ... | @@ -3,7 +3,8 @@ VITE_APP_TITLE = 数据资产管理系统 | ... | @@ -3,7 +3,8 @@ VITE_APP_TITLE = 数据资产管理系统 |
| 3 | # 接口域名 | 3 | # 接口域名 |
| 4 | # VITE_API_BASEURL = https://www.zgsjzc.com/api | 4 | # VITE_API_BASEURL = https://www.zgsjzc.com/api |
| 5 | # VITE_API_BASEURL = https://swzl-test.csbr.cn/api | 5 | # VITE_API_BASEURL = https://swzl-test.csbr.cn/api |
| 6 | VITE_API_BASEURL = http://10.4.82.1:28052/ | 6 | # VITE_API_BASEURL = http://10.4.82.30:8052/ |
| 7 | VITE_API_BASEURL = http://10.4.82.1:28052/ | ||
| 7 | # 平台用户 接口请地址 | 8 | # 平台用户 接口请地址 |
| 8 | VITE_APP_USER_API_BASEURL = gateway-server/user | 9 | VITE_APP_USER_API_BASEURL = gateway-server/user |
| 9 | # 系统管理 接口地址 | 10 | # 系统管理 接口地址 |
| ... | @@ -23,6 +24,9 @@ VITE_APP_PLAN_BASEURL = ms-daop-jgjf-data-plan-service | ... | @@ -23,6 +24,9 @@ VITE_APP_PLAN_BASEURL = ms-daop-jgjf-data-plan-service |
| 23 | #数据质量接口地址 | 24 | #数据质量接口地址 |
| 24 | VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service | 25 | VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service |
| 25 | 26 | ||
| 27 | #数据盘点接口地址 | ||
| 28 | VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory | ||
| 29 | |||
| 26 | 30 | ||
| 27 | #门户接口 | 31 | #门户接口 |
| 28 | VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal | 32 | VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal | ... | ... |
| ... | @@ -54,6 +54,7 @@ declare module '@vue/runtime-core' { | ... | @@ -54,6 +54,7 @@ declare module '@vue/runtime-core' { |
| 54 | Table_tools: typeof import('./src/components/Tools/table_tools.vue')['default'] | 54 | Table_tools: typeof import('./src/components/Tools/table_tools.vue')['default'] |
| 55 | Table_v2: typeof import('./src/components/Table/table_v2.vue')['default'] | 55 | Table_v2: typeof import('./src/components/Table/table_v2.vue')['default'] |
| 56 | Tabs: typeof import('./src/components/Tabs/index.vue')['default'] | 56 | Tabs: typeof import('./src/components/Tabs/index.vue')['default'] |
| 57 | TemplateItem: typeof import('./src/components/TemplateItem/index.vue')['default'] | ||
| 57 | Toolbar: typeof import('./src/components/LineageGraph/toolbar.vue')['default'] | 58 | Toolbar: typeof import('./src/components/LineageGraph/toolbar.vue')['default'] |
| 58 | Topbar: typeof import('./src/components/LineageGraph/topbar.vue')['default'] | 59 | Topbar: typeof import('./src/components/LineageGraph/topbar.vue')['default'] |
| 59 | Transfer: typeof import('./src/components/Transfer/index.vue')['default'] | 60 | Transfer: typeof import('./src/components/Transfer/index.vue')['default'] | ... | ... |
This diff could not be displayed because it is too large.
src/api/modules/dataInventory.ts
0 → 100644
| 1 | import request from "@/utils/request"; | ||
| 2 | |||
| 3 | |||
| 4 | /** | ||
| 5 | * 获取数据级别 | ||
| 6 | * @param {Object} | ||
| 7 | * { paramCode: "DATA-CLASSIFY" } | ||
| 8 | * DATA-CLASSIFY 数据类别 | ||
| 9 | * DATA-GRADE 数据级别 | ||
| 10 | */ | ||
| 11 | export const getLargeCategoryList = (data) => request({ | ||
| 12 | url:`${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-list`, | ||
| 13 | method: 'post', | ||
| 14 | data | ||
| 15 | }) | ||
| 16 | |||
| 17 | |||
| 18 | /** 分类分级模板数据 */ | ||
| 19 | export const getTempleteClassifyData = (data) => request({ | ||
| 20 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-template/page-list`, | ||
| 21 | method: 'post', | ||
| 22 | data | ||
| 23 | }) | ||
| 24 | |||
| 25 | |||
| 26 | /** 新增分级 | ||
| 27 | * | ||
| 28 | * @param {Object} | ||
| 29 | * @path /classify-grade/save | ||
| 30 | */ | ||
| 31 | |||
| 32 | export const saveClassifyGrad = (data) => request({ | ||
| 33 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/classify-grade/save`, | ||
| 34 | method: 'post', | ||
| 35 | data | ||
| 36 | }) | ||
| 37 | |||
| 38 | /** 删除分级 | ||
| 39 | * @param {Object} | ||
| 40 | * @path /classify-grade/delete | ||
| 41 | * */ | ||
| 42 | |||
| 43 | export const deleteClassifyGrad = (data) => request({ | ||
| 44 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/classify-grade/delete`, | ||
| 45 | method: 'delete', | ||
| 46 | headers: { | ||
| 47 | 'Content-Type': 'multipart/form-data', | ||
| 48 | }, | ||
| 49 | data | ||
| 50 | }) | ||
| 51 | /** 修改分级 | ||
| 52 | * @param {Object} | ||
| 53 | * @path /classify-grade/update | ||
| 54 | * */ | ||
| 55 | |||
| 56 | export const updateClassifyGrad = (data) => request({ | ||
| 57 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/classify-grade/update`, | ||
| 58 | method: 'post', | ||
| 59 | data | ||
| 60 | }) | ||
| 61 | |||
| 62 | |||
| 63 | /** | ||
| 64 | * 分级列表 | ||
| 65 | * @param {Object} | ||
| 66 | * @path /classify-grade/page-list | ||
| 67 | */ | ||
| 68 | |||
| 69 | export const getClassifyGradList = (data) => request({ | ||
| 70 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/classify-grade/page-list`, | ||
| 71 | method: 'post', | ||
| 72 | data | ||
| 73 | }) | ||
| 74 | |||
| 75 | |||
| 76 | /** | ||
| 77 | * 分级新增 | ||
| 78 | * @param {Object} | ||
| 79 | * @path /grade/save | ||
| 80 | */ | ||
| 81 | export const saveGrade = (data) => request({ | ||
| 82 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/grade/save`, | ||
| 83 | method: 'post', | ||
| 84 | data | ||
| 85 | }) | ||
| 86 | |||
| 87 | /** | ||
| 88 | * 分级更新 | ||
| 89 | * @param {Object} | ||
| 90 | * @path /grade/update | ||
| 91 | * */ | ||
| 92 | export const updateGrade = (data) => request({ | ||
| 93 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/grade/update`, | ||
| 94 | method: 'post', | ||
| 95 | data | ||
| 96 | }) | ||
| 97 | |||
| 98 | /** | ||
| 99 | * 分级列表 | ||
| 100 | * @param {Object} | ||
| 101 | * @path /grade/page-list | ||
| 102 | */ | ||
| 103 | export const getGradeList = (data) => request({ | ||
| 104 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/grade/page-list`, | ||
| 105 | method: 'post', | ||
| 106 | data | ||
| 107 | }) | ||
| 108 | |||
| 109 | /** | ||
| 110 | * 批量删除分级 | ||
| 111 | * @param {Array} | ||
| 112 | * @path /grade/delete | ||
| 113 | * */ | ||
| 114 | export const deleteGrade = (data) => request({ | ||
| 115 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/grade/delete`, | ||
| 116 | method: 'delete', | ||
| 117 | data | ||
| 118 | }) | ||
| 119 | |||
| 120 | |||
| 121 | /*---------------------------------分类标准 tab -----------------------------*/ | ||
| 122 | |||
| 123 | /** | ||
| 124 | * 分级树形结构 | ||
| 125 | * @param no params | ||
| 126 | * @path /grade/tree-list | ||
| 127 | */ | ||
| 128 | export const getGradeTreeList = () => request({ | ||
| 129 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/grade/tree-list`, | ||
| 130 | method: 'post', | ||
| 131 | }) |
| ... | @@ -46,8 +46,13 @@ export const getImageUrl = (params) => request({ | ... | @@ -46,8 +46,13 @@ export const getImageUrl = (params) => request({ |
| 46 | }) | 46 | }) |
| 47 | 47 | ||
| 48 | /** 查看图片 */ | 48 | /** 查看图片 */ |
| 49 | // export const getImageContent = (params) => request({ | ||
| 50 | // url: `${import.meta.env.VITE_APP_API_BASEURL}/obs/view-pic?filePath=${params}`, | ||
| 51 | // method: 'get', | ||
| 52 | // responseType: 'blob' | ||
| 53 | // }); | ||
| 49 | export const getImageContent = (params) => request({ | 54 | export const getImageContent = (params) => request({ |
| 50 | url: `${import.meta.env.VITE_APP_API_BASEURL}/obs`, | 55 | url: `${import.meta.env.VITE_APP_API_BASEURL}/obs/view-pic`, |
| 51 | method: 'get', | 56 | method: 'get', |
| 52 | responseType: 'blob' | 57 | responseType: 'blob' |
| 53 | }); | 58 | }); | ... | ... |
This diff is collapsed.
Click to expand it.
| ... | @@ -73,6 +73,58 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -73,6 +73,58 @@ const routes: RouteRecordRaw[] = [ |
| 73 | } | 73 | } |
| 74 | } | 74 | } |
| 75 | }, | 75 | }, |
| 76 | { | ||
| 77 | path: 'newCreate-template', | ||
| 78 | name: 'newCreateTemplate', | ||
| 79 | component: () => import('@/views/data_inventory/newCreateTemplate.vue'), | ||
| 80 | meta: { | ||
| 81 | title: '新增-', | ||
| 82 | sidebar: false, | ||
| 83 | breadcrumb: false, | ||
| 84 | cache: true, | ||
| 85 | reuse: true, | ||
| 86 | editPage: true, | ||
| 87 | activeMenu: '/data-inventory/classify-grade-manage/template-config' | ||
| 88 | }, | ||
| 89 | beforeEnter: (to, from) => { | ||
| 90 | if (to.query.classStandardName) { | ||
| 91 | to.meta.title = `新增-${to.query.classStandardName}`; | ||
| 92 | } | ||
| 93 | } | ||
| 94 | }, | ||
| 95 | { | ||
| 96 | path: 'newCreate-class', | ||
| 97 | name: 'newCreateClass', | ||
| 98 | component: () => import('@/views/data_inventory/newCreateClass.vue'), | ||
| 99 | meta: { | ||
| 100 | title: '新增分类', | ||
| 101 | sidebar: false, | ||
| 102 | breadcrumb: false, | ||
| 103 | cache: true, | ||
| 104 | reuse: true, | ||
| 105 | editPage: true, | ||
| 106 | activeMenu: '/data-inventory/classify-grade-manage/template-config' | ||
| 107 | }, | ||
| 108 | }, | ||
| 109 | { | ||
| 110 | path: 'classifyGrad-edit', | ||
| 111 | name: 'classifyGradEdit', | ||
| 112 | component: () => import('@/views/data_inventory/classifyGradEdit.vue'), | ||
| 113 | meta: { | ||
| 114 | title: '编辑-', | ||
| 115 | sidebar: false, | ||
| 116 | breadcrumb: false, | ||
| 117 | cache: true, | ||
| 118 | reuse: true, | ||
| 119 | editPage: true, | ||
| 120 | activeMenu: '/data-inventory/classify-grade-manage/template-config' | ||
| 121 | }, | ||
| 122 | beforeEnter: (to, from) => { | ||
| 123 | if (to.query.classClassifyGradName) { | ||
| 124 | to.meta.title = `编辑-${to.query.classClassifyGradName}`; | ||
| 125 | } | ||
| 126 | } | ||
| 127 | }, | ||
| 76 | ], | 128 | ], |
| 77 | } | 129 | } |
| 78 | ] | 130 | ] | ... | ... |
| ... | @@ -3,7 +3,7 @@ | ... | @@ -3,7 +3,7 @@ |
| 3 | </route> | 3 | </route> |
| 4 | 4 | ||
| 5 | <script lang="ts" setup name="classStandardEdit"> | 5 | <script lang="ts" setup name="classStandardEdit"> |
| 6 | import { ref, onMounted} from "vue"; | 6 | import { ref, onMounted } from "vue"; |
| 7 | import useUserStore from "@/store/modules/user"; | 7 | import useUserStore from "@/store/modules/user"; |
| 8 | import { useValidator } from '@/hooks/useValidator'; | 8 | import { useValidator } from '@/hooks/useValidator'; |
| 9 | import { TableColumnWidth } from '@/utils/enum'; | 9 | import { TableColumnWidth } from '@/utils/enum'; |
| ... | @@ -69,15 +69,18 @@ const tableInfo = ref({ | ... | @@ -69,15 +69,18 @@ const tableInfo = ref({ |
| 69 | type: "btn", | 69 | type: "btn", |
| 70 | width: 120, | 70 | width: 120, |
| 71 | btns: [ | 71 | btns: [ |
| 72 | { label: "编辑", value: "edit", click: (scope) => { | 72 | { |
| 73 | label: "编辑", value: "edit", click: (scope) => { | ||
| 73 | currTableInfo.value = scope.row; | 74 | currTableInfo.value = scope.row; |
| 74 | drawerInfo.value.visible = true; | 75 | drawerInfo.value.visible = true; |
| 75 | drawerInfo.value.header.title = '编辑分类'; | 76 | drawerInfo.value.header.title = '编辑分类'; |
| 76 | classEditFormItems.value.forEach(item => { | 77 | classEditFormItems.value.forEach(item => { |
| 77 | item.default = scope.row[item.field] | 78 | item.default = scope.row[item.field] |
| 78 | }) | 79 | }) |
| 79 | } }, | 80 | } |
| 80 | { label: "删除", value: "delete", click: (scope) => { | 81 | }, |
| 82 | { | ||
| 83 | label: "删除", value: "delete", click: (scope) => { | ||
| 81 | proxy.$openMessageBox("此操作将永久删除该分类, 是否继续", () => { | 84 | proxy.$openMessageBox("此操作将永久删除该分类, 是否继续", () => { |
| 82 | // deleteBizTerm([scope.row.guid]).then((res: any) => { | 85 | // deleteBizTerm([scope.row.guid]).then((res: any) => { |
| 83 | // if (res.code == proxy.$passCode) { | 86 | // if (res.code == proxy.$passCode) { |
| ... | @@ -88,7 +91,8 @@ const tableInfo = ref({ | ... | @@ -88,7 +91,8 @@ const tableInfo = ref({ |
| 88 | // } | 91 | // } |
| 89 | // }); | 92 | // }); |
| 90 | }) | 93 | }) |
| 91 | } }, | 94 | } |
| 95 | }, | ||
| 92 | ], | 96 | ], |
| 93 | }, | 97 | }, |
| 94 | loading: false, | 98 | loading: false, |
| ... | @@ -146,8 +150,8 @@ const classEditFormItems = ref([{ | ... | @@ -146,8 +150,8 @@ const classEditFormItems = ref([{ |
| 146 | type: 'switch', | 150 | type: 'switch', |
| 147 | field: 'state', | 151 | field: 'state', |
| 148 | default: 'Y', | 152 | default: 'Y', |
| 149 | activeText:"有效", | 153 | activeText: "有效", |
| 150 | inactiveText:"停用", | 154 | inactiveText: "停用", |
| 151 | activeValue: 'Y', | 155 | activeValue: 'Y', |
| 152 | inactiveValue: 'N' | 156 | inactiveValue: 'N' |
| 153 | }, { | 157 | }, { |
| ... | @@ -283,7 +287,7 @@ G6.registerNode('tree-node', { | ... | @@ -283,7 +287,7 @@ G6.registerNode('tree-node', { |
| 283 | group.addShape('circle', { | 287 | group.addShape('circle', { |
| 284 | attrs: { | 288 | attrs: { |
| 285 | x: 95, | 289 | x: 95, |
| 286 | y: bbox.minX + bbox.height / 2-5, | 290 | y: bbox.minX + bbox.height / 2 - 5, |
| 287 | r: 5, | 291 | r: 5, |
| 288 | stroke: '#4FA1A4', | 292 | stroke: '#4FA1A4', |
| 289 | fill: '#fff', | 293 | fill: '#fff', |
| ... | @@ -401,6 +405,10 @@ onMounted(() => { | ... | @@ -401,6 +405,10 @@ onMounted(() => { |
| 401 | name: '装备制造' | 405 | name: '装备制造' |
| 402 | }] | 406 | }] |
| 403 | }); | 407 | }); |
| 408 | graph.value.on('node:mouseenter', (e) => { | ||
| 409 | const nodeItem = e.item // 获取鼠标进入的节点元素对象 | ||
| 410 | console.log('鼠标移入', nodeItem._cfg) | ||
| 411 | }) | ||
| 404 | graph.value.render(); | 412 | graph.value.render(); |
| 405 | graph.value.fitView(); | 413 | graph.value.fitView(); |
| 406 | graph.value.on('node:click', (evt: any) => { | 414 | graph.value.on('node:click', (evt: any) => { |
| ... | @@ -421,7 +429,8 @@ onMounted(() => { | ... | @@ -421,7 +429,8 @@ onMounted(() => { |
| 421 | <ContentWrap id="id-baseInfo" title="基础信息" description="" style="margin-top: 8px;"> | 429 | <ContentWrap id="id-baseInfo" title="基础信息" description="" style="margin-top: 8px;"> |
| 422 | <Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" /> | 430 | <Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" /> |
| 423 | </ContentWrap> | 431 | </ContentWrap> |
| 424 | <ContentWrap id="id-classStandard" class="detail-content" title="分类标准" description="" style="margin-top:16px; height: calc(100% - 161px)"> | 432 | <ContentWrap id="id-classStandard" class="detail-content" title="分类标准" description="" |
| 433 | style="margin-top:16px; height: calc(100% - 161px)"> | ||
| 425 | <div class="tools_btns"> | 434 | <div class="tools_btns"> |
| 426 | <el-button v-show="dataShowMethod == 'table'" type="primary" @click="newCreateClass">添加分类</el-button> | 435 | <el-button v-show="dataShowMethod == 'table'" type="primary" @click="newCreateClass">添加分类</el-button> |
| 427 | <el-button v-show="dataShowMethod == 'table'" @click="importClass">导入分类</el-button> | 436 | <el-button v-show="dataShowMethod == 'table'" @click="importClass">导入分类</el-button> |
| ... | @@ -440,7 +449,6 @@ onMounted(() => { | ... | @@ -440,7 +449,6 @@ onMounted(() => { |
| 440 | </template> | 449 | </template> |
| 441 | 450 | ||
| 442 | <style lang="scss" scoped> | 451 | <style lang="scss" scoped> |
| 443 | |||
| 444 | .container_wrap { | 452 | .container_wrap { |
| 445 | padding: 0px; | 453 | padding: 0px; |
| 446 | } | 454 | } | ... | ... |
| 1 | <route lang="yaml"> | ||
| 2 | name: classifyGradEdit //新增分级分类模板 | ||
| 3 | </route> | ||
| 4 | |||
| 5 | <script lang="ts" setup name="classifyGradEdit"> | ||
| 6 | |||
| 7 | import router from "@/router"; | ||
| 8 | import { ref } from "vue"; | ||
| 9 | import { saveGrade, getGradeList, deleteGrade, getLargeCategoryList, updateGrade } from '@/api/modules/dataInventory'; | ||
| 10 | |||
| 11 | onMounted(() => { | ||
| 12 | getGradeListData(); | ||
| 13 | Promise.all([getDataGrade(), getDataClassify()]); | ||
| 14 | }); | ||
| 15 | |||
| 16 | // 获取分级列表 | ||
| 17 | const getGradeListData = async () => { | ||
| 18 | const params = { | ||
| 19 | pageIndex: 1, | ||
| 20 | pageSize: -1, | ||
| 21 | classifyGradeGuid: guid | ||
| 22 | } | ||
| 23 | const res: any = await getGradeList(params); | ||
| 24 | if (res.code == proxy.$passCode) { | ||
| 25 | tableInfo.value.data = res.data.records; | ||
| 26 | } else { | ||
| 27 | proxy.$ElMessage.error(res.msg); | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | // 获取数据类别 | ||
| 32 | const getDataGrade = async () => { | ||
| 33 | const params = { | ||
| 34 | paramCode: "DATA-CLASSIFY" | ||
| 35 | } | ||
| 36 | const res: any = await getLargeCategoryList(params); | ||
| 37 | if (res.code == proxy.$passCode) { | ||
| 38 | // 提出value和label 作为select的options | ||
| 39 | const options = res.data.map((item: any) => ({ | ||
| 40 | label: item.paramName, | ||
| 41 | value: item.paramValue | ||
| 42 | })); | ||
| 43 | newCreateGradeFormItems.value[1].options = options; | ||
| 44 | classDataRef.value = options; | ||
| 45 | } else { | ||
| 46 | proxy.$ElMessage.error(res.msg); | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | // 获取数据级别 | ||
| 51 | const getDataClassify = async () => { | ||
| 52 | const params = { | ||
| 53 | paramCode: "DATA-GRADE" | ||
| 54 | } | ||
| 55 | const res: any = await getLargeCategoryList(params); | ||
| 56 | if (res.code == proxy.$passCode) { | ||
| 57 | // 提出value和label 作为select的options | ||
| 58 | const options = res.data.map((item: any) => ({ | ||
| 59 | label: item.paramName, | ||
| 60 | value: item.paramValue | ||
| 61 | })); | ||
| 62 | newCreateGradeFormItems.value[0].options = options; | ||
| 63 | // 这里需要过滤已经在表格中数据级别 | ||
| 64 | gradeDataRef.value = options; | ||
| 65 | } else { | ||
| 66 | proxy.$ElMessage.error(res.msg); | ||
| 67 | } | ||
| 68 | } | ||
| 69 | |||
| 70 | // 新增过滤数据级别 | ||
| 71 | const filterDataGrade = () => { | ||
| 72 | const selectedDataGrade = new Set(); | ||
| 73 | tableInfo.value.data.forEach((item: any) => { | ||
| 74 | if (item.dataGrade) { | ||
| 75 | selectedDataGrade.add(item.dataGrade); | ||
| 76 | } | ||
| 77 | }); | ||
| 78 | const filteredOptions = gradeDataRef.value.filter(option => !selectedDataGrade.has(option.value)); | ||
| 79 | (newCreateGradeFormItems.value[0].options as any[]) = filteredOptions; | ||
| 80 | }; | ||
| 81 | |||
| 82 | // 编辑过滤数据级别,需包含当前数据级别,不排除自己 | ||
| 83 | const filterDataGradeEdit = (dataGrade: string) => { | ||
| 84 | const selectedDataGrade = new Set(); | ||
| 85 | tableInfo.value.data.forEach((item: any) => { | ||
| 86 | if (item.dataGrade) { | ||
| 87 | selectedDataGrade.add(item.dataGrade); | ||
| 88 | } | ||
| 89 | }); | ||
| 90 | // 移除当前数据级别dataGrade | ||
| 91 | selectedDataGrade.delete(dataGrade); | ||
| 92 | console.log(selectedDataGrade,); | ||
| 93 | const filteredOptions = gradeDataRef.value.filter(option => !selectedDataGrade.has(option.value)); | ||
| 94 | (newCreateGradeFormItems.value[0].options as any[]) = filteredOptions; | ||
| 95 | }; | ||
| 96 | |||
| 97 | const tableRef = ref(); | ||
| 98 | const classDataRef = ref(); | ||
| 99 | const gradeDataRef = ref(); | ||
| 100 | const fullscreenLoading = ref(false); | ||
| 101 | const editClassifyGradeGuid = ref(''); | ||
| 102 | const { proxy } = getCurrentInstance() as any; | ||
| 103 | const guidArray = ref<any[]>([]); | ||
| 104 | // 获取query参数 中的guid | ||
| 105 | const guid = router.currentRoute.value.query.guid; | ||
| 106 | const tableInfo = ref({ | ||
| 107 | id: "data-class-standard-table", | ||
| 108 | multiple: true, | ||
| 109 | fields: [ | ||
| 110 | { label: "序号", field: 'orderNum', width: 56, align: "center" }, | ||
| 111 | { | ||
| 112 | label: "数据级别", field: "dataGrade", width: 120, getName: (scope) => { | ||
| 113 | let dataGrade = scope.row.dataGrade; | ||
| 114 | return dataGrade + '级'; | ||
| 115 | } | ||
| 116 | }, | ||
| 117 | { | ||
| 118 | label: "数据类别", field: "dataClassify", width: 120, getName: (scope) => { | ||
| 119 | let dataClassify = scope.row.dataClassify; | ||
| 120 | return classDataRef.value.find((item: any) => item.value === dataClassify)?.label; | ||
| 121 | } | ||
| 122 | }, | ||
| 123 | { label: "分级描述", field: "gradeDesc", align: "left", }, | ||
| 124 | |||
| 125 | ], | ||
| 126 | actionInfo: { | ||
| 127 | label: "操作", | ||
| 128 | type: "btn", | ||
| 129 | width: 120, | ||
| 130 | btns: [ | ||
| 131 | { | ||
| 132 | label: "编辑", value: "edit", click: (scope) => { | ||
| 133 | console.log(scope); | ||
| 134 | filterDataGradeEdit(scope.row.dataGrade); | ||
| 135 | newCreateGradeStandardDialogInfo.value.visible = true; | ||
| 136 | newCreateGradeStandardDialogInfo.value.title = '编辑分类'; | ||
| 137 | newCreateGradeFormItems.value.forEach(item => { | ||
| 138 | item.default = scope.row[item.field]; | ||
| 139 | }) | ||
| 140 | editClassifyGradeGuid.value = scope.row.guid; | ||
| 141 | } | ||
| 142 | }, | ||
| 143 | { | ||
| 144 | label: "删除", value: "delete", click: (scope) => { | ||
| 145 | guidArray.value = []; // 重置数组 | ||
| 146 | guidArray.value.push(scope.row.guid); | ||
| 147 | batchRemobe(); | ||
| 148 | } | ||
| 149 | }, | ||
| 150 | ], | ||
| 151 | }, | ||
| 152 | data: [], | ||
| 153 | showPage: false, | ||
| 154 | loading: false, | ||
| 155 | }); | ||
| 156 | |||
| 157 | // 选择勾选的数据 | ||
| 158 | const onTableSelectChange = async (selection: any[]) => { | ||
| 159 | guidArray.value = []; // 重置数组 | ||
| 160 | selection.forEach((item: any) => { | ||
| 161 | guidArray.value.push(item.guid); | ||
| 162 | }); | ||
| 163 | }; | ||
| 164 | |||
| 165 | // 批量删除 | ||
| 166 | const batchRemobe = async () => { | ||
| 167 | // 批量删除,增加confirm确认弹窗 | ||
| 168 | if (guidArray.value.length == 0) { | ||
| 169 | proxy.$ElMessage({ | ||
| 170 | type: 'warning', | ||
| 171 | message: '请选择要删除的数据' | ||
| 172 | }) | ||
| 173 | return; | ||
| 174 | } | ||
| 175 | |||
| 176 | // confirm弹窗 | ||
| 177 | proxy.$confirm('是否删除选中数据?', '提示', { | ||
| 178 | confirmButtonText: '确定', | ||
| 179 | cancelButtonText: '取消', | ||
| 180 | type: 'warning' | ||
| 181 | }).then(async () => { | ||
| 182 | const res: any = await deleteGrade(guidArray.value); | ||
| 183 | if (res.code == proxy.$passCode) { | ||
| 184 | proxy.$ElMessage({ | ||
| 185 | type: 'success', | ||
| 186 | message: '删除成功' | ||
| 187 | }) | ||
| 188 | getGradeListData(); | ||
| 189 | } else { | ||
| 190 | proxy.$ElMessage.error(res.msg); | ||
| 191 | } | ||
| 192 | }).catch(() => { | ||
| 193 | proxy.$ElMessage({ | ||
| 194 | type: 'info', | ||
| 195 | message: '已取消删除' | ||
| 196 | }); | ||
| 197 | }); | ||
| 198 | |||
| 199 | }; | ||
| 200 | |||
| 201 | /**弹窗配置 */ | ||
| 202 | const newCreateGradeFormItems = ref([{ | ||
| 203 | label: '数据级别', | ||
| 204 | type: 'select', | ||
| 205 | placeholder: '请选择', | ||
| 206 | field: 'dataGrade', | ||
| 207 | default: '', | ||
| 208 | options: gradeDataRef.value, | ||
| 209 | required: true, | ||
| 210 | filterable: true, | ||
| 211 | clearable: true, | ||
| 212 | visible: true, | ||
| 213 | }, | ||
| 214 | { | ||
| 215 | label: '数据类别', | ||
| 216 | type: 'select', | ||
| 217 | placeholder: '请选择', | ||
| 218 | field: 'dataClassify', | ||
| 219 | default: '', | ||
| 220 | options: [], | ||
| 221 | required: true, | ||
| 222 | filterable: true, | ||
| 223 | clearable: true, | ||
| 224 | visible: true, | ||
| 225 | }, | ||
| 226 | { | ||
| 227 | label: '序号', | ||
| 228 | type: 'input', | ||
| 229 | maxlength: 19, | ||
| 230 | placeholder: '请输入', | ||
| 231 | field: 'orderNum', | ||
| 232 | default: '', | ||
| 233 | clearable: true, | ||
| 234 | required: true, | ||
| 235 | regexp: /\D/g | ||
| 236 | }, | ||
| 237 | { | ||
| 238 | label: '分级描述', | ||
| 239 | type: 'textarea', | ||
| 240 | maxlength: 50, | ||
| 241 | placeholder: '分类分级的描述说明', | ||
| 242 | field: 'gradeDesc', | ||
| 243 | default: '', | ||
| 244 | clearable: true, | ||
| 245 | required: false, | ||
| 246 | block: true, | ||
| 247 | }]); | ||
| 248 | |||
| 249 | const newCreateGradeFormRules = ref({ | ||
| 250 | dataGrade: [ | ||
| 251 | { required: true, message: '请选择数据级别', trigger: 'change' } | ||
| 252 | ], | ||
| 253 | orderNum: [ | ||
| 254 | { required: true, message: '请输入序号', trigger: 'blur' } | ||
| 255 | ], | ||
| 256 | dataClassify: [ | ||
| 257 | { required: true, message: '请选择数据类别', trigger: 'change' } | ||
| 258 | ] | ||
| 259 | }); | ||
| 260 | |||
| 261 | const newCreateGradeStandardDialogInfo = ref({ | ||
| 262 | visible: false, | ||
| 263 | size: 860, | ||
| 264 | title: "添加分类", | ||
| 265 | type: "", | ||
| 266 | formInfo: { | ||
| 267 | id: "grade-form", | ||
| 268 | items: newCreateGradeFormItems.value, | ||
| 269 | rules: newCreateGradeFormRules.value, | ||
| 270 | }, | ||
| 271 | submitBtnLoading: false, | ||
| 272 | btns: { | ||
| 273 | cancel: () => { | ||
| 274 | newCreateGradeStandardDialogInfo.value.visible = false; | ||
| 275 | }, | ||
| 276 | submit: async (btn, info) => { | ||
| 277 | console.log(info, guid); | ||
| 278 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = true; | ||
| 279 | if (newCreateGradeStandardDialogInfo.value.title === '编辑分类') { | ||
| 280 | const params = { | ||
| 281 | ...info, | ||
| 282 | guid: editClassifyGradeGuid.value, | ||
| 283 | classifyGradeGuid: guid | ||
| 284 | } | ||
| 285 | |||
| 286 | const res: any = await updateGrade(params); | ||
| 287 | if (res.code == proxy.$passCode) { | ||
| 288 | proxy.$ElMessage({ | ||
| 289 | type: 'success', | ||
| 290 | message: '修改分类成功' | ||
| 291 | }) | ||
| 292 | getGradeListData(); | ||
| 293 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | ||
| 294 | newCreateGradeStandardDialogInfo.value.visible = false; | ||
| 295 | } else { | ||
| 296 | proxy.$ElMessage.error(res.msg); | ||
| 297 | } | ||
| 298 | return; | ||
| 299 | } else { | ||
| 300 | const params = { | ||
| 301 | ...info, | ||
| 302 | classifyGradeGuid: guid | ||
| 303 | } | ||
| 304 | const res: any = await saveGrade(params); | ||
| 305 | if (res.code == proxy.$passCode) { | ||
| 306 | proxy.$ElMessage({ | ||
| 307 | type: 'success', | ||
| 308 | message: '新增分类成功' | ||
| 309 | }) | ||
| 310 | getGradeListData(); | ||
| 311 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | ||
| 312 | newCreateGradeStandardDialogInfo.value.visible = false; | ||
| 313 | } else { | ||
| 314 | proxy.$ElMessage.error(res.msg); | ||
| 315 | } | ||
| 316 | } | ||
| 317 | } | ||
| 318 | } | ||
| 319 | }) | ||
| 320 | |||
| 321 | const newStandard = () => { | ||
| 322 | filterDataGrade(); | ||
| 323 | newCreateGradeStandardDialogInfo.value.visible = true; | ||
| 324 | newCreateGradeFormItems.value.forEach(item => item.default = ''); | ||
| 325 | } | ||
| 326 | |||
| 327 | |||
| 328 | |||
| 329 | </script> | ||
| 330 | |||
| 331 | <template> | ||
| 332 | <div class="container_wrap" v-loading="fullscreenLoading"> | ||
| 333 | <div class="content_main"> | ||
| 334 | <div class="table-top-btns"> | ||
| 335 | <el-button type="primary" @click="newStandard">新增标准</el-button> | ||
| 336 | <el-button @click="batchRemobe">批量删除</el-button> | ||
| 337 | </div> | ||
| 338 | <Table ref="tableRef" :tableInfo="tableInfo" @tableSelectionChange="onTableSelectChange" /> | ||
| 339 | </div> | ||
| 340 | <Dialog_form :dialogConfigInfo="newCreateGradeStandardDialogInfo" /> | ||
| 341 | </div> | ||
| 342 | </template> | ||
| 343 | <style lang="scss" scoped> | ||
| 344 | .container_wrap { | ||
| 345 | padding: 0px; | ||
| 346 | } | ||
| 347 | |||
| 348 | .content_main { | ||
| 349 | height: calc(100% - 44px); | ||
| 350 | padding: 17px 16px 10px 16px; | ||
| 351 | |||
| 352 | .table-top-btns { | ||
| 353 | display: flex; | ||
| 354 | margin-bottom: 12px; | ||
| 355 | } | ||
| 356 | } | ||
| 357 | </style> |
src/views/data_inventory/newCreateClass.vue
0 → 100644
| 1 | <route lang="yaml"> | ||
| 2 | name: newCreateClass //新增分级分类模板 | ||
| 3 | </route> | ||
| 4 | |||
| 5 | <script lang="ts" setup name="newCreateClass"> | ||
| 6 | import router from "@/router"; | ||
| 7 | import { getMetaDataBase } from '@/api/modules/dataMetaService'; | ||
| 8 | import { ref } from "vue"; | ||
| 9 | |||
| 10 | |||
| 11 | onMounted(async () => { | ||
| 12 | const params = { | ||
| 13 | pageIndex: 1, | ||
| 14 | pageSize: -1, | ||
| 15 | } | ||
| 16 | const res = await getMetaDataBase(params) | ||
| 17 | console.log(res); | ||
| 18 | }); | ||
| 19 | |||
| 20 | // 表单引用 | ||
| 21 | const formRef = ref(); | ||
| 22 | const tableRef = ref(); | ||
| 23 | const fullscreenLoading = ref(false); | ||
| 24 | const isExpand = ref(true); | ||
| 25 | const newCreateClassFormItems = ref([{ | ||
| 26 | label: '分类名称', | ||
| 27 | type: 'input', | ||
| 28 | maxlength: 50, | ||
| 29 | placeholder: '请输入', | ||
| 30 | field: 'categoryName', | ||
| 31 | default: '', | ||
| 32 | clearable: true, | ||
| 33 | required: true | ||
| 34 | }, { | ||
| 35 | label: '引用分级标准', | ||
| 36 | type: 'select', | ||
| 37 | placeholder: '请选择', | ||
| 38 | field: 'ReferenceGradingStandard', | ||
| 39 | default: '', | ||
| 40 | options: [], //TODO | ||
| 41 | required: true, | ||
| 42 | filterable: true, | ||
| 43 | clearable: true, | ||
| 44 | visible: true, | ||
| 45 | }]); | ||
| 46 | |||
| 47 | const formRules = ref({ | ||
| 48 | templeteName: [ | ||
| 49 | { required: true, message: '请输入模板名称', trigger: 'blur' }, | ||
| 50 | { max: 50, message: '长度在 50 个字符以内', trigger: 'blur' } | ||
| 51 | ], | ||
| 52 | industryCategory: [ | ||
| 53 | { required: true, message: '请选择行业分类', trigger: 'change' } | ||
| 54 | ], | ||
| 55 | gradingStandard: [ | ||
| 56 | { required: true, message: '请选择分级标准', trigger: 'change' } | ||
| 57 | ] | ||
| 58 | }); | ||
| 59 | |||
| 60 | const tableInfo = ref({ | ||
| 61 | id: "data-class-standard-table", | ||
| 62 | fields: [ | ||
| 63 | { label: "序号", type: "index", width: 56, align: "center" }, | ||
| 64 | { label: "层级", field: "databaseNameZh", width: 160, }, | ||
| 65 | { label: "状态", field: "databaseName", width: 120, }, | ||
| 66 | { label: "定义说明", field: "tableCount", width: 120, align: "right", }, | ||
| 67 | { label: "最低安全级别", field: "storageCapacities", align: "right", width: 220, }, | ||
| 68 | { label: "创建时间", field: "columns", width: 140, align: "right", }, | ||
| 69 | ], | ||
| 70 | actionInfo: { | ||
| 71 | show: false, | ||
| 72 | }, | ||
| 73 | data: [ | ||
| 74 | { | ||
| 75 | index: 1, | ||
| 76 | databaseNameZh: "数据库名称", | ||
| 77 | databaseName: "数据库名", | ||
| 78 | tableCount: 0, | ||
| 79 | storageCapacities: 0, | ||
| 80 | columns: 0, | ||
| 81 | }, | ||
| 82 | { | ||
| 83 | index: 2, | ||
| 84 | databaseNameZh: "数据库名称", | ||
| 85 | databaseName: "数据库名", | ||
| 86 | tableCount: 0, | ||
| 87 | storageCapacities: 0, | ||
| 88 | columns: 0, | ||
| 89 | }, | ||
| 90 | { | ||
| 91 | index: 3, | ||
| 92 | databaseNameZh: "数据库名称", | ||
| 93 | databaseName: "数据库名", | ||
| 94 | tableCount: 0, | ||
| 95 | storageCapacities: 0, | ||
| 96 | columns: 0, | ||
| 97 | }, | ||
| 98 | { | ||
| 99 | index: 4, | ||
| 100 | databaseNameZh: "数据库名称", | ||
| 101 | databaseName: "数据库名", | ||
| 102 | tableCount: 0, | ||
| 103 | storageCapacities: 0, | ||
| 104 | columns: 0, | ||
| 105 | }, | ||
| 106 | { | ||
| 107 | index: 5, | ||
| 108 | databaseNameZh: "数据库名称", | ||
| 109 | databaseName: "数据库名", | ||
| 110 | tableCount: 0, | ||
| 111 | storageCapacities: 0, | ||
| 112 | columns: 0, | ||
| 113 | }, | ||
| 114 | { | ||
| 115 | index: 6, | ||
| 116 | databaseNameZh: "数据库名称", | ||
| 117 | databaseName: "数据库名", | ||
| 118 | tableCount: 0, | ||
| 119 | storageCapacities: 0, | ||
| 120 | columns: 0, | ||
| 121 | }, | ||
| 122 | |||
| 123 | ], | ||
| 124 | showPage: false, | ||
| 125 | loading: false, | ||
| 126 | }); | ||
| 127 | |||
| 128 | const onTableSelectChange = (selection: any[]) => { | ||
| 129 | console.log(selection); | ||
| 130 | }; | ||
| 131 | |||
| 132 | const cancel = () => { | ||
| 133 | // 返回上一页路由 | ||
| 134 | router.back(); | ||
| 135 | }; | ||
| 136 | |||
| 137 | const save = async () => { | ||
| 138 | console.log('save'); | ||
| 139 | // 校验表单 | ||
| 140 | const res = formRef.value; | ||
| 141 | res.ruleFormRef.validate((valid: any) => { | ||
| 142 | if (valid) { | ||
| 143 | // 表单校验通过 | ||
| 144 | console.log('表单校验通过'); | ||
| 145 | } else { | ||
| 146 | console.log('表单校验不通过'); | ||
| 147 | return false; | ||
| 148 | } | ||
| 149 | }); | ||
| 150 | |||
| 151 | |||
| 152 | }; | ||
| 153 | </script> | ||
| 154 | |||
| 155 | <template> | ||
| 156 | <div class="container_wrap" v-loading="fullscreenLoading"> | ||
| 157 | <div class="content_main"> | ||
| 158 | <ContentWrap id="id-baseInfo" title="基础信息" description="" style="margin-top: 8px;" :expandSwicth=isExpand> | ||
| 159 | <Form ref="formRef" :itemList="newCreateClassFormItems" formId="main-model-edit" col="col3" :rules=formRules /> | ||
| 160 | </ContentWrap> | ||
| 161 | <ContentWrap id="id-classStandard" class="detail-content" title="分类标准" description="" style="margin-top:16px;" | ||
| 162 | :expandSwicth=isExpand> | ||
| 163 | <div class="table-content_wrap"> | ||
| 164 | <Table ref="tableRef" :tableInfo="tableInfo" /> | ||
| 165 | </div> | ||
| 166 | </ContentWrap> | ||
| 167 | </div> | ||
| 168 | <div class="bottom_tool_wrap"> | ||
| 169 | <el-button @click="cancel">取消</el-button> | ||
| 170 | <el-button type="primary" @click="save">后台运行</el-button> | ||
| 171 | </div> | ||
| 172 | </div> | ||
| 173 | </template> | ||
| 174 | |||
| 175 | <style lang="scss" scoped> | ||
| 176 | .container_wrap { | ||
| 177 | padding: 0px; | ||
| 178 | } | ||
| 179 | |||
| 180 | .content_main { | ||
| 181 | height: calc(100% - 44px); | ||
| 182 | padding: 10px 16px; | ||
| 183 | |||
| 184 | .table-content_wrap { | ||
| 185 | width: 100%; | ||
| 186 | height: 213px; | ||
| 187 | } | ||
| 188 | } | ||
| 189 | |||
| 190 | .bottom_tool_wrap { | ||
| 191 | display: flex; | ||
| 192 | justify-content: center; | ||
| 193 | border-top: 1px solid #D9D9D9; | ||
| 194 | padding-top: 8px; | ||
| 195 | |||
| 196 | } | ||
| 197 | </style> |
| 1 | <route lang="yaml"> | ||
| 2 | name: newCreateTemplate //新增分级分类模板 | ||
| 3 | </route> | ||
| 4 | |||
| 5 | <script lang="ts" setup name="newCreateTemplate"> | ||
| 6 | import router from "@/router"; | ||
| 7 | import { getMetaDataBase } from '@/api/modules/dataMetaService'; | ||
| 8 | import { ref } from "vue"; | ||
| 9 | |||
| 10 | |||
| 11 | onMounted(async () => { | ||
| 12 | const params = { | ||
| 13 | pageIndex: 1, | ||
| 14 | pageSize: -1, | ||
| 15 | } | ||
| 16 | const res = await getMetaDataBase(params) | ||
| 17 | console.log(res); | ||
| 18 | }); | ||
| 19 | |||
| 20 | // 表单引用 | ||
| 21 | const formRef = ref(); | ||
| 22 | const tableRef = ref(); | ||
| 23 | const fullscreenLoading = ref(false); | ||
| 24 | const isExpand = ref(true); | ||
| 25 | const newCreateTemplateFormItems = ref([{ | ||
| 26 | label: '模板名称', | ||
| 27 | type: 'input', | ||
| 28 | maxlength: 50, | ||
| 29 | placeholder: '请输入', | ||
| 30 | field: 'templeteName', | ||
| 31 | default: '', | ||
| 32 | clearable: true, | ||
| 33 | required: true | ||
| 34 | }, { | ||
| 35 | label: '行业分类', | ||
| 36 | type: 'select', | ||
| 37 | placeholder: '请选择', | ||
| 38 | field: ' industryCategory', | ||
| 39 | default: '', | ||
| 40 | options: [], //TODO | ||
| 41 | required: true, | ||
| 42 | filterable: true, | ||
| 43 | clearable: true, | ||
| 44 | visible: true, | ||
| 45 | }, { | ||
| 46 | label: '分级标准', | ||
| 47 | type: 'select', | ||
| 48 | placeholder: '请选择', | ||
| 49 | field: ' gradingStandard', | ||
| 50 | default: '', | ||
| 51 | options: [], //TODO | ||
| 52 | required: true, | ||
| 53 | filterable: true, | ||
| 54 | clearable: true, | ||
| 55 | visible: true, | ||
| 56 | }]); | ||
| 57 | |||
| 58 | const formRules = ref({ | ||
| 59 | templeteName: [ | ||
| 60 | { required: true, message: '请输入模板名称', trigger: 'blur' }, | ||
| 61 | { max: 50, message: '长度在 50 个字符以内', trigger: 'blur' } | ||
| 62 | ], | ||
| 63 | industryCategory: [ | ||
| 64 | { required: true, message: '请选择行业分类', trigger: 'change' } | ||
| 65 | ], | ||
| 66 | gradingStandard: [ | ||
| 67 | { required: true, message: '请选择分级标准', trigger: 'change' } | ||
| 68 | ] | ||
| 69 | }); | ||
| 70 | |||
| 71 | const tableInfo = ref({ | ||
| 72 | id: "data-class-standard-table", | ||
| 73 | multiple: true, | ||
| 74 | fields: [ | ||
| 75 | { label: "序号", type: "index", width: 56, align: "center" }, | ||
| 76 | { label: "数据库名称", field: "databaseNameZh", width: 160, }, | ||
| 77 | { label: "数据库名", field: "databaseName", width: 120, }, | ||
| 78 | { label: "总表数", field: "tableCount", width: 120, align: "right", }, | ||
| 79 | { label: "存储量(约/MB)", field: "storageCapacities", align: "right", width: 220, }, | ||
| 80 | { label: "总字段数", field: "columns", width: 140, align: "right", }, | ||
| 81 | ], | ||
| 82 | actionInfo: { | ||
| 83 | show: false, | ||
| 84 | }, | ||
| 85 | data: [ | ||
| 86 | { | ||
| 87 | index: 1, | ||
| 88 | databaseNameZh: "数据库名称", | ||
| 89 | databaseName: "数据库名", | ||
| 90 | tableCount: 0, | ||
| 91 | storageCapacities: 0, | ||
| 92 | columns: 0, | ||
| 93 | }, | ||
| 94 | { | ||
| 95 | index: 2, | ||
| 96 | databaseNameZh: "数据库名称", | ||
| 97 | databaseName: "数据库名", | ||
| 98 | tableCount: 0, | ||
| 99 | storageCapacities: 0, | ||
| 100 | columns: 0, | ||
| 101 | }, | ||
| 102 | { | ||
| 103 | index: 3, | ||
| 104 | databaseNameZh: "数据库名称", | ||
| 105 | databaseName: "数据库名", | ||
| 106 | tableCount: 0, | ||
| 107 | storageCapacities: 0, | ||
| 108 | columns: 0, | ||
| 109 | }, | ||
| 110 | { | ||
| 111 | index: 4, | ||
| 112 | databaseNameZh: "数据库名称", | ||
| 113 | databaseName: "数据库名", | ||
| 114 | tableCount: 0, | ||
| 115 | storageCapacities: 0, | ||
| 116 | columns: 0, | ||
| 117 | }, | ||
| 118 | { | ||
| 119 | index: 5, | ||
| 120 | databaseNameZh: "数据库名称", | ||
| 121 | databaseName: "数据库名", | ||
| 122 | tableCount: 0, | ||
| 123 | storageCapacities: 0, | ||
| 124 | columns: 0, | ||
| 125 | }, | ||
| 126 | { | ||
| 127 | index: 6, | ||
| 128 | databaseNameZh: "数据库名称", | ||
| 129 | databaseName: "数据库名", | ||
| 130 | tableCount: 0, | ||
| 131 | storageCapacities: 0, | ||
| 132 | columns: 0, | ||
| 133 | }, | ||
| 134 | |||
| 135 | ], | ||
| 136 | showPage: false, | ||
| 137 | loading: false, | ||
| 138 | }); | ||
| 139 | |||
| 140 | const onTableSelectChange = (selection: any[]) => { | ||
| 141 | console.log(selection); | ||
| 142 | }; | ||
| 143 | |||
| 144 | const cancel = () => { | ||
| 145 | // 返回上一页路由 | ||
| 146 | router.back(); | ||
| 147 | }; | ||
| 148 | |||
| 149 | const save = async () => { | ||
| 150 | console.log('save'); | ||
| 151 | // 校验表单 | ||
| 152 | const res = formRef.value; | ||
| 153 | res.ruleFormRef.validate((valid: any) => { | ||
| 154 | if (valid) { | ||
| 155 | // 表单校验通过 | ||
| 156 | console.log('表单校验通过'); | ||
| 157 | } else { | ||
| 158 | console.log('表单校验不通过'); | ||
| 159 | return false; | ||
| 160 | } | ||
| 161 | }); | ||
| 162 | |||
| 163 | |||
| 164 | }; | ||
| 165 | </script> | ||
| 166 | |||
| 167 | <template> | ||
| 168 | <div class="container_wrap" v-loading="fullscreenLoading"> | ||
| 169 | <div class="content_main"> | ||
| 170 | <ContentWrap id="id-baseInfo" title="模板信息" description="" style="margin-top: 8px;" :expandSwicth=isExpand> | ||
| 171 | <Form ref="formRef" :itemList="newCreateTemplateFormItems" formId="main-model-edit" col="col3" | ||
| 172 | :rules=formRules /> | ||
| 173 | </ContentWrap> | ||
| 174 | <ContentWrap id="id-classStandard" class="detail-content" title="选择元数据" description="" style="margin-top:16px;" | ||
| 175 | :expandSwicth=isExpand> | ||
| 176 | <div class="table-content_wrap"> | ||
| 177 | <Table ref="tableRef" :tableInfo="tableInfo" @tableSelectionChange="onTableSelectChange" /> | ||
| 178 | </div> | ||
| 179 | </ContentWrap> | ||
| 180 | </div> | ||
| 181 | <div class="bottom_tool_wrap"> | ||
| 182 | <el-button @click="cancel">取消</el-button> | ||
| 183 | <el-button type="primary" @click="save">后台运行</el-button> | ||
| 184 | </div> | ||
| 185 | </div> | ||
| 186 | </template> | ||
| 187 | |||
| 188 | <style lang="scss" scoped> | ||
| 189 | .container_wrap { | ||
| 190 | padding: 0px; | ||
| 191 | } | ||
| 192 | |||
| 193 | .content_main { | ||
| 194 | height: calc(100% - 44px); | ||
| 195 | padding: 10px 16px; | ||
| 196 | |||
| 197 | .table-content_wrap { | ||
| 198 | width: 100%; | ||
| 199 | height: 213px; | ||
| 200 | } | ||
| 201 | } | ||
| 202 | |||
| 203 | .bottom_tool_wrap { | ||
| 204 | display: flex; | ||
| 205 | justify-content: center; | ||
| 206 | border-top: 1px solid #D9D9D9; | ||
| 207 | padding-top: 8px; | ||
| 208 | |||
| 209 | } | ||
| 210 | </style> |
This diff is collapsed.
Click to expand it.
src/views/data_inventory/templateItem.vue
0 → 100644
| 1 | <template> | ||
| 2 | <div class="template-container"> | ||
| 3 | <div v-for="(item, index) in items" :key="index" :class="['template-item', item.content.status]" | ||
| 4 | :style="getItemStyle(item.content.status)"> | ||
| 5 | <div class="template-item-content"> | ||
| 6 | <div class="item-top-area"> | ||
| 7 | <div class="top-mian-description"> | ||
| 8 | <div class="item-title">{{ item.content.templateName }}</div> | ||
| 9 | <div class="item-status">已发布</div> | ||
| 10 | </div> | ||
| 11 | <div class="top-sub-description"> | ||
| 12 | <span>医疗行业分类</span> | ||
| 13 | <span>五级</span> | ||
| 14 | <span>v5</span> | ||
| 15 | </div> | ||
| 16 | </div> | ||
| 17 | <div class="item-middle-area">{{ item.content.templateDesc }}</div> | ||
| 18 | <div class="item-bottom-area"> | ||
| 19 | <div class="bottom-info"> | ||
| 20 | <span>模板确认人: {{ item.content.modelConfirmUserName }}</span> | ||
| 21 | <span>模板确认时间: {{ item.content.modelConfirmTime }}</span> | ||
| 22 | </div> | ||
| 23 | <div class="botton-btn"> | ||
| 24 | <el-button type="primary" class="off-line-btn">下线</el-button> | ||
| 25 | <el-button type="primary" class="templete-btn">模板训练</el-button> | ||
| 26 | <el-button type="primary" class="delete-btn">删除</el-button> | ||
| 27 | </div> | ||
| 28 | </div> | ||
| 29 | </div> | ||
| 30 | </div> | ||
| 31 | </div> | ||
| 32 | </template> | ||
| 33 | |||
| 34 | <script setup lang="ts"> | ||
| 35 | interface Item { | ||
| 36 | content: ItemContent; | ||
| 37 | } | ||
| 38 | |||
| 39 | interface ItemContent { | ||
| 40 | guid: string, | ||
| 41 | tenantGuid: string, | ||
| 42 | templateName: string, | ||
| 43 | templateDesc: string, | ||
| 44 | version: 0, | ||
| 45 | classifyGuid: string, | ||
| 46 | gradeGuid: string, | ||
| 47 | modelConfirmTime: string, | ||
| 48 | modelConfirmUserName: string, | ||
| 49 | metaGuids: string, | ||
| 50 | status: string | ||
| 51 | } | ||
| 52 | |||
| 53 | const items: Item[] = [ | ||
| 54 | { | ||
| 55 | content: { | ||
| 56 | guid: '1', | ||
| 57 | tenantGuid: '1', | ||
| 58 | templateName: '医疗行业分类分级模板', | ||
| 59 | templateDesc: '使用于医疗行业的分类分级模板', | ||
| 60 | version: 0, | ||
| 61 | classifyGuid: '1', | ||
| 62 | gradeGuid: '1', | ||
| 63 | modelConfirmTime: '2021-09-01', | ||
| 64 | modelConfirmUserName: '张三', | ||
| 65 | metaGuids: '1', | ||
| 66 | status: 'published', | ||
| 67 | } | ||
| 68 | }, | ||
| 69 | { | ||
| 70 | content: { | ||
| 71 | guid: '2', | ||
| 72 | tenantGuid: '2', | ||
| 73 | templateName: '模板2', | ||
| 74 | templateDesc: '模板2描述', | ||
| 75 | version: 0, | ||
| 76 | classifyGuid: '2', | ||
| 77 | gradeGuid: '2', | ||
| 78 | modelConfirmTime: '2021-09-02', | ||
| 79 | modelConfirmUserName: '李四', | ||
| 80 | metaGuids: '2', | ||
| 81 | status: 'running', | ||
| 82 | } | ||
| 83 | }, | ||
| 84 | { | ||
| 85 | content: { | ||
| 86 | guid: '3', | ||
| 87 | tenantGuid: '3', | ||
| 88 | templateName: '模板3', | ||
| 89 | templateDesc: '模板3描述使用于医疗行业的分类分级模板使用于医疗行业的分类分级模板使用于医疗行业的分类分级模板使用于医疗行业的分类分级模板', | ||
| 90 | version: 0, | ||
| 91 | classifyGuid: '3', | ||
| 92 | gradeGuid: '3', | ||
| 93 | modelConfirmTime: '2021-09-03', | ||
| 94 | modelConfirmUserName: '王五', | ||
| 95 | metaGuids: '3', | ||
| 96 | status: 'pending', | ||
| 97 | } | ||
| 98 | }, | ||
| 99 | { | ||
| 100 | content: { | ||
| 101 | guid: '4', | ||
| 102 | tenantGuid: '4', | ||
| 103 | templateName: '模板4', | ||
| 104 | templateDesc: '模板4描述', | ||
| 105 | version: 0, | ||
| 106 | classifyGuid: '4', | ||
| 107 | gradeGuid: '4', | ||
| 108 | modelConfirmTime: '2021-09-04', | ||
| 109 | modelConfirmUserName: '赵六', | ||
| 110 | metaGuids: '4', | ||
| 111 | status: 'published', | ||
| 112 | } | ||
| 113 | }, | ||
| 114 | { | ||
| 115 | content: { | ||
| 116 | guid: '5', | ||
| 117 | tenantGuid: '5', | ||
| 118 | templateName: '模板5', | ||
| 119 | templateDesc: '模板5描述', | ||
| 120 | version: 0, | ||
| 121 | classifyGuid: '5', | ||
| 122 | gradeGuid: '5', | ||
| 123 | modelConfirmTime: '2021-09-05', | ||
| 124 | modelConfirmUserName: '钱七', | ||
| 125 | metaGuids: '5', | ||
| 126 | status: 'running', | ||
| 127 | } | ||
| 128 | }, | ||
| 129 | |||
| 130 | ]; | ||
| 131 | |||
| 132 | const getItemStyle = (status: string) => { | ||
| 133 | let borderColor = '#1BA854'; // 默认绿色 | ||
| 134 | switch (status) { | ||
| 135 | case 'published': | ||
| 136 | borderColor = '#1BA854'; | ||
| 137 | break; | ||
| 138 | case 'running': | ||
| 139 | borderColor = '#FF991C'; | ||
| 140 | break; | ||
| 141 | case 'pending': | ||
| 142 | borderColor = '#B2B2B2 '; | ||
| 143 | break; | ||
| 144 | } | ||
| 145 | return { | ||
| 146 | borderTop: `4px solid ${borderColor}`, | ||
| 147 | }; | ||
| 148 | }; | ||
| 149 | </script> | ||
| 150 | |||
| 151 | <style scoped lang="scss"> | ||
| 152 | .template-container { | ||
| 153 | display: flex; | ||
| 154 | flex-wrap: wrap; | ||
| 155 | gap: 15px; | ||
| 156 | } | ||
| 157 | |||
| 158 | .template-item { | ||
| 159 | width: 400px; | ||
| 160 | } | ||
| 161 | |||
| 162 | .template-item-content { | ||
| 163 | width: 100%; | ||
| 164 | height: 222px; | ||
| 165 | background: #FFFFFF; | ||
| 166 | border: 1px solid rgba(217, 217, 217, 1); | ||
| 167 | padding: 20px; | ||
| 168 | box-sizing: border-box; | ||
| 169 | display: flex; | ||
| 170 | flex-direction: column; | ||
| 171 | |||
| 172 | .item-top-area { | ||
| 173 | .top-mian-description { | ||
| 174 | display: flex; | ||
| 175 | justify-content: space-between; | ||
| 176 | align-items: center; | ||
| 177 | |||
| 178 | .item-title { | ||
| 179 | font-family: PingFangSC-Semibold; | ||
| 180 | font-size: 16px; | ||
| 181 | color: #212121; | ||
| 182 | line-height: 24px; | ||
| 183 | font-weight: 600; | ||
| 184 | } | ||
| 185 | |||
| 186 | .item-status { | ||
| 187 | |||
| 188 | border-radius: 2px; | ||
| 189 | |||
| 190 | font-size: 12px; | ||
| 191 | |||
| 192 | text-align: center; | ||
| 193 | line-height: 18px; | ||
| 194 | font-weight: 400; | ||
| 195 | padding: 1px 8px; | ||
| 196 | } | ||
| 197 | } | ||
| 198 | |||
| 199 | .top-sub-description { | ||
| 200 | margin-top: 9px; | ||
| 201 | display: flex; | ||
| 202 | /* 左对齐 */ | ||
| 203 | justify-content: flex-start; | ||
| 204 | |||
| 205 | span { | ||
| 206 | background: #F5F5F5; | ||
| 207 | border: 1px solid rgba(217, 217, 217, 1); | ||
| 208 | border-radius: 2px; | ||
| 209 | display: inline-block; | ||
| 210 | padding: 1px 8px; | ||
| 211 | margin-right: 8px; | ||
| 212 | |||
| 213 | font-size: 12px; | ||
| 214 | color: #404040; | ||
| 215 | text-align: center; | ||
| 216 | line-height: 18px; | ||
| 217 | font-weight: 400; | ||
| 218 | } | ||
| 219 | } | ||
| 220 | } | ||
| 221 | |||
| 222 | .item-middle-area { | ||
| 223 | |||
| 224 | margin-top: 16px; | ||
| 225 | |||
| 226 | font-size: 14px; | ||
| 227 | color: #999999; | ||
| 228 | letter-spacing: 0; | ||
| 229 | line-height: 21px; | ||
| 230 | font-weight: 400; | ||
| 231 | height: 44px; | ||
| 232 | overflow: hidden; | ||
| 233 | display: -webkit-box; | ||
| 234 | display: -moz-box; | ||
| 235 | -webkit-box-orient: vertical; | ||
| 236 | -webkit-line-clamp: 2; | ||
| 237 | line-clamp: 2; | ||
| 238 | text-overflow: ellipsis; | ||
| 239 | } | ||
| 240 | |||
| 241 | .item-bottom-area { | ||
| 242 | margin-top: 8px; | ||
| 243 | |||
| 244 | .bottom-info { | ||
| 245 | display: flex; | ||
| 246 | justify-content: space-between; | ||
| 247 | align-items: center; | ||
| 248 | |||
| 249 | span { | ||
| 250 | display: inline-block; | ||
| 251 | |||
| 252 | font-size: 14px; | ||
| 253 | color: #666666; | ||
| 254 | letter-spacing: 0; | ||
| 255 | line-height: 21px; | ||
| 256 | font-weight: 400; | ||
| 257 | } | ||
| 258 | } | ||
| 259 | |||
| 260 | .botton-btn { | ||
| 261 | margin-top: 13px; | ||
| 262 | |||
| 263 | .off-line-btn { | ||
| 264 | background-color: #fff; | ||
| 265 | font-size: 14px; | ||
| 266 | color: #4FA1A4; | ||
| 267 | |||
| 268 | } | ||
| 269 | |||
| 270 | .templete-btn, | ||
| 271 | .delete-btn { | ||
| 272 | |||
| 273 | background: #FFFFFF; | ||
| 274 | border: 1px solid rgba(217, 217, 217, 1); | ||
| 275 | font-size: 14px; | ||
| 276 | color: #212121; | ||
| 277 | } | ||
| 278 | } | ||
| 279 | } | ||
| 280 | } | ||
| 281 | |||
| 282 | .template-item.published .template-item-content .item-status { | ||
| 283 | color: #1BA854; | ||
| 284 | background: #F2FFF5; | ||
| 285 | border: 1px solid rgba(109, 209, 142, 1); | ||
| 286 | } | ||
| 287 | |||
| 288 | .template-item.running .template-item-content .item-status { | ||
| 289 | color: #FF991C; | ||
| 290 | background: #FFFBF2; | ||
| 291 | border: 1px solid rgba(255, 203, 120, 1); | ||
| 292 | } | ||
| 293 | |||
| 294 | .template-item.pending .template-item-content .item-status { | ||
| 295 | border: 1px solid rgba(217, 217, 217, 1); | ||
| 296 | color: #404040; | ||
| 297 | background: #F5F5F5; | ||
| 298 | } | ||
| 299 | </style> |
-
Please register or sign in to post a comment