瀏覽代碼

format codes

vera_min 2 年之前
父節點
當前提交
9f637320b7

+ 0 - 31
src/views/iot/device/instance/component/subDevice.vue

@@ -383,7 +383,6 @@ export default defineComponent({
 	components: { EditDic, EditAttr, EditFun, EditEvent, EditTab, devantd, ListDic, functionCom },
 
 	setup(prop, context) {
-		console.log(prop)
 		const route = useRoute()
 		const editDicRef = ref()
 		const editAttrRef = ref()
@@ -442,34 +441,11 @@ export default defineComponent({
 			},
 		})
 
-		onMounted(() => {
-			// const ids = route.params && route.params.id;
-			// api.instance.detail(ids).then((res: any) => {
-			//     console.log(res)
-			// 	state.detail = res.data;
-			// 	state.developer_status = res.data.status;
-			// 	state.tableData.param.productId = res.data.product.id;
-			// 	state.product_id = res.data.product.id;
-			// 	getrunData();
-			// 	api.product.detail(res.data.product.id).then((res: any) => {
-			// 		state.prodetail = res.data;
-			// 		// console.log(res.data);
-			// 	});
-			// 	//第一次加载
-			// 	api.model.property(state.tableData.param).then((res: any) => {
-			// 		state.tableData.data = res.Data;
-			// 		state.tableData.total = res.Total;
-			// 	});
-			//     getDeviceTableData()
-			// });
-		})
-
 		const getDeviceTableData = () => {
 			state.deviceTableData.param.gatewayKey = state.detail.key
 			api.device.getList(state.deviceTableData.param).then((res: any) => {
 				state.deviceTableData.data = res.list
 				state.deviceTableData.total = res.Total
-				console.log(res)
 			})
 		}
 
@@ -480,11 +456,8 @@ export default defineComponent({
 		// 打开弹窗
 		const openDialog = (row: any | null) => {
 			if (row) {
-				// state.ruleForm = row;
-                console.log(row)
                 const ids = row.id;
                 api.instance.detail(ids).then((res: any) => {
-                    console.log(res)
                     state.detail = res.data;
                     state.developer_status = res.data.status;
                     state.tableData.param.productId = res.data.product.id;
@@ -492,7 +465,6 @@ export default defineComponent({
                     getrunData();
                     api.product.detail(res.data.product.id).then((productRes: any) => {
                         state.prodetail = productRes.data;
-                        console.log(productRes.data);
                     });
                     //第一次加载
                     api.model.property(state.tableData.param).then((modelRes: any) => {
@@ -507,7 +479,6 @@ export default defineComponent({
 
 		const onLogDetail = (row: TableDataRow) => {
 			state.jsonData = JSON.parse(row.content)
-			console.log(JSON.parse(row.content))
 			state.dialogVisible = true
 		}
 
@@ -666,7 +637,6 @@ export default defineComponent({
 		}
 
 		const handleClick = (tab: TabsPaneContext, event: Event) => {
-			console.log(tab, event)
 			if (tab.props.name == 4) {
 				//获取日志
 				getlog()
@@ -715,7 +685,6 @@ export default defineComponent({
 		const getlog = () => {
 			state.logtableData.param.deviceKey = state.detail.key
 			api.instance.getLogList(state.logtableData.param).then((res: any) => {
-				console.log(res, '22222222')
 				state.logtableData.data = res.list
 				state.logtableData.total = res.Total
 			})

+ 1 - 28
src/views/iot/device/instance/component/subDeviceMutipleBind.vue

@@ -74,12 +74,9 @@ interface TableDataState {
 }
 export default defineComponent({
 	name: 'MutipleBindDialog',
-	// components: { EditDic, EditAttr, EditFun, EditEvent, EditTab, devantd, ListDic, functionCom },
 
 	setup(prop, { emit }) {
-		console.log(prop)
 		const route = useRoute()
-		// const editDicRef = ref()
 		const state = reactive<TableDataState>({
 			gatewayKey: '',
 			deviceKeyList: [],
@@ -105,11 +102,6 @@ export default defineComponent({
 			}
 		})
 
-		onMounted(() => {
-			console.log('第一次加载')
-			// getProductList()
-		})
-
 		const getDeviceList = () => {
 			if(!state.ruleForm.productId) {
 				state.tableData.data = [];
@@ -123,7 +115,6 @@ export default defineComponent({
 				"pageSize": state.tableData.param.pageSize,
 				"pageNum": state.tableData.param.pageNum
 			}).then((res: any) => {
-				console.log(res)
 				state.tableData.data = res.device;
 				state.tableData.total = res.Total;
 			}).finally(() => (state.tableData.loading = false));
@@ -132,7 +123,7 @@ export default defineComponent({
 
 		const getProductList = () => {
 			api.product.getSubList().then((res: any) => {
-				let productDataList = [{id: "", name: "全部"}].concat(res.product)
+				let productDataList = res.product
 				state.productData = productDataList;
 				state.ruleForm.productId = state.productData[0].id
 				getDeviceList()
@@ -141,23 +132,13 @@ export default defineComponent({
 		};
 
 		const openDialog = (gatewayKey: any) => {
-			console.log('第二次加载')
 			state.gatewayKey = gatewayKey;
 			getProductList()
-			// state.isShowDialog = true;
 		};
 
 		    // 多选框选中数据
 		const handleSelectionChange = (selection: any[]) => {
-			console.log(selection)
-			console.log(typeof selection)
-			// selection.forEach((item:any) => {
-			//   console.log(item)
-			//   state.deviceKeyList.push(item.key)
-			// })
 			state.deviceKeyList = selection.map((item) => item.key);
-			console.log(state.deviceKeyList)
-			console.log(typeof state.deviceKeyList)
 		};
 
 		const confirmBind = () => {
@@ -166,7 +147,6 @@ export default defineComponent({
 				ElMessage.error('请选择要批量绑定的数据。');
 				return;
 			}
-				// return
 			ElMessageBox.confirm(msg, '提示', {
 				confirmButtonText: '确认',
 				cancelButtonText: '取消',
@@ -203,11 +183,4 @@ export default defineComponent({
 })
 </script>
 
-<style lang="scss" scoped>
-.mutiple-bind-dialog-wrap {
-	background: pink;
-}
-
-</style>
-
 

+ 0 - 19
src/views/iot/device/instance/detail.vue

@@ -370,7 +370,6 @@ interface TableDataState {
       pageNum: number;
       pageSize: number;
       gatewayKey: string;
-      // status: string;
       dateRange: string[];
     };
   };
@@ -468,7 +467,6 @@ export default defineComponent({
 		onMounted(() => {
 			const ids = route.params && route.params.id;
       api.instance.detail(ids).then((res: any) => {
-        console.log(res)
 				state.detail = res.data;
 				state.developer_status = res.data.status;
 				state.tableData.param.productId = res.data.product.id;
@@ -476,7 +474,6 @@ export default defineComponent({
 				getrunData();
 				api.product.detail(res.data.product.id).then((res: any) => {
 					state.prodetail = res.data;
-					// console.log(res.data);
 				});
 
 				//第一次加载
@@ -495,9 +492,6 @@ export default defineComponent({
         ElMessage.error('请选择要批量解绑的数据。');
         return;
       }
-      console.log(state.deviceKeyList)
-      console.log(state.deviceKeyList.length)
-        // return
       ElMessageBox.confirm(msg, '提示', {
         confirmButtonText: '确认',
         cancelButtonText: '取消',
@@ -523,22 +517,12 @@ export default defineComponent({
       api.device.getList(state.deviceTableData.param).then((res: any) => {
         state.deviceTableData.data = res.list;
         state.deviceTableData.total = res.Total;
-        console.log(res)
-        console.log(state.deviceTableData.data)
       });
     };
 
     // 多选框选中数据
     const handleSelectionChange = (selection: any[]) => {
-      console.log(selection)
-      console.log(typeof selection)
-      // selection.forEach((item:any) => {
-      //   console.log(item)
-      //   state.deviceKeyList.push(item.key)
-      // })
       state.deviceKeyList = selection.map((item) => item.key);
-      console.log(state.deviceKeyList)
-      console.log(typeof state.deviceKeyList)
     };
         
     // 打开修改产品弹窗
@@ -548,7 +532,6 @@ export default defineComponent({
 
     const onLogDetail = (row: TableDataRow) => {
       state.jsonData = JSON.parse(row.content);
-      console.log(JSON.parse(row.content));
       state.dialogVisible = true;
     };
 
@@ -712,7 +695,6 @@ export default defineComponent({
     };
 
     const handleClick = (tab: TabsPaneContext, event: Event) => {
-      console.log(tab, event);
       if (tab.props.name == 4) {
         //获取日志
         getlog();
@@ -763,7 +745,6 @@ export default defineComponent({
     const getlog = () => {
       state.logtableData.param.deviceKey = state.detail.key;
       api.instance.getLogList(state.logtableData.param).then((res: any) => {
-        console.log(res, '22222222');
         state.logtableData.data = res.list;
         state.logtableData.total = res.Total;
       });