|
@@ -114,32 +114,10 @@
|
|
|
|
|
|
<!-- 页码 -->
|
|
|
<pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
|
|
|
-
|
|
|
- <!-- 导入对话框 -->
|
|
|
- <!-- dialog Start -->
|
|
|
- <el-dialog
|
|
|
- title="导入"
|
|
|
- :visible.sync="improtDialogVisible"
|
|
|
- width="30%"
|
|
|
- @close="improtDialogClose"
|
|
|
- >
|
|
|
- <el-form ref="dialogForm" :model="improtDialogFormData" label-width="86px" :rules="improtDialogFormRules">
|
|
|
- <el-form-item label="文件路径:" prop="fileUrl">
|
|
|
- <file-upload ref="fileUpload" :file-list="uploadFileList" @change="fileUploadChange" />
|
|
|
- <el-input v-show="false" v-model="improtDialogFormData.fileUrl" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="improtDialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" :disabled="!saveBtnClickable" :loading="requestLoading" @click="submitUpload">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- <!-- dialog END -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import FileUpload from '@/components/FileUpload'
|
|
|
import { fecthAuthList, authImportExcel } from '@/api/auth'
|
|
|
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
|
|
|
import { mapGetters } from 'vuex'
|
|
@@ -147,7 +125,7 @@ import { formatDate } from '@/utils'
|
|
|
import { debounce, downLoadWithATag } from '@/utils/tools'
|
|
|
export default {
|
|
|
name: 'ComplexTable',
|
|
|
- components: { Pagination, FileUpload },
|
|
|
+ components: { Pagination },
|
|
|
filters: {
|
|
|
formatTime(time) {
|
|
|
if (!time) {
|
|
@@ -206,27 +184,6 @@ export default {
|
|
|
this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
- // 上传文件
|
|
|
- submitUpload() {
|
|
|
- this.$refs.dialogForm.validate(valid => {
|
|
|
- console.log(valid)
|
|
|
- if (!valid) return
|
|
|
- this.requestLoading = true // 上传文件
|
|
|
- // this.$refs.fileUpload.submit()
|
|
|
- this.handleSave()
|
|
|
- })
|
|
|
- },
|
|
|
- // 监听上传文件的状态变化
|
|
|
- async fileUploadChange(fileList) {
|
|
|
- this.uploadFileList = fileList
|
|
|
- try {
|
|
|
- await this.handleFileUploadStatus(fileList)
|
|
|
- this.handleSave.apply(this)
|
|
|
- } catch (error) {
|
|
|
- console.log(error)
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
// 下载模板
|
|
|
downLoadExportExcel() {
|
|
|
downLoadWithATag(`${process.env.VUE_APP_BASE_API}/download/file?ossName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx&fileName=%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F%E6%9C%BA%E6%9E%84%E3%80%81%E5%95%86%E5%93%81%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`)
|
|
@@ -269,35 +226,6 @@ export default {
|
|
|
this.requestLoading = false
|
|
|
})
|
|
|
}, 200),
|
|
|
-
|
|
|
- // 处理文件上传状态
|
|
|
- handleFileUploadStatus(fileList) {
|
|
|
- console.log(fileList)
|
|
|
- this.chooseFile = fileList[0].raw
|
|
|
- // 文件列表为空
|
|
|
- if (fileList.length <= 0) {
|
|
|
- this.improtDialogFormData.fileUrl = ''
|
|
|
- return Promise.reject('faild')
|
|
|
- }
|
|
|
- // 取第一个文件
|
|
|
- const { response, status } = fileList[0]
|
|
|
- // 文件已选择但未上传
|
|
|
- if (status === 'ready') {
|
|
|
- this.improtDialogFormData.fileUrl = status
|
|
|
- return Promise.reject('faild')
|
|
|
- }
|
|
|
- // 文件已上传
|
|
|
- if (status === 'success') {
|
|
|
- this.improtDialogFormData.fileUrl = response.previewUrl
|
|
|
- return Promise.resolve('success')
|
|
|
- }
|
|
|
- },
|
|
|
- improtDialogClose() {
|
|
|
- console.log(123)
|
|
|
- // this.uploadFileList = []
|
|
|
- this.$refs.fileUpload.clearAllFiles()
|
|
|
- this.$refs.dialogForm.resetFields()
|
|
|
- },
|
|
|
// 获取授权列表
|
|
|
getList() {
|
|
|
this.listLoading = true
|
|
@@ -315,12 +243,6 @@ export default {
|
|
|
this.listLoading = false
|
|
|
})
|
|
|
},
|
|
|
- // 格式化列表数据
|
|
|
- formatList(list = []) {
|
|
|
- list.forEach(i => {
|
|
|
- i.status = i.status === 1
|
|
|
- })
|
|
|
- },
|
|
|
// 过滤列表
|
|
|
handleFilter() {
|
|
|
this.listQuery.page = 1
|