Browse Source

标签管理、更新日志配置

chenlei 3 months ago
parent
commit
fb5858331e

+ 3 - 1
src/api/system/index.js

@@ -1,10 +1,12 @@
 import apiSystemSet from './set'
 import apiSystemCommon from './common'
 import apiSystemHelpCenter from './helpCenter'
+import apiSystemUpdateLog from './updateLog'
 
 export {
     apiSystemSet,
     apiSystemCommon,
-    apiSystemHelpCenter
+    apiSystemHelpCenter,
+    apiSystemUpdateLog
 }
 

+ 42 - 0
src/api/system/updateLog.js

@@ -0,0 +1,42 @@
+/* ETA版本更新日志api */
+import {get,post} from '@/api/index'
+
+export default{
+    /**
+     * 版本更新日志列表
+     * @param Keyword String
+     * @param SortType  Number
+     * @param PageSize Number
+     * @param CurrentIndex Number
+     * @param {*} params 
+     */
+    getLogList:(params)=>{
+        return get('/eta_version_update_log/page_list',params)
+    },
+    /**
+     * 新增更新日志
+     * @param Version String
+     * @param Content String
+     * @param UpdateDate String
+     */
+    addLogData:(params)=>{
+        return post('/eta_version_update_log/add',params)
+    },
+    /**
+     * 编辑更新日志
+     * @param Id Number 
+     * @param Version String
+     * @param Content String
+     * @param UpdateDate String
+     */
+    editLogData:(params)=>{
+        return post('/eta_version_update_log/edit',params)
+    },
+    /**
+     * 删除更新日志
+     * @param Id Number
+     */
+    deleteLogData:(params)=>{
+        return post('/eta_version_update_log/del',params)
+    }
+}

+ 8 - 0
src/router/modules/system.js

@@ -69,6 +69,14 @@ export default[
           title:'查看文章'
         },
       },
+      {
+        path:'updateLog',
+        name:'SystemUpdateLog',
+        component:()=>import('@/views/system/updateLog.vue'),
+        meta:{
+          title:'更新日志配置'
+        },
+      },
     ]
   }
 ]

+ 140 - 0
src/views/system/components/logSetDialog.vue

@@ -0,0 +1,140 @@
+<template>
+    <t-dialog
+        :visible.sync="isLogSetShow"
+        header="添加日志"
+        @close="closeDia"
+        width="820px"
+        :footer="false"
+    >
+        <div class="log-set-wrap">
+            <t-form :data="formData" :rules="rules" inline label-width="80px" ref="logForm">
+                <t-form-item label="版本号" name="Version">
+                    <t-input v-model="formData.Version" placeholder="请输入版本号" style="width:100%"></t-input>
+                </t-form-item>
+                <t-form-item label="更新内容" name="Content" class="update-text">
+                    <div class="rich-editor-wrap" id="log-editor">
+                        <!-- <froala :id="`log-editor`"
+                            :ref="`logEditor`" 
+                            :tag="'textarea'" 
+                            :config="richEditorConfig" v-model="formData.Content">
+                        </froala> -->
+                    </div>
+                </t-form-item>
+                <t-form-item label="更新日期" name="UpdateDate">
+                    <t-date-picker
+                        v-model="formData.UpdateDate"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择日期">
+                    </t-date-picker>
+                </t-form-item>
+            </t-form>
+            <div class="btn-wrap" style="text-align: center;margin-top: 25px;">
+                <t-button plain style="width:200px;" @click="closeDia">取消</t-button>
+                <t-button theme="primary"  style="margin-left:50px;width:200px;" @click="saveLog">保存</t-button>
+            </div>
+        </div>
+    </t-dialog>
+</template>
+
+<script setup>
+import { ref, reactive, watch, defineEmits, nextTick } from 'vue';
+import { useInitFroalaEditor } from '@/hooks/useFroalaEditor'
+import _ from 'lodash';
+import moment from 'moment';
+
+const { lastFocusPosition, initFroalaEditor, frolaEditorContentChange } = useInitFroalaEditor()
+// 定义props
+const props = defineProps({
+    isLogSetShow: {
+        type: Boolean,
+        default: false
+    },
+    logInfo: {
+        type: Object,
+        default: () => ({})
+    }
+});
+
+let reportContentEditorIns = null
+// 定义响应式数据
+const formData = ref({});
+const logForm = ref(null);
+const rules = {
+    Version: [{ required: true, message: '请输入版本号', trigger: 'blur' }],
+    Content: [{ required: true, message: '请输入更新内容', trigger: 'blur' }],
+    UpdateDate: [{ required: true, message: '请选择更新日期', trigger: 'blur' }]
+}
+
+const richEditorConfig = reactive({
+    toolbarButtons: [
+        'textColor',
+        'bold',
+        'italic',
+        'underline',
+        'fontFamily',
+        'fontSize',
+        'align',
+        'outdent',
+        'indent',
+        'specialCharacters',
+        'insertHR',
+        'selectAll',
+        'clearFormatting',
+        'undo',
+        'redo',
+    ],
+    height: 220,
+    fontSizeDefaultSelection: "16",
+    quickInsertEnabled: false,
+    pasteAllowedStyleProps: ['font-family', 'font-size', 'color'],
+    language: "zh_cn",
+    placeholderText: '请输入更新内容',
+    wordPasteKeepFormatting: false,
+    pastePlain: true,
+    wordPasteModal: false,
+    pluginsEnabled: ['colors'] // 定义可用插件
+});
+
+// 监听isLogSetShow的变化
+watch(() => props.isLogSetShow, (newVal) => {
+  if (newVal) {
+    console.log(props.logInfo);
+    
+    formData.value = props.logInfo.Version ? _.cloneDeep(props.logInfo) : { Content: '', UpdateDate: moment(new Date()).format('yyyy-MM-DD') };
+    // 富文本初始化
+    const el = document.getElementById('log-editor')
+    reportContentEditorIns = initFroalaEditor('#log-editor', { height: el.offsetHeight - 80, ...richEditorConfig })
+    setTimeout(() => {
+        props.logInfo.Version ? reportContentEditorIns.html.set(props.logInfo.Content) : reportContentEditorIns.html.set('')
+    }, 10); 
+  }
+});
+
+// 定义emit事件
+const emit = defineEmits(['close', 'saveLog']);
+
+// 方法定义
+const closeDia = () => {
+    emit('close');
+};
+
+const saveLog = async () => {
+    formData.value.Content = reportContentEditorIns.html.get(true).replace(/<p data-f-id="pbf".*?<\/p>/g, "");
+    const valid = await logForm.value.validate()
+    if (valid !== true) return
+    emit('saveLog', formData.value);
+//   });
+};
+</script>
+
+<style lang="scss">
+.log-set-wrap{
+    .rich-editor-wrap{
+        width: 100%;
+    }
+}
+</style>
+<style scoped lang="scss">
+
+</style>

+ 146 - 0
src/views/system/updateLog.vue

@@ -0,0 +1,146 @@
+<template>
+    <div class="update-log-manage-wrap">
+        <div class="top-wrap">
+            <t-button theme="primary" @click="isLogSetShow=true">添加日志</t-button>
+            <t-input v-model="searchText" @input="getTableData" placeholder="输入更新内容检索" clearable style="width:240px;" @clear="getTableData">
+                <template #prefixIcon>
+                    <SearchIcon/>
+                </template>
+            </t-input>
+        </div>
+        <div class="table-wrap">
+            <t-table :data="tableData" @sort-change="sortChangeHandle" :bordered="true" :columns="tableColumns" rowKey="Id">
+                <template #Content="{ row }">
+                    <div v-html="row.Content"></div>
+                </template>
+                <template #opt="{ row }">
+                    <t-button variant="text" theme="primary" @click="handleEditLog(row)">编辑</t-button>
+                    <t-button variant="text" @click="handleDeleteLog(row)" style="color:red;">删除</t-button>
+                </template>
+            </t-table>
+            <t-pagination 
+                layout="prev,pager,next,total" 
+                background
+                :current-page="pageNo"
+                @current-change="currentChange"
+                :page-size="pageSize" 
+                :total="total"
+                >
+            </t-pagination>
+        </div>
+        <LogSetDialog 
+            :isLogSetShow="isLogSetShow"
+            :logInfo="logInfo"
+            @saveLog="saveLog"
+            @close="()=>{logInfo = {};isLogSetShow = false}"
+        />
+    </div>
+</template>
+
+
+<script setup>
+import { ref, onMounted } from 'vue';
+import LogSetDialog from './components/logSetDialog.vue';
+import { SearchIcon } from 'tdesign-icons-vue-next';
+import { apiSystemUpdateLog } from '@/api/system';
+
+// 定义响应式数据
+const searchText = ref('');
+const logInfo = ref({});
+const isLogSetShow = ref(false);
+const tableData = ref([]);
+const tableColumns = ref([
+    { title: '更新内容', colKey: 'Content', align: 'center'},
+    { title: '版本号', colKey: 'Version', align: 'center' },
+    { title: '更新日期', colKey: 'UpdateDate', sorter: true, align: 'center'},
+    { title: '操作', colKey: 'opt', align: 'center'},
+]);
+const pageNo = ref(1);
+const pageSize = ref(10);
+const total = ref(0);
+const sortType = ref(0);
+
+// 方法定义
+const getTableData = async () => {
+    const res = await apiSystemUpdateLog.getLogList({
+        Keyword: searchText.value,
+        SortType: sortType.value,
+        CurrentIndex: pageNo.value,
+        PageSize: pageSize.value,
+    });
+    if (res.Ret !== 200) return;
+    tableData.value = res.Data.List || [];
+    total.value = res.Data.Paging.Totals;
+};
+
+const currentChange = (page) => {
+    pageNo.value = page;
+    getTableData();
+};
+
+const sortChangeHandle = (params) => {
+    if (params) {
+        sortType.value = params.descending === true ? 2 : 1 ;
+    } else sortType.value = 0
+    pageNo.value = 1;
+    getTableData();
+};
+
+const handleEditLog = (row) => {
+    logInfo.value = row;
+    isLogSetShow.value = true;
+};
+
+const handleDeleteLog = async (row) => {
+    await $confirmDialog({
+        body: '删除操作不可恢复,确认删除吗?',
+        confirmBtn:{default:'确认',theme:'primary'},
+    })
+    try {
+    const res = await apiSystemUpdateLog.deleteLogData({ Id: row.Id });
+        if (res.Ret !== 200) return;
+        MessagePlugin.success('删除成功');
+        getTableData();
+    } catch (error) {
+        console.error('删除日志时出错:', error);
+    }
+};
+
+const saveLog = async (form) => {
+    const res = form.Id
+        ? await apiSystemUpdateLog.editLogData(form)
+        : await apiSystemUpdateLog.addLogData(form);
+    if (res.Ret !== 200) return;
+    MessagePlugin.success(`${form.Id ? '编辑' : '添加'}成功`);
+    getTableData();
+    isLogSetShow.value = false;
+};
+
+// 生命周期钩子
+onMounted(() => {
+    getTableData();
+});
+</script>
+
+<style scoped lang="scss">
+.update-log-manage-wrap{
+    padding:30px;
+    background-color: #fff;
+    border-radius: 4px;
+    .top-wrap{
+        display: flex;
+        justify-content: space-between;
+        .t-date-editor{
+            margin-left: auto;
+        }
+    }
+    .table-wrap{
+        margin-top: 30px;
+        .t-pagination{
+            margin-top: 30px;
+            text-align: right;
+        }
+    }
+
+}
+</style>

+ 20 - 11
src/views/training/classifyManage.vue

@@ -9,7 +9,7 @@
             </t-input>
         </div>
         <div class="table-wrap">
-            <t-enhanced-table :data="tableData" :columns="classifyColumn" rowKey="ClassifyId" :tree="{ childrenKey: 'Children' }">
+            <t-enhanced-table :data="tableData" :columns="classifyColumn" rowKey="ClassifyId" :tree="{ childrenKey: 'Children' }" :treeExpandAndFoldIcon="treeExpandIcon">
                 <template #ClassifyName="{ row }">
                     <span>{{row.ParentId?'':row.ClassifyName}}</span>
                 </template>
@@ -48,18 +48,17 @@
         </t-dialog>
     </div>
 </template>
-<script setup>
+<script setup lang="jsx">
 import { ref, onMounted, watch, computed } from 'vue';
 import { ClassifyInterface } from '@/api/modules/trainingApi';
 import { classifyTableColumn } from './config/tableColumn';
-import { SearchIcon } from 'tdesign-icons-vue-next';
+import { SearchIcon, ChevronRightIcon, ChevronDownIcon } from 'tdesign-icons-vue-next';
 import _ from 'lodash';
 
 const classifyColumn = classifyTableColumn
 // 定义响应式数据
 const searchText = ref('');
 const tableData = ref([]);
-const tableLoading = ref(false);
 const currentClassify = ref({});
 const defaultList = ref([{ ClassifyId: -1, ClassifyName: '无' }]);
 const isModifyDialogShow = ref(false);
@@ -77,6 +76,11 @@ const optionList = computed(() => {
   }));
 });
 
+const treeExpandIcon = computed(() => {
+  // 自定义展开图标
+  return treeExpandAndFoldIconRender;
+});
+
 // 监听isModifyDialogShow
 watch(isModifyDialogShow, (newVal) => {
   if (newVal) {
@@ -89,6 +93,11 @@ watch(isModifyDialogShow, (newVal) => {
 });
 
 // 方法
+
+const treeExpandAndFoldIconRender = (h, { type, row }) => {
+  return type === 'expand' ? <ChevronRightIcon /> : <ChevronDownIcon />;
+};
+
 const handleModifyClassify = (data) => {
   currentClassify.value = _.cloneDeep(data);
   if (data.ParentId === 0) {
@@ -120,15 +129,15 @@ const modifyClassify = async () => {
 
 const deleteClassify = async (data) => {
   if (data.Children && data.Children.length) {
-    await  $confirmDialog({
-        body: '该分类下已关联内容,不可删除!',
-        confirmBtn:{default:'知道了',theme:'primary'},
-        cancelBtn: null
+    await $confirmDialog({
+      body: '该分类下已关联内容,不可删除!',
+      confirmBtn:{default:'知道了',theme:'primary'},
+      cancelBtn: null
     })
   } else {
-    await  $confirmDialog({
-        body: '删除后不可恢复,是否确认删除?',
-        confirmBtn:{default:'确认',theme:'primary'},
+    await $confirmDialog({
+      body: '删除后不可恢复,是否确认删除?',
+      confirmBtn:{default:'确认',theme:'primary'},
     })
     ClassifyInterface.deleteClassify({
         ClassifyId: data.ClassifyId

+ 17 - 8
src/views/training/config/tableColumn.js

@@ -2,13 +2,15 @@ export const classifyTableColumn = [
     {
         title:'一级分类',
         colKey:'ClassifyName',
-        minWidth:'200px',
+        align: 'center'
     },{
         title:'二级分类',
         colKey:'ParentId',
+        align: 'center'
     },{
         title:'操作',
         colKey:'opt',
+        align: 'center'
     }
 ]
 
@@ -16,14 +18,19 @@ export const labelTableColumn = [
     {
         title:'标签名称',
         colKey:'TagName',
-        minWidth:'200px',
+        align: 'center'
     },{
         title:'视频数',
         colKey:'VideoTotal',
+        align: 'center'
     },{
         title:'创建时间',
         colKey:'CreateTime',
-        minWidth:'200px',
+        align: 'center'
+    },{
+        title:'操作',
+        colKey:'opt',
+        align: 'center'
     }
 ]
 
@@ -32,29 +39,31 @@ export const videoTableColumn = [
     {
         title:'视频封面',
         colKey:'CoverImg',
-        Width:'300px',
+        align: 'center'
     },{
         title:'视频名称',
         colKey:'Title',
-        minWidth:'200px'
+        align: 'center'
     },{
         title:'分类',
         colKey:'Classify',
-        Width:'200px',
+        align: 'center'
     },{
         title:'标签',
         colKey:'Tags',
-        minWidth:'200px',
+        align: 'center'
     },{
         title:'状态',
         colKey:'PublishState',
+        align: 'center'
     },{
         title:'创建时间',
         colKey:'CreateTime',
-        Width:'200px',
+        align: 'center'
     },
     {
         title:'操作',
         colKey:'opt',
+        align: 'center'
     }
 ]

+ 128 - 132
src/views/training/labelManage.vue

@@ -2,26 +2,21 @@
     <!-- 培训管理-标签管理 -->
     <div class="label-manage-wrap traing-manage">
         <div class="top-wrap">
-            <el-button type="primary" @click="handleModifyLabel({})">新增标签</el-button>
-            <el-input v-model="searchText" clearable 
-                prefix-icon="el-icon-search" placeholder="请输入标签名称" @input="handleCurrentChange(1)" 
-                style="width:240px;"></el-input>
+            <t-button theme="primary" @click="handleModifyLabel({})">新增标签</t-button>
+            <t-input v-model="searchText" clearable placeholder="请输入标签名称" @input="handleCurrentChange(1)" style="width:240px;">
+                <template #prefixIcon>
+                    <SearchIcon/>
+                </template>
+            </t-input>
         </div>
         <div class="table-wrap">
-            <el-table :data="tableData" border v-loading="tableLoading">
-                <el-table-column v-for="column in tableColumn" :key="column.key" 
-                    :label="column.label" align="center"
-                    :prop="column.key"
-                    :min-width="column.minWidth">
-                </el-table-column>
-                <el-table-column label="操作" align="center">
-                    <template slot-scope="{row}">
-                        <el-button type="text" @click="handleModifyLabel(row)">编辑</el-button>
-                        <el-button type="text" @click="deleteLabel(row)" style="color:red;">删除</el-button>
-                    </template>
-                </el-table-column>
-            </el-table>
-            <el-pagination
+            <t-table :data="tableData" :bordered="true" v-loading="tableLoading" :columns="tableColumn" rowKey="TagId">
+                <template #opt="{ row }">
+                    <t-button variant="text" theme="primary" @click="handleModifyLabel(row)">编辑</t-button>
+                    <t-button variant="text" @click="deleteLabel(row)" style="color:red;">删除</t-button>
+                </template>
+            </t-table>
+            <t-pagination
                 layout="total,prev,pager,next,jumper" 
                 background
                 :current-page="currentPage"
@@ -29,138 +24,139 @@
                 :page-size="pageSize" 
                 :total="total"
                 style="text-align:right;margin-top:30px;">
-            </el-pagination>
+            </t-pagination>
         </div>
         <!-- 添加标签弹窗 -->
-        <el-dialog
-            :title="currentLabel.TagId?'编辑标签':'添加标签'"
+        <t-dialog
+            :header="currentLabel.TagId?'编辑标签':'添加标签'"
             :visible.sync="isModifyDialogShow"
-            :close-on-click-modal="false"
-            :modal-append-to-body="false"
             @close="isModifyDialogShow=false"
             width="589px"
-            v-dialogDrag
-            center
+            :footer="false"
             >
             <div class="dialog-container">
                 <div class="input-item">
-                <el-input  placeholder="请输入标签名称" v-model.trim="currentLabel.TagName" required ></el-input>
+                <t-input placeholder="请输入标签名称" v-model.trim="currentLabel.TagName" required ></t-input>
                 </div>
                 <p class="form-hint">注:名称不得超过5个字</p>
             </div>
             <div class="foot-container">
-                <el-button @click="isModifyDialogShow=false">取 消</el-button>
-                <el-button type="primary" @click="modifyLabel">确认</el-button>
+                <t-button @click="isModifyDialogShow=false">取 消</t-button>
+                <t-button theme="primary" @click="modifyLabel">确认</t-button>
             </div>
-        </el-dialog>
+        </t-dialog>
     </div>
 </template>
 
-<script>
-import {labelTableColumn} from './config/tableColumn'
-import {TagInterface} from '@/api/modules/trainingApi'
-export default {
-    data() {
-        return {
-            /* table */
-            tableLoading:false,
-            tableData:[],
-            tableColumn:labelTableColumn,
-            searchText:'',
-            /* table-page */
-            currentPage:1,
-            pageSize:10,
-            total:0,
-            /* modify label */
-            currentLabel:{},
-            isModifyDialogShow:false,
-        };
-    },
-    methods: {
-        handleModifyLabel(data){
-            this.currentLabel = _.cloneDeep(data)
-            this.isModifyDialogShow = true
-        },
-        async modifyLabel(){
-            if(!this.currentLabel.TagName){
-                this.$message.warning("请输入标签名称")
-                return
-            }
-            if(this.currentLabel.TagName.length>5){
-                this.$message.warning("标签名称过长,请重新编辑")
-                return
-            }
-            let res = null
-            if(this.currentLabel.TagId){
-                //edit
-                res = await TagInterface.editTag({
-                    TagId:this.currentLabel.TagId,
-                    TagName:this.currentLabel.TagName
-                })
-            }else{
-                //add
-                res = await TagInterface.addTag({
-                    TagName:this.currentLabel.TagName
-                })
-            }
-            if(res.Ret!==200) return 
-            //添加/编辑成功
-            this.$message.success(`${this.currentLabel.TagId?'编辑':'添加'}成功`)
-            this.currentPage = 1
-            this.getTableData()
-            this.isModifyDialogShow = false
-        },
-        deleteLabel(label){
-            if(label.VideoTotal!==0){
-                this.$confirm('该标签已关联视频,删除失败','提示',{confirmButtonText:'知道了',showCancelButton:false,type:'error'})
-                return
-            }
-            this.$confirm(
-                '删除后不可恢复,是否确认删除该标签?',
-                '提示',
-                {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning',
-                }
-            ).then(()=>{
-                TagInterface.deleteTag({
-                    TagId:label.TagId
-                }).then(res=>{
-                    if(res.Ret!==200) return 
-                    this.$message.success('删除成功')
-                    this.currentPage=1
-                    this.getTableData()
-                })
-            }).catch(()=>{}).finally(()=>{})
-        },
-        getTableData(){
-            this.tableLoading = true
-            TagInterface.getTagList({
-                PageSize:this.pageSize,
-                CurrentIndex:this.currentPage,
-                Keyword:this.searchText
-            }).then(res=>{
-                this.tableLoading = false
-                if(res.Ret!==200) return
-                if(!res.Data){
-                    this.tableData = []
-                    this.total = 0
-                    return
-                } 
-                this.tableData = res.Data.List||[]
-                this.total = res.Data.Paging.Totals
-            })
-        },
-        handleCurrentChange(page){
-            this.currentPage = page
-            this.getTableData()
-        }
-    },
-    mounted(){
-        this.getTableData()
+<script setup>
+import { ref, reactive, onMounted } from 'vue';
+import { labelTableColumn } from './config/tableColumn';
+import { TagInterface } from '@/api/modules/trainingApi';
+import { SearchIcon } from 'tdesign-icons-vue-next';
+import _ from 'lodash';
+
+// 定义响应式数据
+const tableLoading = ref(false);
+const tableData = ref([]);
+const tableColumn = labelTableColumn;
+const searchText = ref('');
+const currentPage = ref(1);
+const pageSize = ref(10);
+const total = ref(0);
+const currentLabel = ref({});
+const isModifyDialogShow = ref(false);
+
+// handleModifyLabel 方法
+const handleModifyLabel = (data) => {
+    // currentLabel.value = 
+  currentLabel.value = _.cloneDeep(data);
+  isModifyDialogShow.value = true;
+};
+
+// modifyLabel 方法
+const modifyLabel = async () => {
+    console.log(currentLabel.value);
+    
+  if (!currentLabel.value.TagName) {
+    MessagePlugin.warning("请输入标签名称");
+    return;
+  }
+  if (currentLabel.value.TagName.length > 5) {
+    MessagePlugin.warning("标签名称过长,请重新编辑");
+    return;
+  }
+  let res = null;
+  if (currentLabel.value.TagId) {
+    // edit
+    res = await TagInterface.editTag({
+      TagId: currentLabel.value.TagId,
+      TagName: currentLabel.value.TagName
+    });
+  } else {
+    // add
+    res = await TagInterface.addTag({
+      TagName: currentLabel.value.TagName
+    });
+  }
+  if (res.Ret !== 200) return;
+  // 添加/编辑成功
+  MessagePlugin.success(`${currentLabel.value.TagId ? '编辑' : '添加'}成功`);
+  currentPage.value = 1;
+  getTableData();
+  isModifyDialogShow.value = false;
+};
+
+// deleteLabel 方法
+const deleteLabel = async (label) => {
+    if (label.VideoTotal !== 0) {
+        await  $confirmDialog({
+            body: '该标签已关联视频,删除失败',
+            confirmBtn:{default:'知道了',theme:'primary'},
+            cancelBtn: null
+        })
+        return;
     }
+    await  $confirmDialog({
+        body: '删除后不可恢复,是否确认删除该标签?',
+        confirmBtn:{default:'确认',theme:'primary'},
+    })
+    TagInterface.deleteTag({ TagId: label.TagId }).then(res => {
+        if (res.Ret !== 200) return;
+        MessagePlugin.success('删除成功');
+        currentPage.value = 1;
+        getTableData();
+    });
 };
+
+// getTableData 方法
+const getTableData = async () => {
+  tableLoading.value = true;
+  const res = await TagInterface.getTagList({
+    PageSize: pageSize.value,
+    CurrentIndex: currentPage.value,
+    Keyword: searchText.value
+  });
+  tableLoading.value = false;
+  if (res.Ret !== 200) return;
+  if (!res.Data) {
+    tableData.value = [];
+    total.value = 0;
+    return;
+  }
+  tableData.value = res.Data.List || [];
+  total.value = res.Data.Paging.Totals;
+};
+
+// handleCurrentChange 方法
+const handleCurrentChange = (page) => {
+  currentPage.value = page;
+  getTableData();
+};
+
+// 生命周期钩子
+onMounted(() => {
+  getTableData();
+});
 </script>
 
 <style scoped lang="scss">

+ 2 - 2
src/views/training/videoManage.vue

@@ -48,7 +48,7 @@
         </div>
         <div class="table-wrap">
             <t-button theme="primary" @click="handleModifyVideo(0)">新增视频</t-button>
-            <t-table border :data="tableData" :columns="tableColumn" ref="dataRef" :bordered="true" :table-layout="'auto'" rowKey="EtaTrialId">
+            <t-table :data="tableData" :columns="tableColumn" ref="dataRef" :bordered="true" :table-layout="'auto'" rowKey="EtaTrialId">
                 <template #CoverImg="{ row }">
                     <!-- 视频封面 -->
                     <div class="img-box">
@@ -109,7 +109,7 @@ import { ref, onMounted } from 'vue';
 import { videoTableColumn } from './config/tableColumn';
 import { VideoInterface, TagInterface, ClassifyInterface } from '@/api/modules/trainingApi';
 import { SearchIcon } from 'tdesign-icons-vue-next';
-  import { useRouter } from 'vue-router'
+import { useRouter } from 'vue-router'
 const router = useRouter();
 
 // 暴露给模板的 ref

+ 2 - 2
vite.config.js

@@ -93,8 +93,8 @@ export default defineConfig(({ mode }) => {
       proxy:{
         '/v1': {
           // target: 'http://192.168.20.10:8912/v1',
-          target: 'http://8.136.199.33:8900/v1',
-          // target: 'http://8.136.199.33:7777/adminapi/',
+          // target: 'http://8.136.199.33:8900/v1',
+          target: 'http://8.136.199.33:7777/adminapi/',
           changeOrigin: true,
           rewrite: (path) => path.replace(/^\/v1/, ''),
         }