Commit b2831854 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 89f88833 412027b6
......@@ -77,7 +77,40 @@
<div class="department_right_add">
<div class="department_manage">窗口管理</div>
<div class="flex aic jcb pdr6">
<a-space>
<a-button type="primary" @click="addModal">新增窗口</a-button>
<a-dropdown>
<a-menu slot="overlay">
<a-menu-item key="1">
<a-upload
name="file"
:multiple="false"
:action="api + 'base/window/importData'"
:showUploadList="false"
:headers="{
Authorization: token,
}"
@change="handleChange"
:data="{
siteId,
}"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
>
<div style="color: #1890ff">批量导入</div>
</a-upload>
</a-menu-item>
<a-menu-item key="2">
<a style="color: #1890ff" @click="handleDownload">
模板下载</a
>
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
更多操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</a-space>
<a-input-search
placeholder="请输入窗口编号搜索"
v-model="windowSearch"
......@@ -190,14 +223,23 @@ import adddepartment from "./components/adddepartment.vue";
import addwindow from "./components/addwindow.vue";
import addWindowBusiness from "./components/addWindowBusiness.vue";
import local from "@/utils/local";
import { mapGetters } from "vuex";
import {
getDeptList,
delDept,
getWindowList,
delWindow,
getWindowTemplate,
} from "@/services/dept";
const columns = [
export default {
components: {
adddepartment,
addwindow,
addWindowBusiness,
},
data() {
const columns = [
{
title: "序号",
width: "6%",
......@@ -212,13 +254,17 @@ const columns = [
},
{
title: "编号",
dataIndex: "fromnum",
width: "10%",
customRender: (text) => {
return text.fromnum || "--";
},
},
{
title: "所属部门",
width: "10%",
dataIndex: "deptName",
customRender: (text) => {
return text.deptName || "--";
},
},
{
title: "工作人员",
......@@ -261,16 +307,10 @@ const columns = [
customRender: "action",
},
},
];
export default {
components: {
adddepartment,
addwindow,
addWindowBusiness,
},
data() {
];
return {
spinning: false,
api: process.env.VUE_APP_API_BASE_URL + "/",
loading: false,
deptLoading: false,
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
......@@ -342,6 +382,9 @@ export default {
this.$route.meta.isBack = false;
}
},
computed: {
...mapGetters("site", ["token"]),
},
created() {},
methods: {
// 去掉空children
......@@ -552,6 +595,35 @@ export default {
},
});
},
// 批量导入窗口模板下载
async handleDownload() {
let res = await getWindowTemplate({}, { responseType: "blob" });
const blob = new Blob([res.data], {
type: "application/octet-stream",
});
let fileName = "批量导入窗口模板";
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.setAttribute("download", `${fileName}.xlsx`); // 设置下载文件名称
document.body.appendChild(link);
link.click();
document.body.appendChild(link);
},
// 导入窗口
handleChange({ file }) {
this.spinning = true;
if (file.status === "done") {
let { code, msg } = file.response;
if (code == 1) {
this.$message.success(msg);
this.getWindowListData();
} else {
this.$message.error(msg);
}
this.spinning = false;
}
},
},
};
</script>
......
......@@ -136,7 +136,9 @@
:multiple="false"
:action="api + 'base/workman/importData'"
:showUploadList="false"
:headers="headers"
:headers="{
Authorization: token,
}"
@change="handleChange"
:data="{
siteId,
......@@ -160,7 +162,9 @@
:multiple="false"
:action="api + 'base/file/commonupload'"
:showUploadList="false"
:headers="headers"
:headers="{
Authorization: token,
}"
@change="handleChangeImg"
accept="application/x-zip-compressed"
>
......@@ -296,6 +300,7 @@ import EditPersonel from "./components/EditPersonel.vue";
import local from "@/utils/local";
import { Empty } from "ant-design-vue";
import { pageSizeOptions } from "@/config/pageConfig.js";
import { mapGetters } from "vuex";
// import axios from "axios";
import {
getDeptList,
......@@ -384,9 +389,6 @@ export default {
},
data() {
return {
headers: {
Authorization: local.getLocal("token"),
},
spinning: false,
columns,
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
......@@ -413,6 +415,9 @@ export default {
curWindow: "", // 当前选中窗口
};
},
computed: {
...mapGetters("site", ["token"]),
},
created() {
this.getDeptList();
this.getWindowData();
......
......@@ -158,7 +158,8 @@ module.exports = {
info: `${BASE_URL}/base/window/info`,
save: `${BASE_URL}/base/window/save`,
delete: `${BASE_URL}/base/window/delete`,
exportExcel: `${BASE_URL}/base/window/exportExcel`,
template: `${BASE_URL}/base/window/downloadTemplate`, // 导入模板下载
importData: `${BASE_URL}/base/window/importData`,
subList: `${BASE_URL}/base/window/subHalllist`, // 查询当前站点所有没有在大厅配置的过的窗口
},
// 工作人员
......
......@@ -51,6 +51,14 @@ export async function delWindow(data) {
export async function getSubHalllist(data) {
return request(window.subList, METHOD.POST, data);
}
// 批量导入窗口模板下载
export async function getWindowTemplate(data, config) {
return request(window.template, METHOD.POST, data, config);
}
// 批量导入窗口
export async function importWindowData(data) {
return request(window.importData, METHOD.POST, data);
}
/**
* 窗口业务
......
......@@ -67,7 +67,12 @@ export default {
data() {
return {
searchVal: "",
stepsList: [],
stepsList: [
{
id:'',
productName:'全部',
}
],
isSearch: false,
active: 0,
......@@ -86,13 +91,22 @@ export default {
getProduct({
page: 1,
size: -1, //每页条数
productName: `%${this.searchVal}%`,
// productName: `%${this.searchVal}%`,
}).then((res) => {
let { code, data } = res;
if (code == 1) {
if (data.data.length) {
this.stepsList = data.data;
this.getApiDetail(data.data[0]);
let arr = [
{
id:'',
productName:'全部',
}
]
data.data.forEach(item => {
arr.push(item)
});
this.stepsList = arr
this.getApiDetail(this.stepsList[0]);
} else {
this.curApiInfo = {};
}
......@@ -101,7 +115,7 @@ export default {
},
getApiDetail(item) {
getInterfaceList({ page: 1, size: -1, productId: item.id }).then(
getInterfaceList({ page: 1, size: -1, productId: item.id , interfaceName: `%${this.searchVal}%`,}).then(
(res) => {
let { code, data } = res;
if (code == 1) {
......@@ -115,8 +129,9 @@ export default {
);
},
handleSearch() {
this.active = 0;
this.getServiceApiList();
// this.active = 0;
// this.getServiceApiList();
this.getApiDetail(this.stepsList[this.active])
// this.isSearch = !this.isSearch;
// if (this.isSearch) {
......
......@@ -218,10 +218,12 @@ export default {
// 搜索
async searchData() {
if (this.searchForm.parentId || this.searchForm.name) {
let obj = {...this.searchForm}
obj.name = '%'+this.searchForm.name+'%'
let res = await menuList({
page: this.tablePagination.current,
size: -1,
...this.searchForm,
...obj,
});
let { data, total } = res.data;
this.tablePagination.total = total;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment