|
@@ -78,31 +78,32 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
+ <!-- 克隆 -->
|
|
|
<el-dialog
|
|
|
- v-model="dialogVisible"
|
|
|
+ v-model="cloneDialog"
|
|
|
title="变量克隆"
|
|
|
- width="30%"
|
|
|
- :before-close="handleClose"
|
|
|
+ width="30rem"
|
|
|
+ :before-close="cloneHandleClose"
|
|
|
>
|
|
|
<div class="dialogOne">
|
|
|
<div>克隆设备对象: <span>183</span></div>
|
|
|
<div class="content">
|
|
|
<span>* </span>变量克隆至:
|
|
|
- <el-radio v-model="radio1" label="1">新设备</el-radio>
|
|
|
- <el-radio v-model="radio1" label="2">已有设备</el-radio>
|
|
|
+ <el-radio v-model="cloneRadio" label="1">新设备</el-radio>
|
|
|
+ <el-radio v-model="cloneRadio" label="2">已有设备</el-radio>
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
<span>* </span>设备名:
|
|
|
<el-input
|
|
|
class="inputer"
|
|
|
- v-model="inputName"
|
|
|
+ v-model="cloneInputName"
|
|
|
placeholder="请输入设备名"
|
|
|
clearable
|
|
|
/>
|
|
|
设备编号:
|
|
|
<el-input
|
|
|
class="inputer"
|
|
|
- v-model="inputCode"
|
|
|
+ v-model="cloneInputCode"
|
|
|
placeholder="请输入设备编号"
|
|
|
clearable
|
|
|
/>
|
|
@@ -111,14 +112,14 @@
|
|
|
<span>* </span>模拟量:
|
|
|
<el-input
|
|
|
class="inputer"
|
|
|
- v-model="inputName"
|
|
|
+ v-model="cloneInputModel"
|
|
|
placeholder="请输入模拟量"
|
|
|
clearable
|
|
|
/>
|
|
|
状态量:
|
|
|
<el-input
|
|
|
class="inputer"
|
|
|
- v-model="inputCode"
|
|
|
+ v-model="cloneInputState"
|
|
|
placeholder="请输入状态量"
|
|
|
clearable
|
|
|
/>
|
|
@@ -127,14 +128,122 @@
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
<el-checkbox
|
|
|
- v-model="checked1"
|
|
|
+ v-model="cloneChecked"
|
|
|
label="连续克隆模式"
|
|
|
style="margin-right: 10px"
|
|
|
></el-checkbox>
|
|
|
- <el-button @click="dialogVisible = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="dialogVisible = false"
|
|
|
- >确定</el-button
|
|
|
+ <el-button @click="cloneDialog = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="cloneDialog = false">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 变量列表 -->
|
|
|
+ <el-dialog
|
|
|
+ v-model="listDialog"
|
|
|
+ :title="listTitleDialog + '的变量列表'"
|
|
|
+ width="70rem"
|
|
|
+ :before-close="listHandleClose"
|
|
|
+ >
|
|
|
+ <div class="dialogOne" style="overflow: hidden">
|
|
|
+ <el-radio-group
|
|
|
+ v-model="listTabPosition"
|
|
|
+ @change="listTabsChange(listTabPosition)"
|
|
|
+ style="margin-bottom: 15px; display: flex"
|
|
|
+ >
|
|
|
+ <el-radio-button label="model">模拟量</el-radio-button>
|
|
|
+ <el-radio-button label="state">状态量</el-radio-button>
|
|
|
+ <el-radio-button label="parameter">参数量</el-radio-button>
|
|
|
+ <div style="margin-left: 10px">
|
|
|
+ <el-button icon="el-icon-plus" type="success">新增</el-button>
|
|
|
+ <el-button type="danger" icon="el-icon-delete">删除</el-button>
|
|
|
+ </div>
|
|
|
+ </el-radio-group>
|
|
|
+
|
|
|
+ <el-input
|
|
|
+ placeholder="搜索变量或编码"
|
|
|
+ v-model="listInputText"
|
|
|
+ style="width: 15rem; margin-bottom: 15px"
|
|
|
+ >
|
|
|
+ <template #suffix>
|
|
|
+ <i class="el-icon-search el-input__icon"></i>
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ :data="
|
|
|
+ listNumberData.filter(
|
|
|
+ (data) =>
|
|
|
+ !listInputText ||
|
|
|
+ data.varName
|
|
|
+ .toLowerCase()
|
|
|
+ .includes(listInputText.toLowerCase()) ||
|
|
|
+ data.varCoding.toLowerCase().includes(listInputText.toLowerCase())
|
|
|
+ )
|
|
|
+ "
|
|
|
+ border
|
|
|
+ stripe
|
|
|
+ :header-cell-style="headClass"
|
|
|
+ @selection-change="listSelectionChange"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ label="序号"
|
|
|
+ sortable
|
|
|
+ width=""
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column prop="varName" label="变量名" sortable width="">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="varCoding" label="变量编码" sortable width="">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="signalDevice" label="通信设备" sortable width="">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="dataAdd" label="数据地址" sortable width="">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="dataType" label="数据类型" width="">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="coefficient" label="系数" width="">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="saveCycle" label="存盘周期" width="">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column fixed="right" label="操作" width="">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ style="color: #409eff"
|
|
|
+ @click.prevent="listUpdate(scope.row)"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ @click="listDelete(scope.$index, scope.row)"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ style="color: red"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <div class="listPagination">
|
|
|
+ <el-pagination
|
|
|
+ v-model:currentPage="currentPage4"
|
|
|
+ :page-sizes="[15, 20, 25, 30]"
|
|
|
+ :page-size="15"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="device_NumData.length"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ background
|
|
|
>
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="listDialog = false">关闭</el-button>
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
@@ -144,15 +253,43 @@
|
|
|
import { defineComponent, ref, Ref } from "vue";
|
|
|
import { ElMessageBox } from "element-plus";
|
|
|
|
|
|
-interface PowerEquipData {
|
|
|
- deviceNumData: Ref;
|
|
|
- dialogVisible: Ref<boolean>;
|
|
|
- checked1: Ref<boolean>;
|
|
|
- handleClose: (done: any) => void;
|
|
|
- radio1: Ref;
|
|
|
- inputName: Ref;
|
|
|
- inputCode: Ref;
|
|
|
-}
|
|
|
+//克隆弹窗基础数据定义
|
|
|
+const cloneData = () => {
|
|
|
+ const cloneDialog = ref(false); //克隆弹窗控制
|
|
|
+ const cloneChecked = ref(false); //克隆复选框控制
|
|
|
+ const cloneRadio = ref("1"); //克隆单选框控制
|
|
|
+ const cloneInputName = ref(""); //克隆input名
|
|
|
+ const cloneInputCode = ref(""); //克隆input编号
|
|
|
+ const cloneInputModel = ref(""); //克隆input模拟量
|
|
|
+ const cloneInputState = ref(""); //克隆input状态量
|
|
|
+
|
|
|
+ //克隆弹窗控制方法回调
|
|
|
+ const cloneHandleClose = (done) => {
|
|
|
+ done();
|
|
|
+ // ElMessageBox.confirm("确定要关闭弹出?").then(() => { done();}).catch(() => {// catch error});
|
|
|
+ };
|
|
|
+ return {
|
|
|
+ cloneDialog,
|
|
|
+ cloneChecked,
|
|
|
+ cloneRadio,
|
|
|
+ cloneInputName,
|
|
|
+ cloneInputCode,
|
|
|
+ cloneHandleClose,
|
|
|
+ cloneInputModel,
|
|
|
+ cloneInputState,
|
|
|
+ };
|
|
|
+};
|
|
|
+//变量列表弹窗基础数据定义
|
|
|
+const listData = () => {
|
|
|
+ const listDialog = ref(false);
|
|
|
+ const listTitleDialog = ref();
|
|
|
+ const listHandleClose = (done) => {
|
|
|
+ done();
|
|
|
+ };
|
|
|
+ const listTabPosition = ref("model");
|
|
|
+
|
|
|
+ return { listDialog, listHandleClose, listTitleDialog, listTabPosition };
|
|
|
+};
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: "powerEquip",
|
|
@@ -162,38 +299,81 @@ export default defineComponent({
|
|
|
filter_Text: String,
|
|
|
},
|
|
|
data() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ listInputText: "", //变量列表input搜索框
|
|
|
+ multipleSelection: [], //变量列表弹窗复选框值存储
|
|
|
+ listNumberData: [
|
|
|
+ {
|
|
|
+ varName: "A相电压",
|
|
|
+ varCoding: "bgbsk_183_Us",
|
|
|
+ signalDevice: "嘉定区竞园新区六里村委(综合用房)",
|
|
|
+ dataAdd: "YC[o]",
|
|
|
+ dataType: "4字节浮点4321",
|
|
|
+ coefficient: 0.001,
|
|
|
+ saveCycle: "5分钟",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ varName: "A相电压",
|
|
|
+ varCoding: "bgbsk_183_Us",
|
|
|
+ signalDevice: "嘉定区竞园新区六里村委(综合用房)",
|
|
|
+ dataAdd: "YC[o]",
|
|
|
+ dataType: "4字节浮点4321",
|
|
|
+ coefficient: 0.001,
|
|
|
+ saveCycle: "5分钟",
|
|
|
+ },
|
|
|
+ ], //变量列表弹窗table值存储
|
|
|
+ };
|
|
|
},
|
|
|
- setup(): PowerEquipData {
|
|
|
- const deviceNumData = ref([]);
|
|
|
- const dialogVisible = ref(false);
|
|
|
- const checked1 = ref(false);
|
|
|
- const radio1 = ref("1");
|
|
|
- const inputName = ref("");
|
|
|
- const inputCode = ref("");
|
|
|
+ setup() {
|
|
|
+ const {
|
|
|
+ cloneDialog,
|
|
|
+ cloneChecked,
|
|
|
+ cloneRadio,
|
|
|
+ cloneInputName,
|
|
|
+ cloneInputCode,
|
|
|
+ cloneHandleClose,
|
|
|
+ cloneInputModel,
|
|
|
+ cloneInputState,
|
|
|
+ } = cloneData();
|
|
|
|
|
|
- const handleClose = (done) => {
|
|
|
- done();
|
|
|
- // ElMessageBox.confirm("确定要关闭弹出?")
|
|
|
- // .then(() => {
|
|
|
- // done();
|
|
|
- // })
|
|
|
- // .catch(() => {
|
|
|
- // // catch error
|
|
|
- // });
|
|
|
+ const { listDialog, listHandleClose, listTitleDialog, listTabPosition } =
|
|
|
+ listData();
|
|
|
+
|
|
|
+ const handleSizeChange = (val) => {
|
|
|
+ console.log(`${val} items per page`);
|
|
|
+ };
|
|
|
+ const handleCurrentChange = (val) => {
|
|
|
+ console.log(`current page: ${val}`);
|
|
|
};
|
|
|
|
|
|
return {
|
|
|
- deviceNumData,
|
|
|
- dialogVisible,
|
|
|
- checked1,
|
|
|
- handleClose,
|
|
|
- radio1,
|
|
|
- inputName,
|
|
|
- inputCode,
|
|
|
+ cloneDialog,
|
|
|
+ cloneChecked,
|
|
|
+ cloneHandleClose,
|
|
|
+ cloneRadio,
|
|
|
+ cloneInputName,
|
|
|
+ cloneInputCode,
|
|
|
+ cloneInputModel,
|
|
|
+ cloneInputState,
|
|
|
+
|
|
|
+ listDialog,
|
|
|
+ listHandleClose,
|
|
|
+ listTitleDialog,
|
|
|
+ listTabPosition,
|
|
|
+ currentPage4: ref(4),
|
|
|
+ handleSizeChange,
|
|
|
+ handleCurrentChange,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ //变量列表弹窗table 复选框change事件
|
|
|
+ listSelectionChange(val) {
|
|
|
+ this.multipleSelection = val;
|
|
|
+ },
|
|
|
+ //变量列表弹窗tabs切换change事件
|
|
|
+ listTabsChange(value) {
|
|
|
+ console.log(value);
|
|
|
+ },
|
|
|
//编辑
|
|
|
editRow(row) {
|
|
|
console.log(row);
|
|
@@ -204,11 +384,13 @@ export default defineComponent({
|
|
|
},
|
|
|
//变量列表
|
|
|
variableList(row) {
|
|
|
+ this.listTitleDialog = 183;
|
|
|
+ this.listDialog = true;
|
|
|
console.log(row);
|
|
|
},
|
|
|
//克隆
|
|
|
clone(index, row) {
|
|
|
- this.dialogVisible = true;
|
|
|
+ this.cloneDialog = true;
|
|
|
console.log(index, row);
|
|
|
},
|
|
|
// 表头样式设置
|
|
@@ -235,4 +417,9 @@ export default defineComponent({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.listPagination {
|
|
|
+ margin-top: 15px;
|
|
|
+ margin-bottom: -30px;
|
|
|
+ float: right;
|
|
|
+}
|
|
|
</style>
|