ZaiZai 1 năm trước cách đây
mục cha
commit
21fc976d40

+ 12 - 0
src/api/modules/project/tree.js

@@ -0,0 +1,12 @@
+import { HcApi } from '../../request/index'
+
+export default {
+    //分页
+    async page(form) {
+        return HcApi({
+            url: '/api/blade-manager/projectInfo/list',
+            method: 'get',
+            params: form,
+        })
+    },
+}

+ 2 - 2
src/views/project/list.vue

@@ -47,8 +47,8 @@
 <script setup>
 import { nextTick, onActivated, ref } from 'vue'
 import { getArrValue, getObjValue } from 'js-fast-way'
-import InfoDialog from './modules/list/info-dialog.vue'
-import HcWbsTree from './modules/list/wbs-tree.vue'
+import InfoDialog from './list/info-dialog.vue'
+import HcWbsTree from './list/wbs-tree.vue'
 import mainApi from '~api/project/project'
 
 defineOptions({

+ 0 - 0
src/views/project/modules/list/info-dialog.vue → src/views/project/list/info-dialog.vue


+ 0 - 0
src/views/project/modules/list/tree-node-edit.vue → src/views/project/list/tree-node-edit.vue


+ 0 - 0
src/views/project/modules/list/wbs-tree.vue → src/views/project/list/wbs-tree.vue


+ 58 - 4
src/views/project/tree.vue

@@ -1,13 +1,67 @@
 <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>
 
 <script setup>
+import { onActivated, ref } from 'vue'
+import { getArrValue } from 'js-fast-way'
+import mainApi from '~api/project/tree'
+
 defineOptions({
     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>