Browse Source

8-14

pull/1/head
lxg 1 year ago
parent
commit
753646818e
  1. 64
      src/views/model/devicemodel/editModel.vue
  2. 4
      src/views/model/devicemodel/index.vue

64
src/views/model/devicemodel/editModel.vue

@ -1,6 +1,5 @@
<template> <template>
<div class="app-container" <div class="app-container" v-loading="loading">
v-loading="loading">
<!-- 添加或修改设备模型信息对话框 --> <!-- 添加或修改设备模型信息对话框 -->
<div class="marginbottom50px"> <div class="marginbottom50px">
<el-steps :active="currentStep"> <el-steps :active="currentStep">
@ -24,16 +23,9 @@
<el-input-number v-model="form.sort" :min="1" :max="100" placeholder="请输入排序" /> <el-input-number v-model="form.sort" :min="1" :max="100" placeholder="请输入排序" />
</el-form-item> </el-form-item>
<el-form-item label="上级" prop="pid"> <el-form-item label="上级" prop="pid">
<el-tree-select <el-tree-select v-model="form.pid" :data="devicemodelOptions"
v-model="form.pid" :props="{ value: 'id', label: 'modelName', children: 'children' }" value-key="id" placeholder="请选择上级"
:data="devicemodelOptions" check-strictly :default-expand-all="true" :default-checked-keys="defaultCheckedKeys" />
:props="{ value: 'id', label: 'modelName', children: 'children' }"
value-key="id"
placeholder="请选择上级"
check-strictly
:default-expand-all="true"
:default-checked-keys="defaultCheckedKeys"
/>
</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">
@ -42,11 +34,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否可用" prop="vailable"> <el-form-item label="是否可用" prop="vailable">
<el-switch <el-switch v-model="form.dc_available" class="ml-2i" style="--el-switch-on-color: #13ce66" />
v-model="form.dc_available"
class="ml-2i"
style="--el-switch-on-color: #13ce66"
/>
</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="请输入内容" />
@ -54,9 +42,12 @@
</div> </div>
<div class="width50percent textalignright"> <div class="width50percent textalignright">
<el-form-item class="inlineblock marginright6percent divsonmarginleft0"> <el-form-item class="inlineblock marginright6percent divsonmarginleft0">
<el-button type="primary" v-if="prevStepButtonShow" @click="prevStep" style="display: inline-block !important" >上一步</el-button> <el-button type="primary" v-if="prevStepButtonShow" @click="prevStep"
<el-button type="primary" v-if="submitButtonShow" @click="submitForm" style="display: inline-block !important">提交</el-button> style="display: inline-block !important">上一步</el-button>
<el-button type="primary" v-if="nextStepButtonShow" @click="nextStep" style="display: inline-block !important">下一步</el-button> <el-button type="primary" v-if="submitButtonShow" @click="submitForm"
style="display: inline-block !important">提交</el-button>
<el-button type="primary" v-if="nextStepButtonShow" @click="nextStep"
style="display: inline-block !important">下一步</el-button>
<el-button @click="cancel" style="display: inline-block !important"> </el-button> <el-button @click="cancel" style="display: inline-block !important"> </el-button>
</el-form-item> </el-form-item>
</div> </div>
@ -64,7 +55,8 @@
<el-carousel-item :key="2" name="2" class="textaligncenter overflowscroll height300"> <el-carousel-item :key="2" name="2" class="textaligncenter overflowscroll height300">
<div class="width75percentinlineblock"> <div class="width75percentinlineblock">
<div class="textalignright marginbottom5"> <div class="textalignright marginbottom5">
<el-button type="primary" style="display: inline-block !important" @click="addParamModel">添加参数模版</el-button> <el-button type="primary" style="display: inline-block !important"
@click="addParamModel">添加参数模版</el-button>
</div> </div>
<el-table :data="selectedModelList" style="width: 100%" max-height="250" @cell-dblclick="startEditing"> <el-table :data="selectedModelList" style="width: 100%" max-height="250" @cell-dblclick="startEditing">
<el-table-column fixed label="序号" width="80" align="center"> <el-table-column fixed label="序号" width="80" align="center">
@ -84,12 +76,8 @@
</el-table-column> </el-table-column>
<el-table-column label="是否可控" align="center" prop="controllab"> <el-table-column label="是否可控" align="center" prop="controllab">
<template #default="scope"> <template #default="scope">
<el-switch <el-switch v-model="scope.row.controllab" @change="selectRadio(scope.row)" class="ml-2i"
v-model="scope.row.controllab" style="--el-switch-on-color: #13ce66" />
@change="selectRadio(scope.row)"
class="ml-2i"
style="--el-switch-on-color: #13ce66"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="类别" align="center" prop="classType"> <el-table-column label="类别" align="center" prop="classType">
@ -105,16 +93,20 @@
<el-table-column label="备注" align="center" prop="note" /> <el-table-column label="备注" align="center" prop="note" />
<el-table-column label="操作" align="center" width="200px"> <el-table-column label="操作" align="center" width="200px">
<template #default="scope"> <template #default="scope">
<el-button style="display:inline-block !important" type="primary" @click="handleDelete(scope.row)">删除</el-button> <el-button style="display:inline-block !important" type="primary"
@click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="fixedbottomright width50percent textalignright"> <div class="fixedbottomright width50percent textalignright">
<el-form-item class="inlineblock marginright6percent divsonmarginleft0"> <el-form-item class="inlineblock marginright6percent divsonmarginleft0">
<el-button type="primary" v-if="prevStepButtonShow" @click="prevStep" style="display: inline-block !important">上一步</el-button> <el-button type="primary" v-if="prevStepButtonShow" @click="prevStep"
<el-button type="primary" v-if="submitButtonShow" @click="submitForm" style="display: inline-block !important">提交</el-button> style="display: inline-block !important">上一步</el-button>
<el-button type="primary" v-if="nextStepButtonShow" @click="nextStep" style="display: inline-block !important">下一步</el-button> <el-button type="primary" v-if="submitButtonShow" @click="submitForm"
style="display: inline-block !important">提交</el-button>
<el-button type="primary" v-if="nextStepButtonShow" @click="nextStep"
style="display: inline-block !important">下一步</el-button>
<el-button @click="cancel" style="display: inline-block !important"> </el-button> <el-button @click="cancel" style="display: inline-block !important"> </el-button>
</el-form-item> </el-form-item>
</div> </div>
@ -122,7 +114,8 @@
</el-carousel> </el-carousel>
</el-form> </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-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 ref="dialogTable" :data="paramModelList" key="newTable" style="width: 100%" max-height="600">
<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" />
@ -148,19 +141,21 @@
</template> </template>
<style lang="scss"> <style lang="scss">
@import "@/assets/styles/self-defined.scss"; @import "@/assets/styles/self-defined.scss";
.customCarousel { .customCarousel {
div { div {
button { button {
display: none !important; display: none !important;
} }
} }
ul { ul {
display: none !important; display: none !important;
} }
} }
</style> </style>
<script setup name="editdevicemodel"> <script setup name="editdevicemodel">
import { listDevicemodel,addDevicemodel, updateDevicemodel } from "@/api/model/devicemodel"; import { listDevicemodel, addDevicemodel, updateDevicemodel, getDevicemodel} from "@/api/model/devicemodel";
import { listParamclass } from "@/api/model/paramclass"; import { listParamclass } from "@/api/model/paramclass";
import { listModelType } from "@/api/model/modelType"; import { listModelType } from "@/api/model/modelType";
import { required } from "@vee-validate/rules"; import { required } from "@vee-validate/rules";
@ -332,6 +327,7 @@ function submitForm() {
} }
}); });
} }
/** 查询设备模型类型列表 */ /** 查询设备模型类型列表 */
function getModelTypeList() { function getModelTypeList() {
loading.value = true; loading.value = true;
@ -341,6 +337,7 @@ function submitForm() {
loading.value = false; loading.value = false;
}); });
} }
function getTreeselect() { function getTreeselect() {
listDevicemodel().then(response => { listDevicemodel().then(response => {
devicemodelOptions.value = []; devicemodelOptions.value = [];
@ -352,6 +349,7 @@ function submitForm() {
devicemodelOptions.value.push(data); devicemodelOptions.value.push(data);
}); });
} }
onMounted(() => { onMounted(() => {
console.log("-------------" + modelId); console.log("-------------" + modelId);

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

@ -254,10 +254,6 @@ function getTreeselect() {
devicemodelOptions.value.push(data); devicemodelOptions.value.push(data);
}); });
} }
<<<<<<< HEAD
=======
>>>>>>> 4581b8b996797432f97cb021b35b194e99980dd9
// //
function cancel() { function cancel() {
open.value = false; open.value = false;

Loading…
Cancel
Save