Browse Source

管理端 图片展示异常 提交修改

qxp 5 years ago
parent
commit
0fed4dcb82

+ 6 - 6
dgtly-admin/src/main/resources/templates/company/editexamine/approve.html

@@ -202,8 +202,8 @@
                     <label class="col-sm-4 control-label">营业执照:</label>
                     <div class="col-sm-8">
                         <div class="fileinput fileinput-new">
-                            <div class="fileinput-new thumbnail" style="max-width: 140px; max-height: 140px;" onclick="openImg(this)">
-                                <img th:src="@{*{businessLicenseUrl}}" >
+                            <div class="fileinput-new thumbnail" style="width: 140px; height: 140px;" onclick="openImg(this)">
+                                <img th:src="@{*{businessLicenseUrl}}" style=" width: 100%; height: 100%;">
                             </div>
                         </div>
                     </div>
@@ -212,8 +212,8 @@
                     <label class="col-sm-4 control-label">企业默认图片:</label>
                     <div class="col-sm-8">
                         <div class="fileinput fileinput-new">
-                            <div class="fileinput-new thumbnail" style="max-width: 140px; max-height: 140px;" onclick="openImg(this)">
-                                <img th:src="@{*{defaultImgUrl}}" >
+                            <div class="fileinput-new thumbnail" style="width: 140px; height: 140px;" onclick="openImg(this)">
+                                <img th:src="@{*{defaultImgUrl}}" style=" width: 100%; height: 100%;">
                             </div>
                         </div>
                     </div>
@@ -223,8 +223,8 @@
                     <label class="col-sm-4 control-label">企业宣传图片:</label>
                     <div class="col-sm-8">
                         <div class="fileinput fileinput-new">
-                            <div class="fileinput-new thumbnail" style="max-width: 140px; max-height: 140px;" onclick="openImg(this)">
-                                <img th:src="@{*{propagandaImgUrl}}"  >
+                            <div class="fileinput-new thumbnail" style="width: 140px; height: 140px;" onclick="openImg(this)">
+                                <img th:src="@{*{propagandaImgUrl}}"  style=" width: 100%; height: 100%;">
                             </div>
                         </div>
                     </div>

+ 29 - 3
dgtly-admin/src/main/resources/templates/company/enterexamine/approve.html

@@ -121,7 +121,12 @@
                     <div class="form-group">
                         <label class="col-sm-4 control-label">营业执照:</label>
                         <div class="col-sm-8">
-                            <img th:src="*{businessLicenseUrl}" />
+                            <div class="fileinput fileinput-new">
+                                <div class="fileinput-new thumbnail"
+                                     style="width: 140px; height: 140px;" onclick="openImg(this)">
+                                    <img th:src="@{*{businessLicenseUrl}}" id="img-businessLicenseUrl" style=" width: 100%; height: 100%;">
+                                </div>
+                            </div>
                         </div>
                     </div>
                 </div>
@@ -129,7 +134,12 @@
                     <div class="form-group">
                         <label class="col-sm-4 control-label">企业默认图片:</label>
                         <div class="col-sm-8">
-                            <img th:src="*{defaultImgUrl}" />
+                            <div class="fileinput fileinput-new">
+                                <div class="fileinput-new thumbnail"
+                                     style="width: 140px; height: 140px;" onclick="openImg(this)">
+                                    <img th:src="@{*{defaultImgUrl}}" id="img-defaultImgUrl"  style=" width: 100%; height: 100%;">
+                                </div>
+                            </div>
                         </div>
                     </div>
                 </div>
@@ -140,7 +150,12 @@
                     <div class="form-group">
                     <label class="col-sm-4 control-label">企业宣传图片:</label>
                     <div class="col-sm-8">
-                        <img th:src="*{propagandaImgUrl}" />
+                        <div class="fileinput fileinput-new">
+                            <div class="fileinput-new thumbnail"
+                                 style="width: 140px; height: 140px;" onclick="openImg(this)">
+                                <img th:src="@{*{propagandaImgUrl}}" id="img-propagandaImgUrl" style=" width: 100%; height: 100%;">
+                            </div>
+                        </div>
                     </div>
                 </div></div>
                 <div class="col-sm-6"></div>
@@ -265,6 +280,17 @@
                 }
             });
         }
+        function openImg(self){
+            var img = $(self).children("img")
+            layer.open({
+                type: 1,
+                title: false,
+                shade: 0.0001,
+                area: ['auto'],
+                shadeClose: true,
+                content: $(img)
+            });
+        }
 
     </script>
 </body>

+ 20 - 4
dgtly-admin/src/main/resources/templates/company/info.html

@@ -71,19 +71,25 @@
             <div class="form-group">    
                 <label class="col-sm-3 control-label">营业执照:</label>
                 <div class="col-sm-8">
-                    <img th:src="*{businessLicenseUrl}" />
+                    <div class="fileinput-new thumbnail" style="width: 140px;height: 140px;" onclick="openImg(this)">
+                        <img th:src="@{*{businessLicenseUrl}}" id="img-businessLicenseUrl" style=" width: 100%; height: 100%;" >
+                    </div>
                 </div>
             </div>
             <div class="form-group">    
                 <label class="col-sm-3 control-label">企业默认图片:</label>
                 <div class="col-sm-8">
-                    <img th:src="*{defaultImgUrl}" />
+                    <div class="fileinput-new thumbnail" style="width: 140px;height: 140px;" onclick="openImg(this)">
+                        <img th:src="@{*{defaultImgUrl}}" id="img-defaultImgUrl"  style=" width: 100%; height: 100%;">
+                    </div>
                 </div>
             </div>
             <div class="form-group">    
                 <label class="col-sm-3 control-label">企业宣传图片:</label>
                 <div class="col-sm-8">
-                    <img th:src="*{propagandaImgUrl}" />
+                    <div class="fileinput-new thumbnail" style="width: 140px;height: 140px;" onclick="openImg(this)">
+                        <img th:src="@{*{propagandaImgUrl}}" id="img-propagandaImgUrl" style=" width: 100%; height: 100%;">
+                    </div>
                 </div>
             </div>
             <div class="form-group">
@@ -111,7 +117,17 @@
         function submitHandler() {
             $.modal.close();
         }
-
+        function openImg(self){
+            var img = $(self).children("img")
+            layer.open({
+                type: 1,
+                title: false,
+                shade: 0.0001,
+                area: [80,80],
+                shadeClose: true,
+                content: $(img)
+            });
+        }
     </script>
 </body>
 </html>

+ 24 - 2
dgtly-goods/dgtly-goods-admin/src/main/java/com/dgtly/goods/controller/GoodsInfoController.java

@@ -4,6 +4,8 @@ import java.util.List;
 
 import com.dgtly.common.utils.StringUtils;
 import com.dgtly.common.utils.file.FileUploadUtils;
+import com.dgtly.framework.util.ShiroUtils;
+import com.dgtly.system.service.ISysConfigService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -38,10 +40,20 @@ public class GoodsInfoController extends BaseController
     @Autowired
     private IGoodsInfoService goodsInfoService;
 
+    @Autowired
+    private ISysConfigService configService;
+
     @RequiresPermissions("goods:info:view")
     @GetMapping()
-    public String info()
+    public String info(ModelMap mmp)
     {
+        Boolean isSystemUser = false;
+        /*判断是否是系统内部人员*/
+        if(ShiroUtils.getCompanyId()==Long.parseLong(configService.selectConfigByKey("sys.company.id"))){
+            isSystemUser=true;
+        }
+        mmp.addAttribute("isSystemUser",isSystemUser);
+
         return prefix + "/info";
     }
 
@@ -53,6 +65,10 @@ public class GoodsInfoController extends BaseController
     @ResponseBody
     public TableDataInfo list(GoodsInfo goodsInfo)
     {
+        /*判断是否是系统内部人员*/
+        if(ShiroUtils.getCompanyId()!=Long.parseLong(configService.selectConfigByKey("sys.company.id"))){
+            goodsInfo.setCompanyId(ShiroUtils.getCompanyId());
+        }
         startPage();
         List<GoodsInfo> list = goodsInfoService.selectGoodsInfoList(goodsInfo);
         return getDataTable(list);
@@ -64,8 +80,14 @@ public class GoodsInfoController extends BaseController
      * 新增商品基础详情
      */
     @GetMapping("/add")
-    public String add()
+    public String add(ModelMap mmp)
     {
+        Boolean isSystemUser = false;
+        /*判断是否是系统内部人员*/
+        if(ShiroUtils.getCompanyId()==Long.parseLong(configService.selectConfigByKey("sys.company.id"))){
+            isSystemUser=true;
+        }
+        mmp.addAttribute("isSystemUser",isSystemUser);
         return prefix + "/add";
     }
 

+ 2 - 1
dgtly-goods/dgtly-goods-admin/src/main/resources/templates/goods/info/info.html

@@ -14,7 +14,8 @@
                                 <p>商品名称:</p>
                                 <input type="text" name="name"/>
                             </li>
-                            <li>
+
+                            <li th:if="${isSys}">
                                 <p>所属商户id:</p>
                                 <input type="text" name="companyId"/>
                             </li>