diff --git a/src/views/system/area/listArea.vue b/src/views/system/area/listArea.vue
index 192c08c..38fd8ae 100644
--- a/src/views/system/area/listArea.vue
+++ b/src/views/system/area/listArea.vue
@@ -5,7 +5,8 @@
import { Plus } from '@element-plus/icons-vue'
import type { IlistQuery } from './area-interface'
import EditArea from './editArea.vue'
-import { delArea, getAreaListPage } from '@/api/system/area'
+import { toTreeList } from '@/utils/structure'
+import { delArea, getAreaByPid, getAreaListPage } from '@/api/system/area'
import type { TableColumn } from '@/components/NormalTable/table_interface'
enum Perm {
@@ -18,7 +19,7 @@
const listQuery: IlistQuery = reactive({
keywords: '',
offset: 1,
- limit: 20,
+ limit: 1,
sort: '',
order: '',
}) // 筛选条件
@@ -41,24 +42,19 @@
})
// 获取区域数据
-const fetchData = (isNowPage: boolean) => {
+const fetchData = () => {
listLoading.value = true
- if (!isNowPage) { // 是否显示当前页,否则跳转第一页
- listQuery.offset = 1
- }
- getAreaListPage(listQuery).then((response) => {
- if (response.code === 200) {
- list.value = response.data.rows
- total.value = parseInt(response.data.total)
- listLoading.value = false
- }
+ getAreaByPid('0').then((res) => {
+ list.value = res.data.map((item: any) => ({ ...item, hasChildren: true }))
+ list.value = toTreeList(list.value)
+ listLoading.value = false
})
}
-fetchData(true)// 获取数据
+fetchData()// 获取数据
onActivated(() => {
- fetchData(true)// 获取数据
+ fetchData()// 获取数据
})
// 新增区域
@@ -90,7 +86,7 @@
message: '删除成功',
type: 'success',
})
- fetchData(true)
+ fetchData()
}
})
})
@@ -98,7 +94,12 @@
// 查询数据
const search = () => {
- fetchData(false)
+ listLoading.value = true
+ getAreaListPage(listQuery).then((res) => {
+ list.value = res.data.rows.map((item: any) => ({ ...item, hasChildren: true }))
+ list.value = toTreeList(list.value)
+ listLoading.value = false
+ })
}
// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写
const changePage = (val: { size: number; page: number }) => {
@@ -108,14 +109,25 @@
if (val && val.page) {
listQuery.offset = val.page
}
- fetchData(true)
+ fetchData()
+}
+const load = (
+ row: any,
+ treeNode: unknown,
+ resolve: (date: any[]) => void,
+) => {
+ getAreaByPid(row.id).then((res) => {
+ console.log(res.data, 'res.data')
+ const data = res.data.map((item: any) => ({ ...item, hasChildren: item.level < 4 }))
+ resolve(data)
+ })
}
-
+
@@ -124,21 +136,19 @@
-
-
-
-
-
-
- 修改
-
-
- 删除
-
-
-
-
-
+
+
+
+
+
+ 修改
+
+
+ 删除
+
+
+
+
diff --git a/src/views/system/area/listArea.vue b/src/views/system/area/listArea.vue
index 192c08c..38fd8ae 100644
--- a/src/views/system/area/listArea.vue
+++ b/src/views/system/area/listArea.vue
@@ -5,7 +5,8 @@
import { Plus } from '@element-plus/icons-vue'
import type { IlistQuery } from './area-interface'
import EditArea from './editArea.vue'
-import { delArea, getAreaListPage } from '@/api/system/area'
+import { toTreeList } from '@/utils/structure'
+import { delArea, getAreaByPid, getAreaListPage } from '@/api/system/area'
import type { TableColumn } from '@/components/NormalTable/table_interface'
enum Perm {
@@ -18,7 +19,7 @@
const listQuery: IlistQuery = reactive({
keywords: '',
offset: 1,
- limit: 20,
+ limit: 1,
sort: '',
order: '',
}) // 筛选条件
@@ -41,24 +42,19 @@
})
// 获取区域数据
-const fetchData = (isNowPage: boolean) => {
+const fetchData = () => {
listLoading.value = true
- if (!isNowPage) { // 是否显示当前页,否则跳转第一页
- listQuery.offset = 1
- }
- getAreaListPage(listQuery).then((response) => {
- if (response.code === 200) {
- list.value = response.data.rows
- total.value = parseInt(response.data.total)
- listLoading.value = false
- }
+ getAreaByPid('0').then((res) => {
+ list.value = res.data.map((item: any) => ({ ...item, hasChildren: true }))
+ list.value = toTreeList(list.value)
+ listLoading.value = false
})
}
-fetchData(true)// 获取数据
+fetchData()// 获取数据
onActivated(() => {
- fetchData(true)// 获取数据
+ fetchData()// 获取数据
})
// 新增区域
@@ -90,7 +86,7 @@
message: '删除成功',
type: 'success',
})
- fetchData(true)
+ fetchData()
}
})
})
@@ -98,7 +94,12 @@
// 查询数据
const search = () => {
- fetchData(false)
+ listLoading.value = true
+ getAreaListPage(listQuery).then((res) => {
+ list.value = res.data.rows.map((item: any) => ({ ...item, hasChildren: true }))
+ list.value = toTreeList(list.value)
+ listLoading.value = false
+ })
}
// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写
const changePage = (val: { size: number; page: number }) => {
@@ -108,14 +109,25 @@
if (val && val.page) {
listQuery.offset = val.page
}
- fetchData(true)
+ fetchData()
+}
+const load = (
+ row: any,
+ treeNode: unknown,
+ resolve: (date: any[]) => void,
+) => {
+ getAreaByPid(row.id).then((res) => {
+ console.log(res.data, 'res.data')
+ const data = res.data.map((item: any) => ({ ...item, hasChildren: item.level < 4 }))
+ resolve(data)
+ })
}
-
+
@@ -124,21 +136,19 @@
-
-
-
-
-
-
- 修改
-
-
- 删除
-
-
-
-
-
+
+
+
+
+
+ 修改
+
+
+ 删除
+
+
+
+
diff --git a/src/views/system/tool/certificate/certificate.vue b/src/views/system/tool/certificate/certificate.vue
index 362637c..d5d597a 100644
--- a/src/views/system/tool/certificate/certificate.vue
+++ b/src/views/system/tool/certificate/certificate.vue
@@ -6,7 +6,7 @@
import type { templateType, typeofSign } from '../tool_interface'
import addDDialog from './addDDialog.vue'
import { printJSON } from '@/utils/printUtils'
-import { templateDelete, templateExport, templatePage } from '@/api/system/tool'
+import { getPhotoUrl, templateDelete, templateExport, templatePage } from '@/api/system/tool'
import { getDictByCode } from '@/api/system/dict'
// import { exportExcel } from '@/utils/exportXlsx'
import { exportFile } from '@/utils/exportUtils'
@@ -135,8 +135,14 @@
})
}
// 下载
+const fileUrl = ref('')
+const downRef = ref()
const exportSele = (row: templateType) => {
- // 下载模板
+ getPhotoUrl(row.minioFileName).then((res) => {
+ fileUrl.value = res.data
+ downRef.value.click()
+ })
+// 下载模板
}
// 表格被选中的行
const selectList = ref([])
@@ -262,6 +268,12 @@
删除
+
+
diff --git a/src/views/system/area/listArea.vue b/src/views/system/area/listArea.vue
index 192c08c..38fd8ae 100644
--- a/src/views/system/area/listArea.vue
+++ b/src/views/system/area/listArea.vue
@@ -5,7 +5,8 @@
import { Plus } from '@element-plus/icons-vue'
import type { IlistQuery } from './area-interface'
import EditArea from './editArea.vue'
-import { delArea, getAreaListPage } from '@/api/system/area'
+import { toTreeList } from '@/utils/structure'
+import { delArea, getAreaByPid, getAreaListPage } from '@/api/system/area'
import type { TableColumn } from '@/components/NormalTable/table_interface'
enum Perm {
@@ -18,7 +19,7 @@
const listQuery: IlistQuery = reactive({
keywords: '',
offset: 1,
- limit: 20,
+ limit: 1,
sort: '',
order: '',
}) // 筛选条件
@@ -41,24 +42,19 @@
})
// 获取区域数据
-const fetchData = (isNowPage: boolean) => {
+const fetchData = () => {
listLoading.value = true
- if (!isNowPage) { // 是否显示当前页,否则跳转第一页
- listQuery.offset = 1
- }
- getAreaListPage(listQuery).then((response) => {
- if (response.code === 200) {
- list.value = response.data.rows
- total.value = parseInt(response.data.total)
- listLoading.value = false
- }
+ getAreaByPid('0').then((res) => {
+ list.value = res.data.map((item: any) => ({ ...item, hasChildren: true }))
+ list.value = toTreeList(list.value)
+ listLoading.value = false
})
}
-fetchData(true)// 获取数据
+fetchData()// 获取数据
onActivated(() => {
- fetchData(true)// 获取数据
+ fetchData()// 获取数据
})
// 新增区域
@@ -90,7 +86,7 @@
message: '删除成功',
type: 'success',
})
- fetchData(true)
+ fetchData()
}
})
})
@@ -98,7 +94,12 @@
// 查询数据
const search = () => {
- fetchData(false)
+ listLoading.value = true
+ getAreaListPage(listQuery).then((res) => {
+ list.value = res.data.rows.map((item: any) => ({ ...item, hasChildren: true }))
+ list.value = toTreeList(list.value)
+ listLoading.value = false
+ })
}
// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写
const changePage = (val: { size: number; page: number }) => {
@@ -108,14 +109,25 @@
if (val && val.page) {
listQuery.offset = val.page
}
- fetchData(true)
+ fetchData()
+}
+const load = (
+ row: any,
+ treeNode: unknown,
+ resolve: (date: any[]) => void,
+) => {
+ getAreaByPid(row.id).then((res) => {
+ console.log(res.data, 'res.data')
+ const data = res.data.map((item: any) => ({ ...item, hasChildren: item.level < 4 }))
+ resolve(data)
+ })
}
-
+
@@ -124,21 +136,19 @@
-
-
-
-
-
-
- 修改
-
-
- 删除
-
-
-
-
-
+
+
+
+
+
+ 修改
+
+
+ 删除
+
+
+
+
diff --git a/src/views/system/tool/certificate/certificate.vue b/src/views/system/tool/certificate/certificate.vue
index 362637c..d5d597a 100644
--- a/src/views/system/tool/certificate/certificate.vue
+++ b/src/views/system/tool/certificate/certificate.vue
@@ -6,7 +6,7 @@
import type { templateType, typeofSign } from '../tool_interface'
import addDDialog from './addDDialog.vue'
import { printJSON } from '@/utils/printUtils'
-import { templateDelete, templateExport, templatePage } from '@/api/system/tool'
+import { getPhotoUrl, templateDelete, templateExport, templatePage } from '@/api/system/tool'
import { getDictByCode } from '@/api/system/dict'
// import { exportExcel } from '@/utils/exportXlsx'
import { exportFile } from '@/utils/exportUtils'
@@ -135,8 +135,14 @@
})
}
// 下载
+const fileUrl = ref('')
+const downRef = ref()
const exportSele = (row: templateType) => {
- // 下载模板
+ getPhotoUrl(row.minioFileName).then((res) => {
+ fileUrl.value = res.data
+ downRef.value.click()
+ })
+// 下载模板
}
// 表格被选中的行
const selectList = ref([])
@@ -262,6 +268,12 @@
删除
+
+
diff --git a/src/views/system/tool/document/document.vue b/src/views/system/tool/document/document.vue
index dc258ed..6cb2d55 100644
--- a/src/views/system/tool/document/document.vue
+++ b/src/views/system/tool/document/document.vue
@@ -5,8 +5,8 @@
// import tableHeader from '../../notice/tableHeader.vue'
import type { templateType, typeofSign } from '../tool_interface'
import addDDialog from './addDDialog.vue'
+import { getPhotoUrl, templateDelete, templateExport, templatePage } from '@/api/system/tool'
import { printJSON } from '@/utils/printUtils'
-import { templateDelete, templateExport, templatePage } from '@/api/system/tool'
import { getDictByCode } from '@/api/system/dict'
import { exportFile } from '@/utils/exportUtils'
const { proxy } = getCurrentInstance() as any
@@ -133,7 +133,13 @@
})
}
// 下载
+const fileUrl = ref('')
+const downRef = ref()
const exportSele = (row: templateType) => {
+ getPhotoUrl(row.minioFileName).then((res) => {
+ fileUrl.value = res.data
+ downRef.value.click()
+ })
// 下载模板
}
// 表格被选中的行
@@ -263,6 +269,12 @@
删除
+
+