fast(大屏): 内嵌大屏页,添加平台、项目大屏地址配置,设备型号的参数和分组添加排序和显隐参数,设备告警组件延迟请求

This commit is contained in:
fhysy 2024-09-14 14:39:33 +08:00
parent 04b287d901
commit 0a5b27a7a0
24 changed files with 8399 additions and 8009 deletions

View File

@ -33,6 +33,11 @@ VUE_APP_THEME_CLASS = 'theme-grey-red'
# 智慧用电管理系统/开发环境
VUE_APP_BASE_API = '/prod-api'
#平台大屏地址
VUE_APP_BIGSCREEN_PLATFORM_URL = 'http://goview.drgyen.cn/#/chart/preview/202409060982078'
#项目大屏地址
VUE_APP_BIGSCREEN_PROJECT_URL = ''
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -28,6 +28,11 @@ VUE_APP_THEME_CLASS = 'theme-green'
# 智慧用电管理系统/开发环境
VUE_APP_BASE_API = '/dev-api'
#平台大屏地址
VUE_APP_BIGSCREEN_PLATFORM_URL = 'http://goview.drgyen.cn/#/chart/preview/202409060982078'
#项目大屏地址
VUE_APP_BIGSCREEN_PROJECT_URL = ''
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -32,6 +32,11 @@ VUE_APP_THEME_CLASS = 'theme-blue-black'
# 智慧用电管理系统/开发环境
VUE_APP_BASE_API = '/dev-api'
#平台大屏地址
VUE_APP_BIGSCREEN_PLATFORM_URL = 'http://goview.drgyen.cn/#/chart/preview/202409060982078'
#项目大屏地址
VUE_APP_BIGSCREEN_PROJECT_URL = ''
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -32,6 +32,11 @@ VUE_APP_THEME_CLASS = 'theme-blue-white'
# 智慧用电管理系统/开发环境
VUE_APP_BASE_API = '/dev-api'
#平台大屏地址
VUE_APP_BIGSCREEN_PLATFORM_URL = 'http://goview.drgyen.cn/#/chart/preview/202409060982078'
#项目大屏地址
VUE_APP_BIGSCREEN_PROJECT_URL = ''
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -33,6 +33,11 @@ VUE_APP_THEME_CLASS = 'theme-green'
# 智慧用电管理系统/开发环境
VUE_APP_BASE_API = '/prod-api'
#平台大屏地址
VUE_APP_BIGSCREEN_PLATFORM_URL = 'http://goview.drgyen.cn/#/chart/preview/202409060982078'
#项目大屏地址
VUE_APP_BIGSCREEN_PROJECT_URL = ''
# 前端端口

View File

@ -33,6 +33,11 @@ VUE_APP_THEME_CLASS = 'theme-blue-black'
# 智慧用电管理系统/开发环境
VUE_APP_BASE_API = '/prod-api'
#平台大屏地址
VUE_APP_BIGSCREEN_PLATFORM_URL = 'http://goview.drgyen.cn/#/chart/preview/202409060982078'
#项目大屏地址
VUE_APP_BIGSCREEN_PROJECT_URL = ''
# 前端端口
port= 9988

View File

@ -61,6 +61,7 @@
"js-beautify": "1.13.0",
"js-cookie": "2.2.1",
"js-md5": "^0.7.3",
"jsbarcode": "^3.11.6",
"jsencrypt": "3.0.0-rc.1",
"moment": "^2.29.4",
"nprogress": "0.2.0",

View File

@ -76,7 +76,7 @@ export const constantRoutes = [
children: [
{
path: '/index',
component: (resolve) => require(['@/views/bigScreen/v3/index'], resolve),
component: (resolve) => require(['@/views/bigScreenIframe/index'], resolve),
name: 'BigScreen',
meta: {
title: '监控大屏', icon: 'dashboard', noCache: true, affix: true

View File

@ -59,6 +59,9 @@ const attribute = {
resolve(state.groupList)
})
},
setAttribute({ commit, state }, data){
commit('SET_ATTRIBUTE_LIST', data)
},
// 初始化 属性和分组数据
InitAttributeAndGroup({ commit, state }, data) {
commit('SET_ATTRIBUTE_LIST', data.attrList)

View File

@ -0,0 +1,65 @@
<template>
<div v-loading="loading" class="big-screen-iframe" style="height: calc(100vh - 0px);">
<iframe ref="iframeRef" :src="src" allow="*" allowfullscreen="true" class="big-iframe" frameborder="0" style="width: 100%; height: 100%;" @error="onIframeError" @load="onIframeLoad"/>
</div>
</template>
<script>
export default {
name: "bigScreenIframe",
data() {
return {
src: "http://goview.drgyen.cn/#/chart/preview/202409060982078",
loading: true,
token: "",
iframeRef: null
};
},
created() {
this.token = this.getCookie("Admin-Token");
this.src = process.env.VUE_APP_BIGSCREEN_PLATFORM_URL + "?token=" + this.token;
},
mounted() {
this.iframeRef = this.$refs.iframeRef;
},
methods: {
getCookie(name) {
const cookies = document.cookie.split("; ");
for (let i = 0; i < cookies.length; i++) {
const cookie = cookies[i].split("=");
if (cookie[0] === name) {
return cookie[1];
}
}
return "";
},
onIframeLoad() {
this.loading = false;
},
onIframeError() {
this.loading = false;
console.error("Iframe load failed.");
}
}
};
</script>
<style>
.big-screen-iframe {
width: 100%;
height: calc(100vh - 0px);
position: relative;
}
.big-iframe {
width: 100%;
height: 100%;
border: none;
}
.app-main {
width: 100% !important;
height: 100vh !important;
}
</style>

View File

@ -2,23 +2,23 @@
<div class="app-container iot-device">
<component
:is="componectVal"
:sourceId="sourceId"
:isTenant="false"
:sourceId="sourceId"
@toTableClick="toTableClick"
></component>
<div v-show="componectVal === ''">
<el-form
:model="queryParams"
v-show="showSearch"
ref="queryForm"
:inline="true"
v-show="showSearch"
:model="queryParams"
label-width="68px"
>
<el-form-item label="型号名称" prop="modelName">
<el-input
v-model="queryParams.modelName"
placeholder="请输入型号名称"
clearable
placeholder="请输入型号名称"
size="small"
@keyup.enter.native="handleQuery"
/>
@ -27,8 +27,8 @@
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
placeholder="请输入设备名称"
size="small"
@keyup.enter.native="handleQuery"
/>
@ -37,8 +37,8 @@
<el-form-item label="设备Key" prop="deviceKey">
<el-input
v-model="queryParams.deviceKey"
placeholder="请输入设备Key"
clearable
placeholder="请输入设备Key"
size="small"
@keyup.enter.native="handleQuery"
/>
@ -47,15 +47,15 @@
<el-form-item label="设备状态" prop="deviceState">
<el-select
v-model="queryParams.deviceState"
placeholder="请选择设备状态"
@change="handleQuery"
clearable
placeholder="请选择设备状态"
size="small"
@change="handleQuery"
>
<el-option
:label="keys"
v-for="(keys, vals) in deviceStatusOpt"
:key="vals"
:label="keys"
:value="vals"
/>
</el-select>
@ -63,24 +63,24 @@
<el-form-item label="设备类型" prop="deviceType">
<el-select
v-model="queryParams.deviceType"
placeholder="请选择设备类型"
@change="handleQuery"
clearable
placeholder="请选择设备类型"
size="small"
@change="handleQuery"
>
<el-option
:label="keys"
:value="vals"
v-for="(keys, vals) in deviceTypeList"
:key="vals"
:label="keys"
:value="vals"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
type="primary"
@click="handleQuery"
>搜索</el-button
>
@ -93,21 +93,21 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['iot:device:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出</el-button
>
@ -125,20 +125,30 @@
@sort-change="sortChange"
>
<el-table-column
type="index"
label="序号"
align="center"
:index="indexFormatter"
align="center"
label="序号"
type="index"
width="80px"
></el-table-column>
<el-table-column label="设备名称" align="left" prop="deviceName" />
<el-table-column label="所属型号" align="left" prop="modelName" />
<el-table-column label="设备key" align="left" prop="deviceKey" />
<el-table-column align="left" label="设备名称" prop="deviceName" />
<el-table-column align="left" label="所属型号" prop="modelName" />
<el-table-column align="left" label="设备key" prop="deviceKey" />
<el-table-column
align="center"
label="设备码"
prop="deviceState"
width="180"
>
<template slot-scope="scope">
<img :ref="'qrCodeDiv' + scope.row.deviceKey" style="width: 100%" @click="lookQrCode(scope.row.qrCodeUrl)"/>
</template>
</el-table-column>
<el-table-column
label="设备类型"
align="left"
width="120px"
label="设备类型"
prop="deviceTypeName"
width="120px"
/>
<!-- <el-table-column
label="设备标签"
@ -148,43 +158,44 @@
prop="deviceTag"
/> -->
<!-- <el-table-column label="父设备" align="left" prop="parentName" /> -->
<el-table-column
label="设备状态"
align="center"
width="120"
label="设备状态"
prop="deviceState"
width="120"
>
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.deviceState === 'ONLINE'"
<el-tag v-if="scope.row.deviceState === 'ONLINE'" type="success"
>在线</el-tag
>
<el-tag
type="danger"
v-else-if="scope.row.deviceState === 'OFFLINE'"
type="danger"
>离线</el-tag
>
<el-tag
type="danger"
v-else-if="scope.row.deviceState === 'OUTLINE'"
type="danger"
>脱线</el-tag
>
<el-tag type="info" v-else-if="scope.row.deviceState === 'UNACTIVE'"
<el-tag v-else-if="scope.row.deviceState === 'UNACTIVE'" type="info"
>未激活</el-tag
>
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
label="创建时间"
prop="createTime"
sortable="custom"
width="160px"
prop="createTime"
/>
<el-table-column
label="操作"
align="center"
width="200px"
class-name="small-padding fixed-width"
label="操作"
width="200px"
>
<template slot-scope="scope">
<!-- <el-button
@ -195,37 +206,37 @@
@click="handleDetails(scope.row)"
>子设备管理</el-button> -->
<el-button
icon="el-icon-search"
size="mini"
type="text"
icon="el-icon-search"
@click="handleDetails(scope.row)"
>详情</el-button
>
<el-button
v-hasPermi="['iot:device:edit']"
icon="el-icon-edit"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['iot:device:edit']"
>修改</el-button
>
<el-button
v-if="scope.row['parentId'] && scope.row['parentId'] !== '0'"
v-hasPermi="['iot:device:edit']"
icon="el-icon-error"
size="mini"
type="text"
icon="el-icon-error"
@click="handleDisassociate(scope.row)"
v-hasPermi="['iot:device:edit']"
>解绑</el-button
>
<el-button
v-else
v-hasPermi="['iot:device:remove']"
icon="el-icon-delete"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['iot:device:remove']"
>删除</el-button
>
</template>
@ -234,21 +245,21 @@
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改设备对话框 -->
<div style="height: 0px;">
<dialog-template
class="eldialog-wrap"
:close-on-click-modal="false"
:title="title"
:visible="open"
@close="open = false"
class="eldialog-wrap"
width="500px"
@close="open = false"
>
<el-form
ref="form"
@ -259,67 +270,67 @@
>
<el-form-item label="所属型号:" prop="modelId">
<e-dialog-table-input
:table="selectModelTable"
:refurbishFun="listModel"
showFileName="modelName"
fileName="modelId,modelName,deviceType,prodKey"
v-model="form.modelName"
title="型号"
:refurbishFun="listModel"
:table="selectModelTable"
fileName="modelId,modelName,deviceType,prodKey"
psize="small"
showFileName="modelName"
title="型号"
@change="handleModelDialogEvent"
/>
</el-form-item>
<el-form-item label="设备类型:" prop="deviceType">
<el-select
disabled
v-model="form.deviceType"
style="width: 100%"
placeholder="请选择设备类型"
clearable
disabled
placeholder="请选择设备类型"
style="width: 100%"
>
<el-option
:label="keys"
:value="vals"
v-for="(keys, vals) in deviceTypeList"
:key="vals"
:label="keys"
:value="vals"
/>
</el-select>
</el-form-item>
<el-form-item
v-if="form.deviceType === 'MINIATURE_BREAKER'"
label="父设备:"
prop="parentId"
v-if="form.deviceType === 'MINIATURE_BREAKER'"
>
<e-dialog-table-input
:table="selectDeviceTable"
:refurbishFun="listDevice"
showFileName="deviceName"
fileName="deviceId,deviceName"
v-model="form.parentName"
title="设备"
:refurbishFun="listDevice"
:table="selectDeviceTable"
fileName="deviceId,deviceName"
psize="small"
showFileName="deviceName"
title="设备"
@change="handleDeviceDialogEvent"
/>
</el-form-item>
<el-form-item
v-if="form.deviceType === 'MINIATURE_BREAKER'"
label="线路类型:"
prop="lineType"
v-if="form.deviceType === 'MINIATURE_BREAKER'"
>
<el-select
v-model="form.lineType"
style="width: 100%"
placeholder="请选择线路类型"
clearable
placeholder="请选择线路类型"
style="width: 100%"
>
<el-option
:label="keys"
:value="vals"
v-for="(keys, vals) in lineTypeOpt"
:key="vals"
:label="keys"
:value="vals"
/>
</el-select>
</el-form-item>
@ -337,19 +348,19 @@
</el-form-item>
<el-form-item
label="设备标签:"
v-if="
form.deviceType !== 'VIDEO_CONTROLLER' &&
form.deviceType !== 'GATEWAY_CONTROLLER'
"
label="设备标签:"
prop="deviceTag"
>
<el-select
v-model="form.deviceTag"
clearable
filterable
multiple
placeholder="请选择设备标签"
clearable
style="width: 100%"
>
<el-option
@ -366,7 +377,7 @@
>*注意锁定即参数不可修改未锁则可以修改</span
>
<div class="form-params-wrap">
<param-wrap ref="paramWrap" typeKeys v-if="open"></param-wrap>
<param-wrap v-if="open" ref="paramWrap" typeKeys></param-wrap>
</div>
</el-form-item>
</el-form>
@ -379,20 +390,23 @@
</dialog-template>
</div>
</div>
<div
v-show="componectVal !== ''"
:class="
componectVal === 'GatewayDetail'
? 'to-home-wrap2 gateway-wrap'
: 'to-home-wrap2 '
"
@click="toTableClick"
v-show="componectVal !== ''"
>
<el-button icon="el-icon-d-arrow-left" title="返回列表" circle
<el-button circle icon="el-icon-d-arrow-left" title="返回列表"
>返回列表</el-button
>
</div>
<el-dialog :visible.sync="imgModelShow" title="设备二维码" width="400px">
<img :src="qrCodeUrl" height="100%" width="100%">
</el-dialog>
</div>
</template>
@ -413,6 +427,7 @@ import ParamWrap from "@/components/ParamWrap/deviceParam";
import GatewayDetail from "@/views/profile/DeviceDetailsView/index";
import EDialogTableInput from "@/components/EDialogTableInput";
import DialogTemplate from "@/components/DialogTemplate";
import JsBarcode from "jsbarcode"
const deviceStatusOpt = {
ONLINE: "在线",
@ -634,6 +649,8 @@ export default {
selectModelTable,
selectDeviceTable,
lineTypeOpt,
imgModelShow:false,
qrCodeUrl:'',
sourceId: "",
componectVal: "",
//
@ -720,6 +737,10 @@ export default {
this.form.parentId = e.deviceId;
this.form.parentName = e.deviceName;
},
lookQrCode(url){
this.qrCodeUrl = url;
this.imgModelShow = true;
},
//
statusFormat(row, column) {
return this.selectDictLabel(this.deviceTagList, row.deviceTag);
@ -789,6 +810,19 @@ export default {
this.deviceList = response.rows;
this.total = response.total;
this.loading = false;
this.$nextTick(() => {
this.deviceList.forEach((item,index) => {
JsBarcode(this.$refs["qrCodeDiv" + item.deviceKey], item.deviceKey, {
format: "CODE128", //
width: 2, //线
height: 65, //
lineColor: "#000", //线
displayValue: true, //
margin: 3 //
});
this.deviceList[index].qrCodeUrl=this.$refs["qrCodeDiv" + item.deviceKey].src;
})
})
});
},
//

View File

@ -1,17 +1,17 @@
<template>
<div class="app-container iot-model">
<el-form
:model="queryParams"
v-show="showSearch"
ref="queryForm"
:inline="true"
v-show="showSearch"
:model="queryParams"
label-width="68px"
>
<el-form-item label="型号名称" prop="modelName">
<el-input
v-model="queryParams.modelName"
placeholder="型号名称"
clearable
placeholder="型号名称"
size="small"
@keyup.enter.native="handleQuery"
/>
@ -19,8 +19,8 @@
<el-form-item label="产品PK" prop="prodKey">
<el-input
v-model="queryParams.prodKey"
placeholder="产品PK"
clearable
placeholder="产品PK"
size="small"
@keyup.enter.native="handleQuery"
/>
@ -29,24 +29,24 @@
<el-form-item label="协议类型" prop="protocolType">
<el-select
v-model="queryParams.protocolType"
@change="handleQuery"
placeholder="请选择协议类型"
clearable
placeholder="请选择协议类型"
size="small"
@change="handleQuery"
>
<el-option
:label="keys"
:value="vals"
v-for="(keys, vals) in protocolTypeOpt"
:key="keys"
:label="keys"
:value="vals"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
type="primary"
@click="handleQuery"
>搜索</el-button
>
@ -59,12 +59,12 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['iot:model:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
>新增</el-button
>
</el-col>
@ -81,41 +81,41 @@
@sort-change="sortChange"
>
<el-table-column
type="index"
label="序号"
align="center"
:index="indexFormatter"
align="center"
label="序号"
type="index"
width="80px"
></el-table-column>
<el-table-column
align="left"
label="型号名称"
align="left"
width="200px"
prop="modelName"
width="200px"
/>
<el-table-column
align="left"
label="厂商名称"
align="left"
width="200px"
prop="vendorName"
width="200px"
/>
<el-table-column
label="产品PK"
align="left"
width="200px"
label="产品PK"
prop="prodKey"
width="200px"
/>
<el-table-column label="产品密钥" align="left" prop="prodSecret">
<el-table-column align="left" label="产品密钥" prop="prodSecret">
<template slot-scope="scope">
<span class="lay-table-textarea" :title="scope.row.prodSecret">
<span :title="scope.row.prodSecret" class="lay-table-textarea">
{{ scope.row.prodSecret }}
</span>
</template>
</el-table-column>
<el-table-column
label="设备类型"
align="center"
label="设备类型"
prop="deviceType"
width="120px"
>
@ -125,8 +125,8 @@
</el-table-column>
<el-table-column
label="协议类型"
align="center"
label="协议类型"
prop="protocolType"
width="120px"
>
@ -136,47 +136,47 @@
</el-table-column>
<el-table-column
label="设备状态"
align="center"
label="设备状态"
prop="modelStatus"
width="100px"
>
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.modelStatus === '0'"
<el-tag v-if="scope.row.modelStatus === '0'" type="success"
>启用</el-tag
>
<el-tag type="danger" v-else>禁用</el-tag>
<el-tag v-else type="danger">禁用</el-tag>
</template>
</el-table-column>
<el-table-column
label=" 创建时间"
align="center"
sortable="custom"
label=" 创建时间"
prop="createTime"
sortable="custom"
width="150px"
/>
<el-table-column
width="160px"
label="操作"
align="center"
class-name="small-padding fixed-width"
label="操作"
width="160px"
>
<template slot-scope="scope">
<el-button
v-hasPermi="['iot:model:edit']"
icon="el-icon-edit"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['iot:model:edit']"
>修改</el-button
>
<el-button
v-hasPermi="['iot:model:remove']"
icon="el-icon-delete"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['iot:model:remove']"
>删除</el-button
>
</template>
@ -185,9 +185,9 @@
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
@ -213,15 +213,15 @@
<el-form-item label="协议类型:" prop="protocolType">
<el-select
v-model="form.protocolType"
style="width: 100%"
placeholder="请选择协议类型"
size="small"
style="width: 100%"
>
<el-option
:label="keys"
:value="vals"
v-for="(keys, vals) in protocolTypeOpt"
:key="vals"
:label="keys"
:value="vals"
/>
</el-select>
</el-form-item>
@ -230,9 +230,9 @@
<el-form-item label="产品PK" prop="prodKey">
<el-input
v-if="form.protocolType === 'OFFICIAL'"
v-model="form.prodKey"
:disabled="form.modelId || form.modelId === 0"
placeholder="请填写产品PK"
v-model="form.prodKey"
></el-input>
<el-input
v-else
@ -257,21 +257,21 @@
position: relative;
top: -10px;"
>
<el-button style="width: 200px; height: 40px;" type="primary" @click="openTableSelectScriesDialog" icon="el-icon-menu">选择型号系列</el-button>
<el-button icon="el-icon-menu" style="width: 200px; height: 40px;" type="primary" @click="openTableSelectScriesDialog">选择型号系列</el-button>
</el-col>
<el-col :span="24">
<el-form-item
v-if="form.protocolType === 'OFFICIAL'"
label="产品json"
prop="prodJson"
v-if="form.protocolType === 'OFFICIAL'"
>
<attribute-view
v-if="open"
ref="attributeref"
:arttributeList="form.prodJson"
:groupList="form.remark"
@handleEvent="handleViewEvent"
ref="attributeref"
></attribute-view>
</el-form-item>
</el-col>
@ -280,23 +280,23 @@
<el-form-item label="设备类型:" prop="deviceType">
<el-select
v-model="form.deviceType"
style="width: 100%"
placeholder="请选择设备类型"
clearable
placeholder="请选择设备类型"
size="small"
style="width: 100%"
>
<el-option
:label="keys"
:value="vals"
v-for="(keys, vals) in deviceTypeList"
:key="vals"
:label="keys"
:value="vals"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="参数设置:" v-show="form.deviceType">
<el-form-item v-show="form.deviceType" label="参数设置:">
<span style="color: red; font-size: 12px"
>*注意锁定即参数不可修改未锁则可以修改</span
>
@ -311,28 +311,28 @@
</el-row>
</el-form>
<div slot="dialog-footer" class="dialog-footer">
<el-button type="primary" size="mini" @click="submitForm"
<el-button size="mini" type="primary" @click="submitForm"
> </el-button
>
<el-button @click="cancel" size="mini"> </el-button>
<el-button size="mini" @click="cancel"> </el-button>
</div>
</dialog-template>
<el-dialog
title="选择"
:visible.sync="selectTableShow"
width="75%"
top="10vh"
class="select-table-dialog"
:close-on-click-modal="false"
:visible.sync="selectTableShow"
class="select-table-dialog"
title="选择"
top="10vh"
width="75%"
>
<select-table-wrap
v-if="selectTableShow"
:tableOption="tableSelectOption.tableOpt"
:otherOption="tableSelectOption.otherOption"
:queryOption="tableSelectOption.queryOpt"
:tableList="tableSelectOption.tableList"
:tableOption="tableSelectOption.tableOpt"
@parentGetList="childGetList($event)"
:otherOption="tableSelectOption.otherOption"
@returnEvent="returnEvent($event)"
/>
@ -354,32 +354,32 @@
<dialog-template
:title="componentTitle"
:visible="AttributeViewShow"
width="750px"
@close="
() => {
AttributeViewShow = false;
}
"
:visible="AttributeViewShow"
width="750px"
>
<component
v-if="AttributeViewShow"
:is="componectVal"
:tempType="childOpt.type"
:paramIdx="childOpt.paramIdx"
v-if="AttributeViewShow"
ref="componentref"
slot="dialog-center"
:other="{
action: '',
prodPK: form.prodKey,
cmdKey: '',
}"
:paramIdx="childOpt.paramIdx"
:paramsList="functionList"
ref="componentref"
:tempType="childOpt.type"
@ok="compEventOk"
slot="dialog-center"
></component>
<div slot="dialog-footer">
<el-button type="primary" size="mini" @click="submitAttribute"
<el-button size="mini" type="primary" @click="submitAttribute"
> </el-button
>
<el-button
@ -1013,6 +1013,7 @@ export default {
v["sourceId"] = this.form.prodKey;
return v;
});
attrList.sort((a, b) => a.sort - b.sort);
}
let groupList = [];
@ -1024,6 +1025,7 @@ export default {
v["sourceId"] = this.form.prodKey;
return v;
});
groupList.sort((a, b) => a.sort - b.sort);
}
console.log(groupList, attrList);
this.form.prodJson = JSON.stringify(attrList) || null;

View File

@ -1,11 +1,11 @@
<template>
<div class="app-container iot-model-series">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px">
<el-form-item label="系列名称" prop="seriesName">
<el-input
v-model="queryParams.seriesName"
placeholder="请输入系列名称"
clearable
placeholder="请输入系列名称"
size="mini"
@keyup.enter.native="handleQuery"
/>
@ -14,15 +14,15 @@
<el-form-item label="产品PK" prop="prodKey">
<el-input
v-model="queryParams.prodKey"
placeholder="产品PK"
clearable
placeholder="产品PK"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
@ -30,44 +30,44 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['model:modelSeries:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['model:modelSeries:edit']"
:disabled="single"
icon="el-icon-edit"
plain
size="mini"
type="success"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['model:modelSeries:remove']"
:disabled="multiple"
icon="el-icon-delete"
plain
size="mini"
type="danger"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['model:modelSeries:export']"
icon="el-icon-download"
plain
size="mini"
type="warning"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -80,26 +80,26 @@
@sort-change="sortChange">
<el-table-column
type="index"
label="序号"
align="center"
:index="indexFormatter"
align="center"
label="序号"
type="index"
width="80px"
></el-table-column>
<el-table-column
label="系列名称"
align="left"
label="系列名称"
prop="seriesName"
/>
<el-table-column
label="产品PK"
align="left"
label="产品PK"
prop="prodKey"
/>
<el-table-column
label="设备类型"
align="center"
label="设备类型"
prop="deviceType"
width="150px"
>
@ -109,48 +109,48 @@
</el-table-column>
<el-table-column
label="启用状态"
align="center"
label="启用状态"
prop="seriesStatus"
width="100px"
>
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.seriesStatus === '0'"
<el-tag v-if="scope.row.seriesStatus === '0'" type="success"
>启用</el-tag
>
<el-tag type="danger" v-else>禁用</el-tag>
<el-tag v-else type="danger">禁用</el-tag>
</template>
</el-table-column>
<el-table-column
label=" 创建时间"
align="center"
sortable="custom"
label=" 创建时间"
prop="createTime"
sortable="custom"
width="160px"
/>
<el-table-column
width="160px"
label="操作"
align="center"
class-name="small-padding fixed-width"
label="操作"
width="160px"
>
<template slot-scope="scope">
<el-button
v-hasPermi="['model:modelSeries:edit']"
icon="el-icon-edit"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['model:modelSeries:edit']"
>修改</el-button
>
<el-button
v-hasPermi="['model:modelSeries:remove']"
icon="el-icon-delete"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['model:modelSeries:remove']"
>删除</el-button
>
</template>
@ -159,14 +159,14 @@
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<dialog-template width="1000px" :title="title" :visible="open" @close="open = false" >
<el-form slot="dialog-center" ref="form" :model="form" :rules="rules" label-width="100px">
<dialog-template :title="title" :visible="open" width="1000px" @close="open = false" >
<el-form ref="form" slot="dialog-center" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="系列名称:" prop="seriesName">
@ -177,9 +177,9 @@
<el-col :span="12">
<el-form-item label="产品PK" prop="prodKey">
<el-input
v-model="form.prodKey"
:disabled="form.seriesId || form.seriesId === 0"
placeholder="请填写产品PK"
v-model="form.prodKey"
></el-input>
</el-form-item>
</el-col>
@ -191,10 +191,10 @@
>
<attribute-view
v-if="open"
ref="attributeref"
:arttributeList="form.prodJson"
:groupList="form.remark"
@handleEvent="handleViewEvent"
ref="attributeref"
></attribute-view>
</el-form-item>
</el-col>
@ -203,23 +203,23 @@
<el-form-item label="设备类型:" prop="deviceType">
<el-select
v-model="form.deviceType"
style="width: 100%"
placeholder="请选择设备类型"
clearable
placeholder="请选择设备类型"
size="small"
style="width: 100%"
>
<el-option
:label="keys"
:value="vals"
v-for="(keys, vals) in deviceTypeList"
:key="vals"
:label="keys"
:value="vals"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="参数设置:" v-show="form.deviceType">
<el-form-item v-show="form.deviceType" label="参数设置:">
<span style="color: red; font-size: 12px"
>*注意锁定即参数不可修改未锁则可以修改</span
>
@ -245,32 +245,32 @@
<dialog-template
:title="componentTitle"
:visible="AttributeViewShow"
width="750px"
@close="
() => {
AttributeViewShow = false;
}
"
:visible="AttributeViewShow"
width="750px"
>
<component
v-if="AttributeViewShow"
:is="componectVal"
:tempType="childOpt.type"
:paramIdx="childOpt.paramIdx"
v-if="AttributeViewShow"
ref="componentref"
slot="dialog-center"
:other="{
action: '',
prodPK: form.prodKey,
cmdKey: '',
}"
:paramIdx="childOpt.paramIdx"
:paramsList="functionList"
ref="componentref"
:tempType="childOpt.type"
@ok="compEventOk"
slot="dialog-center"
></component>
<div slot="dialog-footer">
<el-button type="primary" size="mini" @click="submitAttribute"
<el-button size="mini" type="primary" @click="submitAttribute"
> </el-button
>
<el-button
@ -508,6 +508,7 @@ export default {
v["sourceId"] = this.form.prodKey;
return v;
});
attrList.sort((a, b) => a.sort - b.sort);
}
let groupList = [];
@ -519,6 +520,7 @@ export default {
v["sourceId"] = this.form.prodKey;
return v;
});
groupList.sort((a, b) => a.sort - b.sort);
}
this.form.prodJson = JSON.stringify(attrList) || null;
this.form.remark = JSON.stringify(groupList) || null;

View File

@ -57,9 +57,9 @@
</div>
<el-select
v-model="queryParams.prodKey"
style="margin-left: 5xp; width: 130px"
placeholder="请选择项目类型"
size="small"
style="margin-left: 5xp; width: 130px"
@change="getTableFilterList"
>
<el-option
@ -75,10 +75,6 @@
<div class="device-children-center">
<e-dynamic-table
:border="true"
:loading="tableLoading"
:tableTotal="deviceTotal"
:queryParams="queryParams"
:tableList="tableList"
:filterList="[
...defaultFilterList,
...filterList,
@ -86,29 +82,33 @@
...operate,
]"
:isIndex="true"
:tableHeight="tableList.length > 0 ? '450px' : '495px'"
:isSelect="true"
:loading="tableLoading"
:queryParams="queryParams"
:tableHeight="tableList.length > 0 ? '450px' : '495px'"
:tableList="tableList"
:tableTotal="deviceTotal"
rowKey="deviceId"
@tableSelectionChange="handleTableChange"
@handleQuery="handleQuery"
@tableSelectionChange="handleTableChange"
>
<template v-slot:operate="scope">
<div class="children-device-operate">
<span
@click="handleOpening(scope.row)"
:class="
scope.row.switch == 0 || scope.row.switch == undefined
? 'span-disable'
: ''
"
@click="handleOpening(scope.row)"
>
<i class="iconfont iconfenzha"></i>
分闸
</span>
<span
@click="handleSwitchOn(scope.row)"
:class="scope.row.switch == 1 ? 'span-disable' : ''"
@click="handleSwitchOn(scope.row)"
>
<i class="iconfont iconhezha"></i>
合闸

View File

@ -1,19 +1,19 @@
<template>
<div class="e-object-device-manage-table">
<el-form
:model="queryParams"
v-show="showChildrenView === false"
ref="queryForm"
:inline="true"
:model="queryParams"
label-width="68px"
v-show="showChildrenView === false"
>
<el-row>
<el-col :span="5">
<el-form-item label="型号名称" prop="prodKey">
<el-select
v-model="queryParams.prodKey"
placeholder="请选择项目类型"
clearable
placeholder="请选择项目类型"
size="small"
>
<el-option
@ -29,8 +29,8 @@
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
placeholder="请输入设备名称"
size="small"
/>
</el-form-item>
@ -39,14 +39,14 @@
<el-form-item label="设备状态" prop="deviceState">
<el-select
v-model="queryParams.deviceState"
placeholder="请选择设备状态"
clearable
placeholder="请选择设备状态"
size="small"
>
<el-option
:label="keys"
v-for="(keys, vals) in deviceStatusOpt"
:key="vals"
:label="keys"
:value="vals"
/>
</el-select>
@ -66,9 +66,9 @@
<el-col :span="9">
<el-form-item class="query-foot">
<el-button
type="primary"
icon="el-icon-search"
size="small"
type="primary"
@click="handleQuery"
>搜索</el-button
>
@ -79,13 +79,13 @@
</el-col>
</el-row>
</el-form>
<div class="table-container" v-show="showChildrenView === false">
<div v-show="showChildrenView === false" class="table-container">
<e-simple-card
title=""
extra=""
class="object-device-card"
v-for="(devItem, idx) in list"
:key="idx"
class="object-device-card"
extra=""
title=""
>
<template slot="cardHeader" class="card-custom-head">
<div
@ -154,7 +154,7 @@
"
>
<icon class="iconfont icontongzhi"></icon>
<span stle="margin-left: 10px;" class="footer-title">{{
<span class="footer-title" stle="margin-left: 10px;">{{
devItem.alarmProcessStatus == 1
? "正常"
: `时间:${devItem.alarmTime} ${
@ -182,9 +182,9 @@
<div v-if="showChildrenView">
<e-device-children
ref="eDeviceChildren"
:deviceType="deviceType"
:gatewayDevice="showGatewayInfo"
:sourceId="sourceId"
:deviceType="deviceType"
:wsGuid="ws_guid"
@handleLinkToHome="handleLinkToHome"
></e-device-children>

View File

@ -253,10 +253,12 @@ export default {
};
},
created() {
this.getDicts("alarm_param_type").then((response) => {
this.alarmParamOption = response.data;
});
this.getList();
setTimeout(()=>{
this.getDicts("alarm_param_type").then((response) => {
this.alarmParamOption = response.data;
});
this.getList();
},50)
},
watch: {
deviceKey() {

View File

@ -185,7 +185,7 @@ export default {
deviceKey: this.deviceInfo.deviceKey
};
getDeviceFunList(param).then(res => {
row["children"] = res.data || [];
row["children"] = res.data.filter(item => item.show === true) || [];
this.$forceUpdate();
});
},

View File

@ -1,5 +1,5 @@
<template>
<div class="public-custom-dialog show-chart" id="showChart">
<div id="showChart" class="public-custom-dialog show-chart">
<div class="show-data-header">
<div class="header-time">
<div class="time-select">
@ -14,37 +14,37 @@
</div>
<div class="time-picker">
<el-date-picker
@change="pickerChange"
v-if="timeValue === '4'"
size="small"
v-model="pickerValue1"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
range-separator="至"
size="small"
start-placeholder="开始日期"
type="datetimerange"
@change="pickerChange"
></el-date-picker>
</div>
</div>
<div class="eader-radio">
<el-radio-group v-model="showType" size="small">
<el-radio-button label="表格" :disabled="showlistDisable"></el-radio-button>
<el-radio-button label="图表" :disabled="showchartDisable"></el-radio-button>
<el-radio-button :disabled="showlistDisable" label="表格"></el-radio-button>
<el-radio-button :disabled="showchartDisable" label="图表"></el-radio-button>
</el-radio-group>
</div>
</div>
<div class="show-data-body">
<div id="chart" style="width:100%;height:400px;" v-show="showType === '图表'"></div>
<div class="list-container" v-show="showType === '表格'">
<div v-show="showType === '图表'" id="chart" style="width:100%;height:400px;"></div>
<div v-show="showType === '表格'" class="list-container">
<el-table :data="tableData" class="device-topic-list" style="width: 100%">
<el-table-column prop="time" label="时间" width="250"></el-table-column>
<el-table-column prop="value" label="原始值">
<el-table-column label="时间" prop="time" width="250"></el-table-column>
<el-table-column label="原始值" prop="value">
<template slot-scope="scope">
<div class style="text-align: center;" v-if="dialogData.funDataType === 'IMAGE'">
<div v-if="dialogData.funDataType === 'IMAGE'" class style="text-align: center;">
<el-image
:preview-src-list="[getIotFileUrl(scope.row.value)]"
:src="getIotFileUrl(scope.row.value)"
:title="dialogData.fileName"
style="width: 40px; height: 30px; margin: 5px;cursor: default;"
:src="getIotFileUrl(scope.row.value)"
:preview-src-list="[getIotFileUrl(scope.row.value)]"
></el-image>
</div>
<div v-else>
@ -58,26 +58,26 @@
</el-table-column>
</el-table>
<el-button
@click="loadMoreData"
v-show="tableData.length > 0"
style="margin-top: 10px; margin-left: 44%;"
:disabled="loadMoredisable"
class="load-more"
size="small"
style="margin-top: 10px; margin-left: 44%;"
@click="loadMoreData"
v-text="loadMoreText"
:disabled="loadMoredisable"
></el-button>
</div>
</div>
<div class="show-data-footer">
<el-pagination
:current-page="page.page"
:page-size="page.pageSize"
:page-sizes="[100, 500, 1000]"
:small="true"
:total="page.total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.page"
:page-sizes="[100, 500, 1000]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
></el-pagination>
</div>
</div>
@ -209,7 +209,7 @@ export default {
param.deviceId = this.deviceId;
param.prodPk = this.prodId;
param.fields = this.dialogData.funKey;
param.orderType = 1;
param.orderType = 2;
param.current = this.page.page;
param.size = this.page.pageSize;
param.listWhere = listWhere;
@ -347,7 +347,7 @@ export default {
};
</script>
<style scoped lang="scss">
<style lang="scss" scoped>
.list-container {
overflow: auto;
height: 50vh;

View File

@ -2,10 +2,10 @@
<div class="attribute-form-view">
<el-form
ref="form"
style="padding: 20px 20px 0px 20px"
:model="form"
:rules="rules"
label-width="100px"
style="padding: 20px 20px 0px 20px"
>
<el-form-item label="参数名称:" prop="funName">
<el-input v-model="form.funName" placeholder="请输入参数名称" />
@ -13,22 +13,22 @@
<el-form-item label="标识符:" prop="funKey">
<el-input
v-model="form.funKey"
@input="inputChange"
:disabled="tempType === 'update'"
placeholder="请输入标识符"
@input="inputChange"
/>
</el-form-item>
<el-form-item label="数据类型:" prop="funDataType">
<el-select
v-model="form.funDataType"
@change="funDataTypeChange"
placeholder="请选择数据类型"
@change="funDataTypeChange"
>
<el-option
v-for="(dice, value) in funDataTypeOption"
:value="value"
:key="value"
:label="dice"
:value="value"
/>
</el-select>
</el-form-item>
@ -36,56 +36,64 @@
<el-select v-model="form.cmdKey" placeholder="请选分组">
<el-option
v-for="(item, idx) in groupList"
:value="item.cmdKey"
:key="idx"
:label="item.cmdName"
:value="item.cmdKey"
/>
</el-select>
</el-form-item>
<el-form-item
label="保留小数位:"
v-if="form.funDataType === 'FLOAT'"
label="保留小数位:"
prop="funValAcc"
>
<el-input
v-model="form.funValAcc"
onkeyup="value=value.replace(/[^\d]/g,'')"
@input="inputChange"
v-model="form.funValAcc"
></el-input>
</el-form-item>
<el-form-item label="传输类型:" prop="funRwType">
<el-select v-model="form.funRwType" placeholder="请选择传输类型">
<el-option
v-for="(dice, value) in funRwTypeOption"
:value="value"
:key="value"
:label="dice"
:value="value"
/>
</el-select>
</el-form-item>
<el-form-item label="计量单位:" prop="unitName">
<el-input v-model="form.unitName" @input="inputChange" placeholder="请输入计量单位" />
<el-input v-model="form.unitName" placeholder="请输入计量单位" @input="inputChange" />
</el-form-item>
<el-form-item label="排序:" prop="sort">
<el-input-number v-model="form.sort" :max="1000" :min="1" label="请输入排序" @change="inputChange"></el-input-number>
</el-form-item>
<el-form-item label="是否显示:" prop="show">
<el-switch v-model="form.show" @change="inputChange"/>
</el-form-item>
<div class="item-title-wrap">数据校验</div>
<div class="custom-wrap">
<el-button
size="mini"
:style="`position: absolute; top: ${ form.funDataType === 'FLOAT' ? '585px ' : '530px' }; left: 40px`"
v-if="form.funValidType === 'ENUM'"
:style="`position: absolute; top: ${ form.funDataType === 'FLOAT' ? '585px ' : '530px' }; left: 40px`"
size="mini"
@click="addJsonObj"
>添加数值</el-button
>
<el-form-item
label="校验方式:"
:style="form.funValidType === 'ENUM' ? 'height: 80px;' : ''"
label="校验方式:"
prop="funValidType"
>
<el-select
v-model="form.funValidType"
@change="funValidTypeChange"
placeholder="请选择校验方式"
@change="funValidTypeChange"
>
<el-option
v-for="(dice, value) in funValidTypeOption"
@ -97,14 +105,14 @@
(form.funDataType === 'BOOL' && value === 'LENGTH')
)
"
:value="value"
:key="value"
:label="dice"
:value="value"
/>
</el-select>
</el-form-item>
<div class="enumTypeDiv" v-if="form.funValidType === 'ENUM'">
<div v-if="form.funValidType === 'ENUM'" class="enumTypeDiv">
<div class="enum-item">
<json-editor
ref="jsonEditors"
@ -115,13 +123,13 @@
</div>
<el-row
v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"
:gutter="10"
class="max-min-row"
v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"
>
<el-col :span="12">
<el-form-item label prop="funValMin">
<el-input v-model="form.funValMin" @input="inputChange" placeholder="最小值" />
<el-input v-model="form.funValMin" placeholder="最小值" @input="inputChange" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -130,13 +138,13 @@
</el-row>
<el-row
v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"
:gutter="10"
class="max-min-row"
v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"
>
<el-col :span="12">
<el-form-item label prop="funValMax">
<el-input v-model="form.funValMax" @input="inputChange" placeholder="最大值" />
<el-input v-model="form.funValMax" placeholder="最大值" @input="inputChange" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -181,6 +189,10 @@ export default {
type: String,
default: "add",
},
row: {
type: Object,
default: () => {},
},
},
computed: {
...mapGetters(["groupList"]),
@ -190,7 +202,7 @@ export default {
funDataTypeOption,
funRwTypeOption,
funValidTypeOption,
form: {},
form: {show: true,sort: 100},
//
rules: {
funName: [
@ -209,10 +221,14 @@ export default {
funValidType: [
{ required: true, message: "校验方式不能为空", trigger: "blur" },
],
sort: [
{ required: true, message: "排序不能为空", trigger: "blur" },
],
},
};
},
created() {
console.log("this.paramIdx",this.paramIdx,this.tempType)
if (this.tempType !== "add" && this.paramIdx >= 0) {
this.getParamIten(this.paramIdx);
}
@ -231,8 +247,8 @@ export default {
},
getParamIten(idx) {
this.$store.dispatch("GetAttributeItem", idx).then((res) => {
console.log(res);
this.form = JSON.parse(JSON.stringify(res));
console.log("GetAttributeItem",res,idx);
this.form = {show: true, sort: 100, ...JSON.parse(JSON.stringify(res))};
});
},
/** 提交验证 */

View File

@ -1,16 +1,16 @@
<template>
<div class="app-container product-customparams-wrap">
<el-row :gutter="10" class="mb8" v-show="isOption">
<el-row v-show="isOption" :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
<el-button icon="el-icon-plus" size="mini" type="primary" @click="handleAdd"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-s-platform"
size="mini"
type="primary"
@click="handleParams"
>物模型参数</el-button
>
@ -18,46 +18,52 @@
</el-row>
<el-table v-loading="loading" :data="functionList" height="300px">
<el-table-column type="index" width="75" align="center" label="序号" />
<el-table-column label="参数名称" align="left" prop="funName" />
<el-table-column label="标识符" align="left" prop="funKey" />
<el-table-column label="数据类型" align="left" prop="funDataType" >
<el-table-column align="center" label="序号" type="index" width="75" />
<el-table-column align="left" label="参数名称" prop="funName" />
<el-table-column align="left" label="标识符" prop="funKey" />
<el-table-column align="left" label="数据类型" prop="funDataType" >
<template slot-scope="scope">
<span>{{ funDataTypeOption[scope.row.funDataType] }}</span>
</template>
</el-table-column>
<el-table-column label="所属分组" align="left" prop="funDataType" >
<el-table-column align="left" label="所属分组" prop="funDataType" >
<template slot-scope="scope">
<span>{{ scope.row.cmdKey }}</span>
</template>
</el-table-column>
<el-table-column label="传输类型" align="left" prop="funRwType" >
<el-table-column align="left" label="传输类型" prop="funRwType" >
<template slot-scope="scope">
<span>{{ funRwTypeOption[scope.row.funRwType] }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="排序" prop="sort" />
<el-table-column align="center" label="是否显示" prop="show" >
<template slot-scope="scope">
<span>{{ scope.row.show ? '是' : '否'}}</span>
</template>
</el-table-column>
<!-- <el-table-column label="属性" align="left" prop="funObj" /> -->
<el-table-column
v-if="isOption"
label="操作"
width="100px"
align="center"
class-name="small-padding fixed-width"
label="操作"
width="100px"
>
<template slot-scope="scope">
<el-button
icon="el-icon-edit"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row, scope.$index, 'update')"
>修改</el-button
>
<el-button
icon="el-icon-delete"
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row, scope.$index)"
>删除</el-button
>
@ -67,20 +73,20 @@
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.pageNum"
:total="total"
@pagination="getList"
/>
<!-- 添加或修改功能定义对话框 -->
<el-dialog class="eldialog-wrap" :title="title" :visible.sync="attributeopen" width="550px" :close-on-click-modal="false">
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="attributeopen" class="eldialog-wrap" width="550px">
<el-form
ref="form"
style="padding: 20px 20px 0px 20px"
:model="form"
:rules="rules"
label-width="100px"
style="padding: 20px 20px 0px 20px"
>
<el-form-item label="参数名称:" prop="funName">
<el-input v-model="form.funName" placeholder="请输入参数名称" />
@ -95,34 +101,34 @@
<el-form-item label="数据类型:" prop="funDataType">
<el-select
v-model="form.funDataType"
@change="funDataTypeChange"
placeholder="请选择数据类型"
@change="funDataTypeChange"
>
<el-option
v-for="(dice, value) in funDataTypeOption"
:value="value"
:key="value"
:label="dice"
:value="value"
/>
</el-select>
</el-form-item>
<el-form-item
label="保留小数位:"
v-if="form.funDataType === 'FLOAT'"
label="保留小数位:"
prop="funValAcc"
>
<el-input
onkeyup="value=value.replace(/[^\d]/g,'')"
v-model="form.funValAcc"
onkeyup="value=value.replace(/[^\d]/g,'')"
></el-input>
</el-form-item>
<el-form-item label="传输类型:" prop="funRwType">
<el-select v-model="form.funRwType" placeholder="请选择传输类型">
<el-option
v-for="(dice, value) in funRwTypeOption"
:value="value"
:key="value"
:label="dice"
:value="value"
/>
</el-select>
</el-form-item>
@ -134,21 +140,21 @@
<div class="item-title-wrap">数据校验</div>
<div class="custom-wrap">
<el-button
v-if="form.funValidType === 'ENUM'"
size="mini"
style="position: absolute; top: 460px; left: 40px"
v-if="form.funValidType === 'ENUM'"
@click="addJsonObj"
>添加数值</el-button
>
<el-form-item
label="校验方式:"
:style="form.funValidType === 'ENUM' ? 'height: 80px;' : ''"
label="校验方式:"
prop="funValidType"
>
<el-select
v-model="form.funValidType"
@change="funValidTypeChange"
placeholder="请选择校验方式"
@change="funValidTypeChange"
>
<el-option
v-for="(dice, value) in funValidTypeOption"
@ -160,14 +166,14 @@
(form.funDataType === 'BOOL' && value === 'LENGTH')
)
"
:value="value"
:key="value"
:label="dice"
:value="value"
/>
</el-select>
</el-form-item>
<div class="enumTypeDiv" v-if="form.funValidType === 'ENUM'">
<div v-if="form.funValidType === 'ENUM'" class="enumTypeDiv">
<div class="enum-item">
<json-editor
ref="jsonEditors"
@ -178,9 +184,9 @@
</div>
<el-row
v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"
:gutter="10"
class="max-min-row"
v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"
>
<el-col :span="12">
<el-form-item label prop="funValMin">
@ -193,9 +199,9 @@
</el-row>
<el-row
v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"
:gutter="10"
class="max-min-row"
v-if="form.funValidType === 'RANGE' || form.funValidType === 'LENGTH'"
>
<el-col :span="12">
<el-form-item label prop="funValMax">
@ -210,16 +216,16 @@
</el-form>
<div class="form-button-div">
<el-button type="primary" size="mini" @click="submitForm">保存</el-button>
<el-button size="mini" type="primary" @click="submitForm">保存</el-button>
<el-button size="mini" @click="cancel">取消</el-button>
</div>
</el-dialog>
<el-dialog
:visible.sync="paramsOpen"
class="params-eldialog"
title="物模型参数"
top="5vh"
:visible.sync="paramsOpen"
width="800px"
>
<params-json-wrap

View File

@ -11,6 +11,9 @@
placeholder="请输入标识符"
/>
</el-form-item>
<el-form-item label="排序:" prop="sort">
<el-input-number v-model="form.sort" :max="1000" :min="1" label="请输入排序"></el-input-number>
</el-form-item>
</el-form>
</div>
</template>
@ -34,7 +37,7 @@ export default {
data() {
return {
cmdTypeOption,
form: {},
form: {sort: 10},
//
rules: {
cmdName: [
@ -46,6 +49,9 @@ export default {
cmdType: [
{ required: true, message: "分组类型不能为空", trigger: "blur" },
],
sort: [
{ required: true, message: "排序不能为空", trigger: "blur" },
],
},
};
},
@ -59,7 +65,7 @@ export default {
var that = this
this.$store.dispatch("GetGroupItem", idx).then(res => {
console.log(res)
that.form = JSON.parse(JSON.stringify(res));
that.form = {sort: 10, ...JSON.parse(JSON.stringify(res))};
})
},
/** 提交验证 */

View File

@ -1,15 +1,15 @@
<template>
<div class="app-container prodcut-cmd-wrap">
<el-row :gutter="10" class="mb8" v-if="isOption">
<el-row v-if="isOption" :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">创建分组</el-button>
<el-button icon="el-icon-plus" size="mini" type="primary" @click="handleAdd">创建分组</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="cmdList" height="300px">
<el-table-column type="index" width="55" align="center" label="序号" />
<el-table-column label="名称" align="center" prop="cmdName" />
<el-table-column label="标识符" align="center" prop="cmdKey" />
<el-table-column align="center" label="序号" type="index" width="55" />
<el-table-column align="center" label="名称" prop="cmdName" />
<el-table-column align="center" label="标识符" prop="cmdKey" />
<!-- <el-table-column label="类型" align="center" width prop="cmdType">
<template slot-scope="scope">
<span v-text="cmdTypeOption[scope.row.cmdType]"></span>
@ -20,7 +20,8 @@
<el-button type="text" @click="getCmdById(scope.row)">查看</el-button>
</template>
</el-table-column> -->
<el-table-column label="操作" align="center" width="200" v-if="isOption" class-name="small-padding fixed-width">
<el-table-column align="center" label="排序" prop="sort" />
<el-table-column v-if="isOption" align="center" class-name="small-padding fixed-width" label="操作" width="200">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="handleUpdate(scope.row, scope.$index , 'update')">修改</el-button>
<!-- <el-button size="mini" type="text" @click="handleUpdate(scope.row, scope.$index , 'cope')">复制</el-button> -->
@ -31,7 +32,7 @@
<!-- 添加或修改分组集对话框 -->
<div class="eldialog-wrap">
<el-dialog :title="title" :visible.sync="open" width="650px" :close-on-click-modal="false">
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="650px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="分组名称:" prop="cmdName">
<el-input v-model="form.cmdName" placeholder="请输入名称" />
@ -41,15 +42,15 @@
</el-form-item>
<el-form-item label="分组类型:" prop="cmdType">
<el-select
style="width: 100%;"
v-model="form.cmdType"
@change="cmdTypeChange"
placeholder="请选择分组类型"
style="width: 100%;"
@change="cmdTypeChange"
>
<el-option
:label="doce"
v-for="(doce, value) in cmdTypeOption"
:key="value"
:label="doce"
:value="value"
/>
</el-select>
@ -57,19 +58,19 @@
<div class="st" style="display: flex; justify-content: flex-end;">
<el-transfer
style="text-align: left; display: inline-block"
v-model="value"
filterable
:data="transferData"
:format="{
noChecked: '${total}',
hasChecked: '${checked}/${total}'
}"
:props="{
key: 'funId',
label: 'funName'
}"
:titles="['全选', '全选']"
:format="{
noChecked: '${total}',
hasChecked: '${checked}/${total}'
}"
:data="transferData"
filterable
style="text-align: left; display: inline-block"
></el-transfer>
</div>
</el-form>
@ -80,9 +81,9 @@
</el-dialog>
</div>
<el-dialog
class="params-eldialog"
:title="cmdParamTitle"
:visible.sync="paramsOpen"
class="params-eldialog"
width="800px"
>
<params-json-wrap

View File

@ -6,8 +6,8 @@
<attribute-view
v-if="activeName === 'attribute'"
ref="attributeref"
@handleClick="attributeEvent"
:sourceId="sourceId"
@handleClick="attributeEvent"
/>
</div>
</el-tab-pane>
@ -16,8 +16,8 @@
<group-view
v-if="activeName === 'group'"
ref="groupref"
@handleClick="groupEvent"
:sourceId="sourceId"
@handleClick="groupEvent"
/>
</div>
</el-tab-pane>
@ -74,6 +74,7 @@ export default {
title: "修改参数",
component: "attributeForm",
paramIdx: data.idx,
row:data.row
});
break;

15517
yarn.lock

File diff suppressed because it is too large Load Diff