|
@@ -18,9 +18,10 @@
|
|
<div class="layui-row">
|
|
<div class="layui-row">
|
|
<form class="layui-form layui-form-pane" action="" style="margin-left: 190px;padding: 10px">
|
|
<form class="layui-form layui-form-pane" action="" style="margin-left: 190px;padding: 10px">
|
|
<div class="layui-form-item">
|
|
<div class="layui-form-item">
|
|
- <label class="layui-form-label layui-hide-xs" style="width: 13%">请输入页面对象根目录</label>
|
|
|
|
|
|
+ <label class="layui-form-label layui-hide-xs" style="width: 180px">请输入页面对象根目录</label>
|
|
<div class="layui-input-inline layui-hide-xs" style="width: 45%">
|
|
<div class="layui-input-inline layui-hide-xs" style="width: 45%">
|
|
- <input type="text" name="rootPath" lay-verify="required" placeholder="请输入页面对象根目录" autocomplete="off" class="layui-input">
|
|
|
|
|
|
+ <input type="text" name="rootPath" lay-verify="required" placeholder="请输入页面对象根目录"
|
|
|
|
+ autocomplete="off" class="layui-input">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-mid" style="padding: 0!important;">
|
|
<div class="layui-form-mid" style="padding: 0!important;">
|
|
<button type="button" class="layui-btn" lay-submit lay-filter="formSubmit">立即同步</button>
|
|
<button type="button" class="layui-btn" lay-submit lay-filter="formSubmit">立即同步</button>
|
|
@@ -38,8 +39,9 @@
|
|
<li class="layui-nav-item layui-nav-itemed">
|
|
<li class="layui-nav-item layui-nav-itemed">
|
|
<a href="#">特殊分组</a>
|
|
<a href="#">特殊分组</a>
|
|
<dl class="layui-nav-child">
|
|
<dl class="layui-nav-child">
|
|
- <dd><a class="pageRequest" href="#" data-param="{"elementType": ""}">全部数据</a></dd>
|
|
|
|
- <dd><a class="pageRequest" href="#" data-param="{"elementType": 3}">个人数据</a></dd>
|
|
|
|
|
|
+ <dd><a class="pageRequest" href="#"
|
|
|
|
+ data-param="{"elementType": "","pageID": ""}">全部数据</a></dd>
|
|
|
|
+ <dd><a class="pageRequest" href="#" data-param="{"elementType": 3,"pageID": ""}">个人数据</a></dd>
|
|
</dl>
|
|
</dl>
|
|
</li>
|
|
</li>
|
|
<li class="layui-nav-item">
|
|
<li class="layui-nav-item">
|
|
@@ -50,7 +52,9 @@
|
|
</div>
|
|
</div>
|
|
<script id="itemData" type="text/html">
|
|
<script id="itemData" type="text/html">
|
|
{{# layui.each(d, function(index, item){ }}
|
|
{{# layui.each(d, function(index, item){ }}
|
|
- <dd><a class="pageRequest" href="#" data-param="{"elementType": 0, "pageID": "{{ item.pageID }}"}">{{ item.pageName }}</a></dd>
|
|
|
|
|
|
+ <dd><a class="pageRequest" href="#"
|
|
|
|
+ data-param="{"elementType": 0, "pageID": "{{ item.pageID }}"}">{{
|
|
|
|
+ item.pageName }}</a></dd>
|
|
{{# }); }}
|
|
{{# }); }}
|
|
{{# if(d.length === 0){ }}
|
|
{{# if(d.length === 0){ }}
|
|
<dd><a href="#">未加载到数据</a></dd>
|
|
<dd><a href="#">未加载到数据</a></dd>
|
|
@@ -61,12 +65,48 @@
|
|
<div class="layui-body">
|
|
<div class="layui-body">
|
|
<!-- 内容主体区域 -->
|
|
<!-- 内容主体区域 -->
|
|
<div style="margin: 20px">
|
|
<div style="margin: 20px">
|
|
|
|
+ <form class="layui-row layui-form layui-form-pane" action="">
|
|
|
|
+ <div class="layui-hide layui-form-item">
|
|
|
|
+ <input type="text" name="selectType" value="fuzzy">
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-col-sm12 layui-form-item">
|
|
|
|
+ <div class="layui-inline" style="display: inline">
|
|
|
|
+ <label class="layui-form-label" style="width: 60px;">名称</label>
|
|
|
|
+ <div class="layui-input-inline" style="width: 12%;">
|
|
|
|
+ <input type="text" name="elementName" class="layui-input" placeholder="请输入元素名称">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-inline" style="display: inline">
|
|
|
|
+ <label class="layui-form-label" style="width: 90px;">Android</label>
|
|
|
|
+ <div class="layui-input-inline" style="width: 18%;">
|
|
|
|
+ <input type="text" name="elementAndroidLocate" class="layui-input" placeholder="请输入Android定位关键值">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-inline" style="display: inline">
|
|
|
|
+ <label class="layui-form-label" style="width: 60px;">IOS</label>
|
|
|
|
+ <div class="layui-input-inline" style="width: 18%;">
|
|
|
|
+ <input type="text" name="elementIOSLocate" class="layui-input" placeholder="请输入IOS定位关键值">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-inline" style="display: inline">
|
|
|
|
+ <label class="layui-form-label" style="width: 60px;">备注</label>
|
|
|
|
+ <div class="layui-input-inline" style="width: 12%;">
|
|
|
|
+ <input type="text" name="elementRemark" class="layui-input" placeholder="请输入备注">
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="layui-inline" style="display: inline">
|
|
|
|
+ <button type="button" class="layui-btn mgl-20" lay-submit lay-filter="search"><i class="layui-icon"></i>查询</button>
|
|
|
|
+ <button class="layui-btn layui-btn-primary" type="reset" lay-active="reset">重置</button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </form>
|
|
<table id="myTable" lay-filter="myTable"></table>
|
|
<table id="myTable" lay-filter="myTable"></table>
|
|
<script type="text/html" id="expandAll">
|
|
<script type="text/html" id="expandAll">
|
|
<div class="layui-card" style="margin: 10px;border: 1px solid #f1f2f6;">
|
|
<div class="layui-card" style="margin: 10px;border: 1px solid #f1f2f6;">
|
|
<div class="layui-card-header" style="background-color: #ced6e0">
|
|
<div class="layui-card-header" style="background-color: #ced6e0">
|
|
<h3 style="display: inline">Python代码</h3>
|
|
<h3 style="display: inline">Python代码</h3>
|
|
- <button data-clipboard-target="#{{d.elementName}}" style="display: inline;margin-bottom: 5px;" type="button" class="js-clipboard layui-btn layui-btn-radius layui-btn-primary">
|
|
|
|
|
|
+ <button data-clipboard-target="#{{d.elementName}}" style="display: inline;margin-bottom: 5px;"
|
|
|
|
+ type="button" class="js-clipboard layui-btn layui-btn-radius layui-btn-primary">
|
|
一键复制
|
|
一键复制
|
|
</button>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
@@ -75,18 +115,25 @@
|
|
# {{d.elementRemark}}<br>
|
|
# {{d.elementRemark}}<br>
|
|
<span style="color: #90548c">self</span><span style="color: #a2b1bd">.{{d.elementName}}_locator ={</span><br>
|
|
<span style="color: #90548c">self</span><span style="color: #a2b1bd">.{{d.elementName}}_locator ={</span><br>
|
|
{{# if(typeof d.elementAndroidLocate == 'string' && d.elementAndroidLocate.length > 0){ }}
|
|
{{# if(typeof d.elementAndroidLocate == 'string' && d.elementAndroidLocate.length > 0){ }}
|
|
- <div style="text-indent: 1em"><span style="color: #638655">'Android'</span><span style="color: #a2b1bd">: {</span></div>
|
|
|
|
- <div style="text-indent: 2em"><span style="color: #638655">{{d.elementAndroidLocate}}</span></div>
|
|
|
|
- <div style="text-indent: 1em"><span style="color: #a2b1bd">}</span><span style="color: #cb7530">,</span></div>
|
|
|
|
|
|
+ <div style="text-indent: 1em"><span style="color: #638655">'Android'</span><span
|
|
|
|
+ style="color: #a2b1bd">: {</span></div>
|
|
|
|
+ <div style="text-indent: 2em"><span style="color: #638655">{{d.elementAndroidLocate}}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="text-indent: 1em"><span style="color: #a2b1bd">}</span><span
|
|
|
|
+ style="color: #cb7530">,</span></div>
|
|
{{# } }}
|
|
{{# } }}
|
|
{{# if(typeof d.elementIOSLocate == 'string' && d.elementIOSLocate.length > 0){ }}
|
|
{{# if(typeof d.elementIOSLocate == 'string' && d.elementIOSLocate.length > 0){ }}
|
|
- <div style="text-indent: 1em"><span style="color: #638655">'iOS'</span><span style="color: #a2b1bd">: {</span></div>
|
|
|
|
- <div style="text-indent: 2em"><span style="color: #638655">{{d.elementIOSLocate}}</span></div>
|
|
|
|
|
|
+ <div style="text-indent: 1em"><span style="color: #638655">'iOS'</span><span
|
|
|
|
+ style="color: #a2b1bd">: {</span></div>
|
|
|
|
+ <div style="text-indent: 2em"><span style="color: #638655">{{d.elementIOSLocate}}</span>
|
|
|
|
+ </div>
|
|
<div style="text-indent: 1em"><span style="color: #a2b1bd">}</span></div>
|
|
<div style="text-indent: 1em"><span style="color: #a2b1bd">}</span></div>
|
|
{{# } }}
|
|
{{# } }}
|
|
<span style="color: #a2b1bd">}</span><br>
|
|
<span style="color: #a2b1bd">}</span><br>
|
|
- <span style="color: #90548c">self</span><span style="color: #a2b1bd">.{{d.elementName}} = Element(</span><span style="color: #90548c">self</span><span
|
|
|
|
- style="color: #a2b1bd">.d</span><span style="color: #cb7530">,</span> <span style="color: #90548c">self</span><span
|
|
|
|
|
|
+ <span style="color: #90548c">self</span><span style="color: #a2b1bd">.{{d.elementName}} = Element(</span><span
|
|
|
|
+ style="color: #90548c">self</span><span
|
|
|
|
+ style="color: #a2b1bd">.d</span><span style="color: #cb7530">,</span> <span
|
|
|
|
+ style="color: #90548c">self</span><span
|
|
style="color: #a2b1bd">.{{d.elementName}}_locator)</span><br>
|
|
style="color: #a2b1bd">.{{d.elementName}}_locator)</span><br>
|
|
</h3>
|
|
</h3>
|
|
</div>
|
|
</div>
|
|
@@ -142,12 +189,16 @@
|
|
, $ = layui.$;
|
|
, $ = layui.$;
|
|
|
|
|
|
let clipboard;
|
|
let clipboard;
|
|
|
|
+ let elementType = "";
|
|
|
|
+ let pageID = "";
|
|
|
|
|
|
function menuClick() {
|
|
function menuClick() {
|
|
$(".pageRequest").click(function (data) {
|
|
$(".pageRequest").click(function (data) {
|
|
- const param = data.target.getAttribute("data-param");
|
|
|
|
|
|
+ const param = JSON.parse(data.target.getAttribute("data-param"));
|
|
|
|
+ elementType = param.elementType;
|
|
|
|
+ pageID = param.pageID;
|
|
table.reload('myTable', {
|
|
table.reload('myTable', {
|
|
- where: JSON.parse(param)
|
|
|
|
|
|
+ where: param
|
|
})
|
|
})
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -216,6 +267,26 @@
|
|
return false;
|
|
return false;
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ form.on('submit(search)', function (data) {
|
|
|
|
+ data.field["elementType"] = elementType;
|
|
|
|
+ data.field["pageID"] = pageID;
|
|
|
|
+ table.reload('myTable', {
|
|
|
|
+ where: data.field
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ //处理属性 为 lay-active 的所有元素事件
|
|
|
|
+ util.event('lay-active', {
|
|
|
|
+ reset: function(othis){
|
|
|
|
+ table.reload('myTable', {
|
|
|
|
+ where: {
|
|
|
|
+ elementType : elementType,
|
|
|
|
+ pageID : pageID
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
table.render({
|
|
table.render({
|
|
elem: '#myTable'
|
|
elem: '#myTable'
|
|
, id: 'myTable'
|
|
, id: 'myTable'
|
|
@@ -237,7 +308,14 @@
|
|
, cols: [
|
|
, cols: [
|
|
[
|
|
[
|
|
{title: '#', width: 50, children: '#expandAll', childWidth: 'full'},
|
|
{title: '#', width: 50, children: '#expandAll', childWidth: 'full'},
|
|
- {field: 'elementType', title: '元素状态', width: 140, sort: true, filter: true, templet: '#elementTypeTpl'},
|
|
|
|
|
|
+ {
|
|
|
|
+ field: 'elementType',
|
|
|
|
+ title: '元素状态',
|
|
|
|
+ width: 140,
|
|
|
|
+ sort: true,
|
|
|
|
+ filter: true,
|
|
|
|
+ templet: '#elementTypeTpl'
|
|
|
|
+ },
|
|
{field: 'elementName', title: '元素名', width: 200, sort: true, filter: true},
|
|
{field: 'elementName', title: '元素名', width: 200, sort: true, filter: true},
|
|
{field: 'elementAndroidLocate', title: '元素Android端定位值', width: 485, sort: true, filter: true},
|
|
{field: 'elementAndroidLocate', title: '元素Android端定位值', width: 485, sort: true, filter: true},
|
|
{field: 'elementIOSLocate', title: '元素IOS端定位值', width: 485, sort: true, filter: true},
|
|
{field: 'elementIOSLocate', title: '元素IOS端定位值', width: 485, sort: true, filter: true},
|
|
@@ -260,6 +338,7 @@
|
|
|
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
</body>
|
|
</body>
|
|
</html>
|
|
</html>
|