forked from mirror/MrDoc
优化后台图片管理图片预览功能
This commit is contained in:
parent
7fdeba10be
commit
cd163011a0
@ -15,6 +15,7 @@
|
||||
- [优化]首页移动端控制栏样式;
|
||||
- [优化]文集内搜索文档;
|
||||
- [优化]后台文档管理文档编辑模式显示;
|
||||
- [优化]后台图片管理图片预览功能;
|
||||
|
||||
### v0.6.8 2021-06-27
|
||||
|
||||
|
2
static/icon_img/img_bmp.svg
Normal file
2
static/icon_img/img_bmp.svg
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1626867984018" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1326" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.eot?#iefix") format("embedded-opentype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff2") format("woff2"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff") format("woff"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.ttf") format("truetype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.svg#iconfont") format("svg"); }
|
||||
</style></defs><path d="M860.87 958H159.15a51.4 51.4 0 0 1-51.35-51.35v-787.3A51.4 51.4 0 0 1 159.15 68H622.5a34.11 34.11 0 0 1 24 9.93l255.79 255.83a34.14 34.14 0 0 1 9.93 24v548.89A51.4 51.4 0 0 1 860.87 958zM622.26 102.14l-463.11 0.1A17.13 17.13 0 0 0 142 119.35v787.3a17.14 17.14 0 0 0 17.12 17.12h701.75A17.14 17.14 0 0 0 878 906.65V357.72z" fill="#474F59" p-id="1327"></path><path d="M663.68 350.77H895.1L629.45 85.12v231.42a34.33 34.33 0 0 0 34.23 34.23z" fill="#F49B58" p-id="1328"></path><path d="M895.1 367.89H663.68a51.41 51.41 0 0 1-51.35-51.35V85.12A17.12 17.12 0 0 1 641.55 73L907.2 338.67a17.12 17.12 0 0 1-12.1 29.22zM646.56 126.44v190.1a17.14 17.14 0 0 0 17.12 17.12h190.11z" fill="#474F59" p-id="1329"></path><path d="M297.79 645.76q-15.07 0-30.4-1a141.59 141.59 0 0 1-26.84-4V456.53c4-0.72 8.31-1.41 12.87-2s9.22-1.14 14-1.51 9.45-0.64 14.1-0.82 9.08-0.27 13.28-0.27a185.61 185.61 0 0 1 32 2.6 81.42 81.42 0 0 1 25.61 8.63A44.9 44.9 0 0 1 369.26 479q6 9.86 6 24.37 0 13.42-6.43 23a45.55 45.55 0 0 1-17.94 15.33q17.25 5.74 25.47 17t8.21 28.48q0 29.3-21.36 43.94t-65.42 14.64zM274.51 531h24.37q19.71 0 30.94-5.62t11.23-20.12q0-13.69-11.64-19.45t-30.26-5.75c-5.3 0-10 0.1-14.1 0.28s-7.63 0.46-10.54 0.82z m0 27.11v57.78q5.75 0.55 12.32 0.82t12.05 0.28a135 135 0 0 0 19.85-1.37 51.63 51.63 0 0 0 15.89-4.79 28.42 28.42 0 0 0 10.68-9.18q4-5.74 4-14.79 0-16.14-11.78-22.45t-32.59-6.3zM459.22 453.8q6 10.4 13.41 25.46t15.07 31.63q7.67 16.58 15.19 33.69t13.83 31.62q6.3-14.51 13.7-31.62t15.06-33.69q7.66-16.56 15.06-31.63T574 453.8h31.09q2.52 20.81 4.74 44.22t4 47.93q1.8 24.49 3.34 49.29t2.66 48.33h-34q-1.14-33.14-2.66-68.19t-4.61-67.91q-3 6.3-7.12 15.06c-2.73 5.85-5.66 12.18-8.76 19s-6.26 13.92-9.45 21.22S547 577.17 544 584s-5.8 13.24-8.35 19.18l-6.57 15.2H503.3q-2.73-6.32-6.57-15.34t-8.35-19.3q-4.51-10.29-9.31-21.23t-9.45-21.08q-4.65-10.14-8.76-19t-7.12-14.93q-3.08 32.85-4.61 67.91t-2.65 68.19h-34q1.13-23.55 2.65-48.74t3.35-50q1.82-24.76 4.05-48.05t4.73-43zM710.74 451.88q41.34 0 63.39 15.06t22 47.1q0 16.71-5.89 28.61a49.43 49.43 0 0 1-17.12 19.45q-11.22 7.53-27.38 11.09a173 173 0 0 1-37 3.56h-17.17v66.82h-34.51v-187a172.22 172.22 0 0 1 26.7-3.69q14.66-1 26.98-1z m2.46 29.85q-13.14 0-21.63 0.82v64.62h16.7q24.93 0 38.34-7t13.39-26.4q0-9.31-3.56-15.61a25.6 25.6 0 0 0-9.86-9.86 46.31 46.31 0 0 0-14.92-5.06 107 107 0 0 0-18.46-1.51z" fill="#F49B58" p-id="1330"></path></svg>
|
After Width: | Height: | Size: 3.1 KiB |
2
static/icon_img/img_gif.svg
Normal file
2
static/icon_img/img_gif.svg
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1626867956809" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1014" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.eot?#iefix") format("embedded-opentype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff2") format("woff2"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff") format("woff"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.ttf") format("truetype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.svg#iconfont") format("svg"); }
|
||||
</style></defs><path d="M863.85 958H162.12a51.4 51.4 0 0 1-51.34-51.35V119.33A51.4 51.4 0 0 1 162.12 68h463.36a33.66 33.66 0 0 1 24 9.92l255.79 255.82a33.7 33.7 0 0 1 9.93 24v548.89A51.4 51.4 0 0 1 863.85 958zM625.24 102.11l-463.12 0.1A17.13 17.13 0 0 0 145 119.33v787.3a17.13 17.13 0 0 0 17.11 17.12h701.74A17.14 17.14 0 0 0 881 906.63V357.7z" fill="#474F59" p-id="1015"></path><path d="M666.66 350.75h231.42L632.43 85.1v231.42a34.33 34.33 0 0 0 34.23 34.23z" fill="#EA7D63" p-id="1016"></path><path d="M898.08 367.87H666.66a51.41 51.41 0 0 1-51.35-51.35V85.1A17.12 17.12 0 0 1 644.53 73l265.66 265.65a17.12 17.12 0 0 1-12.11 29.22zM649.55 126.42v190.1a17.14 17.14 0 0 0 17.11 17.12h190.11z" fill="#474F59" p-id="1017"></path><path d="M425.77 479.78q-29.31 0-44.78 18.22t-15.47 50.53a100.14 100.14 0 0 0 3.7 28.06 61.84 61.84 0 0 0 10.95 21.78 50.2 50.2 0 0 0 18.08 14.1q10.8 5.07 25.33 5.06a152 152 0 0 0 15.6-0.69 61.7 61.7 0 0 0 10.41-1.78v-68.18h34.5v91.19q-7.11 2.74-24.09 6a208 208 0 0 1-39.16 3.28 103.19 103.19 0 0 1-37.52-6.57 77.75 77.75 0 0 1-28.89-19.17A87 87 0 0 1 336 590.7q-6.57-18.35-6.58-42.17t7.26-42.18a91 91 0 0 1 19.86-31.08A83.38 83.38 0 0 1 386.06 456a99.26 99.26 0 0 1 36.15-6.57 137.79 137.79 0 0 1 23.41 1.78 158.77 158.77 0 0 1 17.66 4 71.54 71.54 0 0 1 12.19 4.65q4.78 2.47 6.71 3.56l-10.41 28.21a84.06 84.06 0 0 0-20.4-8.35 94.36 94.36 0 0 0-25.6-3.5zM517.23 453.77h34.5v189.78h-34.5zM590.34 643.55V453.77h119.94v29.3h-85.43v48.47h75.85v29.3h-75.85v82.71z" fill="#EA7D63" p-id="1018"></path></svg>
|
After Width: | Height: | Size: 2.3 KiB |
2
static/icon_img/img_jpg.svg
Normal file
2
static/icon_img/img_jpg.svg
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1626867922123" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="858" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.eot?#iefix") format("embedded-opentype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff2") format("woff2"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff") format("woff"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.ttf") format("truetype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.svg#iconfont") format("svg"); }
|
||||
</style></defs><path d="M863.86 958H162.14a51.4 51.4 0 0 1-51.35-51.35v-787.3A51.4 51.4 0 0 1 162.14 68h463.35a34.11 34.11 0 0 1 24 9.93l255.79 255.83a33.64 33.64 0 0 1 9.93 24v548.89A51.4 51.4 0 0 1 863.86 958zM625.25 102.14l-463.11 0.1A17.13 17.13 0 0 0 145 119.35v787.3a17.14 17.14 0 0 0 17.12 17.12h701.74A17.14 17.14 0 0 0 881 906.65V357.72z" fill="#474F59" p-id="859"></path><path d="M666.67 350.77h231.42L632.44 85.12v231.42a34.33 34.33 0 0 0 34.23 34.23z" fill="#F49B58" p-id="860"></path><path d="M898.09 367.89H666.67a51.41 51.41 0 0 1-51.35-51.35V85.12A17.12 17.12 0 0 1 644.54 73l265.65 265.67a17.12 17.12 0 0 1-12.1 29.22zM649.55 126.44v190.1a17.14 17.14 0 0 0 17.12 17.12h190.11z" fill="#474F59" p-id="861"></path><path d="M387.17 581.13a107 107 0 0 1-3 26 52.22 52.22 0 0 1-10.54 21.08q-7.55 9-20.27 14.24t-32.17 5.21q-18.07 0-31.36-5.07t-20.4-10.82l12.32-27.11a98.18 98.18 0 0 0 16.84 8.91 52 52 0 0 0 20.41 4.26q17.52 0 25.46-8.77t7.94-30.12V453.8h34.78zM482.2 451.88q41.34 0 63.39 15.06t22 47.1q0 16.71-5.89 28.61a49.43 49.43 0 0 1-17.12 19.45q-11.24 7.53-27.38 11.09a173.1 173.1 0 0 1-37 3.56H463v66.82h-34.5v-187a172 172 0 0 1 26.7-3.69q14.66-1 27-1z m2.46 29.85q-13.16 0-21.64 0.82v64.62h16.71q24.91 0 38.34-7t13.42-26.43q0-9.31-3.56-15.61a25.6 25.6 0 0 0-9.86-9.86 46.38 46.38 0 0 0-14.93-5.06 106.87 106.87 0 0 0-18.48-1.48zM685.11 479.81q-29.31 0-44.77 18.21t-15.48 50.53a100.63 100.63 0 0 0 3.7 28.07 62 62 0 0 0 11 21.77 50.09 50.09 0 0 0 18.08 14.1q10.81 5.07 25.33 5.06a149.36 149.36 0 0 0 15.61-0.69 62.94 62.94 0 0 0 10.4-1.77V546.9h34.51v91.19q-7.12 2.74-24.1 6a207.89 207.89 0 0 1-39.16 3.28 103.19 103.19 0 0 1-37.52-6.57 77.83 77.83 0 0 1-28.89-19.17 87.18 87.18 0 0 1-18.49-30.94q-6.57-18.35-6.57-42.17t7.24-42.15a91.43 91.43 0 0 1 19.86-31.08A83.49 83.49 0 0 1 645.4 456a99.09 99.09 0 0 1 36.15-6.58 138.74 138.74 0 0 1 23.45 1.77 161.29 161.29 0 0 1 17.67 4 72.87 72.87 0 0 1 12.18 4.66c3.2 1.64 5.43 2.83 6.71 3.56l-10.41 28.21a83.5 83.5 0 0 0-20.4-8.35 93.92 93.92 0 0 0-25.64-3.46z" fill="#F49B58" p-id="862"></path></svg>
|
After Width: | Height: | Size: 2.8 KiB |
2
static/icon_img/img_others.svg
Normal file
2
static/icon_img/img_others.svg
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1626870695914" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3662" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.eot?#iefix") format("embedded-opentype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff2") format("woff2"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff") format("woff"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.ttf") format("truetype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.svg#iconfont") format("svg"); }
|
||||
</style></defs><path d="M707.2 79.9H238.6c-11.6 0-21 9.4-21 21V923c0 11.6 9.4 21 21 21h704.9V316.3L707.2 79.9" fill="#FFFFFF" p-id="3663"></path><path d="M943.6 960h-705c-20.4 0-37-16.6-37-37V100.9c0-20.4 16.6-37 37-37h468.6c4.2 0 8.3 1.7 11.3 4.7L954.9 305c3 3 4.7 7.1 4.7 11.3V944c0 8.9-7.2 16-16 16z m-705-864.1c-2.7 0-5 2.2-5 5V923c0 2.7 2.2 5 5 5h689V323l-227-227h-462z" fill="#00365B" p-id="3664"></path><path d="M943.6 316.3H707.2V79.9z" fill="#FFFFFF" p-id="3665"></path><path d="M943.6 332.3H707.2c-8.8 0-16-7.2-16-16V79.9c0-6.5 3.9-12.3 9.9-14.8s12.9-1.1 17.4 3.5L954.9 305c4.6 4.6 5.9 11.5 3.5 17.4-2.5 6-8.3 9.9-14.8 9.9z m-220.4-32H905L723.2 118.6v181.7z" fill="#00365B" p-id="3666"></path><path d="M104.7 414.2h698.8c22.4 0 40.6 19.8 40.6 44.3v301.4c0 24.5-18.2 44.3-40.6 44.3H104.7c-22.4 0-40.6-19.8-40.6-44.3V458.5c-0.1-24.5 18.1-44.3 40.6-44.3z" fill="#369FB6" p-id="3667"></path><path d="M211 602.5m-60 0a60 60 0 1 0 120 0 60 60 0 1 0-120 0Z" fill="#FFFFFF" p-id="3668"></path><path d="M453 602.5m-60 0a60 60 0 1 0 120 0 60 60 0 1 0-120 0Z" fill="#FFFFFF" p-id="3669"></path><path d="M695 602.5m-60 0a60 60 0 1 0 120 0 60 60 0 1 0-120 0Z" fill="#FFFFFF" p-id="3670"></path></svg>
|
After Width: | Height: | Size: 1.9 KiB |
2
static/icon_img/img_png.svg
Normal file
2
static/icon_img/img_png.svg
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1626867969096" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1170" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.eot?#iefix") format("embedded-opentype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff2") format("woff2"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.woff") format("woff"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.ttf") format("truetype"), url("//at.alicdn.com/t/font_1031158_1uhr8ri0pk5.svg#iconfont") format("svg"); }
|
||||
</style></defs><path d="M859.87 958H158.15a51.41 51.41 0 0 1-51.35-51.35v-787.3A51.41 51.41 0 0 1 158.15 68H621.5a33.66 33.66 0 0 1 24 9.92l255.79 255.84a33.64 33.64 0 0 1 9.93 24v548.89A51.4 51.4 0 0 1 859.87 958z m-238.6-855.86l-463.12 0.1A17.13 17.13 0 0 0 141 119.35v787.3a17.14 17.14 0 0 0 17.12 17.12h701.75A17.14 17.14 0 0 0 877 906.65V357.72z" fill="#474F59" p-id="1171"></path><path d="M662.68 350.77h231.43L628.45 85.12v231.42a34.33 34.33 0 0 0 34.23 34.23z" fill="#F49B58" p-id="1172"></path><path d="M894.1 367.89H662.69a51.41 51.41 0 0 1-51.35-51.35V85.12A17.12 17.12 0 0 1 640.56 73L906.2 338.67a17.12 17.12 0 0 1-12.1 29.22zM645.57 126.44v190.1a17.14 17.14 0 0 0 17.12 17.12h190.09z" fill="#474F59" p-id="1173"></path><path d="M306.24 451.88q41.34 0 63.39 15.06T391.68 514q0 16.71-5.89 28.61a49.43 49.43 0 0 1-17.12 19.45q-11.22 7.53-27.38 11.09a173.1 173.1 0 0 1-37 3.56h-17.22v66.82h-34.51v-187a172.22 172.22 0 0 1 26.7-3.69q14.65-0.96 26.98-0.96z m2.46 29.85q-13.14 0-21.63 0.82v64.62h16.7q24.92 0 38.34-7t13.42-26.43q0-9.31-3.56-15.61a25.6 25.6 0 0 0-9.86-9.86 46.38 46.38 0 0 0-14.93-5.06 106.87 106.87 0 0 0-18.48-1.48zM548.31 643.57Q539 628 527.5 610t-23.83-36.15q-12.32-18.21-25.05-35.33t-24.24-30.81v135.86h-34V453.8h28.21q11 11.49 23.55 27.24t25.33 32.73q12.74 17 24.65 34.09t21.22 31.9v-126h34.23v189.81zM709.05 479.81q-29.29 0-44.77 18.21t-15.47 50.53a100.26 100.26 0 0 0 3.7 28.07 61.79 61.79 0 0 0 11 21.77 50.05 50.05 0 0 0 18.07 14.1q10.82 5.07 25.33 5.06a149.23 149.23 0 0 0 15.61-0.69 63.09 63.09 0 0 0 10.41-1.77V546.9h34.5v91.19q-7.11 2.74-24.1 6a207.78 207.78 0 0 1-39.15 3.28 103.15 103.15 0 0 1-37.52-6.57 77.75 77.75 0 0 1-28.89-19.17 87.18 87.18 0 0 1-18.49-30.94q-6.57-18.35-6.57-42.17t7.26-42.18a91.25 91.25 0 0 1 19.85-31.08A83.53 83.53 0 0 1 669.35 456a99 99 0 0 1 36.14-6.58 138.86 138.86 0 0 1 23.42 1.78 162.36 162.36 0 0 1 17.67 4 72.87 72.87 0 0 1 12.18 4.66c3.19 1.64 5.42 2.83 6.71 3.56l-10.41 28.21a83.66 83.66 0 0 0-20.4-8.35 94 94 0 0 0-25.61-3.47z" fill="#F49B58" p-id="1174"></path></svg>
|
After Width: | Height: | Size: 2.8 KiB |
@ -48,7 +48,18 @@
|
||||
<!-- 图片缩略图模板 -->
|
||||
<script type="text/html" id="imgShow">
|
||||
{% verbatim %}
|
||||
<img src="{{d.file_path}}" style="width:20px;height:20px" />
|
||||
{{#if (d.file_name.endsWith('png')) { }}
|
||||
<img src="/static/icon_img/img_png.svg" style="width:20px;height:20px" />
|
||||
{{# }else if(d.file_name.endsWith('jpg')){ }}
|
||||
<img src="/static/icon_img/img_jpg.svg" style="width:20px;height:20px" />
|
||||
{{# }else if(d.file_name.endsWith('gif')){ }}
|
||||
<img src="/static/icon_img/img_gif.svg" style="width:20px;height:20px" />
|
||||
{{# }else if(d.file_name.endsWith('bmp')){ }}
|
||||
<img src="/static/icon_img/img_bmp.svg" style="width:20px;height:20px" />
|
||||
{{# }else{ }}
|
||||
<img src="/static/icon_img/img_others.svg" style="width:20px;height:20px" />
|
||||
{{# } }}
|
||||
{{d.file_name}}
|
||||
{% endverbatim %}
|
||||
</script>
|
||||
|
||||
@ -69,6 +80,7 @@
|
||||
<!-- 用户操作模板 -->
|
||||
<script type="text/html" id="userOpera">
|
||||
{% verbatim %}
|
||||
<button class="pear-btn pear-btn-normal pear-btn-sm" lay-event="preview" title="预览图片"><i class="pear-icon pear-icon-browse"></i></button>
|
||||
<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i></button>
|
||||
{% endverbatim %}
|
||||
</script>
|
||||
@ -120,28 +132,14 @@
|
||||
toolbar: '#img-toolbar',
|
||||
cols: [[
|
||||
{type: 'checkbox',width:20},
|
||||
{field:'file_path',width:60,title:"",templet:'#imgShow'},
|
||||
{field:'file_name',title:'图片名称',},
|
||||
{field:'file_name',title:'图片名称',templet:'#imgShow'},
|
||||
{field:'file_path',title:'图片路径',},
|
||||
{field:'remark',title:'备注',},
|
||||
{field:'username',title:'用户',},
|
||||
{field:'remark',title:'备注',width:100,},
|
||||
{field:'username',title:'用户',width:140,},
|
||||
{field:'create_time',title:'上传时间',width:160,templet:'#registerTime'},
|
||||
{field:'oprate',title:'操作',width:180,templet:'#userOpera'},
|
||||
]],
|
||||
skin: 'line',
|
||||
done:function(){
|
||||
//查看图片
|
||||
var options = {
|
||||
//inline: true,
|
||||
url: 'data-original',
|
||||
fullscreen:false,//全屏
|
||||
rotatable:false,//旋转
|
||||
scalable:false,//翻转
|
||||
//zoomable:false,//缩放
|
||||
button:false,//关闭按钮
|
||||
};
|
||||
var viewer = new Viewer(document.getElementById('img-div'), options);
|
||||
}
|
||||
});
|
||||
// [文集权限指定用户]渲染用户多选下拉框
|
||||
var select_user = xmSelect.render({
|
||||
@ -246,11 +244,32 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
// 侦听文档删除按钮
|
||||
// 侦听文档操作按钮
|
||||
table.on("tool(img-table)",function(obj){
|
||||
if (obj.event === 'remove') {
|
||||
// console.log(obj)
|
||||
delImg(obj.data.id)
|
||||
}else if(obj.event === 'preview'){
|
||||
let realpath = obj.data.file_path; // url地址
|
||||
let imgHtml = "<img src='"+ realpath +"' />";
|
||||
let img = new Image(); // Image对象
|
||||
|
||||
img.onload = function () { // 重点:要用onload加载
|
||||
let width = img.width,
|
||||
height = img.height;
|
||||
layer.open({
|
||||
type:1, // 类型是1
|
||||
shade:0.2,
|
||||
offset:'auto',
|
||||
area:[width + 'px', height + 'px'],
|
||||
shadeClose:true,
|
||||
scrollbar: false,
|
||||
title: '', // 这里不要写文字
|
||||
content:imgHtml,
|
||||
});
|
||||
};
|
||||
|
||||
img.src = realpath;
|
||||
}
|
||||
});
|
||||
// 侦听表格工具栏
|
||||
|
Loading…
Reference in New Issue
Block a user