| | |
| | | </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" header-align="center" align="left"/> |
| | | <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"> |
| | | <el-table-column label="文件" header-align="center" align="left"> |
| | | <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" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="downloadFile(scope.row.filePath)">下载</el-button> |
| | | <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button> |
| | | <el-button link type="primary" @click="downloadFile(scope.row.filePath)" v-hasPermi="['sysStandard:view']">下载</el-button> |
| | | <el-button link type="primary" @click="openDialog('edit',scope.row)" v-hasPermi="['sysStandard:update']">编辑</el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row)" v-hasPermi="['sysStandard:update']">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | companyId: null, |
| | | sort:null, |
| | | templateName:'', |
| | | templateType: 1 |
| | | }, |
| | | total: 0, |
| | |
| | | |
| | | 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(() => { |
| | |
| | | |
| | | /** 重置新增的表单以及其他数据 */ |
| | | 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) => { |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | 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> |