|
@ -5,13 +5,14 @@ |
|
|
<el-steps :active="currentStep"> |
|
|
<el-steps :active="currentStep"> |
|
|
<el-step title="模型信息" description="名称、编号、序号、备注等" /> |
|
|
<el-step title="模型信息" description="名称、编号、序号、备注等" /> |
|
|
<el-step title="参数类别配置" description="模型的参数类别" /> |
|
|
<el-step title="参数类别配置" description="模型的参数类别" /> |
|
|
<el-step title="调控策略" description="模型的调控策略" /> |
|
|
<el-step title="完成" description="操作成功" /> |
|
|
</el-steps> |
|
|
</el-steps> |
|
|
</div> |
|
|
</div> |
|
|
<div class="overflowscroll"> |
|
|
<div class="overflowscroll"> |
|
|
<el-form ref="devicemodelRef" :model="form" :rules="rules" label-width="100px"> |
|
|
<el-form ref="devicemodelRef" :model="form" :rules="rules" label-width="100px"> |
|
|
<el-carousel ref="carousel" :autoplay="false" :arrow="never" pause-on-hover="false" class="customCarousel"> |
|
|
<el-carousel ref="carousel" :autoplay="false" :arrow="never" pause-on-hover="false" class="customCarousel" |
|
|
<el-carousel-item :key="1" name="1" class="textaligncenter overflowscroll height300"> |
|
|
:height="tableHeightNew"> |
|
|
|
|
|
<el-carousel-item :key="1" name="1" class="textaligncenter overflowscroll" :style="{ height: tableHeightNew }"> |
|
|
<div class="widthhalfinlineblock"> |
|
|
<div class="widthhalfinlineblock"> |
|
|
<el-form-item label="模型名称" prop="modelName"> |
|
|
<el-form-item label="模型名称" prop="modelName"> |
|
|
<el-input v-model="form.modelName" placeholder="请输入模型名称" /> |
|
|
<el-input v-model="form.modelName" placeholder="请输入模型名称" /> |
|
@ -29,12 +30,13 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="模型类别" key="selectmodelType" prop="modelTypeId"> |
|
|
<el-form-item label="模型类别" key="selectmodelType" prop="modelTypeId"> |
|
|
<el-select v-model="form.modelTypeId" placeholder="请选择模型类别" clearable @change="modalTypeControllButton"> |
|
|
<el-select v-model="form.modelTypeId" placeholder="请选择模型类别" clearable @change="modalTypeControllButton"> |
|
|
<!-- <el-option v-for="dict in modeltypeList" :key="dict.id" :label="dict.modelTypeName" :value="dict.id" /> --> |
|
|
<el-option v-for="dict in modeltypeList" :key="dict.modelTypeCode" :label="dict.modelTypeName" |
|
|
<el-option v-for="dict in dc_model_type" :key="dict.value" :label="dict.label" :value="dict.value" /> |
|
|
:value="dict.modelTypeCode" /> |
|
|
|
|
|
<!-- <el-option v-for="dict in dc_model_type" :key="dict.value" :label="dict.label" :value="dict.value" /> --> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="是否可用" prop="vailable"> |
|
|
<el-form-item label="是否可用" prop="vailable"> |
|
|
<el-switch v-model="form.dc_available" class="ml-2i" style="--el-switch-on-color: #13ce66" /> |
|
|
<el-switch v-model="form.vailable" class="ml-2i" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="备注" prop="note"> |
|
|
<el-form-item label="备注" prop="note"> |
|
|
<el-input v-model="form.note" type="textarea" placeholder="请输入内容" /> |
|
|
<el-input v-model="form.note" type="textarea" placeholder="请输入内容" /> |
|
@ -52,54 +54,20 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</div> |
|
|
</div> |
|
|
</el-carousel-item> |
|
|
</el-carousel-item> |
|
|
<el-carousel-item :key="2" name="2" class="textaligncenter overflowscroll height300"> |
|
|
<el-carousel-item :key="2" name="2" class="textaligncenter overflowscroll" :style="{ height: tableHeightNew }"> |
|
|
<div class="width75percentinlineblock"> |
|
|
<div class="width75percentinlineblock vxeTableStyle"> |
|
|
<div class="textalignright marginbottom5"> |
|
|
<div class="table" height="auto"> |
|
|
<el-button type="primary" style="display: inline-block !important" |
|
|
<Table ref="paramModelTable" :config="config" :colField="colField" :columns="columns" |
|
|
@click="addParamModel">添加参数模版</el-button> |
|
|
:tableData="selectedModelListTable" :loading="loading" :hasAddRows="true" :hasDelSelect="true" |
|
|
|
|
|
:hasAllSave="true" @pageChange="pageChange" @addRowsCallBack="addRowsCallBack" |
|
|
|
|
|
@beforeAddRowsCallBack="beforeAddRowsCallBack" @insertRecords="insertRecords" |
|
|
|
|
|
@updateRecords="updateRecords" @delSelectData="removeRecords" @delRowData="delRowData" |
|
|
|
|
|
addRowsText="添加参数模版" :addRowsType=2 @btnClick="addParamModel"> |
|
|
|
|
|
</Table> |
|
|
</div> |
|
|
</div> |
|
|
<el-table :data="selectedModelList" style="width: 100%" max-height="250" @cell-dblclick="startEditing"> |
|
|
|
|
|
<el-table-column fixed label="序号" width="80" align="center"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<span>{{ scope.$index + 1 }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="参数名称" align="center" prop="paramClassName" /> |
|
|
|
|
|
<el-table-column label="参数编码" align="center" prop="paramClassCode" /> |
|
|
|
|
|
<el-table-column label="PLC地址位" align="center" prop="plcAdr" vali> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<ValidationProvider :rules="plcAdr" v-slot=""> |
|
|
|
|
|
<span v-if="!scope.row.editing">{{ scope.row.plcAdr }}</span> |
|
|
|
|
|
<el-input v-else v-model="scope.row.plcAdr" @blur="saveData(scope.row)" /> |
|
|
|
|
|
</ValidationProvider> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="是否可控" align="center" prop="controllab"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<el-switch v-model="scope.row.controllab" @change="selectRadio(scope.row)" class="ml-2i" |
|
|
|
|
|
style="--el-switch-on-color: #13ce66" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="类别" align="center" prop="classType"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<dict-tag :options="dc_class_type" :value="scope.row.classType" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="分区" align="center" prop="devicePartion"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<dict-tag :options="dc_device_partion" :value="scope.row.devicePartion" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="备注" align="center" prop="note" /> |
|
|
|
|
|
<el-table-column label="操作" align="center" width="200px"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<el-button style="display:inline-block !important" type="primary" |
|
|
|
|
|
@click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="fixedbottomright width50percent textalignright"> |
|
|
<div class="fixedbottomright width50percent textalignleft"> |
|
|
<el-form-item class="inlineblock marginright6percent divsonmarginleft0"> |
|
|
<el-form-item class="inlineblock marginright6percent divsonmarginleft0"> |
|
|
<el-button type="primary" v-if="prevStepButtonShow" @click="prevStep" |
|
|
<el-button type="primary" v-if="prevStepButtonShow" @click="prevStep" |
|
|
style="display: inline-block !important">上一步</el-button> |
|
|
style="display: inline-block !important">上一步</el-button> |
|
@ -111,12 +79,26 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</div> |
|
|
</div> |
|
|
</el-carousel-item> |
|
|
</el-carousel-item> |
|
|
|
|
|
<el-carousel-item :key="3" name="3" class="textaligncenter overflowscroll" :style="{ height: tableHeightNew }"> |
|
|
|
|
|
<div class="width75percentinlineblock vxeTableStyle" |
|
|
|
|
|
:style="{ lineHeight: tableHeightNewSec, height: tableHeightNewSec }"> |
|
|
|
|
|
<h1 style="color: rgb(9, 161, 9);font-size: 36px;">操作成功!</h1> |
|
|
|
|
|
<h2 style="font-size: 24px;color: #5555556f;"> |
|
|
|
|
|
倒计时:<span style="color: rgb(255, 77, 0); font-size: 36px;">{{ countdown }}</span> 秒返回首页 |
|
|
|
|
|
</h2> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-carousel-item> |
|
|
</el-carousel> |
|
|
</el-carousel> |
|
|
|
|
|
|
|
|
</el-form> |
|
|
</el-form> |
|
|
<el-dialog :title="title" v-model="addParamModelShow" width="800px" append-to-body |
|
|
<el-dialog :title="title" v-model="addParamModelShow" width="800px" append-to-body |
|
|
:dc_device_partion="dc_device_partion" :dc_class_type="dc_class_type" draggable> |
|
|
:dc_device_partion="dc_device_partion" :dc_class_type="dc_class_type" draggable> |
|
|
<el-table ref="dialogTable" :data="paramModelList" key="newTable" style="width: 100%" max-height="600"> |
|
|
<el-label></el-label> |
|
|
|
|
|
<el-select v-model="value" placeholder="请选择分区" clearable @change="partionChange"> |
|
|
|
|
|
<el-option v-for="dict in dc_device_partion" :value="dict.value" :label="dict.label" :key="dict.key" /> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
<el-table ref="dialogTable" v-show="paramClassTableShow" :data="paramModelListShow" key="newTable" |
|
|
|
|
|
style="width: 100%" :style="{ maxHeight: tableHeightNew ,overflow:'auto'}" class="table_over_flow"> |
|
|
<el-table-column type="selection" width="55" :selectable="ifselectable" /> |
|
|
<el-table-column type="selection" width="55" :selectable="ifselectable" /> |
|
|
<el-table-column label="参数名称" align="center" prop="paramClassName" /> |
|
|
<el-table-column label="参数名称" align="center" prop="paramClassName" /> |
|
|
<el-table-column label="参数编码" align="center" prop="paramClassCode" /> |
|
|
<el-table-column label="参数编码" align="center" prop="paramClassCode" /> |
|
@ -125,12 +107,6 @@ |
|
|
<dict-tag :options="dc_class_type" :value="scope.row.classType" /> |
|
|
<dict-tag :options="dc_class_type" :value="scope.row.classType" /> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="分区" align="center" prop="devicePartion"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<dict-tag :options="dc_device_partion" :value="scope.row.devicePartion" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="备注" align="center" prop="note" /> |
|
|
|
|
|
</el-table> |
|
|
</el-table> |
|
|
<div class="textalignright margintop10"> |
|
|
<div class="textalignright margintop10"> |
|
|
<el-button type="primary" @click="selectedSubmit">提交</el-button> |
|
|
<el-button type="primary" @click="selectedSubmit">提交</el-button> |
|
@ -152,20 +128,30 @@ |
|
|
ul { |
|
|
ul { |
|
|
display: none !important; |
|
|
display: none !important; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.table_over_flow{ |
|
|
|
|
|
overflow: auto !important;; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.customCarousel .vxeTableStyle button { |
|
|
|
|
|
display: inline-block !important; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
<script setup name="editdevicemodel"> |
|
|
<script setup name="editdevicemodel"> |
|
|
import { listDevicemodel, addDevicemodel, updateDevicemodel, getDevicemodel } from "@/api/model/devicemodel"; |
|
|
import { listDevicemodel, addDevicemodel, updateDevicemodel, getDevicemodel } from "@/api/model/devicemodel"; |
|
|
import { listParamclass } from "@/api/model/paramclass"; |
|
|
import { listParamclassNoPage, } from "@/api/model/paramclass"; |
|
|
import { listModelType } from "@/api/model/modelType"; |
|
|
import { listModelTypeNoPage } from "@/api/model/modelType"; |
|
|
import { required } from "@vee-validate/rules"; |
|
|
import { required } from "@vee-validate/rules"; |
|
|
import { listModelparam, addModelparam, updateModelparam, delModelparam } from "@/api/model/modelparam"; |
|
|
import { delModelparam, listModelparamNoPage, addBatch, editBatch, } from "@/api/model/modelparam"; |
|
|
|
|
|
import Table from "@/components/TableColumnTreeSelect/index.vue"; |
|
|
|
|
|
import { ElMessageBox } from 'element-plus'; |
|
|
import { onMounted, ref } from 'vue'; |
|
|
import { onMounted, ref } from 'vue'; |
|
|
|
|
|
import { getCode } from '@/api/model/codeDefine'; |
|
|
const { proxy } = getCurrentInstance(); |
|
|
const { proxy } = getCurrentInstance(); |
|
|
const { dc_class_type, dc_device_partion, dc_model_type } = proxy.useDict('dc_class_type', 'dc_device_partion', 'dc_model_type'); |
|
|
const { dc_class_type, dc_device_partion } = proxy.useDict('dc_class_type', 'dc_device_partion'); |
|
|
const router = useRouter(); |
|
|
const router = useRouter(); |
|
|
const devicemodelOptions = ref([]); |
|
|
const devicemodelOptions = ref([]); |
|
|
const open = ref(false); |
|
|
|
|
|
const loading = ref(false); |
|
|
const loading = ref(false); |
|
|
const modeltypeList = ref([]); |
|
|
const modeltypeList = ref([]); |
|
|
const currentStep = ref(1); |
|
|
const currentStep = ref(1); |
|
@ -173,32 +159,34 @@ const nextStepButtonShow = ref(false); |
|
|
const prevStepButtonShow = ref(false); |
|
|
const prevStepButtonShow = ref(false); |
|
|
const submitButtonShow = ref(true); |
|
|
const submitButtonShow = ref(true); |
|
|
const paramModelList = ref([]); |
|
|
const paramModelList = ref([]); |
|
|
|
|
|
const paramModelListShow = ref([]); |
|
|
|
|
|
const paramModelListTable = ref([]); |
|
|
|
|
|
const paramModelListVxetable = ref([]); |
|
|
const addParamModelShow = ref(false); |
|
|
const addParamModelShow = ref(false); |
|
|
const selectedModelList = ref([]); |
|
|
const selectedModelList = ref([]); |
|
|
const oldSelectedList = ref([]); |
|
|
const tableHeight = ref("0px"); |
|
|
const addModelSubmit = ref([]); |
|
|
const paramClassTableShow = ref(false); |
|
|
const updateModelSubmit = ref([]); |
|
|
const insertRecordsCache = ref([]); |
|
|
const operateModelIds = ref([]); |
|
|
const updateRecordsCache = ref([]); |
|
|
const updateModelIds = ref([]); |
|
|
const delSelectDataCache = ref([]); |
|
|
const deleteModelIds = ref([]); |
|
|
const countdown = ref(3); // 倒计时初始值 |
|
|
console.log(deleteModelIds); |
|
|
|
|
|
console.log(proxy); |
|
|
|
|
|
const modelId = router.currentRoute._value.query.pid; |
|
|
const modelId = router.currentRoute._value.query.pid; |
|
|
|
|
|
const modelCode = router.currentRoute._value.query.modelCode; |
|
|
|
|
|
const selectedModelListTable = ref([]); |
|
|
|
|
|
const tableHeightNew = ref('0px'); |
|
|
|
|
|
const tableHeightNewSec = ref('0px'); |
|
|
|
|
|
const newSelectedList = ref([]); |
|
|
|
|
|
const model_group = ref("model_group"); |
|
|
|
|
|
const model = ref("model"); |
|
|
const data = reactive({ |
|
|
const data = reactive({ |
|
|
form: { |
|
|
form: { |
|
|
sort: 1, |
|
|
sort: 1, |
|
|
}, |
|
|
}, |
|
|
dc_available: [ |
|
|
|
|
|
{ label: '可用', value: 'true', elTagType: 'default', elTagClass: null }, |
|
|
|
|
|
{ label: '不可用', value: 'false', elTagType: 'default', elTagClass: null } |
|
|
|
|
|
], |
|
|
|
|
|
queryParams: { |
|
|
queryParams: { |
|
|
modelName: null, |
|
|
currentPage: 1, |
|
|
modelCode: null, |
|
|
pageSize: 10, |
|
|
sort: null, |
|
|
total: 0, |
|
|
modelTypeId: null, |
|
|
|
|
|
pid: null, |
|
|
|
|
|
note: null |
|
|
|
|
|
}, |
|
|
}, |
|
|
rules: { |
|
|
rules: { |
|
|
modelTypeId: [ |
|
|
modelTypeId: [ |
|
@ -224,10 +212,26 @@ const data = reactive({ |
|
|
|
|
|
|
|
|
const { queryParams, form, rules } = toRefs(data); |
|
|
const { queryParams, form, rules } = toRefs(data); |
|
|
|
|
|
|
|
|
|
|
|
const yes_or_no = [ |
|
|
|
|
|
{ label: '可控', value: true }, |
|
|
|
|
|
{ label: '不可控', value: false } |
|
|
|
|
|
] |
|
|
// 取消按钮 |
|
|
// 取消按钮 |
|
|
function cancel() { |
|
|
function cancel() { |
|
|
open.value = false; |
|
|
ElMessageBox.confirm('您确定要取消吗?', '提示', { |
|
|
reset(); |
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
// 用户点击了确认按钮 |
|
|
|
|
|
router.push({ |
|
|
|
|
|
path: 'devicemodel', |
|
|
|
|
|
query: {} |
|
|
|
|
|
}); |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
// 用户点击了取消按钮 |
|
|
|
|
|
// 可以在这里执行其他操作 |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 表单重置 |
|
|
// 表单重置 |
|
@ -254,86 +258,211 @@ function reset() { |
|
|
proxy.resetForm("devicemodelRef"); |
|
|
proxy.resetForm("devicemodelRef"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const columns = ref([ |
|
|
|
|
|
{ type: "checkbox", width: 50, fixed: "left" }, |
|
|
|
|
|
{ |
|
|
|
|
|
field: "paramClassId", |
|
|
|
|
|
title: "参数名称", |
|
|
|
|
|
width: 'auto', |
|
|
|
|
|
minWidth: 120, |
|
|
|
|
|
editRender: { |
|
|
|
|
|
name: "$select", |
|
|
|
|
|
options: paramModelListTable, |
|
|
|
|
|
attrs: { placeholder: "请输入参数名称" }, |
|
|
|
|
|
}, |
|
|
|
|
|
slots: { |
|
|
|
|
|
edit: "select", |
|
|
|
|
|
options: paramModelListVxetable, |
|
|
|
|
|
value: 'value', |
|
|
|
|
|
label: 'label', |
|
|
|
|
|
key: 'value', |
|
|
|
|
|
visibleChange: beforeChangeParamClass |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: "paramClassId", |
|
|
|
|
|
title: "参数编码", |
|
|
|
|
|
width: 'auto', |
|
|
|
|
|
minWidth: 120, |
|
|
|
|
|
editRender: { |
|
|
|
|
|
name: "$input", |
|
|
|
|
|
attrs: { placeholder: "请输入参数编码" }, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: "plcAdr", |
|
|
|
|
|
title: "PLC地址位", |
|
|
|
|
|
width: 'auto', |
|
|
|
|
|
minWidth: 120, |
|
|
|
|
|
editRender: { name: "$input", attrs: { placeholder: "请输入PLC地址位" } }, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: "controllab", |
|
|
|
|
|
title: "是否可控", |
|
|
|
|
|
width: 'auto', |
|
|
|
|
|
minWidth: 120, |
|
|
|
|
|
editRender: { name: "$select", options: yes_or_no, attrs: { placeholder: "请选择是否可控" } }, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: "classType", |
|
|
|
|
|
title: "类别", |
|
|
|
|
|
width: 'auto', |
|
|
|
|
|
minWidth: 120, |
|
|
|
|
|
editRender: { name: "$select", options: dc_class_type, attrs: { placeholder: "请输入角色内共享" } }, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: "partion", |
|
|
|
|
|
title: "分区", |
|
|
|
|
|
width: 'auto', |
|
|
|
|
|
minWidth: 120, |
|
|
|
|
|
editRender: { name: "$select", options: dc_device_partion, attrs: { placeholder: "请输入用户共享" } }, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
field: "note", |
|
|
|
|
|
title: "备注", |
|
|
|
|
|
width: 'auto', |
|
|
|
|
|
minWidth: 120, |
|
|
|
|
|
editRender: { name: "$input", attrs: { placeholder: "请输入统计单元状态" } }, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
title: "操作", |
|
|
|
|
|
width: 380, |
|
|
|
|
|
slots: { |
|
|
|
|
|
default: "operateNew", |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
const tableData = ref([]); |
|
|
|
|
|
const config = ref({ |
|
|
|
|
|
//表格配置项 |
|
|
|
|
|
id: "table", //唯一标识 |
|
|
|
|
|
height: 'auto', //表格的高度;支持铺满父容器或者固定高度 |
|
|
|
|
|
minHeight: '200px', |
|
|
|
|
|
maxHeight: tableHeight, |
|
|
|
|
|
rowHeight: 66, |
|
|
|
|
|
align: "center", //所有的列对齐方式 |
|
|
|
|
|
border: "none", //是否带有边框:false|default 默认显示边框,true|full 显示完整边框,outer 显示外边框,inner 显示内边框,none |
|
|
|
|
|
round: true, //是否为圆角边框 |
|
|
|
|
|
stripe: true, //是否带有斑马纹 |
|
|
|
|
|
size: "medium", //表格的尺寸:medium, small, mini |
|
|
|
|
|
loading: false, //表格是否显示加载中 |
|
|
|
|
|
showHeader: true, //是否显示表头 |
|
|
|
|
|
columnConfig: { |
|
|
|
|
|
//列配置信息 |
|
|
|
|
|
isCurrent: false, //当鼠标点击列头时,是否要高亮当前列 |
|
|
|
|
|
isHover: true, //当鼠标移到列头时,是否要高亮当前头 |
|
|
|
|
|
}, |
|
|
|
|
|
rowConfig: { |
|
|
|
|
|
//行配置信息 |
|
|
|
|
|
keyField: "id", //自定义行数据唯一主键的字段名 |
|
|
|
|
|
isCurrent: false, //当鼠标点击行时,是否要高亮当前行 |
|
|
|
|
|
isHover: true, //当鼠标移到行时,是否要高亮当前行 |
|
|
|
|
|
}, |
|
|
|
|
|
editConfig: { |
|
|
|
|
|
//可编辑配置项 |
|
|
|
|
|
trigger: "dblclick", //触发方式click(点击触发编辑),dblclick(双击触发编辑) |
|
|
|
|
|
mode: "row", //编辑模式cell(单元格编辑模式),row(行编辑模式) |
|
|
|
|
|
}, |
|
|
|
|
|
pagerConfig: { |
|
|
|
|
|
//分页配置项 |
|
|
|
|
|
enabled: true, //是否启用 |
|
|
|
|
|
currentPage: 1, //当前页 |
|
|
|
|
|
pageSize: 10, //每页大小 |
|
|
|
|
|
total: 0, //总条数 |
|
|
|
|
|
autoHidden: false, //当只有一页时自动隐藏 |
|
|
|
|
|
pageSizes: [10, 15, 20, 50, 100], //每页大小选项列表 |
|
|
|
|
|
}, |
|
|
|
|
|
toolbarConfig: { |
|
|
|
|
|
//工具栏配置 |
|
|
|
|
|
refresh: true, // 显示刷新按钮 |
|
|
|
|
|
import: false, // 显示导入按钮 |
|
|
|
|
|
export: false, // 显示导出按钮 |
|
|
|
|
|
zoom: true, // 显示全屏按钮 |
|
|
|
|
|
custom: true, // 显示自定义列按钮 |
|
|
|
|
|
}, |
|
|
|
|
|
editRules: { |
|
|
|
|
|
partion: [ |
|
|
|
|
|
{ required: true, message: '分区不能为空' }, |
|
|
|
|
|
], |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 提交按钮 */ |
|
|
/** 提交按钮 */ |
|
|
function submitForm() { |
|
|
function submitForm() { |
|
|
loading.value = false; |
|
|
loading.value = false; |
|
|
proxy.$refs["devicemodelRef"].validate(valid => { |
|
|
proxy.$refs["devicemodelRef"].validate(valid => { |
|
|
if (valid) { |
|
|
if (valid) { |
|
|
console.log("进入方法"); |
|
|
|
|
|
//模型按钮主表维护 |
|
|
//模型按钮主表维护 |
|
|
if (form.value.id != null) { |
|
|
if (form.value.id != null) { |
|
|
updateDevicemodel(form.value).then(response => { |
|
|
updateDevicemodel(form.value).then(response => { |
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
console.log("form.value.modelTypeId"); |
|
|
|
|
|
console.log(form.value.modelTypeId); |
|
|
|
|
|
console.log("response.code == '200'"); |
|
|
|
|
|
console.log(response.code == '200'); |
|
|
|
|
|
console.log(form.value.modelTypeId == model_group.value && response.code == '200'); |
|
|
|
|
|
if (form.value.modelTypeId == model_group.value && response.code == '200') { |
|
|
|
|
|
endStep(); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
addDevicemodel(form.value).then(response => { |
|
|
addDevicemodel(form.value).then(response => { |
|
|
}); |
|
|
if (form.value.modelTypeId == model_group.value && response.code == '200') { |
|
|
} |
|
|
|
|
|
//模型参数表维护 |
|
|
endStep(); |
|
|
//删除计算 |
|
|
|
|
|
let delFlag = true; |
|
|
|
|
|
oldSelectedList.value.forEach((item) => { |
|
|
|
|
|
selectedModelList.value.forEach(element => { |
|
|
|
|
|
if (item.id == element.id) { |
|
|
|
|
|
delFlag == false; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if (delFlag) { |
|
|
|
|
|
deleteModelIds.value.push(item.id); |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
//修改计算 |
|
|
|
|
|
operateModelIds.value.forEach(item => { |
|
|
|
|
|
selectedModelList.value.forEach(element => { |
|
|
|
|
|
if (item.id == element.id) { |
|
|
|
|
|
updateModelSubmit.value.push(element); |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
if (form.value.modelTypeId == model.value) { |
|
|
}); |
|
|
proxy.$refs.paramModelTable.allSubmit(executeRequests); |
|
|
|
|
|
|
|
|
console.log("新增计算"); |
|
|
|
|
|
//新增计算 |
|
|
|
|
|
let addFlag = true; |
|
|
|
|
|
selectedModelList.value.forEach(item => { |
|
|
|
|
|
oldSelectedList.value.forEach(element => { |
|
|
|
|
|
if (item.id == element.id) { |
|
|
|
|
|
addFlag == false; |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
if (addFlag) { |
|
|
|
|
|
addModelSubmit.value.push(item); |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
console.log("新增方法"); |
|
|
} |
|
|
console.log(addModelSubmit.value); |
|
|
|
|
|
//新增 |
|
|
|
|
|
addModelSubmit.value.forEach(item => { |
|
|
|
|
|
delete item.id; |
|
|
|
|
|
addModelparam(item).then(response => { |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//修改 |
|
|
async function executeRequests() { |
|
|
updateModelSubmit.value.forEach(item => { |
|
|
try { |
|
|
updateModelparam(item).then(response => { |
|
|
if (insertRecordsCache.value?.length > 0) { |
|
|
}); |
|
|
await addBatch(insertRecordsCache.value).then(response => { |
|
|
}); |
|
|
console.log("addBatch"); |
|
|
//删除 |
|
|
console.log(insertRecordsCache.value); |
|
|
deleteModelIds.value.forEach(item => { |
|
|
console.log(response); |
|
|
delModelparam(item).then(response => { |
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
if (updateRecordsCache.value?.length > 0) { |
|
|
|
|
|
await editBatch(updateRecordsCache.value).then(response => { |
|
|
|
|
|
console.log("editBatch"); |
|
|
|
|
|
console.log(updateRecordsCache.value); |
|
|
|
|
|
console.log(response); |
|
|
}); |
|
|
}); |
|
|
router.go(-1); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
if (delSelectDataCache.value?.length > 0) { |
|
|
|
|
|
await delModelparam(delSelectDataCache.value).then(response => { |
|
|
|
|
|
console.log("delModelparam"); |
|
|
|
|
|
console.log(delSelectDataCache.value); |
|
|
|
|
|
console.log(response); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
insertRecordsCache.value = []; |
|
|
|
|
|
updateRecordsCache.value = []; |
|
|
|
|
|
delSelectDataCache.value = []; |
|
|
|
|
|
proxy.$modal.msgSuccess("操作成功"); |
|
|
|
|
|
nextStep(); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
// 前一个请求执行失败的处理逻辑 |
|
|
|
|
|
console.error(error); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 查询设备模型类型列表 */ |
|
|
/** 查询设备模型类型列表 */ |
|
|
function getModelTypeList() { |
|
|
function getModelTypeListNoPage() { |
|
|
loading.value = true; |
|
|
loading.value = true; |
|
|
listModelType(queryParams.value).then(response => { |
|
|
listModelTypeNoPage(queryParams.value).then(response => { |
|
|
console.log(response); |
|
|
modeltypeList.value = response.data; |
|
|
modeltypeList.value = response.rows; |
|
|
|
|
|
loading.value = false; |
|
|
loading.value = false; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@ -343,7 +472,7 @@ function getTreeselect() { |
|
|
devicemodelOptions.value = []; |
|
|
devicemodelOptions.value = []; |
|
|
const data = { id: 0, modelName: '顶级节点', children: [] }; |
|
|
const data = { id: 0, modelName: '顶级节点', children: [] }; |
|
|
const parentData = response.data.filter(item => { |
|
|
const parentData = response.data.filter(item => { |
|
|
return (item.modelTypeId == 1); |
|
|
return (item.modelTypeId == 'model_group'); |
|
|
}); |
|
|
}); |
|
|
data.children = proxy.handleTree(parentData, "id", "pid"); |
|
|
data.children = proxy.handleTree(parentData, "id", "pid"); |
|
|
devicemodelOptions.value.push(data); |
|
|
devicemodelOptions.value.push(data); |
|
@ -351,37 +480,84 @@ function getTreeselect() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
|
|
|
let type = router.currentRoute._value.query.type; |
|
|
|
|
|
if (type == 'edit') { |
|
|
getDevicemodel(modelId).then(response => { |
|
|
getDevicemodel(modelId).then(response => { |
|
|
form.value = response.data |
|
|
form.value = response.data; |
|
|
console.log(response.data) |
|
|
modalTypeControllButton(); |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
calculateTableHeight(); |
|
|
|
|
|
window.addEventListener('resize', calculateTableHeight); |
|
|
|
|
|
window.onresize = () => { |
|
|
|
|
|
return (() => { |
|
|
|
|
|
calculateTableHeight(); |
|
|
|
|
|
})() |
|
|
|
|
|
} |
|
|
// 在组件首次加载完成后执行的逻辑 |
|
|
// 在组件首次加载完成后执行的逻辑 |
|
|
// 可以在这里给组件复制 |
|
|
// 可以在这里给组件复制 |
|
|
// form.value.pid=tempPid; |
|
|
// form.value.pid=tempPid; |
|
|
}); |
|
|
}); |
|
|
function modalTypeControllButton() { |
|
|
function modalTypeControllButton(val) { |
|
|
if (form.value.modelTypeId == "2") { |
|
|
console.log('modalTypeControllButton'); |
|
|
|
|
|
console.log(val); |
|
|
|
|
|
if (form.value.modelTypeId == model.value) { |
|
|
submitButtonShow.value = false; |
|
|
submitButtonShow.value = false; |
|
|
nextStepButtonShow.value = true; |
|
|
nextStepButtonShow.value = true; |
|
|
} else if (form.value.modelTypeId == "1") { |
|
|
} else if (form.value.modelTypeId == model_group.value) { |
|
|
submitButtonShow.value = true; |
|
|
submitButtonShow.value = true; |
|
|
nextStepButtonShow.value = false; |
|
|
nextStepButtonShow.value = false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
function nextStep() { |
|
|
function nextStep() { |
|
|
console.log("---------------"); |
|
|
|
|
|
proxy.$refs["devicemodelRef"].validate(valid => { |
|
|
proxy.$refs["devicemodelRef"].validate(valid => { |
|
|
// if (valid) { |
|
|
if (valid) { |
|
|
selectedModelList.value = oldSelectedList.value; |
|
|
|
|
|
if (currentStep.value < 2) { |
|
|
if (currentStep.value < 2) { |
|
|
currentStep.value = currentStep.value + 1; |
|
|
currentStep.value = currentStep.value + 1; |
|
|
proxy.$refs.carousel.next(); |
|
|
proxy.$refs.carousel.next(); |
|
|
submitButtonShow.value = true; |
|
|
submitButtonShow.value = true; |
|
|
nextStepButtonShow.value = false; |
|
|
nextStepButtonShow.value = false; |
|
|
prevStepButtonShow.value = true; |
|
|
prevStepButtonShow.value = true; |
|
|
|
|
|
if (currentStep.value == 2) { |
|
|
|
|
|
let param = { |
|
|
|
|
|
modelTypeId: form.value.modelTypeId, |
|
|
|
|
|
modelId: modelCode |
|
|
|
|
|
} |
|
|
|
|
|
getOldModelParams(param); |
|
|
|
|
|
} |
|
|
|
|
|
} else if (currentStep.value == 2) { |
|
|
|
|
|
currentStep.value = currentStep.value + 1; |
|
|
|
|
|
proxy.$refs.carousel.next(); |
|
|
|
|
|
submitButtonShow.value = false; |
|
|
|
|
|
nextStepButtonShow.value = false; |
|
|
|
|
|
prevStepButtonShow.value = false; |
|
|
|
|
|
startCountdown(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function endStep() { |
|
|
|
|
|
console.log("endStep"); |
|
|
|
|
|
console.log(currentStep.value); |
|
|
|
|
|
proxy.$refs["devicemodelRef"].validate(valid => { |
|
|
|
|
|
console.log("valid"); |
|
|
|
|
|
console.log(valid); |
|
|
|
|
|
if (valid) { |
|
|
|
|
|
console.log("form.value.modelTypeId == model_group"); |
|
|
|
|
|
console.log(form.value.modelTypeId == model_group.value); |
|
|
|
|
|
if (form.value.modelTypeId == model_group.value) { |
|
|
|
|
|
currentStep.value = 3; |
|
|
|
|
|
proxy.$refs.carousel.next(); |
|
|
|
|
|
proxy.$refs.carousel.next(); |
|
|
|
|
|
submitButtonShow.value = false; |
|
|
|
|
|
nextStepButtonShow.value = false; |
|
|
|
|
|
prevStepButtonShow.value = false; |
|
|
|
|
|
console.log("currentStep.value"); |
|
|
|
|
|
console.log(currentStep.value); |
|
|
|
|
|
startCountdown(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
// } |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
function prevStep() { |
|
|
function prevStep() { |
|
@ -395,80 +571,186 @@ function prevStep() { |
|
|
/** 查询参数模型信息列表 */ |
|
|
/** 查询参数模型信息列表 */ |
|
|
function addParamModel() { |
|
|
function addParamModel() { |
|
|
loading.value = true; |
|
|
loading.value = true; |
|
|
listParamclass(queryParams.value).then(response => { |
|
|
|
|
|
console.log(response); |
|
|
|
|
|
paramModelList.value = response.rows; |
|
|
|
|
|
paramModelList.value.forEach(item => { |
|
|
|
|
|
item.paramClassId = item.id; |
|
|
|
|
|
item.modelId = form.value.modelCode; |
|
|
|
|
|
item.controllab = false; |
|
|
|
|
|
}); |
|
|
|
|
|
console.log(paramModelList); |
|
|
|
|
|
addParamModelShow.value = true; |
|
|
addParamModelShow.value = true; |
|
|
loading.value = false; |
|
|
loading.value = false; |
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function handleDelete(element) { |
|
|
function partionChange(val) { |
|
|
selectedModelList.value = selectedModelList.value.filter(item => item.id !== element.id); |
|
|
let paramClassTableShowByPartion = ref(); |
|
|
|
|
|
let selectedModelListByPartion = ref(); |
|
|
|
|
|
paramClassTableShow.value = true; |
|
|
|
|
|
paramClassTableShowByPartion.value = paramModelList.value; |
|
|
|
|
|
selectedModelListByPartion.value = selectedModelList.value?.filter(element => { |
|
|
|
|
|
return element.partion == val; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
paramModelListShow.value = paramClassTableShowByPartion.value?.filter(element => { |
|
|
|
|
|
return !selectedModelListByPartion.value?.some(item => item.paramClassId === element.paramClassCode); |
|
|
|
|
|
}); |
|
|
|
|
|
paramModelListShow.value?.map(item => { |
|
|
|
|
|
item.paramClassId = item.paramClassCode; |
|
|
|
|
|
item.modelId = form.value.modelCode; |
|
|
|
|
|
item.controllab = false; |
|
|
|
|
|
item.partion = val; |
|
|
|
|
|
item.id = "ABCDEFXYZ" + form.value.modelCode + item.paramClassCode; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function selectedSubmit() { |
|
|
function selectedSubmit() { |
|
|
const newSelectedList = proxy.$refs.dialogTable.getSelectionRows().map(row => ({ |
|
|
newSelectedList.value = proxy.$refs.dialogTable.getSelectionRows().map(row => ({ |
|
|
...row, |
|
|
...row, |
|
|
editing: false, // 添加 'editing' 属性并设置初始值为 false |
|
|
editing: false, // 添加 'editing' 属性并设置初始值为 false |
|
|
})); |
|
|
})); |
|
|
if (selectedModelList.value.length > 0) { |
|
|
proxy.$refs.paramModelTable.addRows(newSelectedList.value.length); |
|
|
selectedModelList.value = [ |
|
|
addParamModelShow.value = false; |
|
|
...selectedModelList.value, |
|
|
|
|
|
...newSelectedList, |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getOldModelParams(param) { |
|
|
|
|
|
listModelparamNoPage(param).then(res => { |
|
|
|
|
|
selectedModelList.value = res.data; |
|
|
|
|
|
config.value.pagerConfig.total = selectedModelList.value.length; |
|
|
|
|
|
pageChange(queryParams.value.currentPage, queryParams.value.pageSize); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const calculateTableHeight = () => { |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
const windowHeight = window.innerHeight; |
|
|
|
|
|
const remainingHeight = windowHeight - 523; |
|
|
|
|
|
tableHeight.value = remainingHeight + 'px'; |
|
|
|
|
|
tableHeightNew.value = remainingHeight + 70 + 'px'; |
|
|
|
|
|
tableHeightNewSec.value = remainingHeight + 20 + 'px'; |
|
|
|
|
|
}); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
function getModelParamList() { |
|
|
|
|
|
listParamclassNoPage(queryParams.value).then(response => { |
|
|
|
|
|
paramModelList.value = response.data; |
|
|
|
|
|
paramModelListTable.value = paramModelList.value.map(item => { |
|
|
|
|
|
return { |
|
|
|
|
|
value: item.paramClassCode, |
|
|
|
|
|
label: item.paramClassName, |
|
|
|
|
|
}; |
|
|
|
|
|
}); |
|
|
|
|
|
paramModelListVxetable.value = paramModelListTable.value |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function insertRecords(rows) { |
|
|
|
|
|
insertRecordsCache.value = [ |
|
|
|
|
|
...rows, |
|
|
|
|
|
...insertRecordsCache.value, |
|
|
|
|
|
|
|
|
]; |
|
|
]; |
|
|
} else { |
|
|
|
|
|
selectedModelList.value = newSelectedList; |
|
|
|
|
|
} |
|
|
} |
|
|
addParamModelShow.value = false; |
|
|
|
|
|
|
|
|
function updateRecords(rows) { |
|
|
|
|
|
updateRecordsCache.value = [ |
|
|
|
|
|
...rows, |
|
|
|
|
|
...updateRecordsCache.value, |
|
|
|
|
|
|
|
|
|
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function startEditing(row, column, cell, event) { |
|
|
function removeRecords(rows) { |
|
|
if (!updateModelIds.value.includes(row.id)) { |
|
|
|
|
|
updateModelIds.value.push(row.id); |
|
|
// 过滤掉ABCDEFXYZ开头的数据 |
|
|
|
|
|
const params = rows.map((i) => i.id); |
|
|
|
|
|
delSelectDataCache.value = [ |
|
|
|
|
|
...params.filter(item => { |
|
|
|
|
|
if (typeof item === 'string' && item.includes('ABCDEFXYZ')) { |
|
|
|
|
|
return false; // 过滤掉包含 'ABCDEFXYZ' 的字符串项 |
|
|
|
|
|
} |
|
|
|
|
|
return true; // 保留非字符串项 |
|
|
|
|
|
}), |
|
|
|
|
|
...delSelectDataCache.value |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
row.editing = true; // 进入编辑模式 |
|
|
|
|
|
|
|
|
function delRowData(row) { |
|
|
|
|
|
const params = [row.id]; |
|
|
|
|
|
delSelectDataCache.value = [ |
|
|
|
|
|
...params.filter(item => { |
|
|
|
|
|
if (typeof item === 'string' && item.includes('ABCDEFXYZ')) { |
|
|
|
|
|
return false; // 过滤掉包含 'ABCDEFXYZ' 的字符串项 |
|
|
|
|
|
} |
|
|
|
|
|
return true; // 保留非字符串项 |
|
|
|
|
|
}), |
|
|
|
|
|
...delSelectDataCache.value |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function saveData(row) { |
|
|
function pageChange(currentPage, pageSize) { |
|
|
// 保存数据的逻辑... |
|
|
config.value.pagerConfig.currentPage = currentPage; |
|
|
row.editing = false; // 保存完成后,切换回显示模式 |
|
|
config.value.pagerConfig.pageSize = pageSize; |
|
|
|
|
|
queryParams.value.currentPage = currentPage; |
|
|
|
|
|
queryParams.value.pageSize = pageSize; |
|
|
|
|
|
// 对selectedModelList.value进行分页处理 |
|
|
|
|
|
const startIndex = (currentPage - 1) * pageSize; |
|
|
|
|
|
const endIndex = startIndex + pageSize; |
|
|
|
|
|
selectedModelListTable.value = selectedModelList.value.slice(startIndex, endIndex); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function ifselectable(row, index) { |
|
|
|
|
|
let flag = true; |
|
|
function beforeChangeParamClass(envent, row, column) { |
|
|
console.log(selectedModelList.value); |
|
|
if (envent !== undefined && envent) { |
|
|
if (selectedModelList.value.length > 0) { |
|
|
let thePartionModelList = selectedModelList.value.filter(item => { |
|
|
selectedModelList.value.forEach(element => { |
|
|
return row.partion === item.partion; |
|
|
if (element.id == row.id) { |
|
|
}) |
|
|
flag = false; |
|
|
paramModelListVxetable.value = paramModelList.value.filter(element => { |
|
|
|
|
|
return !thePartionModelList.some(item => { |
|
|
|
|
|
return element.paramClassCode === item.paramClassId; |
|
|
|
|
|
}); |
|
|
|
|
|
}).map(temp => { |
|
|
|
|
|
{ |
|
|
|
|
|
return { |
|
|
|
|
|
value: temp.paramClassCode, |
|
|
|
|
|
label: temp.paramClassName, |
|
|
|
|
|
}; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
paramModelListVxetable.value = paramModelListTable.value |
|
|
} |
|
|
} |
|
|
return flag; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function selectRadio(row) { |
|
|
function startCountdown() { |
|
|
if (!updateModelIds.value.includes(row.id)) { |
|
|
const timer = setInterval(() => { |
|
|
updateModelIds.value.push(row.id); |
|
|
countdown.value--; |
|
|
|
|
|
if (countdown.value === 0) { |
|
|
|
|
|
clearInterval(timer); |
|
|
|
|
|
// 在倒计时结束后导航到首页 |
|
|
|
|
|
router.push({ |
|
|
|
|
|
path: "devicemodel", |
|
|
|
|
|
query: { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
}, 1000); // 每秒减少1秒 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function getOldModelParams() { |
|
|
function addRowsCallBack(records, callback) { |
|
|
listModelparam(queryParams.value).then(response => { |
|
|
callback([...newSelectedList.value]) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// oldSelectedList.value = response.rows; |
|
|
function getModelCode() { |
|
|
|
|
|
getCode("device_model_code").then(response => { |
|
|
|
|
|
form.value.modelCode = response.msg; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getModelCode(); |
|
|
getTreeselect(); |
|
|
getTreeselect(); |
|
|
getModelTypeList(); |
|
|
getModelTypeListNoPage(); |
|
|
|
|
|
getModelParamList(); |
|
|
getOldModelParams(); |
|
|
getOldModelParams(); |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|