|
@@ -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>
|