Bläddra i källkod

fix: 优化产品和设备页面的显示,优化设备数据记录弹窗的显示等

yanglzh 1 år sedan
förälder
incheckning
5095503d87

+ 3 - 2
src/components/pagination/index.vue

@@ -83,8 +83,9 @@ export default defineComponent({
 
 <style scoped lang="scss">
 .pagination-container {
-  background: #fff;
-  padding: 32px 16px;
+  display: flex;
+  justify-content: flex-end;
+  padding: 16px 0 0 !important
 }
 
 .pagination-container.hidden {

+ 31 - 33
src/views/iot/device/instance/component/list.vue

@@ -1,29 +1,27 @@
 <template>
 	<div class="system-edit-dic-container">
-		<el-dialog  v-model="isShowDialog" :show-close="false"  width="75%" :fullscreen="dialogFullScreen">
-		 <template #header="{ close, titleId, titleClass }">
-      <div class="my-header">
-        <h4 :id="titleId" :class="titleClass">数据记录</h4>
-		 
-		 <div>
-            <i class="iconfont "  :class="!dialogFullScreen ? 'icon-fullscreen' : 'icon-tuichuquanping'"   @click="quanping"  style="font-size: 22px;cursor: pointer;"></i>
-			<i class="el-icon"  @click="close" style="font-size: 22px;cursor: pointer;    margin-left: 10px; position: relative; top: 3px;"><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-029747aa=""><path fill="currentColor" d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"></path></svg></i>
-			
-		</div>
-      </div>
-    </template>
+		<el-dialog v-model="isShowDialog" :show-close="false" width="850px" :fullscreen="dialogFullScreen">
+			<template #header="{ close, titleId, titleClass }">
+				<div class="my-header">
+					<h4 :id="titleId" :class="titleClass">数据记录</h4>
 
-			<el-table :data="tableData.data" style="width: 100%"  v-loading="tableData.loading">
-				<el-table-column label="时间" prop="ts" :show-overflow-tooltip="true" />
-				<el-table-column label="属性值" prop="value" :show-overflow-tooltip="true" />
+					<div>
+						<i class="iconfont " :class="!dialogFullScreen ? 'icon-fullscreen' : 'icon-tuichuquanping'" @click="quanping" style="font-size: 22px;cursor: pointer;"></i>
+						<i class="el-icon" @click="close" style="font-size: 22px;cursor: pointer;    margin-left: 10px; position: relative; top: 3px;"><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-029747aa="">
+								<path fill="currentColor"
+									d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z">
+								</path>
+							</svg></i>
+
+					</div>
+				</div>
+			</template>
+
+			<el-table :data="tableData.data" style="width: 100%" v-loading="tableData.loading">
+				<el-table-column label="时间" prop="ts" align="center" width="180" />
+				<el-table-column label="属性值" prop="value" align="center" show-overflow-tooltip />
 			</el-table>
-			<pagination
-				v-show="tableData.total > 0"
-				:total="tableData.total"
-				v-model:page="tableData.param.pageNum"
-				v-model:limit="tableData.param.pageSize"
-				@pagination="typeList"
-			/>
+			<pagination v-show="tableData.total > 0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="typeList" />
 		</el-dialog>
 	</div>
 </template>
@@ -67,7 +65,7 @@ export default defineComponent({
 		const formRef = ref<HTMLElement | null>(null);
 		const state = reactive<DicState>({
 			isShowDialog: false,
-		    dialogFullScreen: false,
+			dialogFullScreen: false,
 			tableData: {
 				data: [],
 				total: 0,
@@ -76,16 +74,16 @@ export default defineComponent({
 					pageNum: 1,
 					pageSize: 10,
 					id: 0,
-					propertyKey:'',
+					propertyKey: '',
 				},
 			},
 		});
 		// 打开弹窗
-		const openDialog = (row: RuleFormState | null,devid) => {
+		const openDialog = (row: RuleFormState | null, devid) => {
 			resetForm();
 			if (row) {
 				state.tableData.param.id = devid;
-				state.tableData.param.propertyKey=row.key
+				state.tableData.param.propertyKey = row.key
 				typeList();
 
 			}
@@ -102,7 +100,7 @@ export default defineComponent({
 
 		};
 		const resetForm = () => {
-			state.tableData= {
+			state.tableData = {
 				data: [],
 				total: 0,
 				loading: false,
@@ -116,8 +114,8 @@ export default defineComponent({
 		const closeDialog = () => {
 			state.isShowDialog = false;
 		};
-		const quanping=()=>{
-			state.dialogFullScreen = state.dialogFullScreen?false:true;
+		const quanping = () => {
+			state.dialogFullScreen = state.dialogFullScreen ? false : true;
 		}
 		// 取消
 		const onCancel = () => {
@@ -125,7 +123,7 @@ export default defineComponent({
 		};
 
 		return {
-            Close,
+			Close,
 			quanping,
 			typeList,
 			openDialog,
@@ -139,8 +137,8 @@ export default defineComponent({
 </script>
 <style scoped>
 .my-header {
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
+	display: flex;
+	flex-direction: row;
+	justify-content: space-between;
 }
 </style>

+ 6 - 6
src/views/iot/device/instance/index.vue

@@ -90,11 +90,11 @@
       </div>
       <el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="标识" prop="key" width="130" show-overflow-tooltip v-col="'key'" />
-        <el-table-column label="设备名称" prop="name" show-overflow-tooltip v-col="'name'" />
-        <el-table-column label="设备类型" prop="product.deviceType" show-overflow-tooltip v-col="'deviceType'" />
-        <el-table-column label="产品名称" prop="productName" show-overflow-tooltip v-col="'productName'" />
-        <el-table-column prop="status" label="状态" width="100" align="center" v-col="'status'">
+        <el-table-column label="标识" prop="key" min-width="150" show-overflow-tooltip v-col="'key'" />
+        <el-table-column label="设备名称" prop="name" min-width="160" show-overflow-tooltip v-col="'name'" />
+        <el-table-column label="设备类型" prop="product.deviceType" min-width="120" align="center" show-overflow-tooltip v-col="'deviceType'" />
+        <el-table-column label="产品名称" prop="productName" min-width="120" align="center" show-overflow-tooltip v-col="'productName'" />
+        <el-table-column prop="status" label="状态" min-width="80" align="center" v-col="'status'">
           <template #default="scope">
             <el-tag type="info" size="small" v-if="scope.row.status == 1">离线</el-tag>
             <el-tag type="success" size="small" v-if="scope.row.status == 2">在线</el-tag>
@@ -104,7 +104,7 @@
         <el-table-column prop="createdAt" label="创建时间" align="center" width="160" v-col="'registryTime'"></el-table-column>
         <el-table-column prop="desc" label="说明" show-overflow-tooltip v-col="'desc'"></el-table-column>
 
-        <el-table-column label="操作" width="200" align="center" fixed="right">
+        <el-table-column label="操作" width="180" align="center" fixed="right">
           <template #default="scope">
             <router-link :to="'/iotmanager/device/instance/' + scope.row.id" class="link-type" style="padding-right: 12px;font-size: 12px;color: #409eff;" v-auth="'detail'">
               <span>详情</span>

+ 10 - 11
src/views/iot/device/product/index.vue

@@ -49,22 +49,21 @@
       <el-table :data="tableData.data" style="width: 100%" @selection-change="handleSelectionChange" v-loading="tableData.loading">
         <el-table-column type="selection" width="55" align="center" />
         <!--        <el-table-column label="ID" align="center" prop="id" width="60"  v-col="'id'"/>-->
-        <el-table-column label="标识" prop="key" :show-overflow-tooltip="true" v-col="'key'" />
-        <el-table-column label="名称" prop="name" :show-overflow-tooltip="true" v-col="'name'" />
-        <el-table-column label="分类" prop="categoryName" :show-overflow-tooltip="true" v-col="'categoryName'" />
-        <!-- <el-table-column label="组织" prop="deptName" :show-overflow-tooltip="true" v-col="'deptName'"/> -->
-        <el-table-column label="消息协议" prop="messageProtocol" :show-overflow-tooltip="true" v-col="'messageProtocol'" />
-        <el-table-column label="接入方式" prop="transportProtocol" :show-overflow-tooltip="true" v-col="'transportProtocol'" />
-        <el-table-column label="类型" prop="deviceType" :show-overflow-tooltip="true" v-col="'deviceType'" />
-
-        <el-table-column prop="status" label="状态" width="100" align="center" v-col="'status'">
+        <el-table-column label="标识" prop="key" min-width="150" show-overflow-tooltip v-col="'key'" />
+        <el-table-column label="名称" prop="name" min-width="160" show-overflow-tooltip v-col="'name'" />
+        <el-table-column label="分类" prop="categoryName" align="center" width="160" show-overflow-tooltip v-col="'categoryName'" />
+        <!-- <el-table-column label="组织" prop="deptName" show-overflow-tooltip v-col="'deptName'"/> -->
+        <el-table-column label="消息协议" prop="messageProtocol" align="center" min-width="160" show-overflow-tooltip v-col="'messageProtocol'" />
+        <el-table-column label="接入方式" prop="transportProtocol" min-width="120" align="center" show-overflow-tooltip v-col="'transportProtocol'" />
+        <el-table-column label="类型" prop="deviceType" min-width="90" align="center" show-overflow-tooltip v-col="'deviceType'" />
+        <el-table-column prop="status" label="状态" min-width="90" align="center" v-col="'status'">
           <template #default="scope">
             <el-tag type="success" size="small" v-if="scope.row.status">已发布</el-tag>
             <el-tag type="info" size="small" v-else>未发布</el-tag>
           </template>
         </el-table-column>
         <!-- <el-table-column prop="createdAt" label="创建时间" align="center" width="180"></el-table-column> -->
-        <el-table-column label="操作" width="150" align="center" fixed="right">
+        <el-table-column label="操作" width="130" align="center" fixed="right">
           <template #default="scope">
             <router-link :to="'/iotmanager/device/product/detail/' + scope.row.id" class="link-type" style="padding-right: 12px;font-size: 12px;color: #409eff;">
               <span>详情</span>
@@ -74,7 +73,7 @@
           </template>
         </el-table-column>
       </el-table>
-      <pagination v-show="tableData.total>0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="typeList" />
+      <pagination v-show="tableData.total > 0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="typeList" />
     </el-card>
     <EditDic ref="editDicRef" @typeList="typeList" />
   </div>

+ 31 - 33
src/views/iot/device/template/component/list.vue

@@ -1,29 +1,27 @@
 <template>
 	<div class="system-edit-dic-container">
-		<el-dialog  v-model="isShowDialog" :show-close="false"  width="75%" :fullscreen="dialogFullScreen">
-		 <template #header="{ close, titleId, titleClass }">
-      <div class="my-header">
-        <h4 :id="titleId" :class="titleClass">数据记录</h4>
-		 
-		 <div>
-            <i class="iconfont "  :class="!dialogFullScreen ? 'icon-fullscreen' : 'icon-tuichuquanping'"   @click="quanping"  style="font-size: 22px;cursor: pointer;"></i>
-			<i class="el-icon"  @click="close" style="font-size: 22px;cursor: pointer;    margin-left: 10px; position: relative; top: 3px;"><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-029747aa=""><path fill="currentColor" d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"></path></svg></i>
-			
-		</div>
-      </div>
-    </template>
+		<el-dialog v-model="isShowDialog" :show-close="false" width="850" :fullscreen="dialogFullScreen">
+			<template #header="{ close, titleId, titleClass }">
+				<div class="my-header">
+					<h4 :id="titleId" :class="titleClass">数据记录</h4>
 
-			<el-table :data="tableData.data" style="width: 100%"  v-loading="tableData.loading">
-				<el-table-column label="时间" prop="ts" :show-overflow-tooltip="true" />
-				<el-table-column label="属性值" prop="value" :show-overflow-tooltip="true" />
+					<div>
+						<i class="iconfont " :class="!dialogFullScreen ? 'icon-fullscreen' : 'icon-tuichuquanping'" @click="quanping" style="font-size: 22px;cursor: pointer;"></i>
+						<i class="el-icon" @click="close" style="font-size: 22px;cursor: pointer;    margin-left: 10px; position: relative; top: 3px;"><svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-029747aa="">
+								<path fill="currentColor"
+									d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z">
+								</path>
+							</svg></i>
+
+					</div>
+				</div>
+			</template>
+
+			<el-table :data="tableData.data" style="width: 100%" v-loading="tableData.loading">
+				<el-table-column label="时间" prop="ts" align="center" width="180" />
+				<el-table-column label="属性值" prop="value" align="center" show-overflow-tooltip />
 			</el-table>
-			<pagination
-				v-show="tableData.total > 0"
-				:total="tableData.total"
-				v-model:page="tableData.param.pageNum"
-				v-model:limit="tableData.param.pageSize"
-				@pagination="typeList"
-			/>
+			<pagination v-show="tableData.total > 0" :total="tableData.total" v-model:page="tableData.param.pageNum" v-model:limit="tableData.param.pageSize" @pagination="typeList" />
 		</el-dialog>
 	</div>
 </template>
@@ -67,7 +65,7 @@ export default defineComponent({
 		const formRef = ref<HTMLElement | null>(null);
 		const state = reactive<DicState>({
 			isShowDialog: false,
-		    dialogFullScreen: false,
+			dialogFullScreen: false,
 			tableData: {
 				data: [],
 				total: 0,
@@ -76,16 +74,16 @@ export default defineComponent({
 					pageNum: 1,
 					pageSize: 10,
 					id: 0,
-					propertyKey:'',
+					propertyKey: '',
 				},
 			},
 		});
 		// 打开弹窗
-		const openDialog = (row: RuleFormState | null,devid) => {
+		const openDialog = (row: RuleFormState | null, devid) => {
 			resetForm();
 			if (row) {
 				state.tableData.param.id = devid;
-				state.tableData.param.propertyKey=row.key
+				state.tableData.param.propertyKey = row.key
 				typeList();
 
 			}
@@ -102,7 +100,7 @@ export default defineComponent({
 
 		};
 		const resetForm = () => {
-			state.tableData= {
+			state.tableData = {
 				data: [],
 				total: 0,
 				loading: false,
@@ -116,8 +114,8 @@ export default defineComponent({
 		const closeDialog = () => {
 			state.isShowDialog = false;
 		};
-		const quanping=()=>{
-			state.dialogFullScreen = state.dialogFullScreen?false:true;
+		const quanping = () => {
+			state.dialogFullScreen = state.dialogFullScreen ? false : true;
 		}
 		// 取消
 		const onCancel = () => {
@@ -125,7 +123,7 @@ export default defineComponent({
 		};
 
 		return {
-            Close,
+			Close,
 			quanping,
 			typeList,
 			openDialog,
@@ -139,8 +137,8 @@ export default defineComponent({
 </script>
 <style scoped>
 .my-header {
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
+	display: flex;
+	flex-direction: row;
+	justify-content: space-between;
 }
 </style>

+ 1 - 1
src/views/system/datahub/modeling/component/detail.vue

@@ -1,6 +1,6 @@
 <template>
 	<div class="system-edit-dic-container">
-		<el-dialog v-model="isShowDialog" :show-close="false" width="75%" :fullscreen="dialogFullScreen">
+		<el-dialog v-model="isShowDialog" :show-close="false" width="850" :fullscreen="dialogFullScreen">
 			<template #header="{ close, titleId, titleClass }">
 				<div class="my-header">
 					<h4 :id="titleId" :class="titleClass">数据记录</h4>