c89e416a by lxs

分类分级任务bug修改

1 parent c7b77154
...@@ -684,7 +684,7 @@ defineExpose({ ...@@ -684,7 +684,7 @@ defineExpose({
684 @radioGroupChange="radioGroupChange" @selectChange="formSelectChange" @toolBtnClick="formToolBtnClick" 684 @radioGroupChange="radioGroupChange" @selectChange="formSelectChange" @toolBtnClick="formToolBtnClick"
685 @checkboxChange="checkboxChange" @switchChange="switchChange" @btnClick="btnClick" 685 @checkboxChange="checkboxChange" @switchChange="switchChange" @btnClick="btnClick"
686 @treeSelectLoad="treeSelectLoad" @treeSelectNodeChange="treeSelectNodeChange" 686 @treeSelectLoad="treeSelectLoad" @treeSelectNodeChange="treeSelectNodeChange"
687 @scheduleChange="scheduleChange" @inputChange="formInputChange" /> 687 @scheduleChange="scheduleChange" @inputChange="formInputChange" @cascaderChange="cascaderChange" />
688 <template v-if="con.note"> 688 <template v-if="con.note">
689 <div class="sql-note">{{ con.note }}</div> 689 <div class="sql-note">{{ con.note }}</div>
690 </template> 690 </template>
......
...@@ -84,10 +84,15 @@ const handleTreeSelectNodeClick = (node, item) => { ...@@ -84,10 +84,15 @@ const handleTreeSelectNodeClick = (node, item) => {
84 } 84 }
85 const cascaderChange = (val, item) => { 85 const cascaderChange = (val, item) => {
86 emits("cascaderChange", val, item); 86 emits("cascaderChange", val, item);
87 if(item.blur){
88 const formCascader = formCascaderRef.value[0] || formCascaderRef.value;
89 formCascader.togglePopperVisible(false)
90 }
87 } 91 }
88 const inputChange = (val) => { 92 const inputChange = (val) => {
89 onSubmit() 93 onSubmit()
90 } 94 }
95 const formCascaderRef = ref()
91 onMounted(() => { 96 onMounted(() => {
92 props.init && onSubmit() 97 props.init && onSubmit()
93 }) 98 })
...@@ -197,7 +202,7 @@ onMounted(() => { ...@@ -197,7 +202,7 @@ onMounted(() => {
197 :show-all-levels="item.showAllLevels ?? true" :clearable="item.clearable" 202 :show-all-levels="item.showAllLevels ?? true" :clearable="item.clearable"
198 :filterable="item.filterable ?? false" :collapse-tags="item.collapse ?? false" 203 :filterable="item.filterable ?? false" :collapse-tags="item.collapse ?? false"
199 :collapse-tags-tooltip="item.tagsTooltip ?? false" :max-collapse-tags="item.maxTags ?? 1" 204 :collapse-tags-tooltip="item.tagsTooltip ?? false" :max-collapse-tags="item.maxTags ?? 1"
200 :disabled="item.disabled ?? false" @change="(val) => cascaderChange(val, item)" /> 205 :disabled="item.disabled ?? false" :popper-class="item.popperClass ?? ''" @change="(val) => cascaderChange(val, item)" />
201 </template> 206 </template>
202 <template v-else> 207 <template v-else>
203 <el-input v-model.trim="formInline[item.field]" :placeholder="item.placeholder" :clearable="item.clearable" 208 <el-input v-model.trim="formInline[item.field]" :placeholder="item.placeholder" :clearable="item.clearable"
......
...@@ -44,8 +44,8 @@ const loadMore = () => { ...@@ -44,8 +44,8 @@ const loadMore = () => {
44 const treeSelectLoad = (node, resolve, item) => { 44 const treeSelectLoad = (node, resolve, item) => {
45 emits("treeSelectLoad", node, resolve, item); 45 emits("treeSelectLoad", node, resolve, item);
46 }; 46 };
47 const selectChange = (val, row) => { 47 const selectChange = (val, row, info) => {
48 emits("selectChange", val, row); 48 emits("selectChange", val, row, info);
49 }; 49 };
50 const handleTreeSelectNodeChange = (node, item) => { 50 const handleTreeSelectNodeChange = (node, item) => {
51 emits("treeSelectNodeChange", node, item); 51 emits("treeSelectNodeChange", node, item);
......
...@@ -35,7 +35,7 @@ const tableInfo = ref({ ...@@ -35,7 +35,7 @@ const tableInfo = ref({
35 label: "目录名称", field: "cgDirName", width: 120, type: "text_btn", columClass: 'text_btn', click: (scope) => { 35 label: "目录名称", field: "cgDirName", width: 120, type: "text_btn", columClass: 'text_btn', click: (scope) => {
36 router.push({ 36 router.push({
37 name: "classifyGradeCatalogue", 37 name: "classifyGradeCatalogue",
38 // query: { guid: scope.row.damGuid }, 38 query: { name: scope.row.cgDirName },
39 }); 39 });
40 } 40 }
41 }, 41 },
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 import { ref, onMounted } from "vue"; 6 import { ref, onMounted } from "vue";
7 import { useRouter, useRoute } from "vue-router"; 7 import { useRouter, useRoute } from "vue-router";
8 import { ElMessage, ElMessageBox } from "element-plus"; 8 import { ElMessage, ElMessageBox } from "element-plus";
9 import { Search, Warning } from "@element-plus/icons-vue"; 9 import { Search, Warning, ArrowUp } from "@element-plus/icons-vue";
10 import { tagMethod, tagType, changeNum } from "@/utils/common"; 10 import { tagMethod, tagType, changeNum } from "@/utils/common";
11 import TableTools from '@/components/Tools/table_tools.vue'; 11 import TableTools from '@/components/Tools/table_tools.vue';
12 import { 12 import {
...@@ -41,7 +41,7 @@ const treeInfo: any = ref({ ...@@ -41,7 +41,7 @@ const treeInfo: any = ref({
41 id: "data-pickup-tree", 41 id: "data-pickup-tree",
42 filter: true, 42 filter: true,
43 queryValue: "", 43 queryValue: "",
44 queryPlaceholder: "输入组织名称搜索", 44 queryPlaceholder: "输入分类名称搜索",
45 props: { 45 props: {
46 label: "classifyName", 46 label: "classifyName",
47 value: "classifyDetailGuid", 47 value: "classifyDetailGuid",
...@@ -51,7 +51,7 @@ const treeInfo: any = ref({ ...@@ -51,7 +51,7 @@ const treeInfo: any = ref({
51 expandOnNodeClick: false, 51 expandOnNodeClick: false,
52 data: [], 52 data: [],
53 }); 53 });
54 54 const titleClose = ref(false)
55 const taskDetail: any = ref({}) 55 const taskDetail: any = ref({})
56 const fieldCounts = ref({}) 56 const fieldCounts = ref({})
57 const tabsInfo = ref({ 57 const tabsInfo = ref({
...@@ -163,8 +163,10 @@ const fieldItemList = ref([ ...@@ -163,8 +163,10 @@ const fieldItemList = ref([
163 label: "classifyName", 163 label: "classifyName",
164 value: "classifyDetailGuid", 164 value: "classifyDetailGuid",
165 }, 165 },
166 // popperClass: 'strictiy_cascader',
166 filterable: true, 167 filterable: true,
167 clearable: true, 168 clearable: true,
169 blur: true
168 }, 170 },
169 { 171 {
170 type: "select", 172 type: "select",
...@@ -180,7 +182,8 @@ const fieldItemList = ref([ ...@@ -180,7 +182,8 @@ const fieldItemList = ref([
180 clearable: true, 182 clearable: true,
181 }, 183 },
182 ]); 184 ]);
183 185 const tableToolRef = ref();
186 const toolH = ref(49);
184 const page = ref({ 187 const page = ref({
185 limit: 50, 188 limit: 50,
186 curr: 1, 189 curr: 1,
...@@ -192,7 +195,6 @@ const page = ref({ ...@@ -192,7 +195,6 @@ const page = ref({
192 { label: "200", value: 200 }, 195 { label: "200", value: 200 },
193 ], 196 ],
194 }); 197 });
195
196 const currTableData: any = ref({}); 198 const currTableData: any = ref({});
197 const sheetTableInfo = ref({ 199 const sheetTableInfo = ref({
198 id: "mapping-table", 200 id: "mapping-table",
...@@ -241,7 +243,7 @@ const fieldTableInfo = ref({ ...@@ -241,7 +243,7 @@ const fieldTableInfo = ref({
241 label: "分类", field: "classifyDetailGuid", width: 280, 243 label: "分类", field: "classifyDetailGuid", width: 280,
242 type: "cascader", 244 type: "cascader",
243 options: [], 245 options: [],
244 showAllLevels: false, 246 showAllLevels: true,
245 props: { 247 props: {
246 checkStrictly: false, 248 checkStrictly: false,
247 expandTrigger: "hover", 249 expandTrigger: "hover",
...@@ -261,9 +263,12 @@ const fieldTableInfo = ref({ ...@@ -261,9 +263,12 @@ const fieldTableInfo = ref({
261 } 263 }
262 }, 264 },
263 { 265 {
264 label: "分级", field: "gradeDetailName", width: 120, type: 'select', options: [], props: { label: 'gradeName', value: 'guid' }, 266 label: "分级", field: "gradeDetailGuid", width: 80, type: 'select', options: [], props: { label: 'gradeName', value: 'guid' },
267 getName: (scope) => {
268 return scope.row.gradeDetailName || '--'
269 }
265 }, 270 },
266 { label: "标签", field: "label", width: 96 }, 271 { label: "标签", field: "label", width: 120 },
267 { label: "规则", field: "ruleDetail", width: 200 }, 272 { label: "规则", field: "ruleDetail", width: 200 },
268 { label: "表英文名", field: "tableName", width: 200 }, 273 { label: "表英文名", field: "tableName", width: 200 },
269 { label: "表中文名", field: "tableChName", width: 120 }, 274 { label: "表中文名", field: "tableChName", width: 120 },
...@@ -292,7 +297,7 @@ const formItems = ref([ ...@@ -292,7 +297,7 @@ const formItems = ref([
292 field: "classifyName", 297 field: "classifyName",
293 default: [], 298 default: [],
294 options: [], 299 options: [],
295 showAllLevels: false, 300 showAllLevels: true,
296 props: { 301 props: {
297 checkStrictly: false, 302 checkStrictly: false,
298 expandTrigger: "hover", 303 expandTrigger: "hover",
...@@ -612,6 +617,9 @@ const btnClick = async (btn, bType = null) => { ...@@ -612,6 +617,9 @@ const btnClick = async (btn, bType = null) => {
612 if (type == 'path') { 617 if (type == 'path') {
613 router.push({ 618 router.push({
614 name: "classifyGradeCatalogue", 619 name: "classifyGradeCatalogue",
620 query: {
621 name: taskDetail.value.cgDirName
622 }
615 }); 623 });
616 } else if (type == 'batch') { 624 } else if (type == 'batch') {
617 if (selectRowData.value.length == 0) { 625 if (selectRowData.value.length == 0) {
...@@ -679,19 +687,30 @@ const searchField = (val: any, clear: boolean = false) => { ...@@ -679,19 +687,30 @@ const searchField = (val: any, clear: boolean = false) => {
679 getFieldTableData(); 687 getFieldTableData();
680 }; 688 };
681 689
682 const cascaderChange = (val, row) => { 690 const cascaderChange = (val, info) => {
683 treeInfoRef.value.expandedKey = val || ['all']; 691 if (dialogInfo.value.visible) {
684 treeInfoRef.value.setCurrentKey(val?.at(-1) || 'all'); 692 const cascaderData = dialogRef.value.getCascaderCheckedData();
685 console.log('cascader', val) 693 formItems.value[1].default = cascaderData.length ? cascaderData[0].data.gradeGuid : '';
686 getFieldTableData(); 694 } else {
695 if (info && info.row) {
696 const cascaderData = getCascaderCheckedData();
697 info.row.gradeDetailGuid = cascaderData.length ? cascaderData[0].data.gradeGuid : '';
698
699 } else {
700 treeInfoRef.value.expandedKey = val || ['all'];
701 treeInfoRef.value.setCurrentKey(val?.at(-1) || 'all');
702 getFieldTableData();
703 }
704 }
687 }; 705 };
688 706
689 const selectChange = (val, item, scope = null) => { 707 const selectChange = (val, item, scope = null) => {
690 if (scope) { 708 if (scope && item.field == 'gradeDetailName') {
691 let row = scope.row; 709 let row = scope.row;
692 row.gradeGuid = val || ''; 710 row.gradeGuid = val || '';
693 row.gradeDetailName = val ? item.options.find(i => i.guid == val)?.gradeName : ''; 711 row.gradeDetailName = val ? item.options.find(i => i.guid == val)?.gradeName : '';
694 } else { 712 } else {
713 const params: any = scope;
695 if (tabsInfo.value.activeName == 'sheet') { 714 if (tabsInfo.value.activeName == 'sheet') {
696 if (!val) { 715 if (!val) {
697 sheetItemList.value[1].default = ''; 716 sheetItemList.value[1].default = '';
...@@ -699,6 +718,7 @@ const selectChange = (val, item, scope = null) => { ...@@ -699,6 +718,7 @@ const selectChange = (val, item, scope = null) => {
699 } else { 718 } else {
700 sheetItemList.value[1].disabled = false; 719 sheetItemList.value[1].disabled = false;
701 } 720 }
721 params.tableGuid = '';
702 } else { 722 } else {
703 if (item.field == "databaseGuid") { 723 if (item.field == "databaseGuid") {
704 if (!val) { 724 if (!val) {
...@@ -708,7 +728,10 @@ const selectChange = (val, item, scope = null) => { ...@@ -708,7 +728,10 @@ const selectChange = (val, item, scope = null) => {
708 fieldItemList.value[3].disabled = true; 728 fieldItemList.value[3].disabled = true;
709 } else { 729 } else {
710 fieldItemList.value[2].disabled = false; 730 fieldItemList.value[2].disabled = false;
731 params.tableGuid && (fieldItemList.value[3].disabled = false);
711 } 732 }
733 params.tableGuid = '';
734 params.fieldGuid = '';
712 } else { 735 } else {
713 if (!val) { 736 if (!val) {
714 fieldItemList.value[3].default = ''; 737 fieldItemList.value[3].default = '';
...@@ -716,6 +739,7 @@ const selectChange = (val, item, scope = null) => { ...@@ -716,6 +739,7 @@ const selectChange = (val, item, scope = null) => {
716 } else { 739 } else {
717 fieldItemList.value[3].disabled = false; 740 fieldItemList.value[3].disabled = false;
718 } 741 }
742 params.fieldGuid = '';
719 } 743 }
720 } 744 }
721 if (val) { 745 if (val) {
...@@ -763,7 +787,10 @@ onBeforeMount(() => { ...@@ -763,7 +787,10 @@ onBeforeMount(() => {
763 }) 787 })
764 788
765 onMounted(() => { 789 onMounted(() => {
766 790 toolH.value = tableToolRef.value.offsetHeight;
791 window.addEventListener('resize', function () {
792 toolH.value = tableToolRef.value.offsetHeight;
793 })
767 }) 794 })
768 795
769 </script> 796 </script>
...@@ -772,7 +799,7 @@ onMounted(() => { ...@@ -772,7 +799,7 @@ onMounted(() => {
772 <div class="container_wrap full flex" v-loading="loading"> 799 <div class="container_wrap full flex" v-loading="loading">
773 <div class="main_wrap full"> 800 <div class="main_wrap full">
774 <div class="content_main panel"> 801 <div class="content_main panel">
775 <div class="template_panel"> 802 <div class="template_panel" :class="{ active: !titleClose }">
776 <div class="panel_title"> 803 <div class="panel_title">
777 <div class="title_wrap"> 804 <div class="title_wrap">
778 <span class="title_text">{{ taskDetail.taskName }}</span> 805 <span class="title_text">{{ taskDetail.taskName }}</span>
...@@ -780,6 +807,12 @@ onMounted(() => { ...@@ -780,6 +807,12 @@ onMounted(() => {
780 {{ filterVal(taskDetail.confirmStatus, 'confirmStatus') }} 807 {{ filterVal(taskDetail.confirmStatus, 'confirmStatus') }}
781 </el-tag> 808 </el-tag>
782 </div> 809 </div>
810 <div class="title_btn" @click="titleClose = !titleClose">
811 <el-icon :class="{ active: !titleClose }">
812 <ArrowUp />
813 </el-icon>
814 <span class="title_btn_item">{{ titleClose ? '展开' : '收起' }}</span>
815 </div>
783 </div> 816 </div>
784 <div class="title_desc"> 817 <div class="title_desc">
785 <div class="desc_group"> 818 <div class="desc_group">
...@@ -804,7 +837,8 @@ onMounted(() => { ...@@ -804,7 +837,8 @@ onMounted(() => {
804 </div> 837 </div>
805 <div class="desc_item"> 838 <div class="desc_item">
806 <span class="desc_label">元数据名称:</span> 839 <span class="desc_label">元数据名称:</span>
807 <span class="desc_value">{{ (taskDetail.metaNames || []).length ? taskDetail.metaNames.join(',') : '--' 840 <span class="desc_value">{{ (taskDetail.metaNames || []).length ? taskDetail.metaNames.join(',') :
841 '--'
808 }}</span> 842 }}</span>
809 </div> 843 </div>
810 </div> 844 </div>
...@@ -824,7 +858,7 @@ onMounted(() => { ...@@ -824,7 +858,7 @@ onMounted(() => {
824 <span>个字段</span> 858 <span>个字段</span>
825 </p> 859 </p>
826 </div> 860 </div>
827 <div class="panel_content"> 861 <div class="panel_content" :class="{ full: titleClose }">
828 <Tabs class="panel_tabs" :tabs-info="tabsInfo" @tab-change="tabChange" /> 862 <Tabs class="panel_tabs" :tabs-info="tabsInfo" @tab-change="tabChange" />
829 <div class="panel" v-show="tabsInfo.activeName == 'sheet'"> 863 <div class="panel" v-show="tabsInfo.activeName == 'sheet'">
830 <div class="table_tool_wrap"> 864 <div class="table_tool_wrap">
...@@ -840,7 +874,7 @@ onMounted(() => { ...@@ -840,7 +874,7 @@ onMounted(() => {
840 <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" /> 874 <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" />
841 </div> 875 </div>
842 <div class="box_right"> 876 <div class="box_right">
843 <div class="table_tool_wrap"> 877 <div class="table_tool_wrap" ref="tableToolRef">
844 <TableTools ref="fieldSearchRef" :searchItems="fieldItemList" :searchId="'field-search'" :init="false" 878 <TableTools ref="fieldSearchRef" :searchItems="fieldItemList" :searchId="'field-search'" :init="false"
845 @selectChange="selectChange" @cascaderChange="cascaderChange" @search="searchField" /> 879 @selectChange="selectChange" @cascaderChange="cascaderChange" @search="searchField" />
846 <div class="tools_btns"> 880 <div class="tools_btns">
...@@ -851,7 +885,7 @@ onMounted(() => { ...@@ -851,7 +885,7 @@ onMounted(() => {
851 </div> 885 </div>
852 </div> 886 </div>
853 </div> 887 </div>
854 <div class="table_panel_wrap panel"> 888 <div class="table_panel_wrap panel" :style="{ height: 'calc(100% - ' + toolH + 'px)' }">
855 <div class="table_panel" v-loading="fieldTableInfo.loading"> 889 <div class="table_panel" v-loading="fieldTableInfo.loading">
856 <el-table ref="costTableRef" :data="fieldTableInfo.data" border :height="'100%'" 890 <el-table ref="costTableRef" :data="fieldTableInfo.data" border :height="'100%'"
857 style="width: 100%; display: inline-block" :style="{ 'max-height': 'calc(100% - 44px)' }" 891 style="width: 100%; display: inline-block" :style="{ 'max-height': 'calc(100% - 44px)' }"
...@@ -884,7 +918,8 @@ onMounted(() => { ...@@ -884,7 +918,8 @@ onMounted(() => {
884 <el-cascader v-else-if="item.type == 'cascader' && scope.row['STATE'] === 'Running'" 918 <el-cascader v-else-if="item.type == 'cascader' && scope.row['STATE'] === 'Running'"
885 ref="cascaderRef" v-model="scope.row[item.field]" :options="item.options" :props="item.props" 919 ref="cascaderRef" v-model="scope.row[item.field]" :options="item.options" :props="item.props"
886 :show-all-levels="item.showAllLevels ?? true" :disabled="item.disabled ?? false" 920 :show-all-levels="item.showAllLevels ?? true" :disabled="item.disabled ?? false"
887 :clearable="item.clearable ?? true" size="small" /> 921 :clearable="item.clearable ?? true" size="small"
922 @change="val => cascaderChange(val, scope)" />
888 <span v-else> 923 <span v-else>
889 {{ item.getName ? item.getName(scope) : scope.row[item.field] !== 0 && !scope.row[item.field] 924 {{ item.getName ? item.getName(scope) : scope.row[item.field] !== 0 && !scope.row[item.field]
890 ? 925 ?
...@@ -915,7 +950,7 @@ onMounted(() => { ...@@ -915,7 +950,7 @@ onMounted(() => {
915 </div> 950 </div>
916 </div> 951 </div>
917 </div> 952 </div>
918 <Dialog ref="dialogRef" :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" /> 953 <Dialog ref="dialogRef" :dialogInfo="dialogInfo" @cascaderChange="cascaderChange" @btnClick="dialogBtnClick" />
919 </div> 954 </div>
920 </template> 955 </template>
921 956
...@@ -986,6 +1021,9 @@ onMounted(() => { ...@@ -986,6 +1021,9 @@ onMounted(() => {
986 1021
987 .template_panel { 1022 .template_panel {
988 padding: 0 16px; 1023 padding: 0 16px;
1024 height: 40px;
1025 overflow: hidden;
1026 transition: height .3s;
989 1027
990 .panel_title { 1028 .panel_title {
991 display: flex; 1029 display: flex;
...@@ -1006,6 +1044,25 @@ onMounted(() => { ...@@ -1006,6 +1044,25 @@ onMounted(() => {
1006 margin-right: 12px; 1044 margin-right: 12px;
1007 } 1045 }
1008 } 1046 }
1047
1048 .title_btn {
1049 padding: 2px 4px;
1050 cursor: pointer;
1051
1052 .el-icon {
1053 margin-right: 4px;
1054 transform: rotateX(180deg);
1055 transition: transform .3s;
1056
1057 &.active {
1058 transform: rotateX(0deg);
1059 }
1060 }
1061
1062 &:hover {
1063 background: #f2f2f2;
1064 }
1065 }
1009 } 1066 }
1010 1067
1011 .title_desc { 1068 .title_desc {
...@@ -1047,10 +1104,15 @@ onMounted(() => { ...@@ -1047,10 +1104,15 @@ onMounted(() => {
1047 margin-left: 8px; 1104 margin-left: 8px;
1048 } 1105 }
1049 } 1106 }
1107
1108 &.active {
1109 height: 144px;
1110 }
1050 } 1111 }
1051 1112
1052 .panel_content { 1113 .panel_content {
1053 height: calc(100% - 145px); 1114 height: calc(100% - 145px);
1115 flex: 1;
1054 1116
1055 .panel { 1117 .panel {
1056 height: calc(100% - 35px); 1118 height: calc(100% - 35px);
...@@ -1104,6 +1166,9 @@ onMounted(() => { ...@@ -1104,6 +1166,9 @@ onMounted(() => {
1104 } 1166 }
1105 1167
1106 :deep(.table_tool_wrap) { 1168 :deep(.table_tool_wrap) {
1169 height: auto;
1170 min-height: unset;
1171
1107 .table-tools { 1172 .table-tools {
1108 .tools_search { 1173 .tools_search {
1109 padding-top: 8px; 1174 padding-top: 8px;
......
...@@ -32,7 +32,7 @@ const treeInfo = ref({ ...@@ -32,7 +32,7 @@ const treeInfo = ref({
32 filter: true, 32 filter: true,
33 queryValue: "", 33 queryValue: "",
34 loading: false, 34 loading: false,
35 queryPlaceholder: "请输入分类名称搜索", 35 queryPlaceholder: "请输入规则名称搜索",
36 props: { 36 props: {
37 label: "classifyName", 37 label: "classifyName",
38 value: "guid", 38 value: "guid",
...@@ -42,7 +42,8 @@ const treeInfo = ref({ ...@@ -42,7 +42,8 @@ const treeInfo = ref({
42 expandOnNodeClick: false, 42 expandOnNodeClick: false,
43 data: [], 43 data: [],
44 }); 44 });
45 45 const toolH = ref(82)
46 const toolRef = ref();
46 const expand1 = ref(true) 47 const expand1 = ref(true)
47 const expand2 = ref(true) 48 const expand2 = ref(true)
48 49
...@@ -322,7 +323,10 @@ const handleScroll = () => { ...@@ -322,7 +323,10 @@ const handleScroll = () => {
322 // 点击分类列表 323 // 点击分类列表
323 const listClick = (row) => { 324 const listClick = (row) => {
324 templateInfo.value = row; 325 templateInfo.value = row;
325 getClassifyTree() 326 getClassifyTree();
327 searchItemValue.value.classifyGuid = row.guid;
328 searchItemValue.value.detailGuid = '';
329 getTableData();
326 }; 330 };
327 331
328 // 获取分类列表 332 // 获取分类列表
...@@ -340,12 +344,14 @@ const getPermissionList = (val, init = true) => { ...@@ -340,12 +344,14 @@ const getPermissionList = (val, init = true) => {
340 currpermissionList.value = JSON.parse(JSON.stringify(data)) 344 currpermissionList.value = JSON.parse(JSON.stringify(data))
341 listPage.value.totalPages = res.data.totalPages 345 listPage.value.totalPages = res.data.totalPages
342 if (data.length) { 346 if (data.length) {
347 let tempInfo = data[0];
343 if (route.query.type == 'edit') { 348 if (route.query.type == 'edit') {
344 templateInfo.value = data.filter(item => item.guid == taskDetail.value.classifyGuid)[0] 349 tempInfo = data.filter(item => item.guid == taskDetail.value.classifyGuid)[0]
345 } else {
346 templateInfo.value = data[0];
347 } 350 }
348 getClassifyTree() 351 listClick(tempInfo);
352 nextTick(() => {
353 toolH.value = toolRef.value.offsetHeight
354 })
349 } 355 }
350 } else { 356 } else {
351 permissionList.value.push(...JSON.parse(JSON.stringify(data))) 357 permissionList.value.push(...JSON.parse(JSON.stringify(data)))
...@@ -370,7 +376,6 @@ const getClassifyTree = () => { ...@@ -370,7 +376,6 @@ const getClassifyTree = () => {
370 const data = res.data || []; 376 const data = res.data || [];
371 treeInfo.value.data = data; 377 treeInfo.value.data = data;
372 treeInfoRef.value.setCurrentKey(''); 378 treeInfoRef.value.setCurrentKey('');
373 tableInfo.value.data = [];
374 } 379 }
375 }).catch(() => { 380 }).catch(() => {
376 treeInfo.value.loading = false; 381 treeInfo.value.loading = false;
...@@ -395,16 +400,22 @@ onBeforeMount(() => { ...@@ -395,16 +400,22 @@ onBeforeMount(() => {
395 } 400 }
396 }) 401 })
397 402
403 onMounted(() => {
404 window.addEventListener('resize', function () {
405 toolH.value = toolRef.value.offsetHeight
406 })
407 })
408
398 </script> 409 </script>
399 410
400 <template> 411 <template>
401 <div class="container_wrap full flex"> 412 <div class="container_wrap full flex">
402 <div class="aside_wrap" v-show="step == 0"> 413 <div class="aside_wrap" v-show="step == 0">
403 <div class="aside_title">选择分类</div> 414 <div class="aside_title">选择分类</div>
404 <div class="aside_search"> 415 <!-- <div class="aside_search">
405 <el-input v-model.trim="asideSearchInput" placeholder="请输入关键字" :prefix-icon="Search" clearable 416 <el-input v-model.trim="asideSearchInput" placeholder="请输入关键字" :prefix-icon="Search" clearable
406 @change="querySearch" /> 417 @change="querySearch" />
407 </div> 418 </div> -->
408 <div class="aside_list" v-loading="listLoading" v-infinite-scroll="handleScroll"> 419 <div class="aside_list" v-loading="listLoading" v-infinite-scroll="handleScroll">
409 <div class="list_item" v-for="(item, i) in currpermissionList" :class="{ active: selectIndex == i }" 420 <div class="list_item" v-for="(item, i) in currpermissionList" :class="{ active: selectIndex == i }"
410 @click="selectIndex = i; listClick(item);" v-preReClick>{{ item.name }}</div> 421 @click="selectIndex = i; listClick(item);" v-preReClick>{{ item.name }}</div>
...@@ -412,7 +423,7 @@ onBeforeMount(() => { ...@@ -412,7 +423,7 @@ onBeforeMount(() => {
412 </div> 423 </div>
413 <div class="main_wrap" :class="{ full: step == 1 }"> 424 <div class="main_wrap" :class="{ full: step == 1 }">
414 <div class="content_main" v-show="step == 0"> 425 <div class="content_main" v-show="step == 0">
415 <div class="template_panel"> 426 <div class="template_panel" ref="toolRef">
416 <div class="title_item"> 427 <div class="title_item">
417 <span class="title_label">分类标准:</span> 428 <span class="title_label">分类标准:</span>
418 <span class="title_text">{{ templateInfo.name || '--' }}</span> 429 <span class="title_text">{{ templateInfo.name || '--' }}</span>
...@@ -426,7 +437,7 @@ onBeforeMount(() => { ...@@ -426,7 +437,7 @@ onBeforeMount(() => {
426 <span class="title_text">{{ templateInfo.description || '--' }}</span> 437 <span class="title_text">{{ templateInfo.description || '--' }}</span>
427 </div> 438 </div>
428 </div> 439 </div>
429 <div class="panel_content"> 440 <div class="panel_content" :style="{ height: 'calc(100% - ' + toolH + 'px)' }">
430 <div class="box_left"> 441 <div class="box_left">
431 <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" /> 442 <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" />
432 </div> 443 </div>
...@@ -445,8 +456,8 @@ onBeforeMount(() => { ...@@ -445,8 +456,8 @@ onBeforeMount(() => {
445 col="col3" /> 456 col="col3" />
446 </div> 457 </div>
447 </ContentWrap> 458 </ContentWrap>
448 <ContentWrap id="id-approveInfo" title="选择元数据" expandSwicth style="margin-top: 15px" :isExpand="expand2" 459 <ContentWrap id="id-approveInfo" :class="{ full: expand2 }" title="选择元数据" expandSwicth style="margin-top: 15px"
449 @expand="(v) => expand2 = v"> 460 :isExpand="expand2" @expand="(v) => expand2 = v">
450 <div class="table_panel_wrap full"> 461 <div class="table_panel_wrap full">
451 <Table ref="metadataTableRef" :tableInfo="metadataTableInfo" @tableSelectionChange="tableSelectionChange" /> 462 <Table ref="metadataTableRef" :tableInfo="metadataTableInfo" @tableSelectionChange="tableSelectionChange" />
452 </div> 463 </div>
...@@ -476,6 +487,10 @@ onBeforeMount(() => { ...@@ -476,6 +487,10 @@ onBeforeMount(() => {
476 display: inline-block; 487 display: inline-block;
477 } 488 }
478 489
490 .aside_list {
491 height: calc(100% - 36px);
492 }
493
479 .icon-add.el-icon { 494 .icon-add.el-icon {
480 width: 24px; 495 width: 24px;
481 height: 24px; 496 height: 24px;
...@@ -522,7 +537,6 @@ onBeforeMount(() => { ...@@ -522,7 +537,6 @@ onBeforeMount(() => {
522 flex-direction: column; 537 flex-direction: column;
523 height: calc(100% - 45px); 538 height: calc(100% - 45px);
524 overflow: hidden auto; 539 overflow: hidden auto;
525 flex: 1;
526 540
527 &.panel { 541 &.panel {
528 padding: 0 16px; 542 padding: 0 16px;
...@@ -571,7 +585,7 @@ onBeforeMount(() => { ...@@ -571,7 +585,7 @@ onBeforeMount(() => {
571 border-top: 1px solid #d9d9d9; 585 border-top: 1px solid #d9d9d9;
572 586
573 .box_left { 587 .box_left {
574 width: 240px; 588 width: 200px;
575 height: 100%; 589 height: 100%;
576 border-right: 1px solid #d9d9d9; 590 border-right: 1px solid #d9d9d9;
577 591
...@@ -590,7 +604,7 @@ onBeforeMount(() => { ...@@ -590,7 +604,7 @@ onBeforeMount(() => {
590 } 604 }
591 605
592 .box_right { 606 .box_right {
593 width: calc(100% - 240px); 607 width: calc(100% - 200px);
594 padding-top: 8px; 608 padding-top: 8px;
595 609
596 .el-breadcrumb { 610 .el-breadcrumb {
...@@ -601,15 +615,32 @@ onBeforeMount(() => { ...@@ -601,15 +615,32 @@ onBeforeMount(() => {
601 } 615 }
602 616
603 :deep(#id-approveInfo) { 617 :deep(#id-approveInfo) {
604 height: calc(100% - 192px); 618 height: auto;
619 transition: height 0.3s;
605 620
606 .el-card__body { 621 .el-card__body {
607 height: calc(100% - 50px) !important; 622 height: 0 !important;
623 transition: none;
608 624
609 .card-body-content { 625 .card-body-content {
610 height: 100%; 626 height: 100%;
611 } 627 }
612 } 628 }
629
630 &.full {
631 flex: 1;
632 margin-bottom: 16px;
633
634 .el-card__body {
635 height: calc(100% - 50px) !important;
636
637 .card-body-content {
638 height: 100%;
639 }
640 }
641 }
642
643
613 } 644 }
614 645
615 .table_panel_wrap { 646 .table_panel_wrap {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!