Compare commits
5 Commits
2da26d5f47
...
4749cdce3c
Author | SHA1 | Date | |
---|---|---|---|
4749cdce3c | |||
df3da71c59 | |||
d80aa54c8e | |||
3463bc7993 | |||
f3c5e1924b |
@ -5,7 +5,10 @@ VITE_APP_TITLE = 云平台管理系统
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 开发环境
|
||||
VITE_APP_BASE_API = 'https://fuyuanshen.com/backend'
|
||||
# VITE_APP_BASE_API = 'http://47.120.79.150/backend'
|
||||
VITE_APP_BASE_API = 'http://192.168.110.54:8000'
|
||||
# VITE_APP_BASE_API = 'http://localhost:8000'
|
||||
|
||||
|
||||
# 应用访问路径 例如使用前缀 /admin/
|
||||
VITE_APP_CONTEXT_PATH = '/'
|
||||
@ -16,7 +19,7 @@ VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/admin/applications'
|
||||
# SnailJob 控制台地址
|
||||
VITE_APP_SNAILJOB_ADMIN = 'http://localhost:8800/snail-job'
|
||||
|
||||
VITE_APP_PORT = 80
|
||||
VITE_APP_PORT = 9000
|
||||
|
||||
# 接口加密功能开关(如需关闭 后端也必须对应关闭)
|
||||
VITE_APP_ENCRYPT = true
|
||||
|
@ -40,7 +40,7 @@ function getTreeData(para: any) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
Promise.allSettled([promise2]).then(res => {
|
||||
debugger;
|
||||
|
||||
if (res[0].status == 'fulfilled') {
|
||||
let json = res[0].value;
|
||||
|
||||
@ -370,7 +370,7 @@ function getNodeDevice(para) {
|
||||
Promise.allSettled([promise2]).then(res => {
|
||||
|
||||
if (res[0].status == 'fulfilled') {
|
||||
debugger;
|
||||
|
||||
resolve(res[0].value);
|
||||
}
|
||||
});
|
||||
|
137
src/api/equipmentManagement/repairRecords/index.ts
Normal file
137
src/api/equipmentManagement/repairRecords/index.ts
Normal file
@ -0,0 +1,137 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
//修改设备维修记录
|
||||
function updateRepair(data) {
|
||||
return request({
|
||||
url: '/equipment/repairRecords',
|
||||
method: 'put',
|
||||
data:data
|
||||
// data: {
|
||||
// "recordId": data.recordId,
|
||||
// "deviceId": data.deviceId,
|
||||
// "createTime": data.createTime,
|
||||
// "updateTime": data.updateTime,
|
||||
// "repairTime": data.repairTime,
|
||||
// "repairPart": data.repairPart,
|
||||
// "repairReason": data.repairReason,
|
||||
// "repairPerson": data.repairPerson,
|
||||
// // "beforeFile": data.beforeFile,
|
||||
// // "afterFile": data.afterFile
|
||||
// }
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//新增设备维修记录
|
||||
function addRepir(data) {
|
||||
return request({
|
||||
url: '/equipment/repairRecords',
|
||||
method: 'post',
|
||||
data:data
|
||||
// data: {
|
||||
// "recordId": data.recordId,
|
||||
// "deviceId": data.deviceId,
|
||||
// "createTime": data.createTime,
|
||||
// "updateTime": data.updateTime,
|
||||
// "repairTime": data.repairTime,
|
||||
// "repairPart": data.repairPart,
|
||||
// "repairReason": data.repairReason,
|
||||
// "repairPerson": data.repairPerson,
|
||||
// // "beforeFile": data.beforeFile,
|
||||
// // "afterFile": data.afterFile
|
||||
// }
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
//导出设备维修记录
|
||||
function exportRepir(data) {
|
||||
return request({
|
||||
url: '/equipment/repairRecords/export',
|
||||
method: 'post',
|
||||
data: {
|
||||
"recordId": data.recordId,
|
||||
"deviceId": data.deviceId,
|
||||
"createTime": data.createTime,
|
||||
"updateTime": data.updateTime,
|
||||
"repairTime": data.repairTime,
|
||||
"repairPart": data.repairPart,
|
||||
"repairReason": data.repairReason,
|
||||
"repairPerson": data.repairPerson
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
//获取明细设备维修记录
|
||||
function getRepirDetail(id) {
|
||||
return request({
|
||||
url: '/equipment/repairRecords/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//获取列表
|
||||
function getRepairList(data) {
|
||||
return request({
|
||||
url: '/equipment/repairRecords/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
"recordId": data.recordId,
|
||||
"deviceId": data.deviceId,
|
||||
"repairPart": data.repairPart,
|
||||
"repairReason": data.repairReason,
|
||||
"repairPerson": data.repairPerson,
|
||||
"repairBeginTime": data.repairBeginTime,
|
||||
"repairEndTime": data.repairBeginTime,
|
||||
"pageNum": data.pageNum,
|
||||
"pageSize": data.pageSize
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//删除记录
|
||||
function dropRepir(id) {
|
||||
if (Array.isArray(id)) {
|
||||
id = id.join(",");
|
||||
}
|
||||
return request({
|
||||
url: '/equipment/repairRecords/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
//获取设备类型
|
||||
function getDeviceTypeAll() {
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/api/deviceType/all',
|
||||
method: 'get',
|
||||
|
||||
}).then((res) => {
|
||||
resolve(res);
|
||||
}).catch((ex) => {
|
||||
reject(ex);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
updateRepair: updateRepair,
|
||||
addRepir: addRepir,
|
||||
exportRepir: exportRepir,
|
||||
getRepirDetail: getRepirDetail,
|
||||
getRepairList: getRepairList,
|
||||
dropRepir: dropRepir,
|
||||
getDeviceTypeAll: getDeviceTypeAll
|
||||
}
|
46
src/utils/common.ts
Normal file
46
src/utils/common.ts
Normal file
@ -0,0 +1,46 @@
|
||||
function DateFormat(date, format) {
|
||||
if (!date) {
|
||||
date = new Date();
|
||||
}
|
||||
if (!format) {
|
||||
format = 'yyyy-MM-dd HH:mm:ss';
|
||||
}
|
||||
// 处理参数默认值
|
||||
if (typeof date === 'string' || typeof date === 'number') {
|
||||
date = new Date(date);
|
||||
}
|
||||
date = date instanceof Date ? date : new Date();
|
||||
format = format || 'yyyy-MM-dd';
|
||||
|
||||
// 检查日期是否有效
|
||||
if (isNaN(date.getTime())) {
|
||||
return 'Invalid Date';
|
||||
}
|
||||
|
||||
// 定义格式化映射
|
||||
const formatMap = {
|
||||
'yyyy': date.getFullYear(),
|
||||
'MM': String(date.getMonth() + 1).padStart(2, '0'),
|
||||
'dd': String(date.getDate()).padStart(2, '0'),
|
||||
'HH': String(date.getHours()).padStart(2, '0'),
|
||||
'mm': String(date.getMinutes()).padStart(2, '0'),
|
||||
'ss': String(date.getSeconds()).padStart(2, '0'),
|
||||
'SSS': String(date.getMilliseconds()).padStart(3, '0'),
|
||||
'M': date.getMonth() + 1,
|
||||
'd': date.getDate(),
|
||||
'H': date.getHours(),
|
||||
'm': date.getMinutes(),
|
||||
's': date.getSeconds(),
|
||||
'S': date.getMilliseconds()
|
||||
};
|
||||
|
||||
// 替换格式字符串中的占位符
|
||||
return format.replace(/(yyyy|MM|dd|HH|mm|ss|SSS|M|d|H|m|s|S)/g, (match) => {
|
||||
return formatMap[match];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export default{
|
||||
DateFormat:DateFormat
|
||||
}
|
@ -34,6 +34,7 @@ const service = axios.create({
|
||||
// 请求拦截器
|
||||
service.interceptors.request.use(
|
||||
(config: InternalAxiosRequestConfig) => {
|
||||
|
||||
// 对应国际化资源文件后缀
|
||||
config.headers['Content-Language'] = getLanguage();
|
||||
|
||||
|
1049
src/views/equipmentManagement/repairRecords/index.vue
Normal file
1049
src/views/equipmentManagement/repairRecords/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<div class="content" >
|
||||
<div class="leftTree fleft">
|
||||
<div class="head">
|
||||
<div class="title">设备分组</div>
|
||||
@ -95,7 +95,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<el-table ref="grid" height="calc(100vh - 320px)" :v-loading="Status.loading" border :data="deviceList"
|
||||
<el-table ref="grid" height="calc(100vh - 320px)" v-loading="Status.loading" border :data="deviceList"
|
||||
@selection-change="RowSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" />
|
||||
@ -144,7 +144,7 @@
|
||||
|
||||
|
||||
<!-- 提示框 -->
|
||||
<el-dialog :draggable="true" v-model="Status.confirm.Visible" :title="Status.confirm.title" width="500" center>
|
||||
<el-dialog :width="300" :draggable="true" v-model="Status.confirm.Visible" :title="Status.confirm.title" width="500" center>
|
||||
<span>
|
||||
{{ Status.confirm.text }}
|
||||
</span>
|
||||
@ -200,11 +200,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { status } from 'nprogress';
|
||||
|
||||
import api from '@/api/equipmentManagement/devicegroup/index';
|
||||
import { stat } from 'fs';
|
||||
import { func } from 'vue-types';
|
||||
import { deviceTypeAll } from '@/api/equipmentManagement/device';
|
||||
import common from '@/utils/common'
|
||||
|
||||
interface Device {
|
||||
deviceName: string;
|
||||
@ -318,14 +316,18 @@ var hideConfirm = function () {
|
||||
}
|
||||
|
||||
var showloading = function () {
|
||||
window.loadingIndex = ElLoading.service({ fullscreen: true })
|
||||
// window.loadingIndex = ElLoading.service({ fullscreen: true })
|
||||
|
||||
Status.loading=true;
|
||||
|
||||
}
|
||||
|
||||
var closeLoading = function () {
|
||||
if (window.loadingIndex) {
|
||||
window.loadingIndex.close();
|
||||
}
|
||||
// if (window.loadingIndex) {
|
||||
// window.loadingIndex.close();
|
||||
// }
|
||||
|
||||
Status.loading=false;
|
||||
}
|
||||
var hideloading = closeLoading;
|
||||
|
||||
@ -363,7 +365,7 @@ var getDeviceList = () => {
|
||||
}
|
||||
//树控件节点点击事件
|
||||
var handleNodeClick = (node) => {
|
||||
debugger;
|
||||
|
||||
if (checkNode.val == node.id) {
|
||||
return;
|
||||
}
|
||||
@ -408,7 +410,7 @@ var editNode = (node) => {
|
||||
var completeEdit = (node) => {
|
||||
|
||||
|
||||
let now = DateFormat(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
let now =common.DateFormat(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
let newNode =
|
||||
{
|
||||
@ -453,13 +455,13 @@ var cancelEdit = (node) => {
|
||||
|
||||
//删除节点
|
||||
var delNode = (node) => {
|
||||
debugger;
|
||||
|
||||
if (node.data.children && node.data.children.length > 0) {
|
||||
alert("节点包含子节点,不允许删除");
|
||||
return;
|
||||
}
|
||||
confirm("您确认删除’" + node.data.groupName + "’节点吗", () => {
|
||||
debugger;
|
||||
|
||||
hideConfirm();
|
||||
|
||||
api.delTreeNode(treeDataOrin.value, node.data.id).then((res) => {
|
||||
@ -478,48 +480,6 @@ var delNode = (node) => {
|
||||
|
||||
}
|
||||
|
||||
var DateFormat = function (date, format) {
|
||||
if (!date) {
|
||||
date = new Date();
|
||||
}
|
||||
if (!format) {
|
||||
format = 'yyyy-MM-dd HH:mm:ss';
|
||||
}
|
||||
// 处理参数默认值
|
||||
if (typeof date === 'string' || typeof date === 'number') {
|
||||
date = new Date(date);
|
||||
}
|
||||
date = date instanceof Date ? date : new Date();
|
||||
format = format || 'yyyy-MM-dd';
|
||||
|
||||
// 检查日期是否有效
|
||||
if (isNaN(date.getTime())) {
|
||||
return 'Invalid Date';
|
||||
}
|
||||
|
||||
// 定义格式化映射
|
||||
const formatMap = {
|
||||
'yyyy': date.getFullYear(),
|
||||
'MM': String(date.getMonth() + 1).padStart(2, '0'),
|
||||
'dd': String(date.getDate()).padStart(2, '0'),
|
||||
'HH': String(date.getHours()).padStart(2, '0'),
|
||||
'mm': String(date.getMinutes()).padStart(2, '0'),
|
||||
'ss': String(date.getSeconds()).padStart(2, '0'),
|
||||
'SSS': String(date.getMilliseconds()).padStart(3, '0'),
|
||||
'M': date.getMonth() + 1,
|
||||
'd': date.getDate(),
|
||||
'H': date.getHours(),
|
||||
'm': date.getMinutes(),
|
||||
's': date.getSeconds(),
|
||||
'S': date.getMilliseconds()
|
||||
};
|
||||
|
||||
// 替换格式字符串中的占位符
|
||||
return format.replace(/(yyyy|MM|dd|HH|mm|ss|SSS|M|d|H|m|s|S)/g, (match) => {
|
||||
return formatMap[match];
|
||||
});
|
||||
}
|
||||
|
||||
//增加节点
|
||||
var addNode = (node) => {
|
||||
let title = '';
|
||||
@ -533,7 +493,7 @@ var addNode = (node) => {
|
||||
}
|
||||
let val = new Date().getTime();
|
||||
// let newNode = { value: val, txt: '' };
|
||||
let now = DateFormat(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
let now =common.DateFormat(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
|
||||
|
||||
@ -543,7 +503,7 @@ var addNode = (node) => {
|
||||
|
||||
})
|
||||
.then(({ value }) => {
|
||||
debugger;
|
||||
|
||||
if (!value) {
|
||||
alert("请输入分组名称");
|
||||
return;
|
||||
@ -596,7 +556,7 @@ var defaultProps = {
|
||||
}
|
||||
|
||||
var RowSelectionChange = (tr) => {
|
||||
debugger;
|
||||
|
||||
console.log("行选中变化", tr);
|
||||
getSelectionRows();
|
||||
};
|
||||
@ -692,7 +652,7 @@ var showDevice = () => {
|
||||
if (res[1].status == 'fulfilled') {
|
||||
let res2 = res[1].value;
|
||||
if (res2.code == 200) {
|
||||
debugger;
|
||||
|
||||
let vals = res2.rows.map(item => item.deviceId);
|
||||
|
||||
transfer.value = vals;
|
||||
@ -710,7 +670,7 @@ var showDevice = () => {
|
||||
//确认选择这些设备
|
||||
var OKCheckDevice = () => {
|
||||
|
||||
debugger;
|
||||
|
||||
|
||||
let arr = transfer.value.map(item => ({
|
||||
deviceId: item
|
||||
|
Reference in New Issue
Block a user