465c4e8e by xukangle

fix: 分类分级查询

1 parent 23cc819c
...@@ -34,6 +34,8 @@ import { getLabelList } from "@/api/modules/dataLabel"; ...@@ -34,6 +34,8 @@ import { getLabelList } from "@/api/modules/dataLabel";
34 const currentPath = ref<string[]>([]); 34 const currentPath = ref<string[]>([]);
35 const { proxy } = getCurrentInstance() as any; 35 const { proxy } = getCurrentInstance() as any;
36 const route = useRoute(); 36 const route = useRoute();
37 // 分级引用refGradeGuid
38 const refGradeGuid = ref('');
37 // 分级分类树形列表 39 // 分级分类树形列表
38 const CgDirTreeList = ref(); 40 const CgDirTreeList = ref();
39 const getCgDirTreeData = async () => { 41 const getCgDirTreeData = async () => {
...@@ -49,6 +51,7 @@ const getCgDirTreeData = async () => { ...@@ -49,6 +51,7 @@ const getCgDirTreeData = async () => {
49 treeInfo.value.expandedKey.push(res.data[0].classifyDetailGuid); 51 treeInfo.value.expandedKey.push(res.data[0].classifyDetailGuid);
50 treeInfo.value.currentNodeKey = res.data[0].classifyDetailGuid; 52 treeInfo.value.currentNodeKey = res.data[0].classifyDetailGuid;
51 searchItemList.value[1].options = res.data; 53 searchItemList.value[1].options = res.data;
54 refGradeGuid.value = res.data[0].refGradeGuid;
52 treeInfo.value.loading = false; 55 treeInfo.value.loading = false;
53 } else { 56 } else {
54 proxy.$ElMessage.error(res.msg); 57 proxy.$ElMessage.error(res.msg);
...@@ -117,6 +120,7 @@ onMounted(async () => { ...@@ -117,6 +120,7 @@ onMounted(async () => {
117 getDictionaryList(); 120 getDictionaryList();
118 getSearchTableList(); 121 getSearchTableList();
119 getLabelListData(); 122 getLabelListData();
123 getGradeData(refGradeGuid.value);
120 124
121 }) 125 })
122 126
...@@ -159,7 +163,7 @@ const searchItemList = ref([ ...@@ -159,7 +163,7 @@ const searchItemList = ref([
159 options: [], 163 options: [],
160 props: { 164 props: {
161 label: 'label', 165 label: 'label',
162 value: 'label', 166 value: 'guid',
163 }, 167 },
164 clearable: true, 168 clearable: true,
165 filterable: true, 169 filterable: true,
...@@ -176,7 +180,7 @@ const searchItemList = ref([ ...@@ -176,7 +180,7 @@ const searchItemList = ref([
176 lazy: false, 180 lazy: false,
177 props: { 181 props: {
178 label: "classifyName", 182 label: "classifyName",
179 value: "classifyName", 183 value: "guid",
180 }, 184 },
181 block: false, 185 block: false,
182 filterable: false, 186 filterable: false,
...@@ -192,7 +196,7 @@ const searchItemList = ref([ ...@@ -192,7 +196,7 @@ const searchItemList = ref([
192 options: [], 196 options: [],
193 props: { 197 props: {
194 label: 'name', 198 label: 'name',
195 value: 'name', 199 value: 'guid',
196 }, 200 },
197 clearable: true, 201 clearable: true,
198 }, 202 },
...@@ -216,7 +220,7 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -216,7 +220,7 @@ const toSearch = (val: any, clear: boolean = false) => {
216 execGuid: execGuidInfo.value.execGuid, 220 execGuid: execGuidInfo.value.execGuid,
217 classifyDetail: val.classifyName, 221 classifyDetail: val.classifyName,
218 gradeDetailGuid: val.levelName, 222 gradeDetailGuid: val.levelName,
219 label: val.labelName, 223 labelGuid: val.labelName,
220 databaseGuid: selectedA.value, 224 databaseGuid: selectedA.value,
221 tableGuid: selectedB.value, 225 tableGuid: selectedB.value,
222 fieldGuid: selectedC.value, 226 fieldGuid: selectedC.value,
...@@ -253,7 +257,7 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -253,7 +257,7 @@ const toSearch = (val: any, clear: boolean = false) => {
253 const nodeClick = async (data: any) => { 257 const nodeClick = async (data: any) => {
254 console.log('nodeClick', data); 258 console.log('nodeClick', data);
255 const { guid, classifyDetailGuid, refGradeGuid } = data 259 const { guid, classifyDetailGuid, refGradeGuid } = data
256 getGradeData(refGradeGuid); 260 // getGradeData(refGradeGuid);
257 searchItemList.value[1].default = data.classifyName; 261 searchItemList.value[1].default = data.classifyName;
258 await getCgDirFieldPage({ 262 await getCgDirFieldPage({
259 execGuid: execGuidInfo.value.execGuid, 263 execGuid: execGuidInfo.value.execGuid,
...@@ -1264,7 +1268,7 @@ const exportDB = async () => { ...@@ -1264,7 +1268,7 @@ const exportDB = async () => {
1264 // 分类选择 1268 // 分类选择
1265 const treeSelectNodeChange = (node, item) => { 1269 const treeSelectNodeChange = (node, item) => {
1266 const { refGradeGuid } = node; 1270 const { refGradeGuid } = node;
1267 getGradeData(refGradeGuid); 1271 // getGradeData(refGradeGuid);
1268 } 1272 }
1269 1273
1270 // 这里应该是onActivated 钩子,路由从configure-路由从configure-rules跳转过来要重新请求数据、 1274 // 这里应该是onActivated 钩子,路由从configure-路由从configure-rules跳转过来要重新请求数据、
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!