Newer
Older
xc-business-system / src / views / quality / template / index.vue
liyaguang on 19 Oct 2023 2 KB feat(*): 模板管理页面
<!-- 模板管理列表 -->
<script name="TemplateList" lang="ts" setup>
import type { TableColumn } from '@/components/NormalTable/table_interface'
const columns = ref<TableColumn[]>([
  { text: '模板标识', value: 'flag', align: 'center' },
  { text: '模板名称', value: 'name', align: 'center' },
  { text: '更新人', value: 'user', align: 'center' },
  { text: '更新时间', value: 'time', align: 'center' },
])
const tableList = ref([
  {
    flag: '计量模板',
    name: '计量文件模板',
    user: '张三',
    time: '2023-03-01',
  },
])
const loadingTable = ref(false)
const searchList = () => {

}
const clearList = () => {

}
const $router = useRouter()
const handler = (type: string, row: any) => {
  $router.push({
    path: `/templatelist/${type}`,
  })
}
</script>

<template>
  <app-container>
    <search-area :need-clear="true" @search="searchList" @clear="clearList">
      <search-item>
        <el-input placeholder="模板名称" />
      </search-item>
    </search-area>

    <table-container>
      <!-- <template #btns-right>
        <icon-button icon="icon-add" title="新建" type="primary" />
        <icon-button icon="icon-export" title="导出" type="primary" />
      </template> -->
      <normal-table
        :data="tableList" :columns="columns" :list-loading="loadingTable"
        :is-showmulti-select="false" :is-multi="true" :pagination="false"
      >
        <template #preColumns>
          <el-table-column label="序号" width="55" align="center">
            <template #default="scope">
              {{ scope.$index + 1 }}
            </template>
          </el-table-column>
        </template>
        <template #columns>
          <el-table-column
            label="操作"
            align="center"
            fixed="right"
            width="120"
          >
            <template #default="{ row }">
              <el-button
                size="small"
                type="primary"
                link
                @click="handler('update', row)"
              >
                编辑
              </el-button>
              <el-button
                size="small"
                type="primary"
                link
                @click="handler('detail', row)"
              >
                详情
              </el-button>
            </template>
          </el-table-column>
        </template>
      </normal-table>
    </table-container>
  </app-container>
</template>