diff --git a/ALOps_sys_fe/alops-ui/src/api/device/deviceInformation.js b/ALOps_sys_fe/alops-ui/src/api/device/deviceInformation.js index 62409f3d..cbb6dbf0 100644 --- a/ALOps_sys_fe/alops-ui/src/api/device/deviceInformation.js +++ b/ALOps_sys_fe/alops-ui/src/api/device/deviceInformation.js @@ -6,8 +6,7 @@ export function addRule(data) { return request({ url: api + 'addRule', method: 'post', - data: data, - headers: { 'Content-Type': 'application/json' } + data: data }) } // 查询规则 diff --git a/ALOps_sys_fe/alops-ui/src/api/device/files.js b/ALOps_sys_fe/alops-ui/src/api/device/files.js index 1718d272..55f3a8c2 100644 --- a/ALOps_sys_fe/alops-ui/src/api/device/files.js +++ b/ALOps_sys_fe/alops-ui/src/api/device/files.js @@ -48,7 +48,7 @@ export function update(data) { // 删除 export function del(id) { return request({ - url: api + 'delete' + id, + url: api + id, method: 'delete' }) } diff --git a/ALOps_sys_fe/alops-ui/src/api/device/supplier.js b/ALOps_sys_fe/alops-ui/src/api/device/supplier.js new file mode 100644 index 00000000..17424568 --- /dev/null +++ b/ALOps_sys_fe/alops-ui/src/api/device/supplier.js @@ -0,0 +1,49 @@ +import request from '@/utils/request' +const api = '/device/supplier/' + +// 查询详细 +export function getDict() { + return request({ + url: '/sys_dict', + method: 'get' + }) +} + +// 查询列表 +export function list(query) { + return request({ + url: api + 'query', + method: 'get', + params: query + }) +} + +// 新增 +export function add(data) { + return request({ + url: api + 'add', + method: 'post', + data: data + }) +} + +// 修改 +export function update(data) { + return request({ + url: api + 'edit', + method: 'put', + data: data + }) +} + +// 删除 +export function del(id) { + return request({ + url: api + id, + method: 'delete' + }) +} + + + + diff --git a/ALOps_sys_fe/alops-ui/src/utils/request.js b/ALOps_sys_fe/alops-ui/src/utils/request.js index 7150ecb1..aa4947b7 100644 --- a/ALOps_sys_fe/alops-ui/src/utils/request.js +++ b/ALOps_sys_fe/alops-ui/src/utils/request.js @@ -42,6 +42,7 @@ service.interceptors.request.use(config => { data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, time: new Date().getTime() } + console.log("%c 🛑: requestObj ", "font-size:16px;background-color:#4408a2;color:white;", requestObj) const requestSize = Object.keys(JSON.stringify(requestObj)).length // 请求数据大小 const limitSize = 5 * 1024 * 1024 // 限制存放数据5M if (requestSize >= limitSize) { diff --git a/ALOps_sys_fe/alops-ui/src/utils/ruoyi.js b/ALOps_sys_fe/alops-ui/src/utils/ruoyi.js index 3de2d98d..f968d9c9 100644 --- a/ALOps_sys_fe/alops-ui/src/utils/ruoyi.js +++ b/ALOps_sys_fe/alops-ui/src/utils/ruoyi.js @@ -52,16 +52,16 @@ export function resetForm(refName) { } // 添加日期范围 -export function addDateRange(params, dateRange, propName) { +export function addDateRange(params, dateRange, propNameStart, propNameEnd) { let search = params search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {} dateRange = Array.isArray(dateRange) ? dateRange : [] - if (typeof (propName) === 'undefined') { + if (typeof (propNameStart) === 'undefined') { search.params['beginTime'] = dateRange[0] search.params['endTime'] = dateRange[1] } else { - search.params['begin' + propName] = dateRange[0] - search.params['end' + propName] = dateRange[1] + search.params[propNameStart] = dateRange[0] + search.params[propNameEnd] = dateRange[1] } return search } diff --git a/ALOps_sys_fe/alops-ui/src/views/QandA/knowledge/index.vue b/ALOps_sys_fe/alops-ui/src/views/QandA/knowledge/index.vue index f1ff3efb..19c41b1f 100644 --- a/ALOps_sys_fe/alops-ui/src/views/QandA/knowledge/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/QandA/knowledge/index.vue @@ -164,10 +164,6 @@ export default { }, created() { this.getList() - // this.getDeptTree() - this.getConfigKey("sys.user.initPassword").then(response => { - this.initPassword = response.msg - }) }, methods: { /** 查询类型列表 */ diff --git a/ALOps_sys_fe/alops-ui/src/views/device/deviceInformation/index.vue b/ALOps_sys_fe/alops-ui/src/views/device/deviceInformation/index.vue index 5d3aacf0..29c03bbf 100644 --- a/ALOps_sys_fe/alops-ui/src/views/device/deviceInformation/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/device/deviceInformation/index.vue @@ -5,44 +5,51 @@ - + - 间隔采集 - 固定时间采集 - 立即采集 + 间隔采集 + 固定时间采集 + 立即采集 - + - - + - + start-placeholder="开始日期" + end-placeholder="结束日期" + :picker-options="{ disabledDate: disablePastDate }" + > + - + - - + @@ -69,7 +76,6 @@ import "splitpanes/dist/splitpanes.css" export default { name: "User", - dicts: ['sys_normal_disable', 'sys_user_sex'], components: { Treeselect, Splitpanes, Pane }, data() { return { @@ -93,13 +99,15 @@ export default { title: "", // 是否显示弹出层 open: false, - // 日期范围 - dateRange: [new Date(), new Date()], // 参数 queryParams: { - ruleType: 1, + ruleType: 0, frequency: 1, gatherTime: null, + startTime: null, + endTime: null, + // 日期范围 + dateRange: [], }, // 表单校验 @@ -108,28 +116,9 @@ export default { { required: true, message: "用户名称不能为空", trigger: "blur" }, { min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' } ], - nickName: [ + dateRange: [ { required: true, message: "用户昵称不能为空", trigger: "blur" } ], - password: [ - { required: true, message: "用户密码不能为空", trigger: "blur" }, - { min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }, - { pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" } - ], - email: [ - { - type: "email", - message: "请输入正确的邮箱地址", - trigger: ["blur", "change"] - } - ], - phonenumber: [ - { - pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, - message: "请输入正确的手机号码", - trigger: "blur" - } - ] } } }, @@ -141,96 +130,22 @@ export default { }, created() { this.getList() - // this.getDeptTree() - this.getConfigKey("sys.user.initPassword").then(response => { - this.initPassword = response.msg - }) }, methods: { /** 查询用户列表 */ getList() { this.loading = true - queryRule(this.addDateRange(this.queryParams, this.dateRange)).then(response => { - this.userList = response.rows - this.total = response.total + queryRule().then(response => { + this.queryParams = {...this.queryParams,...response.data} this.loading = false } ) }, - handleTimeChange(val) { - console.log('时间范围:', val); // val为数组 [start, end] - const [startTime, endTime] = val; - this.queryParams.startTime = startTime - this.queryParams.endTime = endTime - // 可在此处将值分别存储到其他变量 - }, - // 过滤禁用的部门 - filterDisabledDept(deptList) { - return deptList.filter(dept => { - if (dept.disabled) { - return false - } - if (dept.children && dept.children.length) { - dept.children = this.filterDisabledDept(dept.children) - } - return true - }) - }, - // 筛选节点 - filterNode(value, data) { - if (!value) return true - return data.label.indexOf(value) !== -1 - }, - // 用户状态修改 - handleStatusChange(row) { - let text = row.status === "0" ? "启用" : "停用" - this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() { - return changeUserStatus(row.userId, row.status) - }).then(() => { - this.$modal.msgSuccess(text + "成功") - }).catch(function() { - row.status = row.status === "0" ? "1" : "0" - }) - }, - // 取消按钮 - cancel() { - this.open = false - this.reset() - }, - // 表单重置 - reset() { - this.form = { - userId: undefined, - deptId: undefined, - userName: undefined, - nickName: undefined, - password: undefined, - phonenumber: undefined, - email: undefined, - sex: undefined, - status: "0", - remark: undefined, - postIds: [], - roleIds: [] - } - this.resetForm("form") - }, - /** 新增按钮操作 */ - handleAdd() { - this.reset() - getUser().then(response => { - this.postOptions = response.posts - this.roleOptions = response.roles - this.open = true - this.title = "添加用户" - this.form.password = this.initPassword - }) - }, /** 提交按钮 */ submitForm: function() { this.$refs["form"].validate(valid => { if (valid) { - addRule(this.form).then(response => { + addRule(this.queryParams).then(response => { this.$modal.msgSuccess("新增成功") this.open = false this.getList() @@ -238,47 +153,21 @@ export default { } }) }, - /** 删除按钮操作 */ - handleDelete(row) { - const userIds = row.userId || this.ids - this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() { - return delUser(userIds) - }).then(() => { - this.getList() - this.$modal.msgSuccess("删除成功") - }).catch(() => {}) - }, - /** 导出按钮操作 */ - handleExport() { - this.download('system/user/export', { - ...this.queryParams - }, `user_${new Date().getTime()}.xlsx`) - }, - /** 导入按钮操作 */ - handleImport() { - this.upload.title = "用户导入" - this.upload.open = true - }, - /** 下载模板操作 */ - importTemplate() { - this.download('system/user/importTemplate', { - }, `user_template_${new Date().getTime()}.xlsx`) - }, - // 文件上传中处理 - handleFileUploadProgress(event, file, fileList) { - this.upload.isUploading = true - }, - // 文件上传成功处理 - handleFileSuccess(response, file, fileList) { - this.upload.open = false - this.upload.isUploading = false - this.$refs.upload.clearFiles() - this.$alert("
" + response.msg + "
", "导入结果", { dangerouslyUseHTMLString: true }) - this.getList() + handleDateRangeChange(value) { + console.log("%c 🐁: handleDateRangeChange -> value ", "font-size:16px;background-color:#dbe986;color:black;", value) + this.queryParams.startTime = value[0] + this.queryParams.endTime = value[1] }, - // 提交上传文件 - submitFileForm() { - this.$refs.upload.submit() + + disablePastDate(time) { + // 获取当前日期(本地时间戳) + const today = new Date(); + // 重置时间为当天 00:00:00 + today.setHours(0, 0, 0, 0); + + // 禁用所有早于今天 00:00:00 的日期 + console.log("%c 🐇: disablePastDate -> time.getTime() < today.getTime() ", "font-size:16px;background-color:#c5c908;color:black;", time.getTime() , today.getTime(), time.getTime() < today.getTime()) + return time.getTime() < today.getTime(); } } } diff --git a/ALOps_sys_fe/alops-ui/src/views/device/deviceManufacturer/index.vue b/ALOps_sys_fe/alops-ui/src/views/device/deviceManufacturer/index.vue index 5a84e20d..9dea1060 100644 --- a/ALOps_sys_fe/alops-ui/src/views/device/deviceManufacturer/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/device/deviceManufacturer/index.vue @@ -96,8 +96,8 @@
- - + + @@ -240,10 +240,6 @@ export default { }, created() { this.getList() - // this.getDeptTree() - this.getConfigKey("sys.user.initPassword").then(response => { - this.initPassword = response.msg - }) }, methods: { /** 查询用户列表 */ diff --git a/ALOps_sys_fe/alops-ui/src/views/device/deviceSupplier/index.vue b/ALOps_sys_fe/alops-ui/src/views/device/deviceSupplier/index.vue index 2a1cefef..a426c45d 100644 --- a/ALOps_sys_fe/alops-ui/src/views/device/deviceSupplier/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/device/deviceSupplier/index.vue @@ -221,10 +221,6 @@ export default { }, created() { this.getList() - // this.getDeptTree() - this.getConfigKey("sys.user.initPassword").then(response => { - this.initPassword = response.msg - }) }, methods: { /** 查询用户列表 */ diff --git a/ALOps_sys_fe/alops-ui/src/views/device/deviceType/index.vue b/ALOps_sys_fe/alops-ui/src/views/device/deviceType/index.vue index da1b4e7f..91cfdbf1 100644 --- a/ALOps_sys_fe/alops-ui/src/views/device/deviceType/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/device/deviceType/index.vue @@ -62,7 +62,6 @@ - @@ -188,10 +187,6 @@ export default { }, created() { this.getList() - // this.getDeptTree() - this.getConfigKey("sys.user.initPassword").then(response => { - this.initPassword = response.msg - }) }, methods: { /** 查询类型列表 */ @@ -207,8 +202,6 @@ export default { upImage(fileList){ console.log(fileList) this.form.image = fileList - - }, // 取消按钮 cancel() { @@ -234,10 +227,7 @@ export default { }, /** 重置按钮操作 */ resetQuery() { - this.dateRange = [] this.resetForm("queryForm") - this.queryParams.deptId = undefined - this.$refs.tree.setCurrentKey(null) this.handleQuery() }, // 多选框选中数据 diff --git a/ALOps_sys_fe/alops-ui/src/views/device/files/index.vue b/ALOps_sys_fe/alops-ui/src/views/device/files/index.vue index 866eda70..18e5e9aa 100644 --- a/ALOps_sys_fe/alops-ui/src/views/device/files/index.vue +++ b/ALOps_sys_fe/alops-ui/src/views/device/files/index.vue @@ -6,27 +6,19 @@ + + + - - - - - - - - - - + - - - - + + 搜索 @@ -53,46 +45,43 @@ width="60" type="index" > - + - - + + - - - + - + - + + + + - - - - - + - - + + + {{ parseTime(scope.row.createDate) }} + -