remove all semicolons

This commit is contained in:
RuoYi
2025-04-27 10:05:51 +08:00
parent 27a037ed3d
commit 38ed092de7
92 changed files with 2285 additions and 2287 deletions

View File

@ -181,7 +181,7 @@
</template>
<script>
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config"
export default {
name: "Config",
@ -230,26 +230,26 @@ export default {
{ required: true, message: "参数键值不能为空", trigger: "blur" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询参数列表 */
getList() {
this.loading = true;
this.loading = true
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.configList = response.rows;
this.total = response.total;
this.loading = false;
this.configList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@ -260,25 +260,25 @@ export default {
configValue: undefined,
configType: "Y",
remark: undefined
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
this.dateRange = []
this.resetForm("queryForm")
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加参数";
this.reset()
this.open = true
this.title = "添加参数"
},
// 多选框选中数据
handleSelectionChange(selection) {
@ -288,13 +288,13 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const configId = row.configId || this.ids
getConfig(configId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改参数";
});
this.form = response.data
this.open = true
this.title = "修改参数"
})
},
/** 提交按钮 */
submitForm: function() {
@ -302,29 +302,29 @@ export default {
if (valid) {
if (this.form.configId != undefined) {
updateConfig(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addConfig(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const configIds = row.configId || this.ids;
const configIds = row.configId || this.ids
this.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function() {
return delConfig(configIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
return delConfig(configIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@ -335,9 +335,9 @@ export default {
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功");
});
this.$modal.msgSuccess("刷新成功")
})
}
}
};
}
</script>

View File

@ -158,9 +158,9 @@
</template>
<script>
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept"
import Treeselect from "@riophae/vue-treeselect"
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
export default {
name: "Dept",
@ -217,35 +217,35 @@ export default {
}
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询部门列表 */
getList() {
this.loading = true;
this.loading = true
listDept(this.queryParams).then(response => {
this.deptList = this.handleTree(response.data, "deptId");
this.loading = false;
});
this.deptList = this.handleTree(response.data, "deptId")
this.loading = false
})
},
/** 转换部门数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
delete node.children
}
return {
id: node.deptId,
label: node.deptName,
children: node.children
};
}
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@ -258,53 +258,53 @@ export default {
phone: undefined,
email: undefined,
status: "0"
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
this.reset()
if (row != undefined) {
this.form.parentId = row.deptId;
this.form.parentId = row.deptId
}
this.open = true;
this.title = "添加部门";
this.open = true
this.title = "添加部门"
listDept().then(response => {
this.deptOptions = this.handleTree(response.data, "deptId");
});
this.deptOptions = this.handleTree(response.data, "deptId")
})
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.refreshTable = false
this.isExpandAll = !this.isExpandAll
this.$nextTick(() => {
this.refreshTable = true;
});
this.refreshTable = true
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
getDept(row.deptId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改部门";
this.form = response.data
this.open = true
this.title = "修改部门"
listDeptExcludeChild(row.deptId).then(response => {
this.deptOptions = this.handleTree(response.data, "deptId");
this.deptOptions = this.handleTree(response.data, "deptId")
if (this.deptOptions.length == 0) {
const noResultsOptions = { deptId: this.form.parentId, deptName: this.form.parentName, children: [] };
this.deptOptions.push(noResultsOptions);
const noResultsOptions = { deptId: this.form.parentId, deptName: this.form.parentName, children: [] }
this.deptOptions.push(noResultsOptions)
}
});
});
})
})
},
/** 提交按钮 */
submitForm: function() {
@ -312,29 +312,29 @@ export default {
if (valid) {
if (this.form.deptId != undefined) {
updateDept(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addDept(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
return delDept(row.deptId);
return delDept(row.deptId)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
}
}
};
}
</script>

View File

@ -190,8 +190,8 @@
</template>
<script>
import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data";
import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/type";
import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data"
import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/type"
export default {
name: "Data",
@ -269,41 +269,41 @@ export default {
{ required: true, message: "数据顺序不能为空", trigger: "blur" }
]
}
};
}
},
created() {
const dictId = this.$route.params && this.$route.params.dictId;
this.getType(dictId);
this.getTypeList();
const dictId = this.$route.params && this.$route.params.dictId
this.getType(dictId)
this.getTypeList()
},
methods: {
/** 查询字典类型详细 */
getType(dictId) {
getType(dictId).then(response => {
this.queryParams.dictType = response.data.dictType;
this.defaultDictType = response.data.dictType;
this.getList();
});
this.queryParams.dictType = response.data.dictType
this.defaultDictType = response.data.dictType
this.getList()
})
},
/** 查询字典类型列表 */
getTypeList() {
getDictOptionselect().then(response => {
this.typeOptions = response.data;
});
this.typeOptions = response.data
})
},
/** 查询字典数据列表 */
getList() {
this.loading = true;
this.loading = true
listData(this.queryParams).then(response => {
this.dataList = response.rows;
this.total = response.total;
this.loading = false;
});
this.dataList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@ -316,31 +316,31 @@ export default {
dictSort: 0,
status: "0",
remark: undefined
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 返回按钮操作 */
handleClose() {
const obj = { path: "/system/dict" };
this.$tab.closeOpenPage(obj);
const obj = { path: "/system/dict" }
this.$tab.closeOpenPage(obj)
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.dictType = this.defaultDictType;
this.handleQuery();
this.resetForm("queryForm")
this.queryParams.dictType = this.defaultDictType
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加字典数据";
this.form.dictType = this.queryParams.dictType;
this.reset()
this.open = true
this.title = "添加字典数据"
this.form.dictType = this.queryParams.dictType
},
// 多选框选中数据
handleSelectionChange(selection) {
@ -350,13 +350,13 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const dictCode = row.dictCode || this.ids
getData(dictCode).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改字典数据";
});
this.form = response.data
this.open = true
this.title = "修改字典数据"
})
},
/** 提交按钮 */
submitForm: function() {
@ -364,32 +364,32 @@ export default {
if (valid) {
if (this.form.dictCode != undefined) {
updateData(this.form).then(response => {
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$store.dispatch('dict/removeDict', this.queryParams.dictType)
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addData(this.form).then(response => {
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$store.dispatch('dict/removeDict', this.queryParams.dictType)
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const dictCodes = row.dictCode || this.ids;
const dictCodes = row.dictCode || this.ids
this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() {
return delData(dictCodes);
return delData(dictCodes)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
this.$store.dispatch('dict/removeDict', this.queryParams.dictType)
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@ -398,5 +398,5 @@ export default {
}, `data_${new Date().getTime()}.xlsx`)
}
}
};
}
</script>

View File

@ -188,7 +188,7 @@
</template>
<script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type"
export default {
name: "Dict",
@ -234,26 +234,26 @@ export default {
{ required: true, message: "字典类型不能为空", trigger: "blur" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true;
this.loading = true
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.typeList = response.rows;
this.total = response.total;
this.loading = false;
this.typeList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@ -263,25 +263,25 @@ export default {
dictType: undefined,
status: "0",
remark: undefined
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
this.dateRange = []
this.resetForm("queryForm")
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加字典类型";
this.reset()
this.open = true
this.title = "添加字典类型"
},
// 多选框选中数据
handleSelectionChange(selection) {
@ -291,13 +291,13 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const dictId = row.dictId || this.ids
getType(dictId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改字典类型";
});
this.form = response.data
this.open = true
this.title = "修改字典类型"
})
},
/** 提交按钮 */
submitForm: function() {
@ -305,29 +305,29 @@ export default {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addType(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
const dictIds = row.dictId || this.ids
this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
return delType(dictIds);
return delType(dictIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@ -338,10 +338,10 @@ export default {
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功");
this.$store.dispatch('dict/cleanDict');
});
this.$modal.msgSuccess("刷新成功")
this.$store.dispatch('dict/cleanDict')
})
}
}
};
}
</script>

View File

@ -299,10 +299,10 @@
</template>
<script>
import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/menu";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import IconSelect from "@/components/IconSelect";
import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/menu"
import Treeselect from "@riophae/vue-treeselect"
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
import IconSelect from "@/components/IconSelect"
export default {
name: "Menu",
@ -345,48 +345,48 @@ export default {
{ required: true, message: "路由地址不能为空", trigger: "blur" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
// 选择图标
selected(name) {
this.form.icon = name;
this.form.icon = name
},
/** 查询菜单列表 */
getList() {
this.loading = true;
this.loading = true
listMenu(this.queryParams).then(response => {
this.menuList = this.handleTree(response.data, "menuId");
this.loading = false;
});
this.menuList = this.handleTree(response.data, "menuId")
this.loading = false
})
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
delete node.children
}
return {
id: node.menuId,
label: node.menuName,
children: node.children
};
}
},
/** 查询菜单下拉树结构 */
getTreeselect() {
listMenu().then(response => {
this.menuOptions = [];
const menu = { menuId: 0, menuName: '主类目', children: [] };
menu.children = this.handleTree(response.data, "menuId");
this.menuOptions.push(menu);
});
this.menuOptions = []
const menu = { menuId: 0, menuName: '主类目', children: [] }
menu.children = this.handleTree(response.data, "menuId")
this.menuOptions.push(menu)
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@ -401,47 +401,47 @@ export default {
isCache: "0",
visible: "0",
status: "0"
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
this.getTreeselect();
this.reset()
this.getTreeselect()
if (row != null && row.menuId) {
this.form.parentId = row.menuId;
this.form.parentId = row.menuId
} else {
this.form.parentId = 0;
this.form.parentId = 0
}
this.open = true;
this.title = "添加菜单";
this.open = true
this.title = "添加菜单"
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.refreshTable = false
this.isExpandAll = !this.isExpandAll
this.$nextTick(() => {
this.refreshTable = true;
});
this.refreshTable = true
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
this.reset()
this.getTreeselect()
getMenu(row.menuId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改菜单";
});
this.form = response.data
this.open = true
this.title = "修改菜单"
})
},
/** 提交按钮 */
submitForm: function() {
@ -449,29 +449,29 @@ export default {
if (valid) {
if (this.form.menuId != undefined) {
updateMenu(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addMenu(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?').then(function() {
return delMenu(row.menuId);
return delMenu(row.menuId)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
}
}
};
}
</script>

View File

@ -170,7 +170,7 @@
</template>
<script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice"
export default {
name: "Notice",
@ -214,25 +214,25 @@ export default {
{ required: true, message: "公告类型不能为空", trigger: "change" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询公告列表 */
getList() {
this.loading = true;
this.loading = true
listNotice(this.queryParams).then(response => {
this.noticeList = response.rows;
this.total = response.total;
this.loading = false;
});
this.noticeList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@ -242,18 +242,18 @@ export default {
noticeType: undefined,
noticeContent: undefined,
status: "0"
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
@ -263,19 +263,19 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加公告";
this.reset()
this.open = true
this.title = "添加公告"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const noticeId = row.noticeId || this.ids
getNotice(noticeId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改公告";
});
this.form = response.data
this.open = true
this.title = "修改公告"
})
},
/** 提交按钮 */
submitForm: function() {
@ -283,30 +283,30 @@ export default {
if (valid) {
if (this.form.noticeId != undefined) {
updateNotice(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addNotice(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const noticeIds = row.noticeId || this.ids
this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() {
return delNotice(noticeIds);
return delNotice(noticeIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
}
}
};
}
</script>

View File

@ -157,7 +157,7 @@
</template>
<script>
import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post";
import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post"
export default {
name: "Post",
@ -204,25 +204,25 @@ export default {
{ required: true, message: "岗位顺序不能为空", trigger: "blur" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询岗位列表 */
getList() {
this.loading = true;
this.loading = true
listPost(this.queryParams).then(response => {
this.postList = response.rows;
this.total = response.total;
this.loading = false;
});
this.postList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@ -233,18 +233,18 @@ export default {
postSort: 0,
status: "0",
remark: undefined
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
@ -254,19 +254,19 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加岗位";
this.reset()
this.open = true
this.title = "添加岗位"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const postId = row.postId || this.ids
getPost(postId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改岗位";
});
this.form = response.data
this.open = true
this.title = "修改岗位"
})
},
/** 提交按钮 */
submitForm: function() {
@ -274,29 +274,29 @@ export default {
if (valid) {
if (this.form.postId != undefined) {
updatePost(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addPost(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const postIds = row.postId || this.ids;
const postIds = row.postId || this.ids
this.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function() {
return delPost(postIds);
return delPost(postIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@ -305,5 +305,5 @@ export default {
}, `post_${new Date().getTime()}.xlsx`)
}
}
};
}
</script>

View File

@ -100,8 +100,8 @@
</template>
<script>
import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role";
import selectUser from "./selectUser";
import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role"
import selectUser from "./selectUser"
export default {
name: "AuthUser",
@ -129,40 +129,40 @@ export default {
userName: undefined,
phonenumber: undefined
}
};
}
},
created() {
const roleId = this.$route.params && this.$route.params.roleId;
const roleId = this.$route.params && this.$route.params.roleId
if (roleId) {
this.queryParams.roleId = roleId;
this.getList();
this.queryParams.roleId = roleId
this.getList()
}
},
methods: {
/** 查询授权用户列表 */
getList() {
this.loading = true;
this.loading = true
allocatedUserList(this.queryParams).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
this.userList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
// 返回按钮
handleClose() {
const obj = { path: "/system/role" };
this.$tab.closeOpenPage(obj);
const obj = { path: "/system/role" }
this.$tab.closeOpenPage(obj)
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
@ -171,29 +171,29 @@ export default {
},
/** 打开授权用户表弹窗 */
openSelectUser() {
this.$refs.select.show();
this.$refs.select.show()
},
/** 取消授权按钮操作 */
cancelAuthUser(row) {
const roleId = this.queryParams.roleId;
const roleId = this.queryParams.roleId
this.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function() {
return authUserCancel({ userId: row.userId, roleId: roleId });
return authUserCancel({ userId: row.userId, roleId: roleId })
}).then(() => {
this.getList();
this.$modal.msgSuccess("取消授权成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("取消授权成功")
}).catch(() => {})
},
/** 批量取消授权按钮操作 */
cancelAuthUserAll(row) {
const roleId = this.queryParams.roleId;
const userIds = this.userIds.join(",");
const roleId = this.queryParams.roleId
const userIds = this.userIds.join(",")
this.$modal.confirm('是否取消选中用户授权数据项?').then(function() {
return authUserCancelAll({ roleId: roleId, userIds: userIds });
return authUserCancelAll({ roleId: roleId, userIds: userIds })
}).then(() => {
this.getList();
this.$modal.msgSuccess("取消授权成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("取消授权成功")
}).catch(() => {})
}
}
};
}
</script>

View File

@ -252,8 +252,8 @@
</template>
<script>
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"
export default {
name: "Role",
@ -339,85 +339,85 @@ export default {
{ required: true, message: "角色顺序不能为空", trigger: "blur" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询角色列表 */
getList() {
this.loading = true;
this.loading = true
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.roleList = response.rows;
this.total = response.total;
this.loading = false;
this.roleList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
/** 查询菜单树结构 */
getMenuTreeselect() {
menuTreeselect().then(response => {
this.menuOptions = response.data;
});
this.menuOptions = response.data
})
},
// 所有菜单节点数据
getMenuAllCheckedKeys() {
// 目前被选中的菜单节点
let checkedKeys = this.$refs.menu.getCheckedKeys();
let checkedKeys = this.$refs.menu.getCheckedKeys()
// 半选中的菜单节点
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return checkedKeys
},
// 所有部门节点数据
getDeptAllCheckedKeys() {
// 目前被选中的部门节点
let checkedKeys = this.$refs.dept.getCheckedKeys();
let checkedKeys = this.$refs.dept.getCheckedKeys()
// 半选中的部门节点
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return checkedKeys
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => {
this.menuOptions = response.menus;
return response;
});
this.menuOptions = response.menus
return response
})
},
/** 根据角色ID查询部门树结构 */
getDeptTree(roleId) {
return deptTreeSelect(roleId).then(response => {
this.deptOptions = response.depts;
return response;
});
this.deptOptions = response.depts
return response
})
},
// 角色状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
let text = row.status === "0" ? "启用" : "停用"
this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function() {
return changeRoleStatus(row.roleId, row.status);
return changeRoleStatus(row.roleId, row.status)
}).then(() => {
this.$modal.msgSuccess(text + "成功");
this.$modal.msgSuccess(text + "成功")
}).catch(function() {
row.status = row.status === "0" ? "1" : "0";
});
row.status = row.status === "0" ? "1" : "0"
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 取消按钮(数据权限)
cancelDataScope() {
this.openDataScope = false;
this.reset();
this.openDataScope = false
this.reset()
},
// 表单重置
reset() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
this.$refs.menu.setCheckedKeys([])
}
this.menuExpand = false,
this.menuNodeAll = false,
@ -434,19 +434,19 @@ export default {
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
this.dateRange = []
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
@ -458,141 +458,141 @@ export default {
handleCommand(command, row) {
switch (command) {
case "handleDataScope":
this.handleDataScope(row);
break;
this.handleDataScope(row)
break
case "handleAuthUser":
this.handleAuthUser(row);
break;
this.handleAuthUser(row)
break
default:
break;
break
}
},
// 树权限(展开/折叠)
handleCheckedTreeExpand(value, type) {
if (type == 'menu') {
let treeList = this.menuOptions;
let treeList = this.menuOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value
}
} else if (type == 'dept') {
let treeList = this.deptOptions;
let treeList = this.deptOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value
}
}
},
// 树权限(全选/全不选)
handleCheckedTreeNodeAll(value, type) {
if (type == 'menu') {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
this.$refs.menu.setCheckedNodes(value ? this.menuOptions: [])
} else if (type == 'dept') {
this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
this.$refs.dept.setCheckedNodes(value ? this.deptOptions: [])
}
},
// 树权限(父子联动)
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
this.form.menuCheckStrictly = value ? true: false;
this.form.menuCheckStrictly = value ? true: false
} else if (type == 'dept') {
this.form.deptCheckStrictly = value ? true: false;
this.form.deptCheckStrictly = value ? true: false
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getMenuTreeselect();
this.open = true;
this.title = "添加角色";
this.reset()
this.getMenuTreeselect()
this.open = true
this.title = "添加角色"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const roleId = row.roleId || this.ids
const roleMenu = this.getRoleMenuTreeselect(roleId);
const roleMenu = this.getRoleMenuTreeselect(roleId)
getRole(roleId).then(response => {
this.form = response.data;
this.open = true;
this.form = response.data
this.open = true
this.$nextTick(() => {
roleMenu.then(res => {
let checkedKeys = res.checkedKeys
checkedKeys.forEach((v) => {
this.$nextTick(()=>{
this.$refs.menu.setChecked(v, true ,false);
this.$refs.menu.setChecked(v, true ,false)
})
})
});
});
});
this.title = "修改角色";
})
})
})
this.title = "修改角色"
},
/** 选择角色权限范围触发 */
dataScopeSelectChange(value) {
if(value !== '2') {
this.$refs.dept.setCheckedKeys([]);
this.$refs.dept.setCheckedKeys([])
}
},
/** 分配数据权限操作 */
handleDataScope(row) {
this.reset();
const deptTreeSelect = this.getDeptTree(row.roleId);
this.reset()
const deptTreeSelect = this.getDeptTree(row.roleId)
getRole(row.roleId).then(response => {
this.form = response.data;
this.openDataScope = true;
this.form = response.data
this.openDataScope = true
this.$nextTick(() => {
deptTreeSelect.then(res => {
this.$refs.dept.setCheckedKeys(res.checkedKeys);
});
});
});
this.title = "分配数据权限";
this.$refs.dept.setCheckedKeys(res.checkedKeys)
})
})
})
this.title = "分配数据权限"
},
/** 分配用户操作 */
handleAuthUser: function(row) {
const roleId = row.roleId;
this.$router.push("/system/role-auth/user/" + roleId);
const roleId = row.roleId
this.$router.push("/system/role-auth/user/" + roleId)
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.roleId != undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys();
this.form.menuIds = this.getMenuAllCheckedKeys()
updateRole(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
this.form.menuIds = this.getMenuAllCheckedKeys();
this.form.menuIds = this.getMenuAllCheckedKeys()
addRole(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 提交按钮(数据权限) */
submitDataScope: function() {
if (this.form.roleId != undefined) {
this.form.deptIds = this.getDeptAllCheckedKeys();
this.form.deptIds = this.getDeptAllCheckedKeys()
dataScope(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.openDataScope = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.openDataScope = false
this.getList()
})
}
},
/** 删除按钮操作 */
handleDelete(row) {
const roleIds = row.roleId || this.ids;
const roleIds = row.roleId || this.ids
this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() {
return delRole(roleIds);
return delRole(roleIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@ -601,5 +601,5 @@ export default {
}, `role_${new Date().getTime()}.xlsx`)
}
}
};
}
</script>

View File

@ -57,7 +57,7 @@
</template>
<script>
import { unallocatedUserList, authUserSelectAll } from "@/api/system/role";
import { unallocatedUserList, authUserSelectAll } from "@/api/system/role"
export default {
dicts: ['sys_normal_disable'],
props: {
@ -84,53 +84,53 @@ export default {
userName: undefined,
phonenumber: undefined
}
};
}
},
methods: {
// 显示弹框
show() {
this.queryParams.roleId = this.roleId;
this.getList();
this.visible = true;
this.queryParams.roleId = this.roleId
this.getList()
this.visible = true
},
clickRow(row) {
this.$refs.table.toggleRowSelection(row);
this.$refs.table.toggleRowSelection(row)
},
// 多选框选中数据
handleSelectionChange(selection) {
this.userIds = selection.map(item => item.userId);
this.userIds = selection.map(item => item.userId)
},
// 查询表数据
getList() {
unallocatedUserList(this.queryParams).then(res => {
this.userList = res.rows;
this.total = res.total;
});
this.userList = res.rows
this.total = res.total
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
/** 选择授权用户操作 */
handleSelectUser() {
const roleId = this.queryParams.roleId;
const userIds = this.userIds.join(",");
const roleId = this.queryParams.roleId
const userIds = this.userIds.join(",")
if (userIds == "") {
this.$modal.msgError("请选择要分配的用户");
return;
this.$modal.msgError("请选择要分配的用户")
return
}
authUserSelectAll({ roleId: roleId, userIds: userIds }).then(res => {
this.$modal.msgSuccess(res.msg);
this.visible = false;
this.$emit("ok");
});
this.$modal.msgSuccess(res.msg)
this.visible = false
this.$emit("ok")
})
}
}
};
}
</script>

View File

@ -46,7 +46,7 @@
</template>
<script>
import { getAuthRole, updateAuthRole } from "@/api/system/user";
import { getAuthRole, updateAuthRole } from "@/api/system/user"
export default {
name: "AuthRole",
@ -64,60 +64,60 @@ export default {
roles: [],
// 用户信息
form: {}
};
}
},
created() {
const userId = this.$route.params && this.$route.params.userId;
const userId = this.$route.params && this.$route.params.userId
if (userId) {
this.loading = true;
this.loading = true
getAuthRole(userId).then((response) => {
this.form = response.user;
this.roles = response.roles;
this.total = this.roles.length;
this.form = response.user
this.roles = response.roles
this.total = this.roles.length
this.$nextTick(() => {
this.roles.forEach((row) => {
if (row.flag) {
this.$refs.table.toggleRowSelection(row);
this.$refs.table.toggleRowSelection(row)
}
});
});
this.loading = false;
});
})
})
this.loading = false
})
}
},
methods: {
/** 单击选中行数据 */
clickRow(row) {
if (this.checkSelectable(row)) {
this.$refs.table.toggleRowSelection(row);
this.$refs.table.toggleRowSelection(row)
}
},
// 多选框选中数据
handleSelectionChange(selection) {
this.roleIds = selection.map((item) => item.roleId);
this.roleIds = selection.map((item) => item.roleId)
},
// 保存选中的数据编号
getRowKey(row) {
return row.roleId;
return row.roleId
},
// 检查角色状态
checkSelectable(row) {
return row.status === "0" ? true : false;
return row.status === "0" ? true : false
},
/** 提交按钮 */
submitForm() {
const userId = this.form.userId;
const roleIds = this.roleIds.join(",");
const userId = this.form.userId
const roleIds = this.roleIds.join(",")
updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => {
this.$modal.msgSuccess("授权成功");
this.close();
});
this.$modal.msgSuccess("授权成功")
this.close()
})
},
/** 关闭按钮 */
close() {
const obj = { path: "/system/user" };
this.$tab.closeOpenPage(obj);
},
},
};
const obj = { path: "/system/user" }
this.$tab.closeOpenPage(obj)
}
}
}
</script>

View File

@ -201,12 +201,12 @@
</template>
<script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { Splitpanes, Pane } from "splitpanes";
import "splitpanes/dist/splitpanes.css";
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user"
import { getToken } from "@/utils/auth"
import Treeselect from "@riophae/vue-treeselect"
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
import { Splitpanes, Pane } from "splitpanes"
import "splitpanes/dist/splitpanes.css"
export default {
name: "User",
@ -315,76 +315,76 @@ export default {
}
]
}
};
}
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
this.$refs.tree.filter(val)
}
},
created() {
this.getList();
this.getDeptTree();
this.getList()
this.getDeptTree()
this.getConfigKey("sys.user.initPassword").then(response => {
this.initPassword = response.msg;
});
this.initPassword = response.msg
})
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true;
this.loading = true
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
this.userList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then(response => {
this.deptOptions = response.data;
this.enabledDeptOptions = this.filterDisabledDept(JSON.parse(JSON.stringify(response.data)));
});
this.deptOptions = response.data
this.enabledDeptOptions = this.filterDisabledDept(JSON.parse(JSON.stringify(response.data)))
})
},
// 过滤禁用的部门
filterDisabledDept(deptList) {
return deptList.filter(dept => {
if (dept.disabled) {
return false;
return false
}
if (dept.children && dept.children.length) {
dept.children = this.filterDisabledDept(dept.children);
dept.children = this.filterDisabledDept(dept.children)
}
return true;
});
return true
})
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
if (!value) return true
return data.label.indexOf(value) !== -1
},
// 节点单击事件
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.handleQuery();
this.queryParams.deptId = data.id
this.handleQuery()
},
// 用户状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
let text = row.status === "0" ? "启用" : "停用"
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
return changeUserStatus(row.userId, row.status);
return changeUserStatus(row.userId, row.status)
}).then(() => {
this.$modal.msgSuccess(text + "成功");
this.$modal.msgSuccess(text + "成功")
}).catch(function() {
row.status = row.status === "0" ? "1" : "0";
});
row.status = row.status === "0" ? "1" : "0"
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@ -401,66 +401,66 @@ export default {
remark: undefined,
postIds: [],
roleIds: []
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.queryParams.deptId = undefined;
this.$refs.tree.setCurrentKey(null);
this.handleQuery();
this.dateRange = []
this.resetForm("queryForm")
this.queryParams.deptId = undefined
this.$refs.tree.setCurrentKey(null)
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.userId);
this.single = selection.length != 1;
this.multiple = !selection.length;
this.ids = selection.map(item => item.userId)
this.single = selection.length != 1
this.multiple = !selection.length
},
// 更多操作触发
handleCommand(command, row) {
switch (command) {
case "handleResetPwd":
this.handleResetPwd(row);
break;
this.handleResetPwd(row)
break
case "handleAuthRole":
this.handleAuthRole(row);
break;
this.handleAuthRole(row)
break
default:
break;
break
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.reset()
getUser().then(response => {
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.open = true;
this.title = "添加用户";
this.form.password = this.initPassword;
});
this.postOptions = response.posts
this.roleOptions = response.roles
this.open = true
this.title = "添加用户"
this.form.password = this.initPassword
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const userId = row.userId || this.ids;
this.reset()
const userId = row.userId || this.ids
getUser(userId).then(response => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.$set(this.form, "postIds", response.postIds);
this.$set(this.form, "roleIds", response.roleIds);
this.open = true;
this.title = "修改用户";
this.form.password = "";
});
this.form = response.data
this.postOptions = response.posts
this.roleOptions = response.roles
this.$set(this.form, "postIds", response.postIds)
this.$set(this.form, "roleIds", response.roleIds)
this.open = true
this.title = "修改用户"
this.form.password = ""
})
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
@ -477,14 +477,14 @@ export default {
},
}).then(({ value }) => {
resetUserPwd(row.userId, value).then(response => {
this.$modal.msgSuccess("修改成功,新密码是:" + value);
});
}).catch(() => {});
this.$modal.msgSuccess("修改成功,新密码是:" + value)
})
}).catch(() => {})
},
/** 分配角色操作 */
handleAuthRole: function(row) {
const userId = row.userId;
this.$router.push("/system/user-auth/role/" + userId);
const userId = row.userId
this.$router.push("/system/user-auth/role/" + userId)
},
/** 提交按钮 */
submitForm: function() {
@ -492,29 +492,29 @@ export default {
if (valid) {
if (this.form.userId != undefined) {
updateUser(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addUser(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const userIds = row.userId || this.ids;
const userIds = row.userId || this.ids
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
return delUser(userIds);
return delUser(userIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@ -524,8 +524,8 @@ export default {
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.open = true;
this.upload.title = "用户导入"
this.upload.open = true
},
/** 下载模板操作 */
importTemplate() {
@ -534,20 +534,20 @@ export default {
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
this.upload.isUploading = true
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
this.getList()
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
this.$refs.upload.submit()
}
}
};
}
</script>

View File

@ -59,10 +59,10 @@
</template>
<script>
import userAvatar from "./userAvatar";
import userInfo from "./userInfo";
import resetPwd from "./resetPwd";
import { getUserProfile } from "@/api/system/user";
import userAvatar from "./userAvatar"
import userInfo from "./userInfo"
import resetPwd from "./resetPwd"
import { getUserProfile } from "@/api/system/user"
export default {
name: "Profile",
@ -73,19 +73,19 @@ export default {
roleGroup: {},
postGroup: {},
activeTab: "userinfo"
};
}
},
created() {
this.getUser();
this.getUser()
},
methods: {
getUser() {
getUserProfile().then(response => {
this.user = response.data;
this.roleGroup = response.roleGroup;
this.postGroup = response.postGroup;
});
this.user = response.data
this.roleGroup = response.roleGroup
this.postGroup = response.postGroup
})
}
}
};
}
</script>

View File

@ -17,17 +17,17 @@
</template>
<script>
import { updateUserPwd } from "@/api/system/user";
import { updateUserPwd } from "@/api/system/user"
export default {
data() {
const equalToPassword = (rule, value, callback) => {
if (this.user.newPassword !== value) {
callback(new Error("两次输入的密码不一致"));
callback(new Error("两次输入的密码不一致"))
} else {
callback();
callback()
}
};
}
return {
user: {
oldPassword: undefined,
@ -49,21 +49,21 @@ export default {
{ required: true, validator: equalToPassword, trigger: "blur" }
]
}
};
}
},
methods: {
submit() {
this.$refs["form"].validate(valid => {
if (valid) {
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
this.$modal.msgSuccess("修改成功");
});
this.$modal.msgSuccess("修改成功")
})
}
});
})
},
close() {
this.$tab.closePage();
this.$tab.closePage()
}
}
};
}
</script>

View File

@ -54,9 +54,9 @@
</template>
<script>
import store from "@/store";
import { VueCropper } from "vue-cropper";
import { uploadAvatar } from "@/api/system/user";
import store from "@/store"
import { VueCropper } from "vue-cropper"
import { uploadAvatar } from "@/api/system/user"
import { debounce } from '@/utils'
export default {
@ -80,16 +80,16 @@ export default {
},
previews: {},
resizeHandler: null
};
}
},
methods: {
// 编辑头像
editCropper() {
this.open = true;
this.open = true
},
// 打开弹出层结束时的回调
modalOpened() {
this.visible = true;
this.visible = true
if (!this.resizeHandler) {
this.resizeHandler = debounce(() => {
this.refresh()
@ -99,63 +99,63 @@ export default {
},
// 刷新组件
refresh() {
this.$refs.cropper.refresh();
this.$refs.cropper.refresh()
},
// 覆盖默认的上传行为
requestUpload() {
},
// 向左旋转
rotateLeft() {
this.$refs.cropper.rotateLeft();
this.$refs.cropper.rotateLeft()
},
// 向右旋转
rotateRight() {
this.$refs.cropper.rotateRight();
this.$refs.cropper.rotateRight()
},
// 图片缩放
changeScale(num) {
num = num || 1;
this.$refs.cropper.changeScale(num);
num = num || 1
this.$refs.cropper.changeScale(num)
},
// 上传预处理
beforeUpload(file) {
if (file.type.indexOf("image/") == -1) {
this.$modal.msgError("文件格式错误,请上传图片类型,如JPGPNG后缀的文件。");
this.$modal.msgError("文件格式错误,请上传图片类型,如JPGPNG后缀的文件。")
} else {
const reader = new FileReader();
reader.readAsDataURL(file);
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = () => {
this.options.img = reader.result;
this.options.filename = file.name;
};
this.options.img = reader.result
this.options.filename = file.name
}
}
},
// 上传图片
uploadImg() {
this.$refs.cropper.getCropBlob(data => {
let formData = new FormData();
formData.append("avatarfile", data, this.options.filename);
let formData = new FormData()
formData.append("avatarfile", data, this.options.filename)
uploadAvatar(formData).then(response => {
this.open = false;
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
store.commit('SET_AVATAR', this.options.img);
this.$modal.msgSuccess("修改成功");
this.visible = false;
});
});
this.open = false
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl
store.commit('SET_AVATAR', this.options.img)
this.$modal.msgSuccess("修改成功")
this.visible = false
})
})
},
// 实时预览
realTime(data) {
this.previews = data;
this.previews = data
},
// 关闭窗口
closeDialog() {
this.options.img = store.getters.avatar
this.visible = false;
this.visible = false
window.removeEventListener("resize", this.resizeHandler)
}
}
};
}
</script>
<style scoped lang="scss">
.user-info-head {

View File

@ -23,7 +23,7 @@
</template>
<script>
import { updateUserProfile } from "@/api/system/user";
import { updateUserProfile } from "@/api/system/user"
export default {
props: {
@ -56,13 +56,13 @@ export default {
}
]
}
};
}
},
watch: {
user: {
handler(user) {
if (user) {
this.form = { nickName: user.nickName, phonenumber: user.phonenumber, email: user.email, sex: user.sex };
this.form = { nickName: user.nickName, phonenumber: user.phonenumber, email: user.email, sex: user.sex }
}
},
immediate: true
@ -73,16 +73,16 @@ export default {
this.$refs["form"].validate(valid => {
if (valid) {
updateUserProfile(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.user.phonenumber = this.form.phonenumber;
this.user.email = this.form.email;
});
this.$modal.msgSuccess("修改成功")
this.user.phonenumber = this.form.phonenumber
this.user.email = this.form.email
})
}
});
})
},
close() {
this.$tab.closePage();
this.$tab.closePage()
}
}
};
}
</script>