用户物品导出

This commit is contained in:
2023-11-14 11:36:58 +08:00
parent 66222d5d93
commit 55dd565e92
4 changed files with 16 additions and 13 deletions

View File

@@ -119,13 +119,13 @@ public class GorseController extends BaseController {
} }
@PutMapping(value = "/bulk/{type}") @PutMapping(value = "/bulk/{type}")
public ResponseData bulkUser(@RequestParam Map<String, String> data, @RequestParam("file") MultipartFile file, @PathVariable("type") String type) throws Exception { public ResponseData bulkUserOrItem(@RequestParam Map<String, String> data, @RequestParam("file") MultipartFile file, @PathVariable("type") String type) throws Exception {
return success(gorseService.bulkUserOrItem(data, file, type)); return success(gorseService.bulkUserOrItem(data, file, type));
} }
@GetMapping(value = "/get_bulk_user") @GetMapping(value = "/get_bulk/{type}")
public ResponseData getBulkUser() throws Exception { public String getBulkUserOrItem(@PathVariable("type") String type) throws Exception {
return success(gorseService.getBulkUser()); return gorseService.getBulkUserOrItem(type);
} }

View File

@@ -127,8 +127,11 @@ public class GorseService {
} }
public File getBulkUser() throws IOException { /**
return this.request("GET", this.endpoint + "/api/bulk/users", null, File.class); * 导出用户或物品信息
*/
public String getBulkUserOrItem(String type) {
return "redirect:" + this.endpoint + "/api/bulk/" + type;
} }
public JSONObject sendPostFormData(String url, MultipartEntityBuilder builder) throws IOException { public JSONObject sendPostFormData(String url, MultipartEntityBuilder builder) throws IOException {

View File

@@ -19,6 +19,7 @@
</div> </div>
<div style="margin: 0px 0 20px 0"> <div style="margin: 0px 0 20px 0">
<el-button type="primary" @click="createRow()" icon="el-icon-plus"> </el-button> <el-button type="primary" @click="createRow()" icon="el-icon-plus"> </el-button>
<el-button type="primary" @click="downloadItem()" icon="el-icon-download">导出条目</el-button>
<el-button type="primary" @click="showImportItemPage()" icon="el-icon-upload2">导入条目</el-button> <el-button type="primary" @click="showImportItemPage()" icon="el-icon-upload2">导入条目</el-button>
</div> </div>
<div> <div>
@@ -144,7 +145,7 @@
</template> </template>
<script> <script>
import request from '@/utils/request'; import request, {getBaseUrl} from '@/utils/request';
var _this; var _this;
export default { export default {
@@ -210,6 +211,9 @@ export default {
_this.qo.pageNo = val; _this.qo.pageNo = val;
_this.queryData(); _this.queryData();
}, },
downloadItem() {
window.open(getBaseUrl() + '/bulk/get_bulk/items');
},
similarItem(item) { similarItem(item) {
_this.$router.push({ _this.$router.push({
path: "similarItem", query: { path: "similarItem", query: {

View File

@@ -81,7 +81,7 @@
</template> </template>
<script> <script>
import request from '@/utils/request'; import request, {getBaseUrl} from '@/utils/request';
var _this; var _this;
export default { export default {
@@ -139,11 +139,7 @@ export default {
}); });
}, },
downloadUser() { downloadUser() {
request({ window.open(getBaseUrl() + '/bulk/get_bulk/users');
url: '/gorse/get_bulk_user',
method: 'get'
}).then(res => {
});
}, },
linkUser(item) { linkUser(item) {
_this.$router.push({ _this.$router.push({