master
xy 1 year ago
parent c9d10aaae5
commit aa4006cbf5

@ -35,3 +35,12 @@ export function destroy(params, isLoading = true) {
isLoading
})
}
export function clone(params, isLoading=true) {
return request({
method: 'get',
url: '/api/admin/aspiration/clone',
params,
isLoading
})
}

@ -235,6 +235,14 @@
>
</template>
<template v-else>
<el-button
v-if="isHasAuth('clone')"
size="small"
type="primary"
plain
@click="clone(row)"
>克隆</el-button
>
<el-button
v-if="isHasAuth('detail')"
size="small"
@ -306,7 +314,7 @@ import { authMixin } from "@/mixin/authMixin";
import { uploadSize } from "@/settings";
import { deepCopy } from "@/utils";
import { download } from "@/utils/downloadRequest";
import { destroy, index, save } from "@/api/aspiration/aspiration";
import { destroy, index, save, clone } from "@/api/aspiration/aspiration";
import AddAspiration from "./components/AddAspiration.vue";
import ShowAspiration from "./components/ShowAspiration.vue";
import axios from "axios";
@ -469,6 +477,21 @@ export default {
default:
}
},
async clone(row) {
try {
await this.$confirm("确认操作?", "提示", {
confirmButtonText: "确认",
cancelButtonText: "取消",
});
await clone({
id: row.id
})
this.$message.success("操作成功")
this.getList(true)
} catch (err) {
console.error(err)
}
},
async detail(row) {
await this.$refs["ShowAspiration"].getDetail(row.id);
this.isShowDetail = true;

@ -40,6 +40,31 @@
>搜索</el-button
>
</template>
<el-popover
v-if="isHasAuth('import')"
placement="bottom-start"
title="导入"
width="400"
trigger="click">
<template #reference>
<el-button type="primary" size="small" icon="el-icon-upload">导入</el-button>
</template>
<template #default>
<el-upload
ref="upload"
:action="action"
:on-success="uploadSuccess"
accept=".xls,.xlsx"
:headers="{
'Authorization': 'Bearer ' + getToken()
}"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="uploadData"></el-button>
<div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件</div>
</el-upload>
</template>
</el-popover>
</template>
</vxe-toolbar>
</slot>
@ -312,6 +337,7 @@ export default {
},
data() {
return {
action: `${process.env.VUE_APP_BASE_API}/api/admin/middle-school-indicator/import`,
uploadSize,
examineKey: 0,
isShowAdd: false,
@ -367,6 +393,19 @@ export default {
this.calcTableHeight();
},
methods: {
getToken,
uploadData() {
this.$refs.upload.submit();
},
uploadSuccess(response) {
console.log(response)
if (response.hasOwnProperty('errcode')) {
this.$message.error(response.errmsg)
} else {
this.$message.success(`已导入${response.total}`)
this.getList(true)
}
},
exportMethod() {
this.$confirm("请选择导出方式", "提示", {
confirmButtonText: "全量导出",

@ -36,6 +36,31 @@
>搜索</el-button
>
</template>
<el-popover
v-if="isHasAuth('import')"
placement="bottom-start"
title="导入"
width="400"
trigger="click">
<template #reference>
<el-button type="primary" size="small" icon="el-icon-upload">导入</el-button>
</template>
<template #default>
<el-upload
ref="upload"
:action="action"
:on-success="uploadSuccess"
accept=".xls,.xlsx"
:headers="{
'Authorization': 'Bearer ' + getToken()
}"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="uploadData"></el-button>
<div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件</div>
</el-upload>
</template>
</el-popover>
</template>
</vxe-toolbar>
</slot>
@ -375,6 +400,7 @@ export default {
},
data() {
return {
action: `${process.env.VUE_APP_BASE_API}/api/admin/school/import`,
uploadSize,
examineKey: 0,
isShowAdd: false,
@ -463,6 +489,19 @@ export default {
this.calcTableHeight();
},
methods: {
getToken,
uploadData() {
this.$refs.upload.submit();
},
uploadSuccess(response) {
console.log(response)
if (response.hasOwnProperty('errcode')) {
this.$message.error(response.errmsg)
} else {
this.$message.success(`已导入${response.total}`)
this.getList(true)
}
},
exportMethod() {
this.$confirm("请选择导出方式", "提示", {
confirmButtonText: "全量导出",

@ -31,6 +31,31 @@
@click="getList(true)"
>搜索</el-button
>
<el-popover
v-if="isHasAuth('import')"
placement="bottom-start"
title="导入"
width="400"
trigger="click">
<template #reference>
<el-button style="margin-left: 10px;" type="primary" size="small" icon="el-icon-upload">导入</el-button>
</template>
<template #default>
<el-upload
ref="upload"
:action="action"
:on-success="uploadSuccess"
accept=".xls,.xlsx"
:headers="{
'Authorization': 'Bearer ' + getToken()
}"
:auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="uploadData"></el-button>
<div slot="tip" class="el-upload__tip">只能上传xls/xlsx文件</div>
</el-upload>
</template>
</el-popover>
</template>
</vxe-toolbar>
</slot>
@ -231,6 +256,7 @@ export default {
},
data() {
return {
action: `${process.env.VUE_APP_BASE_API}/api/admin/specialty/import`,
uploadSize,
examineKey: 0,
isShowAdd: false,
@ -287,6 +313,19 @@ export default {
this.calcTableHeight();
},
methods: {
getToken,
uploadData() {
this.$refs.upload.submit();
},
uploadSuccess(response) {
console.log(response)
if (response.hasOwnProperty('errcode')) {
this.$message.error(response.errmsg)
} else {
this.$message.success(`已导入${response.total}`)
this.getList(true)
}
},
exportMethod() {
this.$confirm("请选择导出方式", "提示", {
confirmButtonText: "全量导出",

Loading…
Cancel
Save