Commit 37ff7554 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents e599b1b1 644674bc
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
:label-col="{ span: 4 }" :label-col="{ span: 4 }"
:wrapper-col="{ span: 20 }" :wrapper-col="{ span: 20 }"
> >
<a-form-model-item label="站点名称" prop="siteName">
<a-input v-model="form.siteName" disabled />
</a-form-model-item>
<a-form-model-item label="主题名称" prop="categoryName"> <a-form-model-item label="主题名称" prop="categoryName">
<a-input v-model="form.categoryName" placeholder="请输入主题名称" /> <a-input v-model="form.categoryName" placeholder="请输入主题名称" />
</a-form-model-item> </a-form-model-item>
...@@ -110,6 +113,9 @@ export default { ...@@ -110,6 +113,9 @@ export default {
onEdit(data) { onEdit(data) {
this.$nextTick(() => { this.$nextTick(() => {
this.form = { ...data }; this.form = { ...data };
this.form.siteName = local.getLocal("siteName")
? local.getLocal("siteName")
: data.siteName;
if (this.form.cover) { if (this.form.cover) {
this.fileList = [ this.fileList = [
{ {
......
...@@ -357,13 +357,13 @@ export default { ...@@ -357,13 +357,13 @@ export default {
} }
}, },
}, },
watch: { // watch: {
deptSearchVal(newVal) { // deptSearchVal(newVal) {
if (newVal === "") { // if (newVal === "") {
this.getDeptListData(); // this.getDeptListData();
} // }
}, // },
}, // },
// 进入路由前 // 进入路由前
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
if (from.path === "/department/adddepartment") { if (from.path === "/department/adddepartment") {
...@@ -401,13 +401,13 @@ export default { ...@@ -401,13 +401,13 @@ export default {
}); });
}, },
// 获取部门列表 // 获取部门列表
async getDeptListData(obj = {}) { async getDeptListData() {
this.deptLoading = true; this.deptLoading = true;
let res = await getDeptList({ let res = await getDeptList({
siteId: this.siteId, siteId: this.siteId,
page: 1, page: 1,
size: -1, size: -1,
...obj, name: `%${this.deptSearchVal}%`,
}); });
this.deptLoading = false; this.deptLoading = false;
let { code, data } = res.data; let { code, data } = res.data;
...@@ -481,7 +481,7 @@ export default { ...@@ -481,7 +481,7 @@ export default {
let res = await delDept({ id: num }); let res = await delDept({ id: num });
let { code, msg } = res.data; let { code, msg } = res.data;
if (code === 1) { if (code === 1) {
_this.getDeptListData(_this.siteId); _this.getDeptListData();
_this.$message.success(msg); _this.$message.success(msg);
} }
}, },
...@@ -501,11 +501,15 @@ export default { ...@@ -501,11 +501,15 @@ export default {
deptId: this.deptId, deptId: this.deptId,
...obj, ...obj,
}); });
let { code, data } = res.data;
if (code === 1) {
this.total = data.pageInfo.totalResult;
this.windowData = data.data;
this.loading = false; this.loading = false;
if (res.data.code === 1) {
let { total, data } = res.data.data;
if (!data.length && this.page > 1) {
this.page -= 1;
this.getWindowListData();
}
this.total = total;
this.windowData = data;
} }
}, },
// 新增窗口 // 新增窗口
...@@ -539,7 +543,7 @@ export default { ...@@ -539,7 +543,7 @@ export default {
let res = await delWindow({ id: num }); let res = await delWindow({ id: num });
let { code, msg } = res.data; let { code, msg } = res.data;
if (code === 1) { if (code === 1) {
_this.getWindowListData(_this.siteId); _this.getWindowListData();
_this.$message.success(msg); _this.$message.success(msg);
} }
}, },
...@@ -560,8 +564,8 @@ export default { ...@@ -560,8 +564,8 @@ export default {
this.getWindowListData(); this.getWindowListData();
}, },
// 左边搜索 // 左边搜索
onSearch(value) { onSearch() {
this.getDeptListData({ name: `%${value}%` }); this.getDeptListData();
}, },
// 右边搜索 // 右边搜索
onSearchRight() { onSearchRight() {
......
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