Browse Source

修改文件

ZaiZai 9 months ago
parent
commit
3447cc9bdc
3 changed files with 172 additions and 4 deletions
  1. 40 0
      src/api/modules/exctab/exceltab.js
  2. 19 4
      src/router/modules/base.js
  3. 113 0
      src/views/exctab/exceltab.vue

+ 40 - 0
src/api/modules/exctab/exceltab.js

@@ -0,0 +1,40 @@
+import { HcApi } from '../../request/index'
+
+export default {
+    async page(form) {
+        return HcApi({
+            url: '/api/blade-manager/exceltab/page',
+            method: 'get',
+            params: form,
+        })
+    },
+    //详情
+    async detail(id) {
+        return HcApi({
+            url: '/api/blade-user/detail',
+            method: 'get',
+            params: { id },
+        })
+    },
+    async add(form) {
+        return HcApi({
+            url: '/api/blade-user/submit2',
+            method: 'post',
+            data: form,
+        })
+    },
+    async up(form) {
+        return HcApi({
+            url: '/api/blade-user/update2',
+            method: 'post',
+            data: form,
+        })
+    },
+    async del(ids) {
+        return HcApi({
+            url: '/api/blade-user/remove',
+            method: 'post',
+            params: { ids },
+        })
+    },
+}

+ 19 - 4
src/router/modules/base.js

@@ -40,17 +40,32 @@ export default [
         meta: { title: '项目管理' },
         component: Layout,
         children: [
+            {
+                path: '/manager/projectinfo/archivetreeconfig',
+                name: 'projectinfo_archivetreeconfig',
+                meta: { title: '项目归档树' },
+                component: () => import('~src/views/project/tree.vue'),
+            },
             {
                 path: '/manager/projectinfo/list',
                 name: 'projectinfo/list',
                 meta: { title: '项目列表' },
                 component: () => import('~src/views/project/list.vue'),
             },
+        ],
+    },
+    {
+        path: '/excel',
+        name: 'excel',
+        redirect: '/exctab/exceltab',
+        meta: { title: '表单管理' },
+        component: Layout,
+        children: [
             {
-                path: '/manager/projectinfo/archivetreeconfig',
-                name: 'projectinfo_archivetreeconfig',
-                meta: { title: '项目归档树' },
-                component: () => import('~src/views/project/tree.vue'),
+                path: '/exctab/exceltab',
+                name: 'exceltab',
+                meta: { title: '清表列表' },
+                component: () => import('~src/views/exctab/exceltab.vue'),
             },
         ],
     },

+ 113 - 0
src/views/exctab/exceltab.vue

@@ -0,0 +1,113 @@
+<template>
+    <hc-card>
+        <template #header>
+            <div class="w-60">
+                <hc-search-input v-model="searchForm.name" placeholder="请输入模板名称" @search="searchClick" />
+            </div>
+        </template>
+        <template #extra>
+            <el-button hc-btn type="primary" @click="addClick">新增</el-button>
+            <el-button hc-btn type="danger" @click="delClick">删除</el-button>
+        </template>
+        <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" :index-style="{ width: 60 }">
+            <template #action="{ row }">
+                <el-link type="warning" @click="editRowClick(row)">修改</el-link>
+                <el-link v-del-com:[delRowClick]="row" type="danger">删除</el-link>
+                <el-link type="primary">清表模板</el-link>
+                <el-link type="primary">元素识别</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 { getDictionaryData } from '~uti/tools'
+import mainApi from '~api/exctab/exceltab'
+
+//激活
+onActivated(() => {
+    searchForm.value.current = 1
+    tableTemplateType()
+    searchClick()
+})
+
+//获取模板类型
+const tableTempType = ref([])
+const tableTemplateType = async () => {
+    tableTempType.value = await getDictionaryData('table_template_type', true)
+    console.log(tableTempType.value)
+}
+const getTableTempTypeName = (key) => {
+    return tableTempType.value.find(item => item.dictKey === key)?.dictValue
+}
+
+
+//搜索表单
+const searchForm = ref({ parentId: 0, current: 1, size: 30, total: 0 })
+
+//搜索
+const searchClick = () => {
+    searchForm.value.current = 1
+    getTableData()
+}
+
+//分页
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
+
+//表格数据
+const tableColumn = ref([
+    { key: 'name', name: '模板名称' },
+    { key: 'tableTemplateType', name: '模板类型', width: 120, align: 'center' },
+    { key: 'tabCout', name: '表数量', width: 100, align: 'center' },
+    { key: 'createTime', name: '创建时间', width: 180, align: 'center' },
+    { key: 'action', name: '操作', width: 220, align: 'center' },
+])
+
+//获取表格数据
+const tableLoading = ref(false)
+const tableData = ref([{}])
+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 addClick = () => {
+
+}
+
+//批量删除
+const delClick = () => {
+
+}
+
+//修改
+const editRowClick = (row) => {
+
+}
+
+//单个删除
+const delRowClick = async ({ item }, resolve) => {
+
+}
+</script>
+
+<style lang="scss">
+
+</style>