Kaynağa Gözat

修改请求地址

Zt 1 yıl önce
ebeveyn
işleme
e12f12cdd3

+ 6 - 3
reado-app/components/ecahrts/dataQuery.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="charts-box">
-		<qiun-data-charts type="line" :opts="opts" :chartData="chartData" />
+		<qiun-data-charts type="line" :opts="opts" :chartData="chartData" :onzoom="true" :ontouch="true"/>
 	</view>
 </template>
 
@@ -19,10 +19,12 @@
 						"#ea7ccc"
 					],
 					padding: [15, 10, 0, 15],
-					enableScroll: false,
+					enableScroll: true,
 					legend: {},
 					xAxis: {
-						disableGrid: true
+						disableGrid: true,
+						itemCount:5,
+						scrollShow:true,
 					},
 					yAxis: {
 						gridType: "dash",
@@ -50,6 +52,7 @@
 					categories: time,
 					series: this.service
 				};
+				// this.opts.xAxis.itemCount=this.service[0].data.length
 				this.chartData = JSON.parse(JSON.stringify(res));
 			},
 		}

+ 9 - 0
reado-app/pages/reportForm/report-detail/index.vue

@@ -23,6 +23,7 @@
 			this.id = options.id
 			this.title = options.title
 			this.src = `/static/webview/report-wv.html?id=${this.id}`
+			// this.getReportTable()
 		},
 		onReady() {
 			setTimeout(() => {
@@ -38,6 +39,14 @@
 					url: '/pages/reportForm/index'
 				});
 			},
+			//报表详情
+			getReportTable(){
+				uni.$http.get('/reportTable/getReportTableById', {
+					id: this.id
+				}).then(res => {
+					console.log(res, 'res');
+				})
+			}
 		}
 	}
 </script>

+ 1 - 1
reado-app/static/luckysheet/dist/luckysheet.umd.js

@@ -66980,7 +66980,7 @@ field\u53EF\u4EE5\u662F\u8207database\u7B2C\u4E00\u884C\u4E2D\u67D0\u500B\u5217\
 			.strokeStyle = Sl.strokeStyle, b.stroke(), b.closePath(), v.get(0).toDataURL("image/png")
 	}
 
-	function Be0( e, n = {}) {
+	function Be0(e, n = {}) {
 		let {
 			range: t = h.luckysheet_select_save[h.luckysheet_select_save.length - 1]
 		} = Ue({}, n);

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
reado-app/static/webview/plugins/axios.min.js


+ 9 - 2
reado-app/static/webview/record-wv.html

@@ -36,8 +36,15 @@
 					console.log('当前环境:' + JSON.stringify(res));
 					const id = window.location.search.split('?id=')[1]
 					$.ajax({
-						url: "http://192.168.0.40:8081/reportTable/getReportTableById/" + id,
+						url: "/reportTable/getReportTableById/" + id,
 						type: 'GET',
+						beforeSend: function() {
+							getUserIP(function(ip) {
+								console.log("得到的本地IP :" + ip);
+								this.url = "http://" + ip +
+									":8081/reportTable/getReportTableById/" + this.id
+							});
+						},
 						success: function(res) {
 							if (res.code === 200) {
 								const tableData = JSON.parse(res.data.reportTableData)
@@ -64,4 +71,4 @@
 		</script>
 
 	</body>
-</html>
+</html>

+ 467 - 204
reado-app/static/webview/report-wv.html

@@ -26,13 +26,79 @@
 			.layui-laypage-em {
 				background-color: #1e9fff !important;
 			}
+
+			.model {
+				width: 100%;
+				height: 100%;
+				background: rgba(0, 0, 0, 0.3);
+				position: fixed;
+				z-index: 9999;
+			}
+
+			.table-box {
+				width: 300px;
+				height: 300px;
+				background: #ffffff;
+				margin: auto;
+				position: absolute;
+				top: 0;
+				left: 0;
+				right: 0;
+				bottom: 0;
+				padding: 10px;
+				overflow-y: auto;
+			}
+
+			.head {
+				display: flex;
+				justify-content: flex-end;
+				font-size: 20px;
+				font-weight: bold;
+				color: #000000;
+			}
+
+			.cel {
+				cursor: pointer;
+			}
+
+			#table {
+				width: 100%;
+				margin-top: 20px;
+				font-size: 18px;
+			}
+
+			#table tr {
+				width: 100%;
+				height: 30px;
+			}
+
+			#table td {
+				border-bottom: 1px solid #000000;
+				border-top: 1px solid #000000;
+				padding: 5px;
+			}
 		</style>
 	</head>
 	<body>
 		<div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;height:90%;left: 0px;top: 0px;">
 		</div>
 
-		<table id="demo" lay-filter="test"></table>
+		<!-- <table id="demo" lay-filter="test"></table> -->
+		<div class="model" style="display: none;">
+			<div class="table-box">
+				<div class="head">
+					<!-- <div>运行记录</div> -->
+					<div class="cel">×</div>
+				</div>
+				<table id="table">
+					<tr>
+						<th>
+							运行内容
+						</th>
+					</tr>
+				</table>
+			</div>
+		</div>
 
 		<div class="la-btn">
 			<button id="recordBtn" type="button" class="layui-btn layui-btn-normal layui-btn-sm btn">运行记录</button>
@@ -52,160 +118,320 @@
 
 		<!-- uni 的 SDK -->
 		<script type="text/javascript" src="https://unpkg.com/@dcloudio/uni-webview-js@0.0.3/index.js"></script>
+		<script src="./wvIP.js"></script>
+
+		<script src="./plugins/axios.min.js"></script>
+
 		<script>
 			$(function() {
 				document.addEventListener('UniAppJSBridgeReady', function() {
 					uni.getEnv(function(res) {
 						console.log('当前环境:' + JSON.stringify(res));
 						const id = window.location.search.split('?id=')[1]
-						$.ajax({
-							url: "http://192.168.0.40:8081/reportTable/getReportTableById",
-							type: 'GET',
-							data: {
-								id: id
-							},
-							success: function(res) {
-								if (res.code === 200) {
-									console.log(res.data, 'res.data');
-									// 报表数据
-									let tableData = JSON.parse(res.data.reportTableData)
-									let option = tableData.option
-									console.log(tableData, 'jsonData')
-									// 基础数据项值
-									let baseItem = tableData.baseItem
-									// 数据项
-									let reportTableItemList = res.data.reportTableItemList
-									let reportChartList = res.data.reportChartList
-									// 报表类型
-									let reportTableType = res.data.reportTableType
-
-									let luckysheetOption = {
-										container: 'luckysheet', // 设定 DOM 容器的 id
-										title: '报表模板', // 设定表格名称
-										lang: 'zh', // 设定表格语言
-										showinfobar: false, // 是否显示顶部信息栏
-										showtoolbar: false, // 是否显示工具栏
-										showtoolbarConfig: {
-											paintFormat: true, //格式刷
-											moreFormats: true, // 单元格格式
-											font: true, // 字体
-											fontSize: true, // 字号大小
-											bold: true, // 粗体 (Ctrl+B)
-											italic: true, // 斜体 (Ctrl+I)
-											strikethrough: true, // 删除线 (Alt+Shift+5)
-											underline: true, // 下划线 (Alt+Shift+6)
-											textColor: true, // 文本颜色
-											fillColor: true, // 单元格颜色
-											border: true, // 边框
-											mergeCell: true, // 合并单元格
-											horizontalAlignMode: true, // 水平对齐方式
-											verticalAlignMode: true, // 垂直对齐方式
-											function: true, // 公式
-											// image: true
-											// chart: true
-										},
-										showsheetbar: false, // 是否显示底部 sheet 页按钮
-										sheetFormulaBar: false, // 是否显示公式
-										row: 120, // 是否显示底部 sheet 页按钮
-										data: [{
-											"name": "统计报表", //工作表名称
-										}],
-										cellRightClickConfig: { // 自定义配置单元格右击菜单
-											copy: true, // 复制
-											copyAs: false, // 复制为
-											paste: true, // 粘贴
-											insertRow: true, // 插入行
-											insertColumn: true, // 插入列
-											deleteRow: true, // 删除选中行
-											deleteColumn: true, // 删除选中列
-											deleteCell: false, // 删除单元格
-											hideRow: false, // 隐藏选中行和显示选中行
-											hideColumn: false, // 隐藏选中列和显示选中列
-											rowHeight: true, // 行高
-											columnWidth: true, // 列宽
-											clear: false, // 清除内容
-											matrix: false, // 矩阵操作选区
-											sort: false, // 排序选区
-											filter: false, // 筛选选区
-											chart: true, // 图表生成
-											image: false, // 插入图片
-											link: false, // 插入链接
-											data: false, // 数据验证
-											cellFormat: false // 设置单元格格式
-										},
-										plugins: ['chart']
-									}
 
-									if (!option) {
-										option = JSON.parse(JSON.stringify(luckysheetOption))
-									}
-									option.data = tableData.data
-									// 设置工作表保护
-									option.data[0].config.authority = {
-										sheet: 1, // 如果为 1 或 true,则该工作表受到保护;如果为 0 或 false,则该工作表不受保护。
-										hintText: '该工作表受到保护,无法操作', // 弹窗提示的文字
-									}
-									// 关闭右键菜单
-									option.cellRightClickConfig.chart = false
-									option.cellRightClickConfig.columnWidth = false
-									option.cellRightClickConfig.rowHeight = false
-									option.cellRightClickConfig.deleteColumn = false
-									option.cellRightClickConfig.deleteRow = false
-									option.cellRightClickConfig.insertColumn = false
-									option.cellRightClickConfig.insertRow = false
-									// 关闭工具栏
-									option.showtoolbar = false
-									option.enableAddRow = false
-									option.showtoolbarConfig = {
-										bold: false,
-										border: false,
-										fillColor: false,
-										font: false,
-										fontSize: false,
-										function: false,
-										horizontalAlignMode: false,
-										italic: false,
-										mergeCell: false,
-										moreFormats: false,
-										paintFormat: false,
-										strikethrough: false,
-										textColor: false,
-										underline: false,
-										verticalAlignMode: false
-									}
-									// 钩子函数
-									option.hook = {
-										workbookCreateAfter() {
-											// 图表操作
-											for (let i in reportChartList) {
-												insertEChartInfo(reportChartList[i])
-											}
-											// option.data.forEach((data, i) => {
-											//   if (data.chart && data.chart.length > 0) {
-											//     data.chart.forEach((chart, j) => {
-											//       console.log(chart.chart_id)
-											//       let dom = document.getElementById(chart.chart_id + '_c')
-											//       if (dom) dom.style.display = 'none'
-											//     })
-											//   }
-											// })
-											// 绘制基础数据项
-											drawBaseInfo(baseItem)
-											// 绘制数据值
-											drawTableData(reportTableItemList,
-												reportTableType)
-											luckysheet.setRangeShow('BH1')
-											convertChart(tableData)
-											printExcel()
+						// axios.defaults.baseURL = "http://192.168.0.40:8081"
+						getUserIP(function(ip) {
+							axios.defaults.baseURL = "http://" + ip + ":8081"
+						});
+
+						axios.get('/reportTable/getReportTableById?id=' + id).then(res => {
+							console.log(res, 'res');
+							const data = res.data
+							if (data.code === 200) {
+								// 报表数据
+								let tableData = JSON.parse(data.data.reportTableData)
+								let option = tableData.option
+								// 基础数据项值
+								let baseItem = tableData.baseItem
+								// 数据项
+								let reportTableItemList = data.data.reportTableItemList
+								let reportChartList = data.data.reportChartList
+								// 报表类型
+								let reportTableType = data.data.reportTableType
+
+								let luckysheetOption = {
+									container: 'luckysheet', // 设定 DOM 容器的 id
+									title: '报表模板', // 设定表格名称
+									lang: 'zh', // 设定表格语言
+									showinfobar: false, // 是否显示顶部信息栏
+									showtoolbar: false, // 是否显示工具栏
+									showtoolbarConfig: {
+										paintFormat: true, //格式刷
+										moreFormats: true, // 单元格格式
+										font: true, // 字体
+										fontSize: true, // 字号大小
+										bold: true, // 粗体 (Ctrl+B)
+										italic: true, // 斜体 (Ctrl+I)
+										strikethrough: true, // 删除线 (Alt+Shift+5)
+										underline: true, // 下划线 (Alt+Shift+6)
+										textColor: true, // 文本颜色
+										fillColor: true, // 单元格颜色
+										border: true, // 边框
+										mergeCell: true, // 合并单元格
+										horizontalAlignMode: true, // 水平对齐方式
+										verticalAlignMode: true, // 垂直对齐方式
+										function: true, // 公式
+										// image: true
+										// chart: true
+									},
+									showsheetbar: false, // 是否显示底部 sheet 页按钮
+									sheetFormulaBar: false, // 是否显示公式
+									row: 120, // 是否显示底部 sheet 页按钮
+									data: [{
+										"name": "统计报表", //工作表名称
+									}],
+									cellRightClickConfig: { // 自定义配置单元格右击菜单
+										copy: true, // 复制
+										copyAs: false, // 复制为
+										paste: true, // 粘贴
+										insertRow: true, // 插入行
+										insertColumn: true, // 插入列
+										deleteRow: true, // 删除选中行
+										deleteColumn: true, // 删除选中列
+										deleteCell: false, // 删除单元格
+										hideRow: false, // 隐藏选中行和显示选中行
+										hideColumn: false, // 隐藏选中列和显示选中列
+										rowHeight: true, // 行高
+										columnWidth: true, // 列宽
+										clear: false, // 清除内容
+										matrix: false, // 矩阵操作选区
+										sort: false, // 排序选区
+										filter: false, // 筛选选区
+										chart: true, // 图表生成
+										image: false, // 插入图片
+										link: false, // 插入链接
+										data: false, // 数据验证
+										cellFormat: false // 设置单元格格式
+									},
+									plugins: ['chart']
+								}
+
+								if (!option) {
+									option = JSON.parse(JSON.stringify(luckysheetOption))
+								}
+								option.data = tableData.data
+								// 设置工作表保护
+								option.data[0].config.authority = {
+									sheet: 1, // 如果为 1 或 true,则该工作表受到保护;如果为 0 或 false,则该工作表不受保护。
+									hintText: '该工作表受到保护,无法操作', // 弹窗提示的文字
+								}
+
+								// 关闭右键菜单
+								option.cellRightClickConfig.chart = false
+								option.cellRightClickConfig.columnWidth = false
+								option.cellRightClickConfig.rowHeight = false
+								option.cellRightClickConfig.deleteColumn = false
+								option.cellRightClickConfig.deleteRow = false
+								option.cellRightClickConfig.insertColumn = false
+								option.cellRightClickConfig.insertRow = false
+								// 关闭工具栏
+								option.showtoolbar = false
+								option.enableAddRow = false
+								option.showtoolbarConfig = {
+									bold: false,
+									border: false,
+									fillColor: false,
+									font: false,
+									fontSize: false,
+									function: false,
+									horizontalAlignMode: false,
+									italic: false,
+									mergeCell: false,
+									moreFormats: false,
+									paintFormat: false,
+									strikethrough: false,
+									textColor: false,
+									underline: false,
+									verticalAlignMode: false
+								}
+								// 钩子函数
+								option.hook = {
+									workbookCreateAfter() {
+										// 图表操作
+										for (let i in reportChartList) {
+											insertEChartInfo(reportChartList[i])
 										}
+										// option.data.forEach((data, i) => {
+										//   if (data.chart && data.chart.length > 0) {
+										//     data.chart.forEach((chart, j) => {
+										//       console.log(chart.chart_id)
+										//       let dom = document.getElementById(chart.chart_id + '_c')
+										//       if (dom) dom.style.display = 'none'
+										//     })
+										//   }
+										// })
+										// 绘制基础数据项
+										drawBaseInfo(baseItem)
+										// 绘制数据值
+										drawTableData(reportTableItemList,
+											reportTableType)
+										luckysheet.setRangeShow('BH1')
+										convertChart(tableData)
+										printExcel()
 									}
-									luckysheet.create(option)
-								} else {
-									layer.msg(res.msg);
 								}
+								luckysheet.create(option)
+							} else {
+
 							}
 						})
 
+						// $.ajax({
+						// 	url: "http://192.168.0.40:8081/reportTable/getReportTableById",
+						// 	type: 'GET',
+						// 	data: {
+						// 		id: id
+						// 	},
+						// 	// beforeSend: function() {
+						// 	// 	getUserIP(function(ip) {
+						// 	// 		console.log("得到的本地IP :" + ip);
+						// 	// 		this.url = "http://" + ip +
+						// 	// 			":8081/reportTable/getReportTableById"
+						// 	// 	});
+						// 	// },
+						// 	success: function(res) {
+						// 		if (res.code === 200) {
+						// 			console.log(res.data, 'res.data');
+						// 			// 报表数据
+						// 			let tableData = JSON.parse(res.data.reportTableData)
+						// 			let option = tableData.option
+						// 			console.log(tableData, 'jsonData')
+						// 			// 基础数据项值
+						// 			let baseItem = tableData.baseItem
+						// 			// 数据项
+						// 			let reportTableItemList = res.data.reportTableItemList
+						// 			let reportChartList = res.data.reportChartList
+						// 			// 报表类型
+						// 			let reportTableType = res.data.reportTableType
+
+						// 			let luckysheetOption = {
+						// 				container: 'luckysheet', // 设定 DOM 容器的 id
+						// 				title: '报表模板', // 设定表格名称
+						// 				lang: 'zh', // 设定表格语言
+						// 				showinfobar: false, // 是否显示顶部信息栏
+						// 				showtoolbar: false, // 是否显示工具栏
+						// 				showtoolbarConfig: {
+						// 					paintFormat: true, //格式刷
+						// 					moreFormats: true, // 单元格格式
+						// 					font: true, // 字体
+						// 					fontSize: true, // 字号大小
+						// 					bold: true, // 粗体 (Ctrl+B)
+						// 					italic: true, // 斜体 (Ctrl+I)
+						// 					strikethrough: true, // 删除线 (Alt+Shift+5)
+						// 					underline: true, // 下划线 (Alt+Shift+6)
+						// 					textColor: true, // 文本颜色
+						// 					fillColor: true, // 单元格颜色
+						// 					border: true, // 边框
+						// 					mergeCell: true, // 合并单元格
+						// 					horizontalAlignMode: true, // 水平对齐方式
+						// 					verticalAlignMode: true, // 垂直对齐方式
+						// 					function: true, // 公式
+						// 					// image: true
+						// 					// chart: true
+						// 				},
+						// 				showsheetbar: false, // 是否显示底部 sheet 页按钮
+						// 				sheetFormulaBar: false, // 是否显示公式
+						// 				row: 120, // 是否显示底部 sheet 页按钮
+						// 				data: [{
+						// 					"name": "统计报表", //工作表名称
+						// 				}],
+						// 				cellRightClickConfig: { // 自定义配置单元格右击菜单
+						// 					copy: true, // 复制
+						// 					copyAs: false, // 复制为
+						// 					paste: true, // 粘贴
+						// 					insertRow: true, // 插入行
+						// 					insertColumn: true, // 插入列
+						// 					deleteRow: true, // 删除选中行
+						// 					deleteColumn: true, // 删除选中列
+						// 					deleteCell: false, // 删除单元格
+						// 					hideRow: false, // 隐藏选中行和显示选中行
+						// 					hideColumn: false, // 隐藏选中列和显示选中列
+						// 					rowHeight: true, // 行高
+						// 					columnWidth: true, // 列宽
+						// 					clear: false, // 清除内容
+						// 					matrix: false, // 矩阵操作选区
+						// 					sort: false, // 排序选区
+						// 					filter: false, // 筛选选区
+						// 					chart: true, // 图表生成
+						// 					image: false, // 插入图片
+						// 					link: false, // 插入链接
+						// 					data: false, // 数据验证
+						// 					cellFormat: false // 设置单元格格式
+						// 				},
+						// 				plugins: ['chart']
+						// 			}
+
+						// 			if (!option) {
+						// 				option = JSON.parse(JSON.stringify(luckysheetOption))
+						// 			}
+						// 			option.data = tableData.data
+						// 			// 设置工作表保护
+						// 			option.data[0].config.authority = {
+						// 				sheet: 1, // 如果为 1 或 true,则该工作表受到保护;如果为 0 或 false,则该工作表不受保护。
+						// 				hintText: '该工作表受到保护,无法操作', // 弹窗提示的文字
+						// 			}
+
+						// 			// 关闭右键菜单
+						// 			option.cellRightClickConfig.chart = false
+						// 			option.cellRightClickConfig.columnWidth = false
+						// 			option.cellRightClickConfig.rowHeight = false
+						// 			option.cellRightClickConfig.deleteColumn = false
+						// 			option.cellRightClickConfig.deleteRow = false
+						// 			option.cellRightClickConfig.insertColumn = false
+						// 			option.cellRightClickConfig.insertRow = false
+						// 			// 关闭工具栏
+						// 			option.showtoolbar = false
+						// 			option.enableAddRow = false
+						// 			option.showtoolbarConfig = {
+						// 				bold: false,
+						// 				border: false,
+						// 				fillColor: false,
+						// 				font: false,
+						// 				fontSize: false,
+						// 				function: false,
+						// 				horizontalAlignMode: false,
+						// 				italic: false,
+						// 				mergeCell: false,
+						// 				moreFormats: false,
+						// 				paintFormat: false,
+						// 				strikethrough: false,
+						// 				textColor: false,
+						// 				underline: false,
+						// 				verticalAlignMode: false
+						// 			}
+						// 			// 钩子函数
+						// 			option.hook = {
+						// 				workbookCreateAfter() {
+						// 					// 图表操作
+						// 					for (let i in reportChartList) {
+						// 						insertEChartInfo(reportChartList[i])
+						// 					}
+						// 					// option.data.forEach((data, i) => {
+						// 					//   if (data.chart && data.chart.length > 0) {
+						// 					//     data.chart.forEach((chart, j) => {
+						// 					//       console.log(chart.chart_id)
+						// 					//       let dom = document.getElementById(chart.chart_id + '_c')
+						// 					//       if (dom) dom.style.display = 'none'
+						// 					//     })
+						// 					//   }
+						// 					// })
+						// 					// 绘制基础数据项
+						// 					drawBaseInfo(baseItem)
+						// 					// 绘制数据值
+						// 					drawTableData(reportTableItemList,
+						// 						reportTableType)
+						// 					luckysheet.setRangeShow('BH1')
+						// 					convertChart(tableData)
+						// 					printExcel()
+						// 				}
+						// 			}
+						// 			luckysheet.create(option)
+						// 		} else {
+						// 			layer.msg(res.msg);
+						// 		}
+						// 	}
+						// })
+
 						function printExcel() {
 							let currentSelected = luckysheet.getRange()
 							luckysheet.hideGridLines()
@@ -228,7 +454,7 @@
 								// 因需要打印左边的边框,需重新设置第一列
 								//RowColumn.column[0] = 0;
 								// 进行选区操作 
-								// luckysheet.setRangeShow("A1:L25");
+								luckysheet.setRangeShow(RowColumn);
 								const cellData = handelCell(luckysheet.getAllSheets()[0].celldata)
 								let {
 									minR,
@@ -453,71 +679,108 @@
 						}
 
 						$('#recordBtn').on('click', () => {
-							layui.use('table', function() {
-								var table = layui.table;
-								var layer = layui.layer;
-
-								layer.open({
-									type: 1,
-									title: '运行记录',
-									content: $('#demo'),
-									offset: ['180px', '45px'],
-									end: function() {
-										$('#demo').hide();
-										$('.layui-table-view').hide()
-									},
-									cancel: function(index, layero) {
-										$('.layui-layer-content')
-											.hide()
-									}
-								});
+							$('.model').show()
 
-								var tableReload = table.render({
-									elem: '#demo',
-									width: 300,
-									page: {
-										elem: '#demo',
-										layout: ['prev', 'page', 'next',
-											'count'
-										]
-									},
-									url: 'http://192.168.0.40:8081/reportTable/getAutoChReportTable',
-									where: {
-										autoTableId: id
-									},
-									text: {
-										none: '暂无数据' //默认:无数据。
-									},
-									cols: [
-										[{
-											field: 'reportTableName',
-											title: null,
-											width: 300
-										}]
-									],
-									parseData: function(res) {
-										return {
-											"code": 0,
-											"msg": res.msg,
-											"count": res.data.count,
-											"data": res.data
-												.reportTableList
-										};
+							$.ajax({
+								type: 'GET',
+								url: "/reportTable/getAutoChReportTable",
+								beforeSend: function() {
+									getUserIP(function(ip) {
+										console.log("得到的本地IP :" + ip);
+										this.url =
+											"http://" + ip +
+											":8081/reportTable/getAutoChReportTable"
+									});
+								},
+								success: function(res) {
+									if (res.code === 200) {
+										$.each(res.data.reportTableList, function(k,
+											v) {
+											$("#table tbody").append(
+												"<tr data-id='1' data-title='123'>" +
+												"<td>" + k +
+												"</td>" +
+												"</tr>" + "<tr >"
+											)
+										})
 									}
-								});
+								}
+							})
 
-								//触发行单击事件
-								table.on('row(test)', function(obj) {
-									const id = obj.data.id
-									const title = obj.data
-										.reportTableName
-									uni.navigateTo({
-										url: `/pages/reportForm/report-detail/recordDetail?id=${id}&title=${title}`
-									})
-								});
 
-								$('th').hide()
-							});
+							// layui.use('table', function() {
+							// 	var table = layui.table;
+							// 	var layer = layui.layer;
+
+							// 	layer.open({
+							// 		type: 1,
+							// 		title: '运行记录',
+							// 		content: $('#demo'),
+							// 		offset: ['180px', '45px'],
+							// 		end: function() {
+							// 			$('#demo').hide();
+							// 			$('.layui-table-view').hide()
+							// 		},
+							// 		cancel: function(index, layero) {
+							// 			$('.layui-layer-content')
+							// 				.hide()
+							// 		}
+							// 	});
+							// 	var tableReload = table.render({
+							// 		elem: '#demo',
+							// 		width: 300,
+							// 		page: {
+							// 			elem: '#demo',
+							// 			layout: ['prev', 'page', 'next',
+							// 				'count'
+							// 			]
+							// 		},
+							// 		// url: 'http://192.168.0.40:8081/reportTable/getAutoChReportTable',
+							// 		where: {
+							// 			autoTableId: id
+							// 		},
+							// 		text: {
+							// 			none: '暂无数据' //默认:无数据。
+							// 		},
+							// 		cols: [
+							// 			[{
+							// 				field: 'reportTableName',
+							// 				title: null,
+							// 				width: 300
+							// 			}]
+							// 		],
+							// 		parseData: function(res) {
+							// 			return {
+							// 				"code": 0,
+							// 				"msg": res.msg,
+							// 				"count": res.data.count,
+							// 				"data": res.data
+							// 					.reportTableList
+							// 			};
+							// 		}
+							// 	});
+							// 	getUserIP(function(ip) {
+							// 		console.log("得到的本地IP :" + ip);
+							// 		tableReload.config.url = "http://" + ip +
+							// 			":8081/reportTable/getAutoChReportTable"
+							// 	});
+
+							// 	//触发行单击事件
+							// 	table.on('row(test)', function(obj) {
+							// 		const id = obj.data.id
+							// 		const title = obj.data
+							// 			.reportTableName
+							// 		uni.navigateTo({
+							// 			url: `/pages/reportForm/report-detail/recordDetail?id=${id}&title=${title}`
+							// 		})
+							// 	});
+
+							// 	$('th').hide()
+							// });
+						})
+
+						$('.cel').on('click', () => {
+							$('.model').hide()
 						})
 					});
 				});

+ 37 - 0
reado-app/static/webview/wvIP.js

@@ -0,0 +1,37 @@
+function getUserIP(onNewIP) { //  onNewIp - your listener function for new IPs
+  // compatibility for firefox and chrome
+  var MyPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection
+  var pc = new MyPeerConnection({
+    iceServers: []
+  })
+  var noop = function() { }
+  var localIPs = {}
+  var ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g
+
+  function iterateIP(ip) {
+    if (!localIPs[ip]) onNewIP(ip)
+    localIPs[ip] = true
+  }
+  // create a bogus data channel
+  pc.createDataChannel('')
+  // create offer and set local description
+  try {
+    pc.createOffer(function(sdp) {
+      sdp.sdp.split('\n').forEach(function(line) {
+        if (line.indexOf('candidate') < 0) return
+        line.match(ipRegex).forEach(iterateIP)
+      })
+
+      pc.setLocalDescription(sdp, noop, noop)
+    }, function(sdp) {
+      console.log('fail')
+    })
+  } catch (err) {
+    console.log(err)
+  }
+  // listen for candidate events
+  pc.onicecandidate = function(ice) {
+    if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return
+    ice.candidate.candidate.match(ipRegex).forEach(iterateIP)
+  }
+}

+ 4 - 4
reado-app/utils/request.js

@@ -2,7 +2,7 @@ import {
 	$http
 } from '@escook/request-miniprogram'
 
-// $http.baseUrl = "http://192.168.0.40:8081"
+$http.baseUrl = "http://192.168.0.40:8081"
 
 uni.$http = $http
 
@@ -16,9 +16,9 @@ import {
 	getUserIP
 } from './getIP.js'
 
-getUserIP((ip) => {
-	$http.baseUrl = 'http://' + ip + ':8081'
-})
+// getUserIP((ip) => {
+// 	$http.baseUrl = 'http://' + ip + ':8081'
+// })
 
 // 请求拦截器
 $http.beforeRequest = function(options) {

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor