Commit 04d91d81 authored by 覃振观's avatar 覃振观 👶

23-12-7: Class panel

parent 1e7f4f57
......@@ -31,16 +31,12 @@ function loadCodeRuleListGrid() {
{ display: "品牌名称", name: "brandName", width: 100, minWidth: 60, type: "string", align: "left" },
{ display: "产品类型", name: "prodcutType", width: 140, minWidth: 60, type: "datetime", align: "left" }
],
dataAction: "server",
dataType: "server",
url: web_app.name + '/product/findProduct.ajax',
parms: {
page: 0,
size: 30
},
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
width: "100%",
width: "50%",
height: "100%",
heightDiff: -8,
checkbox: true,
......@@ -53,6 +49,11 @@ function loadCodeRuleListGrid() {
UICtrl.setSearchAreaToggle(gridManager);
}
// parms: {
// page: 0,
// size: 30
// },
function updateHandler(data) {
var id = data.productId;
if (!id) {
......
$(document).ready(function() {
initializeUI();
initializeToobarContainer();
$('#pageTab').tab();
initializateSelectC();
loadDataTest();
......@@ -14,6 +16,16 @@ function initializateSelectC() {
});
}
function initializeUI() {
UICtrl.layout("#layout",{
leftWidth:6,
rightWidth:6,
allowRightCollapse: false,
allowRightResize: false
});
}
function loadDataTest() {
console.log("loadData")
var params = new URLSearchParams(document.location.search);
......@@ -21,25 +33,12 @@ function loadDataTest() {
Public.ajax(web_app.name + "/product/loadProductDetail.ajax", {
productId: paramsData.productId
}, function (data) {
debugger;
$('#submitForm').formSet(data);
var fronData = {};
fronData.Rows = data.fronColor;
faceGrid("#frontFaceDiv", fronData);
fronData.Rows = data.backColor;
faceGrid("#backFaceDiv", fronData);
// var selectedCategory = data.selectedCategory;
// $("#selectedCategory").ligerComboBox({
// textField: 'productCategoryName',
// valueField: 'productCategoryId',
// columns: [
// { header: 'ID', name: 'productCategoryId', width: 20 },
// { header: '名字', name: 'productCategoryName' }
// ],
// data: selectedCategory,
// selectBoxWidth: 200
// });
fronData.Rows = data.fronColors;
faceGrid("#frontFaceGrid", fronData);
fronData.Rows = data.backColors;
faceGrid("#backFaceGrid", fronData);
});
}
......@@ -47,29 +46,53 @@ function faceGrid(elId, data) {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
updateHandler: function(){
updateHandler();
},
aaHandler: { id: 'ccAA', text: 'Hello', img: 'fa-music', className: 'btn-gray',
click: function () {
alert('hello~!');
}
}
});
gridManager = UICtrl.grid(elId, {
debugger;
var gridManager = UICtrl.grid(elId, {
columns: [
{ display: "颜色名称", name: "productFaceColorId", width: 140, minWidth: 60, type: "string", align: "left" },
{ display: "油墨覆盖率(%)", name: "coverageRate", width: 120, minWidth: 60, type: "string", align: "left" }
],
toolbar: toolbarOptions,
dataAction: "local",
dataType: "local",
data: data, // data 数据结构 data: ("Rows": [ {}, {} ])
checkbox: true,
usePager: true,
pageSize: 20,
usePager: false,
width: "100%",
height: 420,
enabledSort: false,
autoAddRowByKeydown:false,
heightDiff: -10,
fixedCellHeight: true,
selectRowButtonOnly: true,
height: 150,
onDblClickRow : function(data, rowindex, rowobj) {
updateHandler(data);
}
});
}
\ No newline at end of file
}
function initializeToobarContainer(){
$('#toolBarCenter').attr('position','bottom');
//dropup==true 更多按钮向上展示
$('#toolBar').data('dropup',true).removeClass('job-button-fixed-top').addClass('job-button-fixed-bottom');
UICtrl.layout($("#jobPageLayout"), {heightDiff:-2,topHeight:40,bottomHeight:40,onSizeChanged:function(){
}});
}
// checkbox: true,
// enabledSort: false,
// autoAddRowByKeydown:false,
// heightDiff: -10,
// fixedCellHeight: true,
// selectRowButtonOnly: true,
// var selectedCategory = data.selectedCategory;
// $("#selectedCategory").ligerComboBox({
// textField: 'productCategoryName',
// valueField: 'productCategoryId',
// columns: [
// { header: 'ID', name: 'productCategoryId', width: 20 },
// { header: '名字', name: 'productCategoryName' }
// ],
// data: selectedCategory,
// selectBoxWidth: 200
// });
\ No newline at end of file
......@@ -16,15 +16,17 @@
<x:script src='/biz/topsun/product/productDetail.js'/>
</head>
<body>
<div class="container-fluid">
<div class="container-fluid" style="position: relative; display: inline-flex; flex-direction: column; height: 97%;
background-color: #f3f3f4 !important;" >
<%-- style="position: relative; display: inline-flex; flex-direction: column;"--%>
<%-- <x:hidden name="productDetailId" />--%>
<%-- <x:hidden name="productId"/>--%>
<%-- <div class="hg-form-cols">--%>
<%-- <div labelCol="15"> </div>--%>
<%-- </div>--%>
<%-- style="overflow: 98vh;"--%>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="productDetailId" />
<x:hidden name="productId"/>
<div class="hg-form-cols">
<div labelCol="15"> </div>
</div>
<div class="hg-form-row">
<x:title title="基本属性" name="group" hideTable="#info" />
<x:inputC name="productId" required="true" label="产品编码" labelCol="2" maxLength="64" fieldCol="4" />
......@@ -56,17 +58,36 @@
<x:title title="排版参数" name="group" hideTable="#info" />
<x:inputC name="modulus" required="true" label="模数" labelCol="2" maxLength="64" fieldCol="4" />
<x:inputC name="row_num" required="true" label="行数" labelCol="2" maxLength="64" fieldCol="4" />
<div id="frontFaceGrid" style="margin: 2px;"></div>
<div id="frontFaceGrid" style="margin: 2px;"></div>
<div id="layout" style="height: 280px; display: contents;">
<div position="left" title="正面颜色" >
<div id="frontFaceGrid" style="margin: 2px;"></div>
</div>
<div position="right" title="反面颜色">
<div id="backFaceGrid" style="margin: 2px;"></div>
</div>
</div>
<x:title title="产品材质" name="group" hideTable="#info" />
</div>
<div class="layout" id='frontFaceDiv'>
<div class="layout" id='lossFormDiv'>
</div>
<div class="layout" id='backFaceDiv'>
<div class="layout" id='materialListDiv'>
</div>
</div>
</div>
</form>
<div id="toolBarCenter" class="footer" style="background: none repeat scroll 0 0 #fff; border-top: 1px solid #e7eaec;
position: absolute; bottom: 0; width: 100%; display:flex; justify-content:center;">
<%-- style=""--%>
<div id='toolBar' checkAccess="false">
<a> aaa </a>
</div>
</div>
</div>
</body>
</html>
......
......@@ -98,21 +98,23 @@ public class ProductApplicationImpl implements ProductApplication {
if(productDetail != null) {
if(productDetail.getBackProductFaceId() != null) {
ProductFace frontFace = faceRepository.findByProductFaceIdEquals(productDetail.getBackProductFaceId());
ProductFaceColor fronColor = faceColorRepository.findByProductFaceIdEquals(productDetail.getBackProductFaceId());
ArrayList <ProductFaceColor> fronColors =
(ArrayList<ProductFaceColor>) faceColorRepository.findByProductFaceId(productDetail.getBackProductFaceId());
resultMap.put("frontFace", frontFace);
resultMap.put("fronColor", fronColor == null ? new ProductFaceColor() : fronColor);
resultMap.put("fronColors", fronColors == null ? new ArrayList<>() : fronColors);
} else {
ProductFaceColor fc = new ProductFaceColor();
fc.setProductFaceColorId("111");
resultMap.put("fronColor", fc);
ArrayList fronColors = new ArrayList<>();
fronColors.add(fc);
resultMap.put("fronColors", fronColors);
}
if(productDetail.getBackProductFaceId() != null) {
ProductFace backFace = faceRepository.findByProductFaceIdEquals(productDetail.getBackProductFaceId());
ProductFaceColor backColor = faceColorRepository.findByProductFaceIdEquals(productDetail.getBackProductFaceId());
ArrayList <ProductFaceColor> backColors =
(ArrayList<ProductFaceColor>) faceColorRepository.findByProductFaceId(productDetail.getBackProductFaceId());
resultMap.put("backFace", backFace);
resultMap.put("backColor", backColor == null ? new ProductFaceColor() : backColor);
} else {
resultMap.put("backColor", new ProductFaceColor());
resultMap.put("backColors", backColors == null ? new ArrayList<>() : backColors);
}
}
ObjectMapper mapper = new ObjectMapper();
......
......@@ -57,7 +57,6 @@ public class ProductController extends CommonController {
SDO sdo = this.getSDO();
String productId = sdo.getString("id");
Map<String, Object> map = productService.queryDetailAll(Integer.parseInt(productId));
return toResult(map);
}
......
......@@ -3,11 +3,13 @@ package com.huigou.topsun.product.repository;
import com.huigou.topsun.product.domain.ProductFaceColor;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* @Auther: xin.lu
* @author xin.lu
* @Date: 2023/11/22/10:41
* @Description:
*/
public interface ProductFaceColorRepository extends JpaRepository<ProductFaceColor,String> {
ProductFaceColor findByProductFaceIdEquals(String productFaceId);
List<ProductFaceColor> findByProductFaceId(String productFaceId);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment