yangys
2025-09-15 d7eb1d1e959559e3a77ed825a6b73dc79dbb008a
src/views/wel/components/ReplaceLeft.vue
ÎļþÃû´Ó src/views/wel/components/TodolistLeft.vue ÐÞ¸Ä
@@ -2,16 +2,33 @@
 * @Date: 2025-07-01 20:45:15
 * @LastEditors: æŽå–†(开发组) lzhe@yxqiche.com
 * @LastEditTime: 2025-08-11 10:35:59
 * @FilePath: /mdmweb/src/views/flow/components/TodolistLeft.vue
 * @FilePath: /mdmweb/src/views/flow/components/ReplaceLeft.vue
-->
<template>
    <basic-container>
        <div class="tool">
            <el-button type="primary" plain @click="addApp">添加文件</el-button>
        </div>
        <el-table :data="tableData" border @row-click="showContent" max-height="200">
        <el-table :data="tableData" :row-style="{height:'20px'}" :cell-style="{padding:'0px'}" border @row-click="showContent" max-height="380" highlight-current-row>
            <el-table-column type="index" label="#" width="40" align="center"/>
            <el-table-column prop="name" label="程序名称">
                <template #default="{ row }">
                    <div style="display: flex;align-items: center;">
                        <span style="margin-right: 8px;">{{ row.name }}</span>
                        <el-icon v-if="row.fileType === 'other'">
                            <el-tooltip class="box-item" effect="light" content="其他文件"  placement="right">
                            <FolderOpened />
                            </el-tooltip>
                        </el-icon>
                        <el-icon v-if="row.fileType === 'program'">
                            <el-tooltip class="box-item" effect="light" content="程序文件"  placement="right">
                                <Tickets/>
                            </el-tooltip>
                        </el-icon>
                        <!--<img v-else src="./app.jpg" alt="" width="16" height="16">-->
                    </div>
                </template>
            </el-table-column>
            <el-table-column fixed="right" label="操作" width="60" align="center">
            <template #default="scope" >
@@ -127,6 +144,7 @@
        }
    },
    mounted() {
        this.getAttList();
        this.onLoad(this.page);
    },
@@ -165,11 +183,22 @@
                    this.$message.error('获取已选程序失败');
                    return;
                } else {
                    this.tableData = res.data.data || [];
                    this.tableData = this.sortTable(res.data.data || []);
                }
                // this.$emit('selection-change',this.tableData)
            })
        },
        sortTable(data) {
           data.sort(function(a,b){
                if(a.program === b.program){//如果program相同,按照name的降序
                    //return a.name - b.name
                    return a.name.localeCompare(b.name)
                }else{
                    return b.program - a.program
                }
            });
            return data;
        },
        addApp() {
            this.appDialog = true;
        },