|
@@ -6,22 +6,20 @@
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="one-block-2">
|
|
<div class="one-block-2">
|
|
|
- <!-- dev调试时,action参数:请填写你本地完整的api地址,如:http://localhost:7068/api/v1/example/uploadFile -->
|
|
|
|
|
|
|
+ <!-- dev调试时,action参数:请填写你本地完整的api地址,如:http://localhost:7068/api/example/uploadFile -->
|
|
|
<a-upload-dragger
|
|
<a-upload-dragger
|
|
|
name="file"
|
|
name="file"
|
|
|
:multiple="true"
|
|
:multiple="true"
|
|
|
:action="action_url"
|
|
:action="action_url"
|
|
|
- @change="handleChange"
|
|
|
|
|
|
|
+ @change="uploadStatus"
|
|
|
>
|
|
>
|
|
|
<p class="ant-upload-drag-icon">
|
|
<p class="ant-upload-drag-icon">
|
|
|
<a-icon type="inbox" />
|
|
<a-icon type="inbox" />
|
|
|
</p>
|
|
</p>
|
|
|
<p class="ant-upload-text">
|
|
<p class="ant-upload-text">
|
|
|
- Click or drag file to this area to upload
|
|
|
|
|
|
|
+ 点击 或 拖动到此处
|
|
|
</p>
|
|
</p>
|
|
|
<p class="ant-upload-hint">
|
|
<p class="ant-upload-hint">
|
|
|
- Support for a single or bulk upload. Strictly prohibit from uploading company data or other
|
|
|
|
|
- band files
|
|
|
|
|
</p>
|
|
</p>
|
|
|
</a-upload-dragger>
|
|
</a-upload-dragger>
|
|
|
</div>
|
|
</div>
|
|
@@ -84,7 +82,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import { localApi } from '@/api/main'
|
|
|
|
|
|
|
+import { requestEggApi, ipcApiRoute } from '@/api/main'
|
|
|
|
|
|
|
|
const fileList = [
|
|
const fileList = [
|
|
|
{
|
|
{
|
|
@@ -109,7 +107,7 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
file_list: fileList,
|
|
file_list: fileList,
|
|
|
- action_url: process.env.VUE_APP_API_BASE_URL + '/api/v1/example/uploadFile',
|
|
|
|
|
|
|
+ action_url: process.env.VUE_APP_API_BASE_URL + '/api/example/uploadFile',
|
|
|
image_info: [],
|
|
image_info: [],
|
|
|
num: 0,
|
|
num: 0,
|
|
|
dir_path: "D:\\www\\xing\\electron-egg",
|
|
dir_path: "D:\\www\\xing\\electron-egg",
|
|
@@ -120,7 +118,7 @@ export default {
|
|
|
const params = {
|
|
const params = {
|
|
|
'id': id
|
|
'id': id
|
|
|
}
|
|
}
|
|
|
- localApi('openDir', params).then(res => {
|
|
|
|
|
|
|
+ requestEggApi('openDir', params).then(res => {
|
|
|
if (res.code !== 0) {
|
|
if (res.code !== 0) {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
@@ -128,7 +126,7 @@ export default {
|
|
|
console.log('err:', err)
|
|
console.log('err:', err)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- handleChange(info) {
|
|
|
|
|
|
|
+ uploadStatus(info) {
|
|
|
const status = info.file.status;
|
|
const status = info.file.status;
|
|
|
if (status !== 'uploading') {
|
|
if (status !== 'uploading') {
|
|
|
console.log(info.file);
|
|
console.log(info.file);
|
|
@@ -153,7 +151,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
selectDir() {
|
|
selectDir() {
|
|
|
- localApi('selectFileDir', {}).then(res => {
|
|
|
|
|
|
|
+ requestEggApi('selectFileDir', {}).then(res => {
|
|
|
if (res.code !== 0) {
|
|
if (res.code !== 0) {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
@@ -167,7 +165,7 @@ export default {
|
|
|
const self = this;
|
|
const self = this;
|
|
|
console.log('[messageShow] type:', type)
|
|
console.log('[messageShow] type:', type)
|
|
|
if (type == 'http') {
|
|
if (type == 'http') {
|
|
|
- localApi('messageShow', {}).then(res => {
|
|
|
|
|
|
|
+ requestEggApi('messageShow', {}).then(res => {
|
|
|
if (res.code !== 0) {
|
|
if (res.code !== 0) {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
@@ -176,7 +174,7 @@ export default {
|
|
|
self.$message.error(err + '异常')
|
|
self.$message.error(err + '异常')
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
- self.$ipcCallMain('example.messageShow', '').then(r => {
|
|
|
|
|
|
|
+ self.$ipcCallMain(ipcApiRoute.messageShow, '').then(r => {
|
|
|
self.$message.info(r);
|
|
self.$message.info(r);
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -185,7 +183,7 @@ export default {
|
|
|
const self = this;
|
|
const self = this;
|
|
|
console.log('[messageShowConfirm] type:', type)
|
|
console.log('[messageShowConfirm] type:', type)
|
|
|
if (type == 'http') {
|
|
if (type == 'http') {
|
|
|
- localApi('messageShowConfirm', {}).then(res => {
|
|
|
|
|
|
|
+ requestEggApi('messageShowConfirm', {}).then(res => {
|
|
|
if (res.code !== 0) {
|
|
if (res.code !== 0) {
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
@@ -194,7 +192,7 @@ export default {
|
|
|
self.$message.error(err + '异常')
|
|
self.$message.error(err + '异常')
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
- self.$ipcCallMain('example.messageShowConfirm', '').then(r => {
|
|
|
|
|
|
|
+ self.$ipcCallMain(ipcApiRoute.messageShowConfirm, '').then(r => {
|
|
|
self.$message.info(r);
|
|
self.$message.info(r);
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|