From 97a84b500fb1d5418d8a72a7fc8af2829c83ece5 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期五, 28 十一月 2025 15:16:19 +0800
Subject: [PATCH] 修改
---
src/views/build/conpanyFunctionConsult/standardSysTemp/sysStandardModule/index.vue | 65 +++++++++++++++++++++++---------
1 files changed, 46 insertions(+), 19 deletions(-)
diff --git a/src/views/build/conpanyFunctionConsult/standardSysTemp/sysStandardModule/index.vue b/src/views/build/conpanyFunctionConsult/standardSysTemp/sysStandardModule/index.vue
index cbf9738..58e3498 100644
--- a/src/views/build/conpanyFunctionConsult/standardSysTemp/sysStandardModule/index.vue
+++ b/src/views/build/conpanyFunctionConsult/standardSysTemp/sysStandardModule/index.vue
@@ -20,24 +20,27 @@
</el-option>
</el-select>
</el-form-item>
+ <el-form-item label="文件名称:" >
+ <el-input v-model.trim="data.queryParams.templateName" placeholder="文件名称"></el-input>
+ </el-form-item>
<el-form-item >
- <el-button v-if="isAdmin" type="primary" @click="getList">查询</el-button>
- <el-button v-if="isAdmin" type="primary" plain @click="reset">重置</el-button>
+ <el-button type="primary" @click="getList">查询</el-button>
+ <el-button type="primary" plain @click="reset">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- 表格数据 -->
- <el-table v-loading="loading" :data="dataList" :border="true">
+ <el-table v-loading="loading" :data="dataList" :border="true" @sort-change="handleSortChange">
<el-table-column label="序号" type="index" align="center" width="80"/>
- <el-table-column label="模板名称" prop="templateName" align="center"/>
- <el-table-column label="分类" prop="classify" align="center">
+ <el-table-column label="文件名称" prop="templateName" header-align="center" align="left" sortable="custom"/>
+<!-- <el-table-column label="分类" prop="classify" align="center">-->
+<!-- <template #default="scope">-->
+<!-- <span>{{scope.row.classify == 1 ? '体系标准' :scope.row.classify == 2 ?'安全标准': scope.row.classify == 3 ? '其他' : ''}}</span>-->
+<!-- </template>-->
+<!-- </el-table-column>-->
+ <el-table-column label="文件" header-align="center" align="left">
<template #default="scope">
- <span>{{scope.row.classify == 1 ? '体系标准' :scope.row.classify == 2 ?'安全标准': scope.row.classify == 3 ? '其他' : ''}}</span>
- </template>
- </el-table-column>
- <el-table-column label="模板文件" align="center">
- <template #default="scope">
- <el-link type="primary" @click="openFile(scope.row.filePath)">{{scope.row.templateName + '模板' + scope.row.format}}</el-link>
+ <el-link type="primary" @click="openFile(scope.row.filePath)">{{scope.row.templateName + scope.row.format}}</el-link>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
@@ -80,6 +83,8 @@
pageNum: 1,
pageSize: 10,
companyId: null,
+ sort:null,
+ templateName:'',
templateType: 1
},
total: 0,
@@ -107,7 +112,7 @@
const openFile = async(path)=>{
const ext = path.split('.').pop().toLowerCase();
- if (ext === 'doc') {
+ if (ext === 'doc' || ext === 'xlsx' || ext === 'xls') {
ElMessageBox.confirm('暂不支持线上预览.doc文件,是否下载查看?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }).then(() => {
window.open(`${import.meta.env.VITE_APP_BASE_API}/${path}`, '_blank');
}).catch(() => {
@@ -185,13 +190,27 @@
/** 重置新增的表单以及其他数据 */
const reset= async()=> {
- data.queryParams = {
- pageNum: 1,
- pageSize: 10,
- companyId: null,
- templateType: 1
+ if(data.isAdmin){
+ data.queryParams = {
+ pageNum: 1,
+ pageSize: 10,
+ companyId: null,
+ templateName:'',
+ sort:data.queryParams.sort,
+ templateType: 1
+ }
+ await getCompanyList()
+ }else {
+ data.queryParams = {
+ pageNum: 1,
+ pageSize: 10,
+ companyId: data.queryParams.companyId,
+ templateName:'',
+ sort:data.queryParams.sort,
+ templateType: 1
+ }
}
- await getCompanyList()
+
await getList()
}
const handleDelete = (val) => {
@@ -213,5 +232,13 @@
}
})
}
-
+const handleSortChange = (val) => {
+ console.log('bal',val)
+ if(val.order === 'ascending' ){
+ data.queryParams.sort = 1
+ }else if(val.order === "descending" ){
+ data.queryParams.sort = 2
+ }
+ getList()
+}
</script>
--
Gitblit v1.9.2