Browse Source

Merge branch 'develop' of https://gitee.com/lmlz_0/dc-ui into develop

pull/1/head
lxg 1 year ago
parent
commit
3420ae17bf
  1. 1
      src/api/model/modelType.js
  2. 25
      src/assets/styles/self-defined.scss
  3. 6
      src/router/index.js
  4. 372
      src/views/model/devicemodel/addmodel.vue
  5. 147
      src/views/model/devicemodel/index.vue

1
src/api/model/modelType.js

@ -2,7 +2,6 @@ import request from '@/utils/request'
// 查询设备模型类别列表 // 查询设备模型类别列表
export function listModelType(query) { export function listModelType(query) {
console.log("-------------"+query);
return request({ return request({
url: '/model/dcModelType/list', url: '/model/dcModelType/list',
method: 'get', method: 'get',

25
src/assets/styles/self-defined.scss

@ -20,3 +20,28 @@
margin-left: 100px; margin-left: 100px;
} }
.marginbottom50px{
margin-bottom: 50px;
}
.textaligncenter{
text-align:center;
}
.textalignleft{
text-align:left;
}
.widthhalfinlineblock{
width: 50%;
display: inline-block;
}
.textalignright{
text-align:right;
}
.marginbottom20{
margin-bottom: 5px;
}
.margintop10{
margin-top:10px;
}

6
src/router/index.js

@ -167,12 +167,6 @@ export const constantRoutes = [
} }
] ]
}, },
{
path: '/devicemodel/addmodel',
component: () => import('@/views/model/devicemodel/addmodel'),
name: 'newdevicemodel',
meta: { title: '新增设备模型', icon: '' }
},
] ]
// 动态路由,基于用户权限动态去加载 // 动态路由,基于用户权限动态去加载

372
src/views/model/devicemodel/addmodel.vue

@ -1,63 +1,196 @@
<template> <template>
<div class="app-container"> <div class="app-container"
v-loading="loading">
<!-- 添加或修改设备模型信息对话框 --> <!-- 添加或修改设备模型信息对话框 -->
<template> <div class="marginbottom50px">
<el-steps :space="200" :active="1" simple> <el-steps :active="currentStep">
<el-step title="Step 1" :icon="Edit" /> <el-step title="模型信息" description="名称、编号、序号、备注等" />
<el-step title="Step 2" :icon="UploadFilled" /> <el-step title="参数类别配置" description="模型的参数类别" />
<el-step title="Step 3" :icon="Picture" /> <el-step title="调控策略" description="模型的调控策略" />
</el-steps> </el-steps>
</div>
<el-steps :active="1" finish-status="success" simple style="margin-top: 20px"> <div>
<el-step title="Step 1" /> <el-form ref="devicemodelRef" :model="form" :rules="rules" label-width="100px">
<el-step title="Step 2" /> <el-carousel ref="carousel" :autoplay="false" :arrow="never" pause-on-hover="false" class="customCarousel" >
<el-step title="Step 3" /> <el-carousel-item :key="1" name="1" class="textaligncenter">
</el-steps> <div class="widthhalfinlineblock">
</template> <el-form-item label="模型名称" prop="modelName">
<el-input v-model="form.modelName" placeholder="请输入模型名称" />
</el-form-item>
<el-form ref="devicemodelRef" :model="form" :rules="rules" label-width="80px"> <el-form-item label="模型编码" prop="modelCode">
<el-form-item label="模型名称" prop="modelName"> <el-input v-model="form.modelCode" placeholder="请输入模型编码" />
<el-input v-model="form.modelName" placeholder="请输入模型名称" /> </el-form-item>
</el-form-item> <el-form-item label="排序" prop="sort">
<el-form-item label="模型编码" prop="modelCode"> <el-input-number v-model="form.sort" :min="1" :max="100" placeholder="请输入排序"/>
<el-input v-model="form.modelCode" placeholder="请输入模型编码" /> </el-form-item>
</el-form-item> <el-form-item label="上级" prop="pid">
<el-form-item label="排序;排序" prop="sort"> <el-tree-select
<el-input v-model="form.sort" placeholder="请输入排序;排序" /> v-model="form.pid"
</el-form-item> :data="devicemodelOptions"
<el-form-item label="上级id;上级id" prop="pid"> :props="{ value: 'id', label: 'modelName', children: 'children' }"
<el-tree-select value-key="id"
v-model="form.pid" placeholder="请选择上级"
:data="devicemodelOptions" check-strictly
:props="{ value: 'id', label: 'modelName', children: 'children' }" :default-expand-all="true"
value-key="id" :default-checked-keys="defaultCheckedKeys"
placeholder="请选择上级id;上级id" />
check-strictly </el-form-item>
/> <el-form-item label="模型类别" key="selectmodelType" prop="modelTypeId">
</el-form-item> <el-select v-model="form.modelTypeId" placeholder="请选择模型类别" clearable>
<el-form-item label="备注" prop="note"> <el-option v-for="dict in modeltypeList" :key="dict.id" :label="dict.modelTypeName" :value="dict.id" />
<el-input v-model="form.note" type="textarea" placeholder="请输入内容" /> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item label="是否是叶节点">
<el-button type="primary" @click="submitForm"> </el-button> <el-switch
<el-button @click="cancel"> </el-button> v-model="form.dc_is_leaf"
</el-form-item> @change="switch_isLeaf"
</el-form> class="ml-2i"
style="--el-switch-on-color: #13ce66"
/>
</el-form-item>
<el-form-item label="是否可用">
<el-switch
v-model="form.dc_available"
class="ml-2i"
style="--el-switch-on-color: #13ce66"
/>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="form.note" type="textarea" placeholder="请输入内容" />
</el-form-item>
</div>
</el-carousel-item>
<el-carousel-item :key="2" name="2" class="textaligncenter">
<div class="widthhalfinlineblock">
<div class="textalignright marginbottom5">
<el-button type="primary" style="display: inline-block !important" @click="addParamModel">添加参数模版</el-button>
</div>
<el-table :data="selectedModelList" style="width: 100%" max-height="250" @cell-dblclick="startEditing">
<el-table-column fixed label="序号" width="80">
<template #default="scope" >
<span>{{ scope.$index+1 }}</span>
</template>
</el-table-column>
<el-table-column label="ID" align="center" width="55" prop="id" />
<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">
<template #default="scope">
<span v-if="!scope.row.editing">{{ scope.row.editing}}</span>
<el-input v-else v-model="scope.row.plcAdr" @blur="saveData(scope)"/>
</template>
</el-table-column>
<!-- <el-table-column label="是否可控" align="center" prop="control">
<template #default="scope">
<dict-tag :options="dc_class_type" :value="scope.row.control" />
</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" class-name="small-padding fixed-width">
<template #default="scope">
<el-button type="text" icon="View" @click="handleView(scope.row)">查看</el-button>
<el-button type="text" icon="Edit" @click="handleEdit(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-carousel-item>
</el-carousel>
<div class="textaligncenter">
<el-form-item class="widthhalfinlineblock">
<el-button type="primary" v-if="prevStepButtonShow" @click="prevStep" >上一步</el-button>
<el-button type="primary" v-if="submitButtonShow" @click="submitForm" >提交</el-button>
<el-button type="primary" v-if="nextStepButtonShow" @click="nextStep" >下一步</el-button>
<el-button @click="cancel"> </el-button>
</el-form-item>
</div>
</el-form>
<el-dialog :title="title" v-model="addParamModelShow" width="800px" append-to-body :dc_device_partion="dc_device_partion" :dc_class_type="dc_class_type">
<el-table ref="dialogTable" :data="paramModelList" key="newTable" style="width: 100%" max-height="600">
<el-table-column type="selection" width="55" :selectable="ifselectable"/>
<el-table-column label="ID" align="center" width="55" prop="id" />
<el-table-column label="参数名称" align="center" prop="paramClassName" />
<el-table-column label="参数编码" align="center" prop="paramClassCode" />
<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>
<div class="textalignright margintop10">
<el-button type="primary" @click="selectedSubmit">提交</el-button>
</div>
</el-dialog>
</div>
</div> </div>
</template> </template>
<style lang="scss">
@import "@/assets/styles/self-defined.scss";
.customCarousel {
div{
button {
display: none !important;
}
}
ul{
display: none !important;
}
}
</style>
<script setup name="newdevicemodel"> <script setup name="newdevicemodel">
import { addDevicemodel, updateDevicemodel } from "@/api/model/devicemodel"; import { listDevicemodel,addDevicemodel, updateDevicemodel } from "@/api/model/devicemodel";
import { Edit, Picture, UploadFilled } from '@element-plus/icons-vue' import { listParamclass } from "@/api/model/paramclass";
import { listModelType} from "@/api/model/modelType";
import { onMounted, ref } from 'vue';
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const {dc_class_type, dc_device_partion} = proxy.useDict('dc_available', 'dc_is_leaf', 'dc_class_type', 'dc_device_partion');
const router = useRouter(); const router = useRouter();
const devicemodelOptions = ref([]); const devicemodelOptions = ref([]);
const open = ref(false); const open = ref(false);
const title = ref(""); const loading = ref(false);
const modeltypeList = ref([]);
const currentStep = ref(1);
const nextStepButtonShow = ref(false);
const prevStepButtonShow = ref(false);
const submitButtonShow = ref(true);
const paramModelList = ref([]);
const addParamModelShow = ref(false);
const nordeNumber = ref(1);
const selectedModelList = ref([]);
console.log(router);
console.log(proxy);
const tempPid = router.currentRoute._value.query.pid;
const data = reactive({ const data = reactive({
form: {}, form: {
sort:1,
dc_is_leaf:false,
dc_available:false,
// pid:tempPid,
},
dc_available: [
{label: '可用', value: 'true', elTagType: 'default', elTagClass: null},
{label: '不可用', value: 'false', elTagType: 'default', elTagClass: null}
],
dc_is_leaf: [
{label: '是', value: 'true', elTagType: 'default', elTagClass: null},
{label: '否', value: 'false', elTagType: 'default', elTagClass: null}
],
queryParams: { queryParams: {
modelName: null, modelName: null,
modelCode: null, modelCode: null,
@ -68,12 +201,21 @@
}, },
rules: { rules: {
modelTypeId: [ modelTypeId: [
{ required: true, message: "模型类别Id不能为空", trigger: "change" } { required: true, message: "模型类别不能为空", trigger: "change" }
],
modelName: [
{ required: true, message: "模型名称不能为空", trigger: "change" }
],
modelCode: [
{ required: true, message: "模型编码不能为空", trigger: "change" }
],
pid: [
{ required: true, message: "上级不能为空", trigger: "change" }
], ],
} }
}); });
const { queryParams, form, rules } = toRefs(data); const { queryParams, form, rules, dc_available, dc_is_leaf } = toRefs(data);
// //
function cancel() { function cancel() {
@ -111,19 +253,139 @@
if (valid) { if (valid) {
if (form.value.id != null) { if (form.value.id != null) {
updateDevicemodel(form.value).then(response => { updateDevicemodel(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
router.go(-1); router.go(-1);
proxy.$modal.msgSuccess("修改成功");
}); });
} else { } else {
addDevicemodel(form.value).then(response => { addDevicemodel(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
router.go(-1); router.go(-1);
proxy.$modal.msgSuccess("新增成功");
}); });
} }
} }
}); });
} }
/** 查询设备模型类型列表 */
function getModelTypeList() {
loading.value = true;
listModelType(queryParams.value).then(response => {
console.log(response);
modeltypeList.value = response.rows;
loading.value = false;
});
}
function getTreeselect() {
listDevicemodel().then(response => {
devicemodelOptions.value = [];
const data = { id: 0, modelName: '顶级节点', children: [] };
const parentData = response.data.filter(item => {
// 使 includes()indexOf()
return !item.isLeaf;
});
data.children = proxy.handleTree(parentData, "id", "pid");
devicemodelOptions.value.push(data);
});
}
onMounted(() => {
console.log("-------------"+tempPid);
//
//
// form.value.pid=tempPid;
});
function switch_isLeaf(){
if(form.value.dc_is_leaf){
submitButtonShow.value = false;
nextStepButtonShow.value = true;
}else{
submitButtonShow.value = true;
nextStepButtonShow.value = false;
}
}
function nextStep(){
console.log("---------------");
proxy.$refs["devicemodelRef"].validate(valid => {
// if (valid) {
if(currentStep.value<2){
currentStep.value = currentStep.value + 1;
proxy.$refs.carousel.next();
submitButtonShow.value = true;
nextStepButtonShow.value = false;
prevStepButtonShow.value = true;
}
// }
});
}
function prevStep(){
currentStep.value = currentStep.value - 1;
proxy.$refs.carousel.prev();
submitButtonShow.value = false;
nextStepButtonShow.value = true;
prevStepButtonShow.value = false;
}
/** 查询参数模型信息列表 */
function addParamModel(){
loading.value = true;
listParamclass(queryParams.value).then(response => {
console.log(response);
paramModelList.value = response.rows;
console.log(paramModelList);
addParamModelShow.value = true;
loading.value = false;
});
}
function handleView(){
}
function handleEdit(){
}
function selectedSubmit(){
const newSelectedList = proxy.$refs.dialogTable.getSelectionRows().map(row => ({
...row,
editing: false, // 'editing' false
}));
if(selectedModelList.value.length>0){
selectedModelList.value = {
...selectedModelList,
...newSelectedList,
}
}else{
selectedModelList.value = newSelectedList;
}
console.log(selectedModelList);
addParamModelShow.value = false;
}
function startEditing(scope) {
console.log(scope);
scope.row.editing = true; //
}
function saveData(scope) {
// ...
scope.row.editing = false; //
}
function ifselectable(row, index){
let flag = true;
console.log(selectedModelList.value);
if(selectedModelList.value != []){
selectedModelList.value.forEach(element => {
if(element.id == row.id){
flag = false;
}
});
}
return flag;
}
getTreeselect();
getModelTypeList();
</script> </script>

147
src/views/model/devicemodel/index.vue

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="模型名称" prop="modelName"> <el-form-item label="模型名称" prop="modelName">
<el-input <el-input
v-model="queryParams.modelName" v-model="queryParams.modelName"
@ -17,22 +17,47 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="排序;排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input <el-input
v-model="queryParams.sort" v-model="queryParams.sort"
placeholder="请输入排序;排序" placeholder="请输入排序"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="上级id;上级id" prop="pid"> <el-form-item label="模型类别Id" prop="modelTypeId">
<el-select v-model="queryParams.modelTypeId" placeholder="请选择模型类别Id" clearable>
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="上级id" prop="pid">
<el-input <el-input
v-model="queryParams.pid" v-model="queryParams.pid"
placeholder="请输入上级id;上级id" placeholder="请输入上级id"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="是否是叶节点" prop="isLeaf">
<el-select v-model="queryParams.isLeaf" placeholder="请选择是否是叶节点" clearable>
<el-option
v-for="dict in dc_is_leaf"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否可用" prop="vailable">
<el-select v-model="queryParams.vailable" placeholder="请选择是否可用" clearable>
<el-option
v-for="dict in available"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button> <el-button icon="Refresh" @click="resetQuery">重置</el-button>
@ -70,10 +95,20 @@
> >
<el-table-column label="模型名称" align="center" prop="modelName" /> <el-table-column label="模型名称" align="center" prop="modelName" />
<el-table-column label="模型编码" align="center" prop="modelCode" /> <el-table-column label="模型编码" align="center" prop="modelCode" />
<el-table-column label="排序;排序" align="center" prop="sort" /> <el-table-column label="排序" align="center" prop="sort" />
<el-table-column label="模型类别Id" align="center" prop="modelTypeId" /> <el-table-column label="模型类别Id" align="center" prop="modelTypeId" />
<el-table-column label="上级id;上级id" align="center" prop="pid" /> <el-table-column label="上级id" align="center" prop="pid" />
<el-table-column label="备注" align="center" prop="note" /> <el-table-column label="备注" align="center" prop="note" />
<el-table-column label="是否是叶节点" align="center" prop="isLeaf">
<template #default="scope">
<dict-tag :options="dc_is_leaf" :value="scope.row.isLeaf"/>
</template>
</el-table-column>
<el-table-column label="是否可用" align="center" prop="vailable">
<template #default="scope">
<dict-tag :options="available" :value="scope.row.vailable"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@ -107,22 +142,45 @@
<el-form-item label="模型编码" prop="modelCode"> <el-form-item label="模型编码" prop="modelCode">
<el-input v-model="form.modelCode" placeholder="请输入模型编码" /> <el-input v-model="form.modelCode" placeholder="请输入模型编码" />
</el-form-item> </el-form-item>
<el-form-item label="排序;排序" prop="sort"> <el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" placeholder="请输入排序;排序" /> <el-input v-model="form.sort" placeholder="请输入排序" />
</el-form-item>
<el-form-item label="模型类别Id" prop="modelTypeId">
<el-select v-model="form.modelTypeId" placeholder="请选择模型类别Id">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="上级id;上级id" prop="pid"> <el-form-item label="上级id" prop="pid">
<el-tree-select <el-tree-select
v-model="form.pid" v-model="form.pid"
:data="devicemodelOptions" :data="devicemodelOptions"
:props="{ value: 'id', label: 'modelName', children: 'children' }" :props="{ value: 'id', label: 'modelName', children: 'children' }"
value-key="id" value-key="id"
placeholder="请选择上级id;上级id" placeholder="请选择上级id"
check-strictly check-strictly
/> />
</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="请输入内容" />
</el-form-item> </el-form-item>
<el-form-item label="是否是叶节点">
<el-radio-group v-model="form.isLeaf">
<el-radio
v-for="dict in dc_is_leaf"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否可用">
<el-radio-group v-model="form.vailable">
<el-radio
v-for="dict in available"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
@ -138,7 +196,8 @@
import { listDevicemodel, getDevicemodel, delDevicemodel, addDevicemodel, updateDevicemodel } from "@/api/model/devicemodel"; import { listDevicemodel, getDevicemodel, delDevicemodel, addDevicemodel, updateDevicemodel } from "@/api/model/devicemodel";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const router = useRouter(); const { available, dc_is_leaf } = proxy.useDict('available', 'dc_is_leaf');
const devicemodelList = ref([]); const devicemodelList = ref([]);
const devicemodelOptions = ref([]); const devicemodelOptions = ref([]);
const open = ref(false); const open = ref(false);
@ -147,7 +206,7 @@ const showSearch = ref(true);
const title = ref(""); const title = ref("");
const isExpandAll = ref(true); const isExpandAll = ref(true);
const refreshTable = ref(true); const refreshTable = ref(true);
const router = useRouter();
const data = reactive({ const data = reactive({
form: {}, form: {},
queryParams: { queryParams: {
@ -156,12 +215,32 @@ const data = reactive({
sort: null, sort: null,
modelTypeId: null, modelTypeId: null,
pid: null, pid: null,
note: null note: null,
isLeaf: null,
vailable: null
}, },
rules: { rules: {
modelName: [
{ required: true, message: "模型名称不能为空", trigger: "blur" }
],
modelCode: [
{ required: true, message: "模型编码不能为空", trigger: "blur" }
],
sort: [
{ required: true, message: "排序不能为空", trigger: "blur" }
],
modelTypeId: [ modelTypeId: [
{ required: true, message: "模型类别Id不能为空", trigger: "change" } { required: true, message: "模型类别Id不能为空", trigger: "change" }
], ],
pid: [
{ required: true, message: "上级id不能为空", trigger: "blur" }
],
isLeaf: [
{ required: true, message: "是否是叶节点不能为空", trigger: "blur" }
],
vailable: [
{ required: true, message: "是否可用不能为空", trigger: "blur" }
]
} }
}); });
@ -211,7 +290,11 @@ function reset() {
sort: null, sort: null,
modelTypeId: null, modelTypeId: null,
pid: null, pid: null,
note: null note: null,
isLeaf: "0",
vailable: "0"
}; };
proxy.resetForm("devicemodelRef"); proxy.resetForm("devicemodelRef");
} }
@ -229,17 +312,26 @@ function resetQuery() {
/** 新增按钮操作 */ /** 新增按钮操作 */
function handleAdd(row) { function handleAdd(row) {
const path = "/devicemodel/addmodel" const path = "/newdevicemodel";
reset(); let pid = 0;
getTreeselect(); if(row.isLeaf){
proxy.$message({
message: '请选择非叶节点行再操作',
type: 'warn'
});
return;
}
if (row != null && row.id) { if (row != null && row.id) {
form.value.pid = row.id; pid = row.id;
} else {
form.value.pid = 0;
} }
router.push(path); router.push({
// open.value = true; name:path,
// title.value = ""; query:{
pid:pid,
// devicemodelOptions:devicemodelOptions
}
});
} }
/** 展开/折叠操作 */ /** 展开/折叠操作 */
@ -273,13 +365,13 @@ function submitForm() {
updateDevicemodel(form.value).then(response => { updateDevicemodel(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功"); proxy.$modal.msgSuccess("修改成功");
open.value = false; open.value = false;
router.go(-1); getList();
}); });
} else { } else {
addDevicemodel(form.value).then(response => { addDevicemodel(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功"); proxy.$modal.msgSuccess("新增成功");
open.value = false; open.value = false;
router.go(-1); getList();
}); });
} }
} }
@ -296,5 +388,8 @@ function handleDelete(row) {
}).catch(() => {}); }).catch(() => {});
} }
/** 查询设备模型信息下拉树结构 */
// getTreeselect();
getList(); getList();
</script> </script>

Loading…
Cancel
Save