详细解释一下这段代码,尤其是跨域调用主要在哪里体现<template> <div> <div class="wrap"> <el-table :data="orders"> <el-table-column prop="oid" label="订单编号" width="180" /> <el-table-column prop="ctime" label="创建时间" width="180" /> <el-table-column p
时间: 2023-10-26 22:07:36 浏览: 153
该代码是一个Vue组件,包含了一个表格组件el-table和三个表格列组件el-table-column。其中,表格数据绑定在orders变量上,表格列组件定义了表格的列名和对应的数据字段。
跨域调用主要在哪里体现需要查看具体的后端接口代码,该前端代码只是展示了一个表格,数据来自于后端接口。如果后端接口和前端页面不在同一个域名下,则需要进行跨域访问。但是该前端代码没有体现跨域调用,因此无法解释跨域调用的具体实现。
相关问题
handleExport 导出方法中,StartTime 和 EndTime 等参数,在后端无法获取,请帮我检查,并修改: 前端代码: <template> <div class="mainbody"> <dt-location :data="[{title:'报告管理'},{title:'车辆报告'}]"></dt-location> <dt-toolbar-box> <template #default> <div class="list-box"> <div class="l-list"> <el-button-group> <el-button icon="Plus" @click="$common.linkUrl('/vinReport/edit')">查询</el-button> <el-button icon="Download" @click="handleExport">导出Excel</el-button> <!-- <el-button icon="Delete" @click="deleteCheckAll">删除</el-button> --> </el-button-group> </div> <div class="r-list"> <div class="search-box"> <el-input placeholder="输入关健字" v-model="datas.keyword" @clear="initData" @keyup.enter.native="initData" clearable> <template #append> <el-button icon="Search" @click="initData"></el-button> </template> </el-input> </div> </div> </div> </template> <template #more> <div class="more-box"> <dl>
<think>好的,我现在需要解决用户在Vue项目中,使用el-button的handleExport方法导出数据时,后端无法接收到StartTime和EndTime参数的问题。首先,我得理清楚用户的问题场景。用户在前端通过点击按钮触发导出,但后端没有正确接收到这两个时间参数。这可能涉及到前端传递参数的方式、请求的配置以及后端接口的接收方法等多个方面。
首先,我应该检查前端代码中的handleExport方法。用户提到使用的是Vue和Element UI的el-button组件,因此导出功能可能通过axios或其他HTTP库发送请求。常见的问题可能包括参数没有正确附加到请求中,或者请求方法使用不当导致参数传递方式错误。
常见的参数传递方式有两种:GET请求的查询参数(query parameters)和POST请求的请求体(body)。但导出功能通常使用GET请求,因为浏览器可以直接处理文件下载。不过,如果是POST请求,可能需要检查参数是否以正确的格式发送,比如JSON或者FormData。
接下来,我需要考虑以下几点:
1. **请求方法是否正确**:如果后端接口期望的是GET请求,而前端使用了POST,那么参数可能不会被正确接收。反之亦然。
2. **参数传递的位置**:GET请求的参数应该放在URL的查询字符串中,而POST请求的参数通常在请求体中。需要确认前端代码是否正确地将参数放在对应的位置。
3. **参数格式是否正确**:例如,时间参数的格式是否符合后端要求,比如ISO字符串或其他格式,是否需要进行编码处理。
4. **后端接口的接收方式**:后端是否从查询参数或请求体中正确解析这些参数。例如,在Spring Boot中,@RequestParam用于GET参数,@RequestBody用于POST的JSON数据。
5. **浏览器开发者工具检查**:通过查看网络请求,确认参数是否确实被发送出去,以及发送的格式是否正确。这一步非常关键,可以快速定位问题所在。
可能的解决方案包括:
- 如果使用GET请求,确保参数以查询字符串形式附加到URL,例如使用axios的params配置项。
- 如果使用POST请求,确保参数以正确的格式(如JSON或FormData)发送,并且请求头Content-Type设置正确。
- 检查后端接口是否需要参数以特定的方式接收,比如通过路由参数、查询参数或请求体,并相应调整前端代码。
此外,还需要考虑是否有跨域问题(CORS)导致请求被拦截,但根据问题描述,后端能接收到请求但缺少特定参数,因此更可能是参数传递方式的问题。
现在,我应该给出具体的代码示例,说明如何正确传递参数。例如,在GET请求中,使用axios的params;在POST请求中,使用data属性,并设置正确的Content-Type。同时,提醒用户检查时间参数的格式是否符合后端的要求,比如使用toISOString()转换为字符串。
最后,建议用户使用浏览器开发者工具的网络面板检查发出的请求详情,确认参数是否正确携带,这有助于进一步调试。如果问题仍然存在,可能需要检查后端代码,确认参数解析逻辑是否正确。</think>在Vue+ElementUI项目中解决导出参数传递问题,可通过以下步骤排查和修复:
### 一、基础代码示例
```vue
<el-button @click="handleExport">导出数据</el-button>
<script>
export default {
methods: {
async handleExport() {
try {
const params = {
StartTime: this.searchForm.startTime, // 时间选择器绑定的值
EndTime: this.searchForm.endTime
};
const res = await this.$axios({
method: 'post', // 或根据接口要求使用'get'
url: '/api/export',
params, // GET请求使用params(追加到URL)
data: params, // POST请求使用data(请求体)
responseType: 'blob'
});
// 文件下载处理...
} catch (error) {
console.error('导出失败', error);
}
}
}
}
</script>
```
### 二、关键问题排查点
1. **请求方法类型验证**
- 打开浏览器开发者工具 > Network标签
- 观察导出请求的Method类型(GET/POST)
- 查看请求参数位置:
* GET请求参数显示在Query String Parameters
* POST请求参数显示在Request Payload/FormData
2. **参数格式处理**
```javascript
// 日期格式处理建议(moment.js示例)
params.StartTime = moment(this.searchForm.startTime).format('YYYY-MM-DD HH:mm:ss')
```
3. **Content-Type配置**
```javascript
// 当需要发送FormData时
const formData = new FormData();
formData.append('StartTime', params.StartTime);
formData.append('EndTime', params.EndTime);
this.$axios.post('/api/export', formData, {
headers: {
'Content-Type': 'multipart/form-data' // 根据接口要求选择
}
})
```
### 三、常见解决方案
| 场景 | 前端代码 | 后端接收方式 |
|------|---------|-------------|
| GET请求 | `method: 'get', params: params` | SpringBoot: `@RequestParam` |
| POST-JSON | `method: 'post', data: params` | SpringBoot: `@RequestBody` |
| POST-FORM | `FormData + multipart/form-data` | SpringBoot: `@RequestParam` |
### 四、调试技巧
1. 在浏览器Network面板检查实际发送的请求参数
2. 使用Postman模拟请求,确认接口正常工作
3. 添加请求拦截器打印日志:
```javascript
this.$axios.interceptors.request.use(config => {
console.log('请求参数:', config.params || config.data);
return config;
});
```
### 五、扩展建议
若使用动态参数,建议采用更健壮的参数处理方式:
```javascript
const buildQueryString = (params) => {
return Object.keys(params)
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
.join('&');
};
// GET请求手动拼接URL
url: `/api/export?${buildQueryString(params)}`
```
[^1]: 关于参数传递方式的差异,RFC7231规范明确指出:GET请求参数应放在URL中,POST请求参数放在请求体中。这种区分是HTTP协议的基础设计原则。
<!-- 地址区域 --> <div class="address-section"> <div class="address-header"> <div class="address-title">收货地址</div> <div class="edit-btn">修改</div> </div> <div class="address-info"> <div class="address-icon"> <i class="fas fa-map-marker-alt"></i> </div> <div class="address-details"> <div class="address-row"> <div class="address-name">广州航海学子</div> <div class="address-phone">134****4658</div> </div> <div class="address-text">广东省广州市黄埔区红山三路101号 广州航海学院</div> </div> </div> </div> <div class="divider"></div> <!-- 商品区域 --> <div class="product-section"> <div class="section-title">商品信息</div> <div class="product-item"> <div class="product-image" > </div> <div class="product-info"> <div class="product-name">大连海参 30头</div> <div class="product-desc">深海野生刺参 无添加 高蛋白 30头</div> <div class="product-price"> <div class="price">¥1218.00</div> <div class="quantity">x1</div> </div> </div> </div> </div> <div class="divider"></div> <!-- 订单信息 --> <div class="order-info"> <div class="section-title">订单信息</div> <div class="info-row"> <div class="info-label">商品总额</div> <div class="info-value">1218.00</div> </div> <div class="info-row"> <div class="info-label">运费</div> <div class="info-value">12.00</div> </div> <div class="info-row"> <div class="info-label">优惠券</div> <div class="info-value">-30.00</div> </div> <div class="total-row"> <div class="total-label">实付款</div> <div class="total-price">¥1200.00</div> </div> </div> <div class="navbar"> <div class="navbar-title">确认订单</div> </div> <!-- 底部操作栏 --> <div class="footer-bar"> <div class="price-summary"> <div class="actual-price">¥100.00</div> </div> <button class="submit-btn">提交订单</button> </div> 如何将图片放入
<think>我们首先需要修改商品区域的HTML结构,将原本的图标(<iclass="fasfa-fish"></i>)替换为图片标签<img>,并设置图片的路径。根据用户提供的引用[1],插入图像的基本方式是使用<img>标签,并通过src属性指定图片路径。修改步骤:1.将原来的图标元素替换为<img>标签。2.为图片设置一个具体的路径(这里假设图片文件名为product.jpg,并且与HTML文件在同一目录下)。3.添加alt属性以提高可访问性(当图片无法显示时,会显示alt文本)。4.为了保持原有的样式,我们可能需要保留或调整class。原代码片段:```<divclass="product-item"><divclass="product-image"><iclass="fasfa-fish"></i><!--需要替换的图标--></div>...</div>```修改后的代码:我们将<i>标签替换为<img>标签,并设置src属性。同时,我们给图片添加一个class(如果需要保留样式,可以使用原class,也可以添加新的class),这里我们保留外层的div的class,将内部的图标替换为图片。注意:由于原结构使用了FontAwesome的图标,现在我们替换为图片,所以需要调整样式以确保布局正常。修改后的商品图片部分代码:```<divclass="product-image"><imgsrc="product.jpg"alt="大连淡干海参500g"></div>```但是,为了确保图片显示合适,我们可能还需要对图片的样式进行一些调整(例如:设置宽度、高度等)。因此,我们可以通过CSS来设置图片样式。建议的CSS样式(可以放在页面的样式部分):```.product-imageimg{width:100%;/*宽度自适应容器*/height:auto;/*高度按比例自适应*/max-height:150px;/*最大高度限制,防止图片过大*/object-fit:cover;/*保持图片比例,覆盖容器*/}```如果图片尺寸不一致,我们也可以固定容器的大小,然后让图片在容器内居中显示等。完整的修改后商品区域代码:```<!--商品区域--><divclass="product-section"><divclass="section-title">商品信息</div><divclass="product-item"><divclass="product-image"><imgsrc="product.jpg"alt="大连淡干海参500g"></div><divclass="product-info"><divclass="product-name">大连淡干海参500g</div><divclass="product-desc">深海野生刺参无添加高蛋白30头</div><divclass="product-price"><divclass="price">¥1218.00</div><divclass="quantity">x1</div></div></div></div></div>```另外,如果图片不是本地文件,而是来自网络,我们可以将src属性设置为图片的URL,例如:```<imgsrc="https://example.com/product.jpg"alt="大连淡干海参500g">```注意:使用网络图片时,要确保该URL是有效的,并且注意图片的加载速度以及跨域问题(如果图片托管在不同域名下,且服务器没有设置允许跨域,则可能无法在本地开发时加载)。如果考虑到动态更新图片(比如从后端获取),那么可以在后期结合JavaScript来动态修改src属性,但现在我们只需要静态插入即可。最后,我们还需要注意原有的图标部分可能有一些样式(如字体大小、颜色等),替换为图片后,可能需要调整外层div的样式,例如设置固定宽高,或者调整布局等,以确保页面美观。因此,我们可能需要调整CSS,例如:```.product-image{width:120px;height:120px;display:flex;align-items:center;justify-content:center;overflow:hidden;}```但具体样式调整需要根据实际效果来定,这里只是提供一个思路。综上所述,修改的核心步骤是替换标签并设置图片路径,然后通过CSS控制图片显示。</think>
以下是在HTML的`product-image`部分正确插入图片标签的方法:
### HTML代码修改步骤
在商品区域的`product-image`部分,将原有的`<i>`图标替换为`<img>`标签,设置图片路径:
```html
<!-- 商品区域 -->
<div class="product-section">
<div class="section-title">商品信息</div>
<div class="product-item">
<div class="product-image">
<!-- 替换这里 - 从图标改为图片标签 -->
<img src="images/product.jpg" alt="大连淡干海参 500g">
</div>
<div class="product-info">
<div class="product-name">大连淡干海参 500g</div>
<div class="product-desc">深海野生刺参 无添加 高蛋白 30头</div>
<div class="product-price">
<div class="price">¥1218.00</div>
<div class="quantity">x1</div>
</div>
</div>
</div>
</div>
```
### 关键说明
1. **图片路径设置**:
- 相对路径:`src="images/product.jpg"`(推荐:将图片放在`images`文件夹)
- 绝对路径:`src="/images/product.jpg"`(从网站根目录开始)
- 网络URL:`src="https://example.com/images/product.jpg"`
2. **alt属性**:
`alt="大连淡干海参 500g"` 为图片提供替代文本,这对SEO和屏幕阅读器用户很重要
3. **CSS样式建议**:
```css
.product-image img {
width: 100%; /* 宽度自适应容器 */
height: auto; /* 高度按比例自适应 */
max-height: 150px; /* 限制最大高度 */
object-fit: cover; /* 保持比例,裁剪多余部分 */
border-radius: 8px; /* 圆角效果 */
}
```
4. **响应式图片优化**:
```html
<picture>
<source srcset="product-large.jpg" media="(min-width: 1200px)">
<source srcset="product-medium.jpg" media="(min-width: 768px)">
<img src="product-small.jpg" alt="大连淡干海参">
</picture>
```
### 完整代码预览
```html
<!-- 商品区域 -->
<div class="product-section">
<div class="section-title">商品信息</div>
<div class="product-item">
<div class="product-image">
<img src="images/product.jpg" alt="大连淡干海参 500g"
class="product-image">
</div>
<div class="product-info">
<div class="product-name">大连淡干海参 500g</div>
<div class="product-desc">深海野生刺参 无添加 高蛋白 30头</div>
<div class="product-price">
<div class="price">¥1218.00</div>
<div class="quantity">x1</div>
</div>
</div>
</div>
</div>
```
**注意事项**:
1. 确保图片文件路径正确
2. 推荐使用JPEG/JPG格式(适合照片类内容)
3. 文件名避免使用中文和空格
4. 使用图片压缩工具优化加载速度
5. Alt文本应准确描述图片内容(不超过125字符)
阅读全文
相关推荐







look54.php:
<?php
session_start();
require "../db54.php";
if(!isset($_SESSION["username"])) {
header("Location: ../login54.php");
exit;
}
$user = $_SESSION["username"];
?>
<!DOCTYPE html>
<html>
<head>
<title>我的购物车</title>
<style>
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px; text-align: left; border-bottom: 1px solid #ddd; }
img { max-width: 100px; }
</style>
<script>
function openme(row) {
row.style.backgroundColor = "#FFFFCC";
}
function closeme(row) {
row.style.backgroundColor = (row.rowIndex % 2 == 1 ? "#F0F0F0" : "");
}
function op(button, id) {
// Implement quantity increase/decrease logic
}
function select_all() {
// Implement select all checkboxes
}
function reset_all() {
// Implement reset all checkboxes
}
function delete_all() {
// Implement delete selected items
}
function na() {
return confirm("确定要移除该商品吗?");
}
function op(t,id) {
value=t.value; //按钮上显示的文字
if(value=='+') { //带参数跳转,兼容Google.ie
parent.top.window.location="look54.php?op=add&id="+id;
}
if(value=='-') {
parent.top.window.location="look54.php?op=sub&id="+id;
}
}
</script>
</head>
<body>
我的购物车
<?php
// 显示当前用户信息 - 统一使用username
if(isset($_SESSION['username'])) {
echo "查看购物车 | 当前用户:" . htmlspecialchars($user) . "";
?>
<form name="cartForm" method="post">
选择
商品名称
商品图片
订阅数量
单价
操作
<?php
// 处理"拿掉该商品"超链接删除
if(isset($_GET['id']) && $_GET["op"]=="移除") {
$id = $_GET['id'];
$sql = "DELETE FROM dingdan54 WHERE id = $id";
if($db54->write($sql)) {
echo "<script>alert('拿掉商品成功!')</script>";
} else {
echo "<script>alert('拿掉商品失败!')</script>";
echo "<script>location.href('look54.php')</script>";
}
}
// 处理增减按钮+-操作
if(isset($_GET["op"])) {
$op = $_GET["op"];
$id = $_GET['id'];
// 获取当前数量
$sql = "SELECT * FROM dingdan54 WHERE id = $id";
$result = $db54->read($sql);
if(count($result) > 0) {
$current_num = $result[0]['num'];
if($op == "add") {
$new_num = $current_num + 1;
} elseif($op == "sub" && $current_num > 1) {
$new_num = $current_num - 1;
} else {
$new_num = $current_num;
}
// 更新数量
$update_sql = "UPDATE dingdan54 SET num = $new_num WHERE id = $id";
$db54->write($update_sql);
}
}
// 处理"拿掉选中商品"按钮
if(isset($_GET["str"])) {
$ids = explode("|", trim($_GET["str"], "|"));
foreach($ids as $id) {
if(is_numeric($id)) {
$sql = "DELETE FROM dingdan54 WHERE id = $id";
$db54->write($sql);
}
}
echo "<script>alert('拿掉商品成功!')</script>";
echo "<script>location.href('look54.php')</script>";
}
// 显示购物车
$cart_sql = "SELECT dingdan54.id AS id, sp54.name AS name, sp54.photo AS photo, SUM(dingdan54.num)
AS total_num, sp54.money AS money FROM sp54
JOIN dingdan54 ON sp54.id = dingdan54.sp_id
WHERE sp54.id = dingdan54.sp_id AND dingdan54.user = '$user' AND dingdan54.flag = 0
GROUP BY sp54.id, sp54.name, sp54.photo, sp54.money";
$cart_result = $db54->read($cart_sql);
$n = count($cart_result);
if ($n == 0) {
echo "购物车是空的! ";
}else{
for ($i = 0; $i < $n; $i++) {
$item = $cart_result[$i];
echo "";
echo "<input type='checkbox' name='flag' value='{$item['id']}'> ";
echo "{$item['name']} ";
echo "![]()
";
echo "<input type='button' name='enter' value='-' onclick='op(this, {$item['id']})'>
<input type='text' name='num{$item['id']}' readonly size='3'
style='text-align:center' value='{$item['total_num']}'>
<input type='button' name='enter' value='+' onclick='op(this, {$item['id']})'> ";
echo "{$item['money']}元 ";
echo "
移除该商品 ";
echo " ";
}
}
?>
<input type="button" name="enter" value="全选" onclick="select_all()">
<input type="button" name="enter" value="全部取消" onclick="reset_all()">
<input type="button" name="enter" value="删除选中商品" onclick="delete_all()">
<?php
$total_sql = "SELECT sp54.money AS money, dingdan54.num AS num
FROM sp54, dingdan54
WHERE sp54.id = dingdan54.sp_id AND dingdan54.user = '$user'
AND dingdan54.flag = 0";
$total_result = $db54->read($total_sql);
$sum = 0;
foreach ($total_result as $item) {
$sum += $item["money"] * $item["num"];
}
echo "应付金额:¥";
echo $sum . " 元";
echo " | 去付款";
?>
</form>
继续购物
<?php } ?>
</body>
</html>
l54.php:
<?php
include('../db54.php');
session_start();
$user_id=$_SESSION["id"]?? 0;
$sql="select * from user54 where id='$user_id'";
$result=$db54->read($sql);
$username=$result[0]["username"];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>信安28班54何雨霏PHP实训</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="all,follow">
</head>
<body>
Nathan AndrewsWeb Developer
BD
Main
何雨霏的留言板
实训页面1
实训页面2
实训页面3
Example dropdown
admin
查看购物车
后台管理
Login page
Demo
6 New
Second menu
admin
查看购物车
后台管理
<?php
?>
信安28班54何雨霏PHP实训 <?php echo $username; ?>
12
You have 6 new messages
4 minutes ago
You have 2 followers
4 minutes ago
Server Rebooted
4 minutes ago
You have 2 followers
10 minutes ago
view all notifications
10
Jason Doesent you a direct message3 days ago at 7:58 pm - 10.06.2019
Frank Williamssent you a direct message3 days ago at 7:58 pm - 10.06.2019
Ashley Woodsent you a direct message3 days ago at 7:58 pm - 10.06.2019
Read all messages
English
German
French
Logout
<?php require "daohang54.php"; ?>
<?php require "look54.php"; ?>
<script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="vendor/popper.js/umd/popper.min.js"> </script>
<script src="https://www.jq22.com/jquery/bootstrap-4.2.1.js"></script>
<script src="js/grasp_mobile_progress_circle-1.0.0.min.js"></script>
<script src="vendor/jquery.cookie/jquery.cookie.js"> </script>
<script src="vendor/chart.js/Chart.min.js"></script>
<script src="vendor/jquery-validation/jquery.validate.min.js"></script>
<script src="vendor/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="js/charts-home.js"></script>
<script src="js/front.js"></script>
</body>
</html>
页面能显示look54的内容,不能显示l54的框架


<template> 欢迎登录 <el-form status-icon ref=“formRef” :rules=“data.rules” :model=“data.form” style=“margin-bottom: 20px;”> <el-form-item prop=“username”> <el-input v-model=“data.form.username” prefix-icon=“User” placeholder=“请输入账号” clearable /> </el-form-item> <el-form-item prop=“password”> <el-input v-model=“data.form.password” prefix-icon=“Lock” placeholder=“请输入密码” show-password clearable /> </el-form-item> {{ role.label }} <el-button @click=“login” type=“primary” class=“login-btn”>登 录</el-button> 还没有账号? 立即注册 </el-form> </template> <script setup> import { reactive, ref } from ‘vue’ import { User, Lock } from ‘@element-plus/icons-vue’ import { ElMessage } from ‘element-plus’ import request from ‘@/utils/request’ import axios from ‘axios’ const roles = [ { label: ‘管理员’, value: ‘ADMIN’ }, { label: ‘教师’, value: ‘TEACHER’ }, { label: ‘学生’, value: ‘STUDENT’ } ] const data = reactive({ form: { role: ‘ADMIN’, username: ‘’, password: ‘’ }, rules: { username: [{ required: true, message: ‘请输入账号’, trigger: ‘blur’ }], password: [{ required: true, message: ‘请输入密码’, trigger: ‘blur’ }] } }) const formRef = ref() const login = () => { formRef.value.validate(async (valid) => { if (!valid) return try { const res = await request.post('/login', data.form) if (res.code === '200') { localStorage.setItem('xm-pro-user', JSON.stringify({ ...res.data, token: res.data.token // 确保token字段存在 })) ElMessage.success('登录成功') // 添加路由跳转容错处理 setTimeout(() => { if (res.data.role === 'ADMIN') { window.location.href = '/' } else { window.location.href = '/front/home' } }, 500) } } catch (error) { ElMessage.error(res.msg) } }) } </script> <template v-if=“!data.user”> <router-link to=“/front/home” class=“nav-item”>首页</router-link> <router-link to=“/courses” class=“nav-item”>视频课程</router-link> <router-link to=“/live” class=“nav-item”>直播课程</router-link> </template> <router-link to=“/login” class=“auth-link”>登录</router-link> | <router-link to=“/register” class=“auth-link”>注册</router-link> 为什么点击登录的时候页面一点反应都没有,也登录不成功,浏览器报错POST http://localhost:8080/login net::ERR_FAILEDUncaught (in promise) ReferenceError: res is not defined

1.使用javascript或者jQuery实现自动发起保存操作,依次检查每一条记录,当1.1发起页面发现有发起按钮可以点击,点击发起按钮,并对按下发起按钮后跳出的弹窗,点击保存按钮,再继续进行下一条操作
1.1发起页面代码
<input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose" title=""> ID 所在校区 巡检计划 巡检结果 巡检图片上传 状态 操作 <input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-type="layTableCheckbox" title=""> <input type="checkbox" value="4/0/repair_inspection_task_manage" name="ids" title=""> 1 广州华南商贸职业学院 华南A计划 保存 查看 发起 <input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-type="layTableCheckbox" title=""> <input type="checkbox" value="3/1/repair_inspection_task_manage" name="ids" title=""> 2 广州华南商贸职业学院 华南A计划 2 流程 查看 Info:Flow Err <input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-type="layTableCheckbox" title=""> <input type="checkbox" value="2/1/repair_inspection_task_manage" name="ids" title=""> 3 广州华南商贸职业学院 华南A计划 2 流程 查看 审核 <input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-type="layTableCheckbox" title=""> <input type="checkbox" value="1/1/repair_inspection_task_manage" name="ids" title=""> 4 广东科技学院松山湖校区 未选择 流程 查看 Info:Flow Err <input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-filter="layTableAllChoose" title=""> <input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-type="layTableCheckbox" title=""> <input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-type="layTableCheckbox" title=""> <input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-type="layTableCheckbox" title=""> <input type="checkbox" name="layTableCheckbox" lay-skin="primary" lay-type="layTableCheckbox" title=""> 操作 查看 发起 查看 Info:Flow Err 查看 审核 查看 Info:Flow Err 1到第<input type="text" min="1" value="1" class="layui-input">页<button type="button" class="layui-laypage-btn">确定</button>共 4 条<select lay-ignore=""><option value="16" selected="">16 条/页</option><option value="30">30 条/页</option><option value="50">50 条/页</option><option value="100">100 条/页</option><option value="200">200 条/页</option></select><style id="LAY-STYLE-DF-table-1">.laytable-cell-1-0-0{width: 40px}.laytable-cell-1-0-1{width: 120px}.laytable-cell-1-0-2{width: 40px}.laytable-cell-1-0-3{width: 120px}.laytable-cell-1-0-4{width: 120px}.laytable-cell-1-0-5{width: 120px}.laytable-cell-1-0-6{width: 120px}.laytable-cell-1-0-7{width: 120px}.laytable-cell-1-0-8{width: 185px}.layui-table-view-1 .layui-table-body .layui-table tr {height: 38px}.layui-table-view-1 .layui-table-body .layui-table tr .layui-table-cell{height: auto; max-height: 37px; white-space: normal; text-overflow: clip;}.layui-table-view-1 .layui-table-body .layui-table tr > td:hover > .layui-table-cell{overflow: auto;}</style>
1.2弹出的弹窗代码
发起<iframe scrolling="auto" allowtransparency="true" id="layui-layer-iframe7" name="layui-layer-iframe7" onload="this.className='';" class="" frameborder="0" src="/https/wenku.csdn.net/gadmin/wf/wfdo.html?act=start&wf_type=repair_inspection_task_manage&wf_fid=4" style="height: 201px;"></iframe>







