|
@@ -1,92 +0,0 @@
|
|
|
-<script setup lang="ts">
|
|
|
|
|
-import { Plus } from '@element-plus/icons-vue'
|
|
|
|
|
-import { ElButton, ElDialog, ElEmpty, ElInput, ElMessage, ElOption, ElPagination, ElSelect, ElTable, ElTableColumn, ElTag } from 'element-plus'
|
|
|
|
|
-
|
|
|
|
|
-import { fetchModel } from '@/api/modules/model'
|
|
|
|
|
-import EditForm from './components/EditForm.vue'
|
|
|
|
|
-type TTipsItem = {
|
|
|
|
|
- text: string,
|
|
|
|
|
- id: string,
|
|
|
|
|
- sort: number,
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const tableRef = ref()
|
|
|
|
|
-const loading = ref(false)
|
|
|
|
|
-const dialogVisible = ref(false)
|
|
|
|
|
-const currentText = ref<{id?: string, text: string}|null>()
|
|
|
|
|
-
|
|
|
|
|
-const dataList = ref<TTipsItem[]>([]);
|
|
|
|
|
-const input = ref<string[]>(['tag1', 'tag2', 'tag3'])
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-async function fetchData() {
|
|
|
|
|
- // loading.value = true
|
|
|
|
|
- // const res = await fetchModel()
|
|
|
|
|
- // console.log(res, 'res')
|
|
|
|
|
- // if(res.code === 0){
|
|
|
|
|
- // dataList.value = res.data.content
|
|
|
|
|
- // console.log(dataList.value, 'dataList')
|
|
|
|
|
- // pagination.value.total = res.data.total
|
|
|
|
|
- // }
|
|
|
|
|
- // loading.value = false
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-function handleDelete (row: TModel) {
|
|
|
|
|
- console.log(row, 'delete')
|
|
|
|
|
- ElMessage.info('查看功能待开发')
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const handleCreate = ()=> {
|
|
|
|
|
- dialogVisible.value = true
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-onMounted(async () => {
|
|
|
|
|
- await fetchData()
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-</script>
|
|
|
|
|
-
|
|
|
|
|
-<template>
|
|
|
|
|
- <div class="absolute-container">
|
|
|
|
|
- <FaPageHeader title="全局提示词" />
|
|
|
|
|
- <FaPageMain class="flex-1 overflow-auto" main-class="flex-1 flex flex-col overflow-auto">
|
|
|
|
|
- <el-input-tag v-model="input" draggable placeholder="Please input" />
|
|
|
|
|
- <!-- <div class="pb-4">
|
|
|
|
|
- <ElSpace>
|
|
|
|
|
- <ElButton type="primary" :icon="Plus" @click="handleCreate">添加提示词</ElButton>
|
|
|
|
|
- </ElSpace>
|
|
|
|
|
- </div>
|
|
|
|
|
- <ElTable
|
|
|
|
|
- v-loading="loading"
|
|
|
|
|
- ref="tableRef" :data="dataList" stripe highlight-current-row border height="100%"
|
|
|
|
|
- >
|
|
|
|
|
- <ElTableColumn label="sort" prop="sort" width="80" />
|
|
|
|
|
- <ElTableColumn label="id" prop="id" width="140" />
|
|
|
|
|
- <ElTableColumn label="Text" prop="text" min-width="240" />
|
|
|
|
|
- <ElTableColumn fixed="right" label="操作" min-width="200">
|
|
|
|
|
- <template #default="{row}">
|
|
|
|
|
- <ElPopconfirm title="确定删除吗?" @confirm="handleDelete(row)">
|
|
|
|
|
- <template #reference>
|
|
|
|
|
- <ElButton link type="danger" size="small">
|
|
|
|
|
- 删除
|
|
|
|
|
- </ElButton>
|
|
|
|
|
- </template>
|
|
|
|
|
- </ElPopconfirm>
|
|
|
|
|
- </template>
|
|
|
|
|
- </ElTableColumn>
|
|
|
|
|
- </ElTable> -->
|
|
|
|
|
- </FaPageMain>
|
|
|
|
|
- <!-- <EditForm v-model:visible="dialogVisible" v-model="currentText" @refresh="()=> {}" ></EditForm> -->
|
|
|
|
|
- </div>
|
|
|
|
|
-</template>
|
|
|
|
|
-<style scoped>
|
|
|
|
|
-.absolute-container {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
-}
|
|
|
|
|
-</style>
|
|
|