| | |
| | | :show-file-list="false" |
| | | :before-upload="(file) => onUploadFileBefore(file, scope.row)" |
| | | :limit="1" |
| | | accept=".pdf" |
| | | > |
| | | <span class="uploads">上传</span> |
| | | <span class="uploads" v-if="permission.helpCenterUpload">上传</span> |
| | | </el-upload> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <script setup> |
| | | import { uploadFileAPI, listDataAPI, updataDataAPI } from '@/api/helpCenter/helpCenter'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { onMounted } from 'vue'; |
| | | import { computed, onMounted } from 'vue'; |
| | | const helpData = ref([]); |
| | | |
| | | import { useStore } from 'vuex' |
| | | const store = useStore(); |
| | | const permission = computed(() => store.state.user.permission); |
| | | // 表格隔行变色 |
| | | const tableRowClassName = ({ row, rowIndex }) => { |
| | | if (rowIndex % 2 === 1) { |
| | |
| | | }; |
| | | // 文件上传 |
| | | const onUploadFileBefore = (file,row) => { |
| | | |
| | | const params={ |
| | | id:row.id, |
| | | filePath:row.filePath |
| | |
| | | } else { |
| | | ElMessage.error('上传失败'); |
| | | } |
| | | getlistDataAPI(); |
| | | }); |
| | | }; |
| | | onMounted(() => { |