diff --git a/.env.dev b/.env.dev index 8214fb5..326077f 100644 --- a/.env.dev +++ b/.env.dev @@ -1,7 +1,7 @@ ### # @Author: zhp # @Date: 2024-04-28 13:42:51 - # @LastEditTime: 2024-05-21 09:39:07 + # @LastEditTime: 2024-05-22 16:29:35 # @LastEditors: DY # @Description: ### @@ -12,9 +12,9 @@ ENV = 'development' VUE_APP_TITLE = 芋道管理系统 # 芋道管理系统/开发环境 -# VUE_APP_BASE_API = 'http://192.168.1.61:48080' +# VUE_APP_BASE_API = 'http://192.168.1.70:30307' VUE_APP_BASE_API = 'http://glass.kszny.picaiba.com' -# + # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/src/api/produceData/index.js b/src/api/produceData/index.js index 5e99ead..155b7e2 100644 --- a/src/api/produceData/index.js +++ b/src/api/produceData/index.js @@ -1,7 +1,7 @@ /* * @Author: zhp * @Date: 2024-05-07 08:54:59 - * @LastEditTime: 2024-05-20 16:24:15 + * @LastEditTime: 2024-05-22 16:31:08 * @LastEditors: DY * @Description: */ @@ -131,10 +131,10 @@ export function importDiTarget(data) { // }) // } -export function cockpitDataMonitor(query) { +export function cockpitDataMonitor(data) { return request({ - url: 'https://restapi.amap.com/v3/weather/weatherInfo?key=95bdbdc1c387a170105f84cd416c4c9f&city=110108', - method: 'get', - query: query + url: '/ip/prod-output/cockpitDataMonitor', + method: 'post', + data: data }) } diff --git a/src/assets/icons/svg/orgTreeIcon.svg b/src/assets/icons/svg/orgTreeIcon.svg new file mode 100644 index 0000000..247a5ae --- /dev/null +++ b/src/assets/icons/svg/orgTreeIcon.svg @@ -0,0 +1,14 @@ + + + 菜单 + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/icons/svg/orgTreeIcon2.svg b/src/assets/icons/svg/orgTreeIcon2.svg new file mode 100644 index 0000000..a43bd80 --- /dev/null +++ b/src/assets/icons/svg/orgTreeIcon2.svg @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 11d9c3d..f3c0b35 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -123,7 +123,7 @@ aside { //main-container全局样式 .app-container { - padding: 16px; + // padding: 16px; } .components-container { diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 44fc12f..1845d89 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -17,20 +17,20 @@ diff --git a/src/views/copilot/factoryData/components/Energy.vue b/src/views/copilot/factoryData/components/Energy.vue index 5339644..fd6841c 100644 --- a/src/views/copilot/factoryData/components/Energy.vue +++ b/src/views/copilot/factoryData/components/Energy.vue @@ -18,19 +18,11 @@ import * as echarts from "echarts"; export default { name: "Energy", props: { - vHeight: { - type: Number, - default: 34, - }, legend: { type: Array, required: true, }, - xAxis: { - type: Array, - required: true, - }, - series: { + energyCockpits: { type: Array, required: true, }, @@ -43,11 +35,10 @@ export default { options: { color: ["#FFD160", "#2760FF", "#12FFF5"], grid: { - left: "3%", - right: "4%", - bottom: "0", + left: "7%", + right: "7%", + bottom: "8%", top: "15%", - containLabel: true, }, tooltip: { trigger: "axis", @@ -65,7 +56,7 @@ export default { color: "rgba(255, 255, 255, 0.7)", fontSize: 12, }, - data: this.xAxis, + data: [], }, yAxis: [ { @@ -190,6 +181,11 @@ export default { }, }; }, + computed: { + isOpen() { + return this.$store.getters.sidebar.opened; + }, + }, watch: { /** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */ // isFullscreen(val) { @@ -216,6 +212,12 @@ export default { // this.actualOptions = actualOptions; // this.initOptions(actualOptions); // }, + energyCockpits() { + this.initChart(); + }, + isOpen(val) { + this.canvasReset(); + }, }, mounted() { // if (screenfull.isEnabled) { @@ -241,17 +243,60 @@ export default { }, 500)(); }, initChart() { + let energyxAxis = []; + let n = 0; + let seriesArr = [ + { + name: "水", + energyType: 1, + data: [], + }, + { + name: "电", + energyType: 2, + data: [], + }, + { + name: "气", + energyType: 3, + data: [], + }, + ]; + if (this.energyCockpits.length > 0) { + let dataArr = this.energyCockpits.map((item) => { + return item.groupName; + }); + energyxAxis = Array.from(new Set(dataArr)); + n = energyxAxis.length; + seriesArr[0].data = Array.from({ length: n }, () => 0); + seriesArr[1].data = Array.from({ length: n }, () => 0); + seriesArr[2].data = Array.from({ length: n }, () => 0); + for (let i = 0; i < this.energyCockpits.length; i++) { + for (let j = 0; j < energyxAxis.length; j++) { + if (this.energyCockpits[i].groupName === energyxAxis[j]) { + if (this.energyCockpits[i].energyType === 1) { + seriesArr[0].data[j] = this.energyCockpits[i].totalEnergyValue; + } else if (this.energyCockpits[i].energyType === 2) { + seriesArr[1].data[j] = this.energyCockpits[i].totalEnergyValue; + } else if (this.energyCockpits[i].energyType === 3) { + seriesArr[2].data[j] = this.energyCockpits[i].totalEnergyValue; + } + } + } + } + } if (this.chart) { this.chart.dispose(); } this.chart = echarts.init(document.getElementById("factoryEnergyChart")); const actualOptions = JSON.parse(JSON.stringify(this.options)); - actualOptions.series[0].data = this.series[0].data; - actualOptions.series[0].name = this.series[0].name; - actualOptions.series[1].data = this.series[1].data; - actualOptions.series[1].name = this.series[1].name; - actualOptions.series[2].data = this.series[2].data; - actualOptions.series[2].name = this.series[2].name; + actualOptions.xAxis.data = energyxAxis; + actualOptions.series[0].data = seriesArr[0].data; + actualOptions.series[0].name = seriesArr[0].name; + actualOptions.series[1].data = seriesArr[1].data; + actualOptions.series[1].name = seriesArr[1].name; + actualOptions.series[2].data = seriesArr[2].data; + actualOptions.series[2].name = seriesArr[2].name; this.actualOptions = actualOptions; this.chart.setOption(actualOptions); }, diff --git a/src/views/copilot/factoryData/components/Order.vue b/src/views/copilot/factoryData/components/Order.vue index 5515fe4..8cec3dc 100644 --- a/src/views/copilot/factoryData/components/Order.vue +++ b/src/views/copilot/factoryData/components/Order.vue @@ -1,8 +1,9 @@ diff --git a/src/views/system/loginlog/index.vue b/src/views/system/loginlog/index.vue index 53b7d71..e98e8e4 100644 --- a/src/views/system/loginlog/index.vue +++ b/src/views/system/loginlog/index.vue @@ -2,63 +2,138 @@
- + - + - + - - - + + + - + - 搜索 + 搜索 重置 - 导出 + 导出 - + - + - - + + - + - +
@@ -86,8 +161,8 @@ export default { userIp: undefined, username: undefined, status: undefined, - createTime: [] - } + createTime: [], + }, }; }, created() { @@ -97,12 +172,11 @@ export default { /** 查询登录日志列表 */ getList() { this.loading = true; - list(this.queryParams).then(response => { - this.list = response.data.list; - this.total = response.data.total; - this.loading = false; - } - ); + list(this.queryParams).then((response) => { + this.list = response.data.list; + this.total = response.data.total; + this.loading = false; + }); }, /** 搜索按钮操作 */ handleQuery() { @@ -116,19 +190,31 @@ export default { }, /** 导出按钮操作 */ handleExport() { - this.$modal.confirm('是否确认导出所有操作日志数据项?').then(() => { + this.$modal + .confirm("是否确认导出所有操作日志数据项?") + .then(() => { // 处理查询参数 - let params = {...this.queryParams}; + let params = { ...this.queryParams }; params.pageNo = undefined; params.pageSize = undefined; this.exportLoading = true; return exportLoginLog(params); - }).then(response => { - this.$download.excel(response, '登录日志.xls'); + }) + .then((response) => { + this.$download.excel(response, "登录日志.xls"); this.exportLoading = false; - }).catch(() => {}); - } - } + }) + .catch(() => {}); + }, + }, }; - + diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index a8be162..ba43566 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -1,59 +1,146 @@ + diff --git a/src/views/system/operatelog/index.vue b/src/views/system/operatelog/index.vue index a692000..42ac5b4 100644 --- a/src/views/system/operatelog/index.vue +++ b/src/views/system/operatelog/index.vue @@ -1,84 +1,184 @@ @@ -233,19 +470,19 @@ import { importTemplate, listUser, resetUserPwd, - updateUser + updateUser, } from "@/api/system/user"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; -import {listSimpleDepts} from "@/api/system/dept"; -import {listSimplePosts} from "@/api/system/post"; +import { listSimpleDepts } from "@/api/system/dept"; +import { listSimplePosts } from "@/api/system/post"; -import {CommonStatusEnum} from "@/utils/constants"; -import {DICT_TYPE, getDictDatas} from "@/utils/dict"; -import {assignUserRole, listUserRoles} from "@/api/system/permission"; -import {listSimpleRoles} from "@/api/system/role"; -import {getBaseHeader} from "@/utils/request"; +import { CommonStatusEnum } from "@/utils/constants"; +import { DICT_TYPE, getDictDatas } from "@/utils/dict"; +import { assignUserRole, listUserRoles } from "@/api/system/permission"; +import { listSimpleRoles } from "@/api/system/role"; +import { getBaseHeader } from "@/utils/request"; export default { name: "SystemUser", @@ -282,7 +519,7 @@ export default { form: {}, defaultProps: { children: "children", - label: "name" + label: "name", }, // 用户导入参数 upload: { @@ -297,7 +534,7 @@ export default { // 设置上传的请求头部 headers: getBaseHeader(), // 上传的地址 - url: process.env.VUE_APP_BASE_API + '/admin-api/system/user/import' + url: process.env.VUE_APP_BASE_API + "/admin-api/system/user/import", }, // 查询参数 queryParams: { @@ -307,7 +544,7 @@ export default { mobile: undefined, status: undefined, deptId: undefined, - createTime: [] + createTime: [], }, // 列信息 columns: [ @@ -317,33 +554,34 @@ export default { { key: 3, label: `部门`, visible: true }, { key: 4, label: `手机号码`, visible: true }, { key: 5, label: `状态`, visible: true }, - { key: 6, label: `创建时间`, visible: true } + { key: 6, label: `创建时间`, visible: true }, ], // 表单校验 rules: { username: [ - { required: true, message: "用户名称不能为空", trigger: "blur" } + { required: true, message: "用户名称不能为空", trigger: "blur" }, ], nickname: [ - { required: true, message: "用户昵称不能为空", trigger: "blur" } + { required: true, message: "用户昵称不能为空", trigger: "blur" }, ], password: [ - { required: true, message: "用户密码不能为空", trigger: "blur" } + { required: true, message: "用户密码不能为空", trigger: "blur" }, ], email: [ { type: "email", message: "'请输入正确的邮箱地址", - trigger: ["blur", "change"] - } + trigger: ["blur", "change"], + }, ], mobile: [ { - pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/, + pattern: + /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/, message: "请输入正确的手机号码", - trigger: "blur" - } - ] + trigger: "blur", + }, + ], }, // 是否显示弹出层(角色权限) openRole: false, @@ -359,7 +597,7 @@ export default { // 根据名称筛选部门树 deptName(val) { this.$refs.tree.filter(val); - } + }, }, created() { this.getList(); @@ -372,16 +610,16 @@ export default { // 更多操作 handleCommand(command, index, row) { switch (command) { - case 'handleUpdate': - this.handleUpdate(row);//修改客户信息 + case "handleUpdate": + this.handleUpdate(row); //修改客户信息 break; - case 'handleDelete': - this.handleDelete(row);//红号变更 + case "handleDelete": + this.handleDelete(row); //红号变更 break; - case 'handleResetPwd': + case "handleResetPwd": this.handleResetPwd(row); break; - case 'handleRole': + case "handleRole": this.handleRole(row); break; default: @@ -391,21 +629,20 @@ export default { /** 查询用户列表 */ getList() { this.loading = true; - listUser(this.queryParams).then(response => { - this.userList = response.data.list; - this.total = response.data.total; - this.loading = false; - } - ); + listUser(this.queryParams).then((response) => { + this.userList = response.data.list; + this.total = response.data.total; + this.loading = false; + }); }, /** 查询部门下拉树结构 + 岗位下拉 */ getTreeselect() { - listSimpleDepts().then(response => { + listSimpleDepts().then((response) => { // 处理 deptOptions 参数 this.deptOptions = []; this.deptOptions.push(...this.handleTree(response.data, "id")); }); - listSimplePosts().then(response => { + listSimplePosts().then((response) => { // 处理 postOptions 参数 this.postOptions = []; this.postOptions.push(...response.data); @@ -424,12 +661,18 @@ export default { // 用户状态修改 handleStatusChange(row) { let text = row.status === CommonStatusEnum.ENABLE ? "启用" : "停用"; - this.$modal.confirm('确认要"' + text + '""' + row.username + '"用户吗?').then(function() { + this.$modal + .confirm('确认要"' + text + '""' + row.username + '"用户吗?') + .then(function () { return changeUserStatus(row.id, row.status); - }).then(() => { + }) + .then(() => { this.$modal.msgSuccess(text + "成功"); - }).catch(function() { - row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE + }) + .catch(function () { + row.status = + row.status === CommonStatusEnum.ENABLE + ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE; }); }, @@ -457,7 +700,7 @@ export default { status: "0", remark: undefined, postIds: [], - roleIds: [] + roleIds: [], }; this.resetForm("form"); }, @@ -486,7 +729,7 @@ export default { this.reset(); this.getTreeselect(); const id = row.id; - getUser(id).then(response => { + getUser(id).then((response) => { this.form = response.data; this.open = true; this.title = "修改用户"; @@ -496,17 +739,19 @@ export default { handleResetPwd(row) { this.$prompt('请输入"' + row.username + '"的新密码', "提示", { confirmButtonText: "确定", - cancelButtonText: "取消" - }).then(({ value }) => { - resetUserPwd(row.id, value).then(response => { + cancelButtonText: "取消", + }) + .then(({ value }) => { + resetUserPwd(row.id, value).then((response) => { this.$modal.msgSuccess("修改成功,新密码是:" + value); }); - }).catch(() => {}); + }) + .catch(() => {}); }, /** 分配用户角色操作 */ handleRole(row) { this.reset(); - const id = row.id + const id = row.id; // 处理了 form 的用户 username 和 nickname 的展示 this.form.id = id; this.form.username = row.username; @@ -514,29 +759,29 @@ export default { // 打开弹窗 this.openRole = true; // 获得角色列表 - listSimpleRoles().then(response => { + listSimpleRoles().then((response) => { // 处理 roleOptions 参数 this.roleOptions = []; this.roleOptions.push(...response.data); }); // 获得角色拥有的菜单集合 - listUserRoles(id).then(response => { + listUserRoles(id).then((response) => { // 设置选中 this.form.roleIds = response.data; - }) + }); }, /** 提交按钮 */ - submitForm: function() { - this.$refs["form"].validate(valid => { + submitForm: function () { + this.$refs["form"].validate((valid) => { if (valid) { if (this.form.id !== undefined) { - updateUser(this.form).then(response => { + updateUser(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); }); } else { - addUser(this.form).then(response => { + addUser(this.form).then((response) => { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); @@ -546,12 +791,12 @@ export default { }); }, /** 提交按钮(角色权限) */ - submitRole: function() { + submitRole: function () { if (this.form.id !== undefined) { assignUserRole({ userId: this.form.id, roleIds: this.form.roleIds, - }).then(response => { + }).then((response) => { this.$modal.msgSuccess("分配角色成功"); this.openRole = false; this.getList(); @@ -561,26 +806,34 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const ids = row.id || this.ids; - this.$modal.confirm('是否确认删除用户编号为"' + ids + '"的数据项?').then(function() { + this.$modal + .confirm('是否确认删除用户编号为"' + ids + '"的数据项?') + .then(function () { return delUser(ids); - }).then(() => { + }) + .then(() => { this.getList(); this.$modal.msgSuccess("删除成功"); - }).catch(() => {}); + }) + .catch(() => {}); }, /** 导出按钮操作 */ handleExport() { - this.$modal.confirm('是否确认导出所有用户数据项?').then(() => { + this.$modal + .confirm("是否确认导出所有用户数据项?") + .then(() => { // 处理查询参数 - let params = {...this.queryParams}; + let params = { ...this.queryParams }; params.pageNo = undefined; params.pageSize = undefined; this.exportLoading = true; return exportUser(params); - }).then(response => { - this.$download.excel(response, '用户数据.xls'); + }) + .then((response) => { + this.$download.excel(response, "用户数据.xls"); this.exportLoading = false; - }).catch(() => {}); + }) + .catch(() => {}); }, /** 导入按钮操作 */ handleImport() { @@ -589,8 +842,8 @@ export default { }, /** 下载模板操作 */ importTemplate() { - importTemplate().then(response => { - this.$download.excel(response, '用户导入模板.xls'); + importTemplate().then((response) => { + this.$download.excel(response, "用户导入模板.xls"); }); }, // 文件上传中处理 @@ -600,7 +853,7 @@ export default { // 文件上传成功处理 handleFileSuccess(response, file, fileList) { if (response.code !== 0) { - this.$modal.msgError(response.msg) + this.$modal.msgError(response.msg); return; } this.upload.open = false; @@ -608,17 +861,22 @@ export default { this.$refs.upload.clearFiles(); // 拼接提示语 let data = response.data; - let text = '创建成功数量:' + data.createUsernames.length; + let text = "创建成功数量:" + data.createUsernames.length; for (const username of data.createUsernames) { - text += '
    ' + username; + text += "
    " + username; } - text += '
更新成功数量:' + data.updateUsernames.length; + text += "
更新成功数量:" + data.updateUsernames.length; for (const username of data.updateUsernames) { - text += '
    ' + username; + text += "
    " + username; } - text += '
更新失败数量:' + Object.keys(data.failureUsernames).length; + text += + "
更新失败数量:" + Object.keys(data.failureUsernames).length; for (const username in data.failureUsernames) { - text += '
    ' + username + ':' + data.failureUsernames[username]; + text += + "
    " + + username + + ":" + + data.failureUsernames[username]; } this.$alert(text, "导入结果", { dangerouslyUseHTMLString: true }); this.getList(); @@ -632,9 +890,18 @@ export default { return { id: node.id, label: node.name, - children: node.children - } - } - } + children: node.children, + }; + }, + }, }; +