Sfoglia il codice sorgente

Merge branch 'master' of http://git.mydig.net/Sagoo-Cloud/sagoo-admin-ui

yukai 3 anni fa
parent
commit
04c42d4103

+ 1 - 51
src/views/network/server/detail.vue

@@ -12,20 +12,12 @@
 			<el-icon style="font-size: 16px;margin: 0 6px;"><ele-Operation /></el-icon>
 			<el-icon style="font-size: 16px;"><ele-Edit /></el-icon>
 		</div>
-
-	  	 <!-- <codeEditor ref="mirrorRef"
-	  :mode="resourceModalPro.mode"
-	  :content="resourceModalPro.content"
-	  >
-	  </codeEditor> -->
 	</el-card>
 </template>
 <script lang="ts">
 import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue';
 import { Delete, Edit, Search, Share, Upload } from '@element-plus/icons-vue';
-import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
 import type { TabsPaneContext } from 'element-plus'
-import codeEditor from '/@/components/codeEditor/index.vue'
 
 import serverDetail from './component/serverDetail.vue'
 
@@ -34,18 +26,15 @@ import { useRoute } from 'vue-router';
 import api from '/@/api/network';
 
 interface TableDataState {
-	// ids: number[];
-	// id: string;
 	resourceModalPro: {
 		mode: string,
 		content: string,
-		// content: object,
 	},
 	detail: {}
 }
 export default defineComponent({
 	name: 'tunnelDetail',
-	components: { codeEditor, serverDetail },
+	components: { serverDetail },
 	props: {
 		type: {
 			type: String,
@@ -56,7 +45,6 @@ export default defineComponent({
 	setup(props, context) {
 		const route = useRoute();
 		const state = reactive<TableDataState>({
-            // id: "",
 			resourceModalPro: {
 				mode: '',
 				content: ''
@@ -72,40 +60,7 @@ export default defineComponent({
 			})
 		};
 		onMounted(() => {
-			// state.id = route.params && route.params.id;
-			// console.log(state.id)
 			getDetail()
-			return;
-			let obj = {
-						"id": 1,
-						"name": "新建服务器",
-						"type": "tcp",
-						"addr": "10010",
-						"register": {
-							"regex": "^\\w+$"
-						},
-						"heartbeat": {
-							"enable": false,
-							"timeout": 30,
-							"regex": "^\\w+$"
-						},
-						"protocol": {
-							"name": "ModbusTCP",
-							"options": {}
-						},
-						"devices": [
-							{
-								"station": 1,
-								"product_id": ""
-							}
-						],
-						"disabled": false,
-						"updated": "2022-08-26T15:10:07+08:00",
-						"created": "2022-08-20T18:44:20+08:00",
-						"running": true
-					}
-					var jsonData = JSON.stringify(obj);//data是请求的后台数据
-					state.resourceModalPro.content = JSON.stringify(JSON.parse(jsonData),null,4);
 		});
 		const handleClick = (tab: TabsPaneContext, event: Event) => {
 			console.log(tab, event)
@@ -116,11 +71,6 @@ export default defineComponent({
 			activeName,
 			getDetail,
 			handleClick,
-			// editDicRef,
-			// editAttrRef,
-			// editFunRef,
-			// editEventRef,
-			// editTabRef,
 			...toRefs(props),
 			...toRefs(state),
 		};

+ 3 - 59
src/views/network/server/edit.vue

@@ -1,6 +1,6 @@
 <template>
 	<el-card class="system-dic-container" style="position: relative;">
-		<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+		<el-tabs v-model="activeName" class="demo-tabs">
 			<el-tab-pane label="编辑服务器" name="first">
 				<el-collapse v-model="activeViewName">
                     <el-collapse-item title="基本信息" name="1">
@@ -45,17 +45,6 @@
                                         :label="dict.label"
                                         :value="dict.value">
                                     </el-option>
-                                    <!-- <el-option label="Modbus RTU" value="Modbus RTU" />
-                                    <el-option label="Modbus TCP" value="Modbus TCP" />
-                                    <el-option label="Omron Hostlink" value="Omron Hostlink" />
-                                    <el-option label="Omron FINS UDP" value="Omron FINS UDP" />
-                                    <el-option label="Omron FINS TCP" value="Omron FINS TCP" />
-                                    <el-option label="Simatic S7-200 Smart" value="Simatic S7-200 Smart" />
-                                    <el-option label="Simatic S7-200" value="Simatic S7-200" />
-                                    <el-option label="Simatic S7-300" value="Simatic S7-300" />
-                                    <el-option label="Simatic S7-400" value="Simatic S7-400" />
-                                    <el-option label="Simatic S7-1200" value="Simatic S7-1200" />
-                                    <el-option label="Simatic S7-1500" value="Simatic S7-1500" /> -->
                                 </el-select>
                             </el-form-item>
                             <el-form-item label="协议参数">
@@ -69,26 +58,16 @@
                     </el-collapse-item>
                 </el-collapse>
 			</el-tab-pane>
-			<!-- <el-tab-pane label="专家视图" name="second">
-                <h1>专家视图</h1>
-            </el-tab-pane> -->
 		</el-tabs>
 		<div style="position: absolute;right:20px;top: 20px;">
 			<el-button size="medium">取消</el-button>
             <el-button @click="submit" size="medium" type="primary">提交</el-button>
 		</div>
-
-	  	 <!-- <codeEditor ref="mirrorRef"
-	  :mode="resourceModalPro.mode"
-	  :content="resourceModalPro.content"
-	  >
-	  </codeEditor> -->
 	</el-card>
 </template>
 <script lang="ts">
 import { toRefs, reactive, onMounted, ref, defineComponent, getCurrentInstance } from 'vue';
-import { Delete, Edit, Search, Share, Upload } from '@element-plus/icons-vue';
-import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
+import { ElMessage } from 'element-plus';
 import type { TabsPaneContext } from 'element-plus'
 import codeEditor from '/@/components/codeEditor/index.vue'
 
@@ -99,13 +78,10 @@ import { useRoute, useRouter } from 'vue-router';
 import api from '/@/api/network';
 
 interface TableDataState {
-	// ids: number[];
-	// id: string;
     activeViewName: string[];
 	resourceModalPro: {
 		mode: string,
 		content: string,
-		// content: object,
 	},
 	detail: object,
     form: object
@@ -168,7 +144,6 @@ export default defineComponent({
 		const getDetail = () => {
 			const id = route.params && route.params.id;
 			api.server.getDetail({"id": id}).then((res: any) => {
-				console.log(res)
                 const {id, name, types, status, addr, register, protocol, heartbeat, devices} = res
                 state.form["id"] = id
                 state.form["name"] = name
@@ -180,17 +155,12 @@ export default defineComponent({
                 state.form["heartbeat"] = JSON.parse(heartbeat)
                 state.form["devices"] = JSON.parse(devices)
 
-                console.log(JSON.parse(protocol).options)
                 let jsonData = JSON.stringify(JSON.parse(protocol).options);
 				state.resourceModalPro.content = JSON.stringify(JSON.parse(jsonData),null,4);
-                console.log(state.resourceModalPro.content)
                 mirrorRef.value.setValue(state.resourceModalPro.content);
-				// state.detail = res
-                console.log(state.form)
 			})
 		};
         const submit = () => {
-            console.log(state.form)
             let params = {
                 ...state.form
             }
@@ -200,38 +170,20 @@ export default defineComponent({
             console.log(params)
             // return
             api.server.editItem({...state.form}).then((res: any) => {
-				console.log(res);
                 ElMessage.success('添加成功')
                 router.go(-1);
-                // const { list, total, page } = res
-                // state.data = list
-                // state.total = total
-                // state.param.page = page
 			});
         };
 		onMounted(() => {
-            getDetail()
-			// let obj = {}
-			// var jsonData = JSON.stringify(obj);
-			// state.resourceModalPro.content = JSON.stringify(JSON.parse(jsonData),null,4);
+            getDetail();
 		});
-		const handleClick = (tab: TabsPaneContext, event: Event) => {
-			console.log(tab, event)
-		}
 
 		return {
-			Edit,
             mirrorRef,
 			activeName,
 			getDetail,
-			handleClick,
             network_server_type,
             network_protocols,
-			// editDicRef,
-			// editAttrRef,
-			// editFunRef,
-			// editEventRef,
-			// editTabRef,
             submit,
 			...toRefs(props),
 			...toRefs(state),
@@ -239,14 +191,6 @@ export default defineComponent({
 	},
 });
 </script>
-
-<style>
-.CodeMirror {
-  width: 100%;
-  height: 600px;
-  font-size: 16px;
-}
-</style>
 <style lang="scss" scoped>
 ::v-deep .el-collapse-item__header {
     position: relative;

+ 0 - 4
src/views/network/tunnel/component/list.vue

@@ -2,12 +2,10 @@
     <div>
         <el-table v-loading="loading" :data="data" style="width: 100%">
             <el-table-column align="center" prop="id" label="ID" width="80"/>
-            <!-- <el-table-column align="center" prop="server" label="服务器"/> -->
             <el-table-column align="center" prop="name" label="名称"/>
             <el-table-column align="center" prop="types" label="类型"/>
             <el-table-column align="center" prop="addr" label="地址"/>
             <el-table-column show-overflow-tooltip align="center" prop="createdAt" label="创建时间" width="170"/>
-            <!-- <el-table-column align="center" prop="last" label="最近上线"/> -->
             <el-table-column align="center" prop="types" label="状态">
                 <template #default="scope">
                     <el-tag size="medium" v-if="!scope.row.status" class="ml-2" type="danger">未启动</el-tag>
@@ -125,14 +123,12 @@ export default defineComponent({
 		};
         // 获取数据
         const fetchList = () => {
-            console.log(props.keyWord)
             let params = {
                 keyWord: props.keyWord,
                 pageNum: state.param.page,
                 PageSize: state.param.pageSize
             }
             api.tunnel.getList(params).then((res: any) => {
-				console.log(res);
                 const { list, total, page } = res
                 state.data = list
                 state.total = total

+ 1 - 4
src/views/network/tunnel/component/serverDetail.vue

@@ -39,13 +39,11 @@
 </template>
 <script lang="ts">
 import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue';
-import { Delete, Edit, Search, Share, Upload } from '@element-plus/icons-vue';
-import { ElMessageBox, ElMessage } from 'element-plus';
+import { ElMessage } from 'element-plus';
 
 import api from '/@/api/network';
 
 interface TableDataState {
-	// detail: object,
     loading: boolean
 }
 export default defineComponent({
@@ -61,7 +59,6 @@ export default defineComponent({
             loading: false
 		});
 		onMounted(() => {
-            console.log(props.detail)
 		});
         // 禁用状态
         const onChangeStatus = () => {

+ 2 - 70
src/views/network/tunnel/create.vue

@@ -1,6 +1,6 @@
 <template>
 	<el-card class="system-dic-container" style="position: relative;">
-		<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+		<el-tabs v-model="activeName" class="demo-tabs">
 			<el-tab-pane label="新增通道" name="first">
 				<el-collapse v-model="activeViewName">
                     <el-collapse-item title="基本信息" name="1">
@@ -36,24 +36,6 @@
                                 </el-form-item>
                                 <el-form-item label="波特率">
                                     <el-select v-model="form.serial.baud_rate" placeholder="请选择波特率">
-                                        <!-- <el-option label="150" :value="150" />
-                                        <el-option label="200" :value="200" />
-                                        <el-option label="300" :value="300" />
-                                        <el-option label="600" :value="600" />
-                                        <el-option label="1200" :value="1200" />
-                                        <el-option label="1800" :value="1800" />
-                                        <el-option label="2400" :value="2400" />
-                                        <el-option label="4800" :value="4800" />
-                                        <el-option label="7200" :value="7200" />
-                                        <el-option label="9600" :value="9600" />
-                                        <el-option label="14400" :value="14400" />
-                                        <el-option label="19200" :value="19200" />
-                                        <el-option label="28800" :value="28800" />
-                                        <el-option label="38400" :value="38400" />
-                                        <el-option label="57600" :value="57600" />
-                                        <el-option label="76800" :value="76800" />
-                                        <el-option label="115200" :value="115200" />
-                                        <el-option label="230400" :value="230400" /> -->
                                         <el-option
                                             v-for="dict in tunnel_serial_baudrate"
                                             :key="dict.value"
@@ -64,10 +46,6 @@
                                 </el-form-item>
                                 <el-form-item label="数据位">
                                     <el-select v-model="form.serial.data_bits" placeholder="请选择数据位">
-                                        <!-- <el-option label="5" :value="5" />
-                                        <el-option label="6" :value="6" />
-                                        <el-option label="7" :value="7" />
-                                        <el-option label="8" :value="8" /> -->
                                         <el-option
                                             v-for="dict in tunnel_serial_databits"
                                             :key="dict.value"
@@ -78,8 +56,6 @@
                                 </el-form-item>
                                 <el-form-item label="停止位">
                                     <el-select v-model="form.serial.stop_bits" placeholder="请选择停止位">
-                                        <!-- <el-option label="1" :value="1" />
-                                        <el-option label="2" :value="2" /> -->
                                         <el-option
                                             v-for="dict in tunnel_serial_stopbits"
                                             :key="dict.value"
@@ -96,9 +72,6 @@
                                             :label="dict.label"
                                             :value="dict.value">
                                         </el-option>
-                                        <!-- <el-option label="无" :value="0" />
-                                        <el-option label="偶" :value="1" />
-                                        <el-option label="奇" :value="2" /> -->
                                     </el-select>
                                 </el-form-item>
                             </el-form>
@@ -134,17 +107,6 @@
                                         :label="dict.label"
                                         :value="dict.value">
                                     </el-option>
-                                    <!-- <el-option label="Modbus RTU" value="Modbus RTU" />
-                                    <el-option label="Modbus TCP" value="Modbus TCP" />
-                                    <el-option label="Omron Hostlink" value="Omron Hostlink" />
-                                    <el-option label="Omron FINS UDP" value="Omron FINS UDP" />
-                                    <el-option label="Omron FINS TCP" value="Omron FINS TCP" />
-                                    <el-option label="Simatic S7-200 Smart" value="Simatic S7-200 Smart" />
-                                    <el-option label="Simatic S7-200" value="Simatic S7-200" />
-                                    <el-option label="Simatic S7-300" value="Simatic S7-300" />
-                                    <el-option label="Simatic S7-400" value="Simatic S7-400" />
-                                    <el-option label="Simatic S7-1200" value="Simatic S7-1200" />
-                                    <el-option label="Simatic S7-1500" value="Simatic S7-1500" /> -->
                                 </el-select>
                             </el-form-item>
                             <el-form-item label="协议参数">
@@ -159,26 +121,16 @@
                     </el-collapse-item>
                 </el-collapse>
 			</el-tab-pane>
-			<!-- <el-tab-pane label="专家视图" name="second">
-                <h1>专家视图</h1>
-            </el-tab-pane> -->
 		</el-tabs>
 		<div style="position: absolute;right:20px;top: 20px;">
 			<el-button size="medium">取消</el-button>
             <el-button @click="submit" size="medium" type="primary">提交</el-button>
 		</div>
-
-	  	 <!-- <codeEditor ref="mirrorRef"
-	  :mode="resourceModalPro.mode"
-	  :content="resourceModalPro.content"
-	  >
-	  </codeEditor> -->
 	</el-card>
 </template>
 <script lang="ts">
 import { toRefs, reactive, onMounted, ref, defineComponent, getCurrentInstance, nextTick } from 'vue';
-import { Delete, Edit, Search, Share, Upload } from '@element-plus/icons-vue';
-import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
+import { ElMessage } from 'element-plus';
 import type { TabsPaneContext } from 'element-plus'
 import codeEditor from '/@/components/codeEditor/index.vue'
 
@@ -189,13 +141,10 @@ import { useRoute, useRouter } from 'vue-router';
 import api from '/@/api/network';
 
 interface TableDataState {
-	// ids: number[];
-	// id: string;
     activeViewName: string[];
 	resourceModalPro: {
 		mode: string,
 		content: string,
-		// content: object,
 	},
 	detail: object,
     form: object
@@ -268,14 +217,12 @@ export default defineComponent({
 		const getDetail = () => {
 			const id = route.params && route.params.id;
 			api.tunnel.getDetail({"id": id}).then((res: any) => {
-				console.log(res)
 				state.detail = res
 			})
 		};
 
 
         const submit = () => {
-            console.log(state.form)
             // 串口参数-检验位-无
             if(state.form.serial.parity == 0) {
                 state.form.serial.rs485 = false
@@ -286,14 +233,9 @@ export default defineComponent({
                 state.form.serial.port = null
                 delete state.form.serial.rs485
             }
-            
-            let params = {
-                ...state.form
-            }
             if(mirrorRef.value.getValue()) {
                 state.form.protoccol.options = eval("(" + mirrorRef.value.getValue() + ")")
             }
-            console.log(params)
             // return
             api.tunnel.addItem({...state.form}).then((res: any) => {
                 ElMessage.success('添加成功')
@@ -305,27 +247,17 @@ export default defineComponent({
             var jsonData = JSON.stringify(obj);
             state.resourceModalPro.content = JSON.stringify(JSON.parse(jsonData),null,4);
 		});
-		const handleClick = (tab: TabsPaneContext, event: Event) => {
-			console.log(tab, event)
-		}
 
 		return {
-			Edit,
             mirrorRef,
 			activeName,
 			getDetail,
-			handleClick,
             network_tunnel_type,
             tunnel_serial_baudrate,
             tunnel_serial_databits,
             tunnel_serial_stopbits,
             tunnel_serial_parity,
             network_protocols,
-			// editDicRef,
-			// editAttrRef,
-			// editFunRef,
-			// editEventRef,
-			// editTabRef,
             submit,
 			...toRefs(props),
 			...toRefs(state),

+ 2 - 66
src/views/network/tunnel/detail.vue

@@ -1,6 +1,6 @@
 <template>
 	<el-card class="system-dic-container" style="position: relative;">
-		<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+		<el-tabs v-model="activeName" class="demo-tabs">
 			<el-tab-pane label="服务器详情" name="first">
 				<serverDetail :detail="detail" />
 			</el-tab-pane>
@@ -12,20 +12,12 @@
 			<el-icon style="font-size: 16px;margin: 0 6px;"><ele-Operation /></el-icon>
 			<el-icon style="font-size: 16px;"><ele-Edit /></el-icon>
 		</div>
-
-	  	 <!-- <codeEditor ref="mirrorRef"
-	  :mode="resourceModalPro.mode"
-	  :content="resourceModalPro.content"
-	  >
-	  </codeEditor> -->
 	</el-card>
 </template>
 <script lang="ts">
 import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue';
-import { Delete, Edit, Search, Share, Upload } from '@element-plus/icons-vue';
 import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
 import type { TabsPaneContext } from 'element-plus'
-import codeEditor from '/@/components/codeEditor/index.vue'
 
 import serverDetail from './component/serverDetail.vue'
 
@@ -34,18 +26,15 @@ import { useRoute } from 'vue-router';
 import api from '/@/api/network';
 
 interface TableDataState {
-	// ids: number[];
-	// id: string;
 	resourceModalPro: {
 		mode: string,
 		content: string,
-		// content: object,
 	},
 	detail: {}
 }
 export default defineComponent({
 	name: 'tunnelDetail',
-	components: { codeEditor, serverDetail },
+	components: { serverDetail },
 	props: {
 		type: {
 			type: String,
@@ -56,7 +45,6 @@ export default defineComponent({
 	setup(props, context) {
 		const route = useRoute();
 		const state = reactive<TableDataState>({
-            // id: "",
 			resourceModalPro: {
 				mode: '',
 				content: ''
@@ -67,60 +55,16 @@ export default defineComponent({
 		const getDetail = () => {
 			const id = route.params && route.params.id;
 			api.tunnel.getDetail({"id": id}).then((res: any) => {
-				console.log(res)
 				state.detail = res
 			})
 		};
 		onMounted(() => {
-			// state.id = route.params && route.params.id;
-			// console.log(state.id)
 			getDetail()
-			return;
-			let obj = {
-						"id": 1,
-						"name": "新建服务器",
-						"type": "tcp",
-						"addr": "10010",
-						"register": {
-							"regex": "^\\w+$"
-						},
-						"heartbeat": {
-							"enable": false,
-							"timeout": 30,
-							"regex": "^\\w+$"
-						},
-						"protocol": {
-							"name": "ModbusTCP",
-							"options": {}
-						},
-						"devices": [
-							{
-								"station": 1,
-								"product_id": ""
-							}
-						],
-						"disabled": false,
-						"updated": "2022-08-26T15:10:07+08:00",
-						"created": "2022-08-20T18:44:20+08:00",
-						"running": true
-					}
-					var jsonData = JSON.stringify(obj);//data是请求的后台数据
-					state.resourceModalPro.content = JSON.stringify(JSON.parse(jsonData),null,4);
 		});
-		const handleClick = (tab: TabsPaneContext, event: Event) => {
-			console.log(tab, event)
-		}
 
 		return {
-			Edit,
 			activeName,
 			getDetail,
-			handleClick,
-			// editDicRef,
-			// editAttrRef,
-			// editFunRef,
-			// editEventRef,
-			// editTabRef,
 			...toRefs(props),
 			...toRefs(state),
 		};
@@ -128,11 +72,3 @@ export default defineComponent({
 });
 </script>
 
-<style>
-.CodeMirror {
-  width: 100%;
-  height: 600px;
-  font-size: 16px;
-}
-</style>
-

+ 2 - 104
src/views/network/tunnel/edit.vue

@@ -1,6 +1,6 @@
 <template>
 	<el-card class="system-dic-container" style="position: relative;">
-		<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+		<el-tabs v-model="activeName" class="demo-tabs">
 			<el-tab-pane label="编辑通道" name="first">
 				<el-collapse v-model="activeViewName">
                     <el-collapse-item title="基本信息" name="1">
@@ -36,24 +36,6 @@
                                 </el-form-item>
                                 <el-form-item label="波特率">
                                     <el-select v-model="form.serial.baud_rate" placeholder="请选择波特率">
-                                        <!-- <el-option label="150" :value="150" />
-                                        <el-option label="200" :value="200" />
-                                        <el-option label="300" :value="300" />
-                                        <el-option label="600" :value="600" />
-                                        <el-option label="1200" :value="1200" />
-                                        <el-option label="1800" :value="1800" />
-                                        <el-option label="2400" :value="2400" />
-                                        <el-option label="4800" :value="4800" />
-                                        <el-option label="7200" :value="7200" />
-                                        <el-option label="9600" :value="9600" />
-                                        <el-option label="14400" :value="14400" />
-                                        <el-option label="19200" :value="19200" />
-                                        <el-option label="28800" :value="28800" />
-                                        <el-option label="38400" :value="38400" />
-                                        <el-option label="57600" :value="57600" />
-                                        <el-option label="76800" :value="76800" />
-                                        <el-option label="115200" :value="115200" />
-                                        <el-option label="230400" :value="230400" /> -->
                                         <el-option
                                             v-for="dict in tunnel_serial_baudrate"
                                             :key="dict.value"
@@ -64,10 +46,6 @@
                                 </el-form-item>
                                 <el-form-item label="数据位">
                                     <el-select v-model="form.serial.data_bits" placeholder="请选择数据位">
-                                        <!-- <el-option label="5" :value="5" />
-                                        <el-option label="6" :value="6" />
-                                        <el-option label="7" :value="7" />
-                                        <el-option label="8" :value="8" /> -->
                                         <el-option
                                             v-for="dict in tunnel_serial_databits"
                                             :key="dict.value"
@@ -78,8 +56,6 @@
                                 </el-form-item>
                                 <el-form-item label="停止位">
                                     <el-select v-model="form.serial.stop_bits" placeholder="请选择停止位">
-                                        <!-- <el-option label="1" :value="1" />
-                                        <el-option label="2" :value="2" /> -->
                                         <el-option
                                             v-for="dict in tunnel_serial_stopbits"
                                             :key="dict.value"
@@ -90,9 +66,6 @@
                                 </el-form-item>
                                 <el-form-item label="检验位">
                                     <el-select v-model="form.serial.parity" placeholder="请选择检验位">
-                                        <!-- <el-option label="无" :value="0" />
-                                        <el-option label="偶" :value="1" />
-                                        <el-option label="奇" :value="2" /> -->
                                         <el-option
                                             v-for="dict in tunnel_serial_parity"
                                             :key="dict.value"
@@ -128,17 +101,6 @@
                         <el-form style="width: 600px;margin: 0 auto;" :model="form" label-width="68px">
                             <el-form-item label="协议">
                                 <el-select v-model="form.protoccol.name" placeholder="请选择协议适配">
-                                    <!-- <el-option label="Modbus RTU" value="Modbus RTU" />
-                                    <el-option label="Modbus TCP" value="Modbus TCP" />
-                                    <el-option label="Omron Hostlink" value="Omron Hostlink" />
-                                    <el-option label="Omron FINS UDP" value="Omron FINS UDP" />
-                                    <el-option label="Omron FINS TCP" value="Omron FINS TCP" />
-                                    <el-option label="Simatic S7-200 Smart" value="Simatic S7-200 Smart" />
-                                    <el-option label="Simatic S7-200" value="Simatic S7-200" />
-                                    <el-option label="Simatic S7-300" value="Simatic S7-300" />
-                                    <el-option label="Simatic S7-400" value="Simatic S7-400" />
-                                    <el-option label="Simatic S7-1200" value="Simatic S7-1200" />
-                                    <el-option label="Simatic S7-1500" value="Simatic S7-1500" /> -->
                                     <el-option
                                         v-for="dict in network_protocols"
                                         :key="dict.value"
@@ -158,25 +120,15 @@
                     </el-collapse-item>
                 </el-collapse>
 			</el-tab-pane>
-			<!-- <el-tab-pane label="专家视图" name="second">
-                <h1>专家视图</h1>
-            </el-tab-pane> -->
 		</el-tabs>
 		<div style="position: absolute;right:20px;top: 20px;">
 			<el-button size="medium">取消</el-button>
             <el-button @click="submit" size="medium" type="primary">提交</el-button>
 		</div>
-
-	  	 <!-- <codeEditor ref="mirrorRef"
-	  :mode="resourceModalPro.mode"
-	  :content="resourceModalPro.content"
-	  >
-	  </codeEditor> -->
 	</el-card>
 </template>
 <script lang="ts">
 import { toRefs, reactive, onMounted, ref, defineComponent, getCurrentInstance } from 'vue';
-import { Delete, Edit, Search, Share, Upload } from '@element-plus/icons-vue';
 import { ElMessageBox, ElMessage, FormInstance } from 'element-plus';
 import type { TabsPaneContext } from 'element-plus'
 import codeEditor from '/@/components/codeEditor/index.vue'
@@ -188,13 +140,10 @@ import { useRoute, useRouter } from 'vue-router';
 import api from '/@/api/network';
 
 interface TableDataState {
-	// ids: number[];
-	// id: string;
     activeViewName: string[];
 	resourceModalPro: {
 		mode: string,
 		content: string,
-		// content: object,
 	},
 	detail: object,
     form: object
@@ -216,7 +165,6 @@ export default defineComponent({
         const { network_tunnel_type, tunnel_serial_baudrate, tunnel_serial_databits, tunnel_serial_stopbits, tunnel_serial_parity, network_protocols } = proxy.useDict('network_tunnel_type', 'tunnel_serial_baudrate', 'tunnel_serial_databits', 'tunnel_serial_stopbits', 'tunnel_serial_parity', 'network_protocols');
 		
         const state = reactive<TableDataState>({
-            // id: "",
 			resourceModalPro: {
 				mode: '',
 				content: ''
@@ -264,7 +212,6 @@ export default defineComponent({
 		const activeName = ref('first')
         const mirrorRef = ref('mirrorRef')
         const submit = () => {
-            console.log(state.form)
             // 串口参数-检验位-无
             if(state.form.serial.parity == 0) {
                 state.form.serial.rs485 = false
@@ -275,13 +222,8 @@ export default defineComponent({
                 state.form.serial.port = null
                 delete state.form.serial.rs485
             }
-            let params = {
-                ...state.form
-            }
-            console.log(params)
             // return
             api.tunnel.editItem({...state.form}).then((res: any) => {
-				console.log(res);
                 ElMessage.success('修改成功')
                 router.go(-1);
 			});
@@ -289,7 +231,6 @@ export default defineComponent({
         const getDetail = () => {
 			const id = route.params && route.params.id;
 			api.tunnel.getDetail({"id": id}).then((res: any) => {
-				console.log(res)
                 const {id, name, types, status, addr, serial, retry, protoccol, heartbeat } = res
                 state.form['name'] = name
                 state.form['types'] = types
@@ -300,67 +241,24 @@ export default defineComponent({
                 state.form['heartbeat'] = JSON.parse(heartbeat)
                 state.form['protoccol'] = protoccol?JSON.parse(protoccol):{name: "Modbus RTU",options: {}}
                 state.form['id'] = id
-                console.log(JSON.parse(protoccol).options)
                 let jsonData = JSON.stringify(JSON.parse(protoccol).options);
 				state.resourceModalPro.content = JSON.stringify(JSON.parse(jsonData),null,4);
-                console.log(state.resourceModalPro.content)
                 mirrorRef.value.setValue(state.resourceModalPro.content);
 			})
 		};
 		onMounted(() => {
-            getDetail()
-			// let obj = {
-			// 			// "id": 1,
-			// 			// "name": "新建服务器",
-			// 			// "type": "tcp",
-			// 			// "addr": "10010",
-			// 			// "register": {
-			// 			// 	"regex": "^\\w+$"
-			// 			// },
-			// 			// "heartbeat": {
-			// 			// 	"enable": false,
-			// 			// 	"timeout": 30,
-			// 			// 	"regex": "^\\w+$"
-			// 			// },
-			// 			// "protocol": {
-			// 			// 	"name": "ModbusTCP",
-			// 			// 	"options": {}
-			// 			// },
-			// 			// "devices": [
-			// 			// 	{
-			// 			// 		"station": 1,
-			// 			// 		"product_id": ""
-			// 			// 	}
-			// 			// ],
-			// 			// "disabled": false,
-			// 			// "updated": "2022-08-26T15:10:07+08:00",
-			// 			// "created": "2022-08-20T18:44:20+08:00",
-			// 			// "running": true
-			// 		}
-			// 		var jsonData = JSON.stringify(obj);
-			// 		state.resourceModalPro.content = JSON.stringify(JSON.parse(jsonData),null,4);
+            getDetail();
 		});
-		const handleClick = (tab: TabsPaneContext, event: Event) => {
-			console.log(tab, event)
-		}
-
 		return {
-			Edit,
             mirrorRef,
 			activeName,
 			getDetail,
-			handleClick,
             network_tunnel_type,
             tunnel_serial_baudrate,
             tunnel_serial_databits,
             tunnel_serial_stopbits,
             tunnel_serial_parity,
             network_protocols,
-			// editDicRef,
-			// editAttrRef,
-			// editFunRef,
-			// editEventRef,
-			// editTabRef,
             submit,
 			...toRefs(props),
 			...toRefs(state),