<template>
|
<div class="app-container">
|
<el-row :gutter="10" class="mb8">
|
<el-col :span="1.5">
|
<el-button type="primary" size="mini" @click="handleExport"
|
>同步</el-button
|
>
|
</el-col>
|
</el-row>
|
|
<template>
|
<el-table
|
border
|
v-loading="loading"
|
:data="orderList"
|
@selection-change="handleSelectionChange"
|
height="560"
|
>
|
<el-table-column type="selection" width="40px" align="center" />
|
<el-table-column label="接口名称" align="center" prop="dictName" />
|
<el-table-column
|
label="备注"
|
align="center"
|
prop="remark"
|
:show-overflow-tooltip="true"
|
/>
|
</el-table>
|
</template>
|
</div>
|
</template>
|
|
<script>
|
import { histongbulist, histongbuexec, hisexec } from "@/api/system/interface";
|
export default {
|
name: "Interface",
|
data() {
|
return {
|
orderList: [],
|
selectionList: [],
|
loading: false,
|
methods: [],
|
};
|
},
|
created() {
|
this.getList();
|
},
|
methods: {
|
getList() {
|
(this.loading = true),
|
histongbulist().then((res) => {
|
if (res.data) {
|
this.orderList = res.data;
|
}
|
this.loading = false;
|
});
|
},
|
handleSelectionChange(selection) {
|
this.selectionList = selection;
|
},
|
handleExport() {
|
if (this.selectionList.length != 0) {
|
if (this.selectionList.length == this.orderList.length) {
|
histongbuexec().then((res) => {
|
this.$modal.msgSuccess("同步成功");
|
this.getList()
|
});
|
} else {
|
this.methods = this.selectionList.map((item) => item.dictName);
|
let data = {
|
methods: this.methods,
|
type: false,
|
};
|
hisexec(data).then((res) => {
|
this.$modal.msgSuccess("同步成功");
|
this.getList()
|
});
|
}
|
} else {
|
this.$modal.msgError("请选择同步数据");
|
}
|
},
|
},
|
};
|
</script>
|