|
@@ -1,13 +1,67 @@
|
|
<template>
|
|
<template>
|
|
- <div>项目树</div>
|
|
|
|
|
|
+ <hc-card>
|
|
|
|
+ <template #header>
|
|
|
|
+ <el-alert title="可独立修改私有项目的归档规则,不会影响其他项目归档规则" type="warning" :closable="false" />
|
|
|
|
+ </template>
|
|
|
|
+ <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" :index-style="{ width: 60 }">
|
|
|
|
+ <template #action="{ row }">
|
|
|
|
+ <el-link type="primary" @click="tableRowClick(row)">配置规则</el-link>
|
|
|
|
+ </template>
|
|
|
|
+ </hc-table>
|
|
|
|
+ <template #action>
|
|
|
|
+ <hc-pages :pages="searchForm" @change="pageChange" />
|
|
|
|
+ </template>
|
|
|
|
+ </hc-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
+import { onActivated, ref } from 'vue'
|
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
|
+import mainApi from '~api/project/tree'
|
|
|
|
+
|
|
defineOptions({
|
|
defineOptions({
|
|
name: 'ProjectTree',
|
|
name: 'ProjectTree',
|
|
})
|
|
})
|
|
-</script>
|
|
|
|
|
|
|
|
-<style scoped lang="scss">
|
|
|
|
|
|
+//激活
|
|
|
|
+onActivated(() => {
|
|
|
|
+ searchForm.value.current = 1
|
|
|
|
+ getTableData()
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+//搜索条件
|
|
|
|
+const searchForm = ref({ projectId: '', current: 1, size: 20, total: 0 })
|
|
|
|
|
|
-</style>
|
|
|
|
|
|
+//分页
|
|
|
|
+const pageChange = ({ current, size }) => {
|
|
|
|
+ searchForm.value.current = current
|
|
|
|
+ searchForm.value.size = size
|
|
|
|
+ getTableData()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//表格数据
|
|
|
|
+const tableColumn = ref([
|
|
|
|
+ { key: 'projectName', name: '项目名称' },
|
|
|
|
+ { key: 'action', name: '操作', width: 100, align: 'center' },
|
|
|
|
+])
|
|
|
|
+const tableData = ref([])
|
|
|
|
+
|
|
|
|
+//获取表格数据
|
|
|
|
+const tableLoading = ref(false)
|
|
|
|
+const getTableData = async () => {
|
|
|
|
+ tableData.value = []
|
|
|
|
+ tableLoading.value = true
|
|
|
|
+ const { data } = await mainApi.page({
|
|
|
|
+ ...searchForm.value,
|
|
|
|
+ total: null,
|
|
|
|
+ })
|
|
|
|
+ tableLoading.value = false
|
|
|
|
+ tableData.value = getArrValue(data?.records)
|
|
|
|
+ searchForm.value.total = data?.total ?? 0
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//配置规则
|
|
|
|
+const tableRowClick = (row) => {
|
|
|
|
+ console.log(row)
|
|
|
|
+}
|
|
|
|
+</script>
|