main #24
@ -6,8 +6,8 @@ VITE_APP_ENV = 'development'
|
||||
|
||||
# 开发环境
|
||||
# VITE_APP_BASE_API = 'http://139.224.253.23:8000'
|
||||
# VITE_APP_BASE_API = 'https://www.cnxhyc.com/jq'
|
||||
VITE_APP_BASE_API = 'http://192.168.110.56:8000'
|
||||
VITE_APP_BASE_API = 'https://www.cnxhyc.com/jq'
|
||||
#VITE_APP_BASE_API = 'http://192.168.110.56:8000'
|
||||
#代永飞接口
|
||||
# VITE_APP_BASE_API = 'http://457102h2d6.qicp.vip:24689'
|
||||
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
VITE_APP_TITLE = 云平台管理系统
|
||||
|
||||
# 生产环境配置 晶全1
|
||||
VITE_APP_ENV = 'production'
|
||||
VITE_APP_ENV = 'https://www.cnxhyc.com'
|
||||
|
||||
# 生产环境配置 富源晟2
|
||||
# VITE_APP_ENV = 'https://fuyuanshen.com/backend-fys'
|
||||
|
||||
# 应用访问路径 晶全1
|
||||
VITE_APP_CONTEXT_PATH = '/'
|
||||
VITE_APP_CONTEXT_PATH = '/jingquan/'
|
||||
|
||||
# 应用访问路径 富源晟2
|
||||
#VITE_APP_CONTEXT_PATH = '/sys/'
|
||||
@ -19,9 +19,8 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications'
|
||||
# SnailJob 控制台地址
|
||||
VITE_APP_SNAILJOB_ADMIN = '/snail-job'
|
||||
|
||||
# 生产环境 晶全3
|
||||
VITE_APP_BASE_API = 'http://139.224.253.23:8000'
|
||||
VITE_AMAP_KEY='84a12a692ae378effdf741e16d584cd3'
|
||||
# 生产环境 晶全3 代理访问
|
||||
VITE_APP_BASE_API = '/jq'
|
||||
|
||||
# 生产环境 富源晟3
|
||||
#VITE_APP_BASE_API = '/backend-fys'
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="content" v-loading="Status.fullLoading">
|
||||
<div class="main">
|
||||
<div class="TopTool">
|
||||
<div class ="TopTool">
|
||||
<div class="button-row">
|
||||
<el-button type="primary" icon="Plus" @click.stop="ShowEdit(null, true, formRef)">新增维修</el-button>
|
||||
<el-button type="primary" plain icon="Download" @click.stop="ExportRecord()">导出</el-button>
|
||||
@ -9,14 +9,8 @@
|
||||
</div>
|
||||
|
||||
<div class="rightSearch">
|
||||
<el-input
|
||||
:suffix-icon="'Search'"
|
||||
clearable
|
||||
v-model="advanceSearch.searchValue"
|
||||
class="responsive-input"
|
||||
placeholder="名称"
|
||||
@input="txtSearch"
|
||||
>
|
||||
<el-input :suffix-icon="'Search'" clearable v-model="advanceSearch.searchValue" class="responsive-input"
|
||||
placeholder="名称" @input="txtSearch">
|
||||
</el-input>
|
||||
|
||||
<el-button style="margin-left: 10px" type="primary" @click.stop="ToggleAdvance()">高级筛选</el-button>
|
||||
@ -43,17 +37,9 @@
|
||||
<el-input v-model="advanceSearch.repairReason" placeholder="请输入" clearable />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="维修时间">
|
||||
<el-date-picker
|
||||
v-model="advanceSearch.Date"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
style="width: 240px"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:size="'default'"
|
||||
/>
|
||||
<el-date-picker v-model="advanceSearch.Date" type="daterange" format="YYYY-MM-DD" style="width: 240px"
|
||||
value-format="YYYY-MM-DD" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
:size="'default'" />
|
||||
<div>
|
||||
<el-button style="margin-left: 5px" type="primary" @click.stop="Search()">查询</el-button>
|
||||
<el-button type="primary" @click.stop="Reset()">重置</el-button>
|
||||
@ -71,7 +57,8 @@
|
||||
<el-table-column label="损坏原因" align="center" prop="repairReason" />
|
||||
<el-table-column label="维修人员" align="center" prop="repairPerson" />
|
||||
|
||||
<el-table-column label="操作" align="center" fixed="right" width="280" class-name="small-padding fixed-width opt">
|
||||
<el-table-column label="操作" align="center" fixed="right" width="280"
|
||||
class-name="small-padding fixed-width opt">
|
||||
<template #default="scope">
|
||||
<div class="center">
|
||||
<el-text class="mx-1" type="primary" @click.stop="ShowEdit(scope.row, true, formRef)">编辑</el-text>
|
||||
@ -81,47 +68,29 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="pagin.total > 0"
|
||||
v-model:page="advanceSearch.pageNum"
|
||||
v-model:limit="advanceSearch.pageSize"
|
||||
:total="pagin.total"
|
||||
@pagination="getRecordList"
|
||||
/>
|
||||
<pagination v-show="pagin.total > 0" v-model:page="advanceSearch.pageNum" v-model:limit="advanceSearch.pageSize"
|
||||
:total="pagin.total" @pagination="getRecordList" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新增、编辑弹出层 -->
|
||||
<el-dialog
|
||||
class="editPop"
|
||||
v-model="Status.ShowEditPop"
|
||||
:data-val="Status.ShowEditPop"
|
||||
:title="!cEdit.isEdit ? '维修详情' : cEdit.recordId ? '编辑维修' : '新增维修'"
|
||||
width="800"
|
||||
:draggable="true"
|
||||
>
|
||||
<el-dialog class="editPop" v-model="Status.ShowEditPop" :data-val="Status.ShowEditPop"
|
||||
:title="!cEdit.isEdit ? '维修详情' : cEdit.recordId ? '编辑维修' : '新增维修'" width="800" :draggable="true">
|
||||
<div class="form">
|
||||
<el-form :model="cEdit" ref="formRef" style="max-width: 750px" :rules="rules">
|
||||
<el-form-item label="设备名称" label-position="right" prop="deviceId">
|
||||
<!-- <el-input v-model="selectedRow['deviceName']" :readonly="true" @click.stop="ShowDevice('Edit', true)" placeholder="请选择设备" /> -->
|
||||
<el-select v-model="cEdit.deviceId" placeholder="选择设备" clearable :disabled="!cEdit.isEdit" filterable>
|
||||
<el-option v-for="item in deviceDist" :key="item.deviceId" :label="item.deviceName" :value="item.deviceId"
|
||||
/></el-select>
|
||||
<el-option v-for="item in deviceDist" :key="item.deviceId" :label="item.deviceName"
|
||||
:value="item.deviceId" /></el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="维修人员" label-position="right" prop="repairPerson">
|
||||
<el-input v-model="cEdit.repairPerson" :readonly="!cEdit.isEdit" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="维修时间" label-position="right" prop="repairTime">
|
||||
<el-date-picker
|
||||
v-model="cEdit.repairTime"
|
||||
:readonly="!cEdit.isEdit"
|
||||
type="datetime"
|
||||
placeholder="请选择时间"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<el-date-picker v-model="cEdit.repairTime" :readonly="!cEdit.isEdit" type="datetime" placeholder="请选择时间"
|
||||
format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="维修部位" label-position="right" prop="repairPart">
|
||||
<el-input v-model="cEdit.repairPart" :readonly="!cEdit.isEdit" placeholder="请输入维修部位" />
|
||||
@ -131,19 +100,10 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="损坏照片" label-position="right">
|
||||
<el-upload
|
||||
:disabled="!cEdit.isEdit"
|
||||
ref="beforeUploadRef"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
:auto-upload="false"
|
||||
:on-change="handleFileChange1"
|
||||
:file-list="beforeFiles"
|
||||
accept=".jpg,.jpeg,.png,.gif.webp"
|
||||
:limit="9"
|
||||
list-type="picture-card"
|
||||
:class="{ 'hide-add-btn': !cEdit.isEdit }"
|
||||
>
|
||||
<el-upload :disabled="!cEdit.isEdit" ref="beforeUploadRef" class="upload-demo" action=""
|
||||
:auto-upload="false" :on-change="handleFileChange1" :file-list="beforeFiles"
|
||||
accept=".jpg,.jpeg,.png,.gif.webp" :limit="9" list-type="picture-card"
|
||||
:class="{ 'hide-add-btn': !cEdit.isEdit }">
|
||||
<el-icon>
|
||||
<Plus />
|
||||
</el-icon>
|
||||
@ -168,19 +128,9 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="修复照片" label-position="right">
|
||||
<el-upload
|
||||
:disabled="!cEdit.isEdit"
|
||||
ref="afterUploadRef"
|
||||
class="upload-demo"
|
||||
action=""
|
||||
:auto-upload="false"
|
||||
:on-change="handleFileChange2"
|
||||
:file-list="afterFiles"
|
||||
accept=".jpg,.jpeg,.png,.gif.webp"
|
||||
:limit="9"
|
||||
list-type="picture-card"
|
||||
:class="{ 'hide-add-btn': !cEdit.isEdit }"
|
||||
>
|
||||
<el-upload :disabled="!cEdit.isEdit" ref="afterUploadRef" class="upload-demo" action="" :auto-upload="false"
|
||||
:on-change="handleFileChange2" :file-list="afterFiles" accept=".jpg,.jpeg,.png,.gif.webp" :limit="9"
|
||||
list-type="picture-card" :class="{ 'hide-add-btn': !cEdit.isEdit }">
|
||||
<el-icon>
|
||||
<Plus />
|
||||
</el-icon>
|
||||
@ -321,7 +271,8 @@
|
||||
</el-dialog> -->
|
||||
|
||||
<!-- 提示框 -->
|
||||
<el-dialog :width="300" :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>
|
||||
@ -509,18 +460,21 @@ function ToggleAdvance() {
|
||||
|
||||
//显示编辑
|
||||
function ShowEdit(item = undefined, isEdit = true, formEl = undefined) {
|
||||
// 先隐藏弹窗,避免提前渲染错误状态
|
||||
Status.ShowEditPop = true;
|
||||
let def = {
|
||||
recordId: null, //维修记录id
|
||||
|
||||
deviceId: '', //设备id
|
||||
repairTime: '', //维修时间
|
||||
repairPart: '', //维修部位
|
||||
repairReason: '', //维修原因
|
||||
repairPerson: '', //维修人员,
|
||||
recordId: null,
|
||||
deviceId: '',
|
||||
repairTime: '',
|
||||
repairPart: '',
|
||||
repairReason: '',
|
||||
repairPerson: '',
|
||||
imageIds: []
|
||||
};
|
||||
|
||||
// 先重置表单和状态,避免残留
|
||||
ResetFormData();
|
||||
// 先赋值 isEdit 基础状态
|
||||
cEdit.isEdit = isEdit;
|
||||
let promise1 = new Promise((resolve, reject) => {
|
||||
if (item) {
|
||||
api
|
||||
@ -542,60 +496,43 @@ function ShowEdit(item = undefined, isEdit = true, formEl = undefined) {
|
||||
|
||||
promise1
|
||||
.then((res) => {
|
||||
debugger;
|
||||
item = res;
|
||||
if (!item) {
|
||||
// 新增场景,isEdit 保持 true
|
||||
cEdit.isEdit = isEdit;
|
||||
return;
|
||||
}
|
||||
let keys = Object.keys(cEdit);
|
||||
keys.forEach((key, i) => {
|
||||
if (item) {
|
||||
//编辑
|
||||
// 编辑/详情场景,赋值数据
|
||||
if (item[key] !== undefined) {
|
||||
cEdit[key] = item[key];
|
||||
} else {
|
||||
cEdit[key] = def[key];
|
||||
}
|
||||
} else {
|
||||
//新增
|
||||
// 新增场景
|
||||
cEdit[key] = def[key];
|
||||
}
|
||||
});
|
||||
debugger;
|
||||
if (item.images && item.images.length) {
|
||||
// 处理图片逻辑(保持原有代码)
|
||||
beforeFiles.value = item.images
|
||||
.filter((v) => {
|
||||
if (v.imageType == 'BEFORE') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
})
|
||||
.map((v) => {
|
||||
return { name: v.imageId, url: v.imageUrl, id: v.imageId };
|
||||
});
|
||||
|
||||
.filter((v) => v.imageType == 'BEFORE')
|
||||
.map((v) => ({ name: v.imageId, url: v.imageUrl, id: v.imageId }));
|
||||
afterFiles.value = item.images
|
||||
.filter((v) => {
|
||||
if (v.imageType == 'AFTER') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
.map((v) => {
|
||||
return { name: v.imageId, url: v.imageUrl, id: v.imageId };
|
||||
});
|
||||
|
||||
if (!formEl) return;
|
||||
|
||||
formEl.validate();
|
||||
.filter((v) => v.imageType == 'AFTER')
|
||||
.map((v) => ({ name: v.imageId, url: v.imageUrl, id: v.imageId }));
|
||||
if (formEl) formEl.validate();
|
||||
}
|
||||
if (item) {
|
||||
selectedRow.value['deviceName'] = item.deviceName;
|
||||
}
|
||||
|
||||
// 确保 isEdit 最终赋值正确(覆盖异步过程中可能的异常)
|
||||
cEdit.isEdit = isEdit;
|
||||
// 所有状态赋值完成后,再显示弹窗
|
||||
Status.ShowEditPop = true;
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
@ -611,11 +548,9 @@ function ShowDevice(type, isvalid) {
|
||||
if (isvalid && !cEdit.isEdit) {
|
||||
return;
|
||||
}
|
||||
|
||||
Status.CheckDeviceType = type;
|
||||
Status.ShowCheckDevice = true;
|
||||
selectedRowId.value = '';
|
||||
|
||||
if (total.value === 0) {
|
||||
handleQuery();
|
||||
}
|
||||
@ -643,11 +578,8 @@ function ResetFormData() {
|
||||
cEdit.repairPart = ''; //维修部位
|
||||
cEdit.repairReason = ''; //维修原因
|
||||
cEdit.repairPerson = ''; //维修人员
|
||||
|
||||
cEdit.imageIds = [];
|
||||
|
||||
selectedRow.value = { deviceName: '', deviceId: '' };
|
||||
|
||||
clearUploadFiles();
|
||||
}
|
||||
|
||||
@ -749,7 +681,7 @@ function ExportRecord() {
|
||||
proxy?.download('/equipment/repairRecords/export', advanceSearch, `维修记录_${new Date().getTime()}.xlsx`, 'post').finally(hideloading);
|
||||
}
|
||||
|
||||
function RowSelectionChange(row) {}
|
||||
function RowSelectionChange(row) { }
|
||||
//获取已选中的行
|
||||
var getSelectionRows = (gridInstance) => {
|
||||
if (gridInstance.value) {
|
||||
@ -950,8 +882,9 @@ const rules = reactive<FormRules<RuleForm>>({
|
||||
:deep .el-form--inline .el-form-item {
|
||||
margin-right: 15px !important;
|
||||
}
|
||||
:deep .el-dialog__body .form {
|
||||
}
|
||||
|
||||
:deep .el-dialog__body .form {}
|
||||
|
||||
:deep .el-dialog__body,
|
||||
.dialog__body {
|
||||
position: relative;
|
||||
@ -1064,6 +997,7 @@ input:focus {
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
:deep .el-dialog__footer,
|
||||
.el-dialog__footer {
|
||||
padding-top: 0px !important;
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
</div>
|
||||
|
||||
<div class="treeContent">
|
||||
<el-tree :default-expand-all="true" :data="treeData" :props="defaultProps" accordion @node-click="handleNodeClick" :highlight-current="true">
|
||||
<el-tree :default-expand-all="true" :data="treeData" :props="defaultProps" accordion
|
||||
@node-click="handleNodeClick" :highlight-current="true">
|
||||
<template #default="{ node, data }">
|
||||
<div class="custom-tree-node">
|
||||
<span :class="data.parentId != null ? '' : 'treeBold'">{{ node.label }}</span>
|
||||
@ -60,7 +61,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div class="btnSearch" @click="getDeviceList()">查询</div>
|
||||
<div class="btnSearch" @click="getDeviceList">查询</div>
|
||||
<div class="btnReset" @click="ResetQuery()">重置</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -76,14 +77,8 @@
|
||||
<el-button type="danger" plain @click="groupDelDevice()">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
ref="grid"
|
||||
height="calc(100vh - 320px)"
|
||||
v-loading="Status.loading"
|
||||
border
|
||||
:data="deviceList"
|
||||
@selection-change="RowSelectionChange"
|
||||
>
|
||||
<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" />
|
||||
|
||||
@ -91,11 +86,9 @@
|
||||
<template #default="scope">
|
||||
<el-popover placement="right" trigger="click">
|
||||
<template #reference>
|
||||
<img
|
||||
:src="scope.row.devicePic"
|
||||
<img :src="scope.row.devicePic"
|
||||
style="width: 40px; height: 40px; cursor: pointer; object-fit: contain"
|
||||
class="hover:opacity-80 transition-opacity"
|
||||
/>
|
||||
class="hover:opacity-80 transition-opacity" />
|
||||
</template>
|
||||
<img :src="scope.row.devicePic" style="max-width: 600px; max-height: 600px; object-fit: contain" />
|
||||
</el-popover>
|
||||
@ -120,13 +113,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="pagin.total > 0"
|
||||
v-model:page="GjSearchForm.pageNum"
|
||||
v-model:limit="GjSearchForm.pageSize"
|
||||
:total="pagin.total"
|
||||
@pagination="getDeviceList"
|
||||
/>
|
||||
<pagination v-show="pagin.total > 0" v-model:page="GjSearchForm.pageNum" v-model:limit="GjSearchForm.pageSize"
|
||||
:total="pagin.total" @pagination="getDeviceList" />
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
@ -134,7 +122,8 @@
|
||||
<div class="clear"></div>
|
||||
|
||||
<!-- 提示框 -->
|
||||
<el-dialog :width="300" :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>
|
||||
@ -148,7 +137,7 @@
|
||||
|
||||
<!-- 选择分组的弹窗 -->
|
||||
<el-dialog v-model="Status.dialogGroupVisible" title="选择分组" width="500" :draggable="true">
|
||||
<el-tree :data="treeData" :props="defaultProps" accordion>
|
||||
<el-tree :data="treeData" :props="defaultProps" accordion default-expand-all>
|
||||
<template #default="{ node, data }">
|
||||
<div class="custom-tree-node" @click.stop="CheckGroup(data)">
|
||||
<span :class="data.parentId != null ? '' : 'treeBold'">{{ node.label }}</span>
|
||||
@ -156,8 +145,12 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
<el-button type="primary" @click="OkCheckGroup()"> 确定 </el-button>
|
||||
<el-button type="primary" @click="CancelCheckGroup()"> 取消 </el-button>
|
||||
<div style="text-align: right;">
|
||||
|
||||
<el-button @click="CancelCheckGroup()"> 取消 </el-button>
|
||||
<el-button type="primary" @click="OkCheckGroup()"> 确定 </el-button>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
<!-- 选择设备的穿梭框 -->
|
||||
@ -171,13 +164,8 @@
|
||||
</el-dialog>
|
||||
|
||||
<!-- 添加节点的弹出框 -->
|
||||
<el-dialog
|
||||
:width="350"
|
||||
:draggable="true"
|
||||
v-model="Status.dialogEditNode"
|
||||
:title="cEdit.id ? '修改分组' : cEdit.pNode ? '新增子节点' : '新增根节点'"
|
||||
center
|
||||
>
|
||||
<el-dialog :width="350" :draggable="true" v-model="Status.dialogEditNode"
|
||||
:title="cEdit.id ? '修改分组' : cEdit.pNode ? '新增子节点' : '新增根节点'" center>
|
||||
<div>
|
||||
<el-form class="demo-form-inline" :inline="true" :model="cEdit" label-width="auto" style="width: 100%">
|
||||
<el-form-item label="分组名称"> <el-input v-model="cEdit.groupName" placeholder="请输入" /> </el-form-item>
|
||||
@ -324,38 +312,40 @@ var hideloading = closeLoading;
|
||||
function ResetQuery() {
|
||||
GjSearchForm.deviceType = '';
|
||||
GjSearchForm.netMode = '';
|
||||
getDeviceList()
|
||||
|
||||
}
|
||||
//查询某个节点的设备
|
||||
var getDeviceList = () => {
|
||||
if (!checkNode.val) {
|
||||
pagin.total = 0;
|
||||
deviceList.value = [];
|
||||
return;
|
||||
}
|
||||
|
||||
let para = {
|
||||
nodeCode: checkNode.val,
|
||||
pageIndex: GjSearchForm.pageNum,
|
||||
pageSize: GjSearchForm.pageSize,
|
||||
communicationMode: GjSearchForm.netMode,
|
||||
deviceType: GjSearchForm.deviceType,
|
||||
deviceName: GjSearchForm.deviceName
|
||||
};
|
||||
showloading();
|
||||
const getDeviceList = () => {
|
||||
// 无论是否有 checkNode.val,都返回 Promise
|
||||
return new Promise((resolve, reject) => {
|
||||
api
|
||||
.getNodeDevice(para)
|
||||
.then((res) => {
|
||||
deviceList.value = res.rows;
|
||||
pagin.total = res.total;
|
||||
})
|
||||
.catch((ex) => {
|
||||
console.log('出现了异常', ex);
|
||||
})
|
||||
.finally(() => {
|
||||
hideloading();
|
||||
resolve();
|
||||
});
|
||||
if (!checkNode.val && checkNode.val !== '') { // 排除全部设备的空字符串
|
||||
pagin.total = 0;
|
||||
deviceList.value = [];
|
||||
hideloading(); // 确保 loading 关闭
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
showloading();
|
||||
let para = {
|
||||
nodeCode: checkNode.val || '', // 空ID对应全部设备
|
||||
pageIndex: GjSearchForm.pageNum,
|
||||
pageSize: GjSearchForm.pageSize,
|
||||
communicationMode: GjSearchForm.netMode,
|
||||
deviceType: GjSearchForm.deviceType,
|
||||
deviceName: GjSearchForm.deviceName
|
||||
};
|
||||
api.getNodeDevice(para).then((res: any) => {
|
||||
console.log(res, 'ressss');
|
||||
deviceList.value = res.rows;
|
||||
pagin.total = res.total;
|
||||
resolve();
|
||||
}).catch((ex) => {
|
||||
console.log('出现了异常', ex);
|
||||
reject(ex); // 抛出错误
|
||||
}).finally(() => {
|
||||
hideloading();
|
||||
});
|
||||
});
|
||||
};
|
||||
//树控件节点点击事件
|
||||
@ -368,16 +358,26 @@ var handleNodeClick = (node) => {
|
||||
getDeviceList();
|
||||
};
|
||||
|
||||
const ALL_DEVICE_NODE = {
|
||||
id: '',
|
||||
groupName: '全部设备',
|
||||
parentId: null,
|
||||
children: [],
|
||||
isAll: true
|
||||
};
|
||||
//树控件筛选后显示的数据源
|
||||
var treeData = computed(() => {
|
||||
let arr = api.treeNodeSearch(treeDataOrin.value, searchTxt.value, 'groupName', 'children');
|
||||
if (arr.length && !checkNode.val) {
|
||||
checkNode.val = arr[0].id;
|
||||
getDeviceList().finally(() => {
|
||||
checkNode.val = '';
|
||||
let newArr = [JSON.parse(JSON.stringify(ALL_DEVICE_NODE))];
|
||||
if (arr.length) {
|
||||
newArr = newArr.concat(arr);
|
||||
}
|
||||
if (newArr.length && !checkNode.val) {
|
||||
checkNode.val = newArr[0].id; // 空ID
|
||||
Promise.resolve(getDeviceList()).finally(() => {
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
return newArr;
|
||||
});
|
||||
|
||||
//显示/隐藏高级筛选
|
||||
@ -565,6 +565,7 @@ var getSelectionRows = () => {
|
||||
|
||||
var RefreshTree = function () {
|
||||
api.getTreeData(searchTxt.value).then((res) => {
|
||||
console.log(res, 'reddddd');
|
||||
treeDataOrin.value = res;
|
||||
});
|
||||
};
|
||||
@ -636,9 +637,8 @@ var showDevice = () => {
|
||||
let arr = res1.rows.map((item) => ({
|
||||
key: item.deviceId,
|
||||
label: item.deviceName //,
|
||||
// disabled: item.groupId && item.groupId == checkNode.val ? false : item.groupId ? true : false
|
||||
}));
|
||||
|
||||
;
|
||||
transfer.data = arr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user