|
@@ -69,6 +69,20 @@
|
|
|
</el-row>
|
|
|
</el-header>
|
|
|
<el-main style="background:#ffffff; width:98%;margin:0% 1% 1% 1%; font-size:14px;border-radius:8px;">
|
|
|
+ <el-upload
|
|
|
+ class="upload-demo"
|
|
|
+ action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
|
|
|
+ :on-preview="handlePreview"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ multiple
|
|
|
+ :limit="3"
|
|
|
+ :on-exceed="handleExceed"
|
|
|
+ :file-list="fileList"
|
|
|
+ >
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
+ <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>
|
|
|
+ </el-upload>
|
|
|
<el-button type="primary" style="margin-left:1%;width:10%;" @click="uploadFile()">导入</el-button>
|
|
|
<el-tooltip class="item" effect="light" content="导出勾选项,没有勾选将导出模版" placement="top">
|
|
|
<el-button style="margin-left:2%;width:10%;" @click="exportExcel">导出</el-button>
|
|
@@ -145,6 +159,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ fileList: [],
|
|
|
div1: true,
|
|
|
id: '',
|
|
|
label: '',
|
|
@@ -192,6 +207,18 @@ export default {
|
|
|
this.AllQueryFolderData(localStorage.getItem('key'))
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleRemove(file, fileList) {
|
|
|
+ console.log(file, fileList)
|
|
|
+ },
|
|
|
+ handlePreview(file) {
|
|
|
+ console.log(file)
|
|
|
+ },
|
|
|
+ handleExceed(files, fileList) {
|
|
|
+ this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
|
|
|
+ },
|
|
|
+ beforeRemove(file, fileList) {
|
|
|
+ return this.$confirm(`确定移除 ${file.name}?`)
|
|
|
+ },
|
|
|
// 左侧导航栏
|
|
|
AllQueryFolderData(e) {
|
|
|
if (e !== '') {
|
|
@@ -319,6 +346,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
moduleTypeArr() {
|
|
|
+ axios.get('https://star.xiaojukeji.com/upload/getPresignedUrl.node?name=“文件名”').then(res => {
|
|
|
+ console.log(res)
|
|
|
+ })
|
|
|
settingQueryModuleInfoListData(this.formData).then(res => {
|
|
|
this.moduleTypeStr = res.data
|
|
|
})
|
|
@@ -498,6 +528,7 @@ export default {
|
|
|
this.$message({ type: 'success', message: '已取消' })
|
|
|
})
|
|
|
},
|
|
|
+ // Nav 当前点击
|
|
|
clickFun(e) {
|
|
|
this.startId = e.id
|
|
|
this.created_id = e.id
|
|
@@ -511,6 +542,8 @@ export default {
|
|
|
this.total = res.data.total
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ // 表格信息删除
|
|
|
deleteCaseData(e) {
|
|
|
if (this.startId === '') {
|
|
|
this.$message({ message: '提示, 👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
@@ -524,8 +557,6 @@ export default {
|
|
|
this.caseInfo = { id: e, modifier: this.userInformation }
|
|
|
deleteCaseData(this.caseInfo).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
- // this.data1 = []
|
|
|
- // this.AllQueryFolderData(localStorage.getItem('key'))
|
|
|
var data = {
|
|
|
pageSize: this.pageSize,
|
|
|
curIndex: this.curIndex,
|
|
@@ -543,6 +574,8 @@ export default {
|
|
|
.catch(action => { this.$message({ type: 'success', message: '已取消' }) })
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ // 导出
|
|
|
exportExcel() {
|
|
|
if (this.startId === '') {
|
|
|
this.$message({ message: '提示,👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
@@ -557,7 +590,9 @@ export default {
|
|
|
return wbout
|
|
|
}
|
|
|
},
|
|
|
- importFile() { // 导入excel
|
|
|
+
|
|
|
+ // 导入excel
|
|
|
+ importFile() {
|
|
|
var obj = this.imFile
|
|
|
if (!obj.files) {
|
|
|
return
|
|
@@ -579,10 +614,10 @@ export default {
|
|
|
var code = res.data.data
|
|
|
this.successNum = code.successNum
|
|
|
this.failNum = code.failNum
|
|
|
- if (res.status === 200) {
|
|
|
+ console.log(res)
|
|
|
+ if (res.data.code === 200) {
|
|
|
if (this.failNum === 0) {
|
|
|
this.updateCaseListData()
|
|
|
- // this.$notify({ title: 'Success', message: '上传成功', type: 'success', duration: 15000 })
|
|
|
} else {
|
|
|
this.haha = '上传成功' + this.successNum + '上传失败' + this.failNum
|
|
|
this.$notify({ title: 'error', message: this.haha, type: 'success', duration: 2000 })
|
|
@@ -594,28 +629,32 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- fixdata: function(data) { // 文件流转BinaryString
|
|
|
- var o = ''
|
|
|
- var l = 0
|
|
|
- var w = 10240
|
|
|
- for (; l < data.byteLength / w; ++l) {
|
|
|
- o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
|
|
|
- }
|
|
|
- o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
|
|
|
- return o
|
|
|
- },
|
|
|
- uploadFile() { // 按钮导入
|
|
|
+
|
|
|
+ // fixdata: function(data) { // 文件流转BinaryString
|
|
|
+ // var o = ''
|
|
|
+ // var l = 0
|
|
|
+ // var w = 10240
|
|
|
+ // for (; l < data.byteLength / w; ++l) {
|
|
|
+ // o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
|
|
|
+ // }
|
|
|
+ // o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
|
|
|
+ // return o
|
|
|
+ // },
|
|
|
+
|
|
|
+ // 按钮导入
|
|
|
+ uploadFile() {
|
|
|
if (this.startId === '') {
|
|
|
this.$message({ message: '提示,👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
|
} else {
|
|
|
this.$refs.imFile.click()
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
updateCaseListData() {
|
|
|
this.createParticipation.caseFolderId = this.startId
|
|
|
queryCasesData(this.createParticipation).then(res => {
|
|
|
this.gridData = res.data
|
|
|
- this.$message({ type: 'success', message: res.msg, duration: 1000 })
|
|
|
+ this.$message({ type: res.msg, message: res.msg, duration: 1000 })
|
|
|
})
|
|
|
}
|
|
|
}
|