VersionProblem.cshtml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. 
  2. @{
  3. ViewBag.Title = "VersionProblem";
  4. Layout = "~/Views/MobileProblem/_APPMain.cshtml";
  5. }
  6. <style>
  7. .menu {
  8. width: 100%;
  9. }
  10. .menuH4 {
  11. font-size: 14px;
  12. text-align: left;
  13. color: #616161;
  14. margin: 10px 10px 10px 20px;
  15. }
  16. .we {
  17. display: flex;
  18. flex-direction: row;
  19. align-items: center;
  20. justify-content: space-between;
  21. width: 100%;
  22. }
  23. .miniblok {
  24. background-color: #efeff4;
  25. border-radius: 8px;
  26. padding: 5px 10px 5px 10px;
  27. font-size: 14px;
  28. margin-bottom: 10px;
  29. border: 1px solid #ffffff;
  30. margin-left: 15px;
  31. color: #616161;
  32. }
  33. .myactive {
  34. border: 1px solid #b47e7e;
  35. color: #b47e7e;
  36. background-color: white;
  37. }
  38. .mui-card {
  39. margin: 5px 0px 0px;
  40. }
  41. .mui-card-media img {
  42. height: 35px !important;
  43. width: auto !important;
  44. border-radius: 50px;
  45. }
  46. p {
  47. word-break: break-all;
  48. display: -webkit-box;
  49. -webkit-box-orient: vertical;
  50. overflow: hidden;
  51. text-overflow: ellipsis;
  52. -webkit-line-clamp: 1;
  53. }
  54. .mui-media-body div {
  55. font-size: 13px;
  56. color: #6f6f6f;
  57. background-color: #ffffff;
  58. position: absolute;
  59. z-index: 999999;
  60. right: 8px;
  61. }
  62. .svg-float {
  63. position: absolute;
  64. top: 8px;
  65. right: 6px;
  66. width: 133px;
  67. text-align: right;
  68. }
  69. .my-content {
  70. padding: 5px 10px;
  71. font-size: 13px;
  72. color: #8f8f94;
  73. max-height: 80px;
  74. overflow: hidden;
  75. }
  76. .overf {
  77. word-break: break-all;
  78. display: -webkit-box;
  79. -webkit-box-orient: vertical;
  80. overflow: hidden;
  81. text-overflow: ellipsis;
  82. }
  83. .mui-button-row {
  84. position: absolute;
  85. padding-top: 5px;
  86. text-align: center;
  87. bottom: 0;
  88. width: 100%;
  89. }
  90. </style>
  91. <!--侧滑菜单容器-->
  92. <div id="offCanvasWrapper" class="mui-off-canvas-wrap mui-draggable">
  93. <div id="vue" class="mui-inner-wrap">
  94. <!--菜单部分-->
  95. <aside id="offCanvasSide" class="mui-off-canvas-right">
  96. <div id="offCanvasSideScroll" class="mui-scroll-wrapper">
  97. <div class="mui-scroll">
  98. <div id="menu" class="menu">
  99. <div style="border-bottom: solid 1px #efeff4;">
  100. <h4 class="menuH4">产品类型</h4>
  101. <div class="we active" style="flex-wrap:wrap;justify-content:flex-start;">
  102. <div v-for="item in Product" class="miniblok " v-on:click="productChange(item)" v-bind:class="item.active?'myactive':''">{{item.名称}}</div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="mui-button-row">
  108. <button type="button" v-on:tap="defaultProduct" class="mui-btn mui-btn-primary" style="width: 48%; background-color: rgb(42, 184, 255); border: none;">重置</button>
  109. <button type="button" v-on:tap="reload" class="mui-btn mui-btn-danger" style="width: 48%;">确定</button></div>
  110. </div>
  111. </aside>
  112. <header class="mui-bar mui-bar-nav">
  113. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color:#ffffff"></a>
  114. <h1 class="mui-title" style="color:white">版本问题查询</h1>
  115. <a v-on:tap="popover" id="icon-menu" class="mui-action-menu mui-icon mui-icon-bars mui-pull-right" style="color: white;"></a>
  116. </header>
  117. <div id="offCanvasContentScroll" class="mui-content mui-scroll-wrapper">
  118. <div class="mui-scroll">
  119. <div style="margin-top:10px">
  120. <input v-on:keydown.enter="DoSearch" v-model="searchText" style="font-size:15px; margin:auto;width:75%" type="search" class="mui-input-clear" placeholder="问题标题/内容/编号">
  121. <button v-on:click="DoSearch" type="button" class="mui-btn mui-btn-primary mui-icon mui-icon-search">
  122. 搜索
  123. </button>
  124. <div id="Problem">
  125. <div v-for="x in Problem" class="mui-card" v-on:tap="goDetail(x.ID,x.产品问题版本ID)">
  126. <div class="mui-card-header mui-card-media">
  127. <img src="~/Content/Images/Account/wtx.jpg" />
  128. <div class="mui-media-body">
  129. {{x.性质}}-{{x.登记人}}
  130. <p style="font-size:12px">登记于 {{x.登记日期}}</p>
  131. <div>{{x.编号}}</div>
  132. <div class="svg-float overf" style="-webkit-line-clamp: 1;">{{x.产品}}({{x.版本}})</div>
  133. </div>
  134. </div>
  135. <div class="mui-card-content my-content">
  136. <div class="overf" style="-webkit-line-clamp: 1;">标题:{{x.问题标题}}</div>
  137. <div class="overf" style="-webkit-line-clamp: 2;">说明:{{x.说明}}</div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <!-- off-canvas backdrop -->
  145. <div class="mui-off-canvas-backdrop"></div>
  146. </div>
  147. </div>
  148. <script>
  149. var vm = new Vue({
  150. el: '#vue',
  151. data: {
  152. Problem: [],
  153. Product: [],
  154. searchText: '',
  155. Pages: 0
  156. },
  157. methods: {
  158. igonHtml: function (data) {
  159. var t = [];
  160. for (var i in data) {
  161. var item = data[i];
  162. var arrEntities = {
  163. 'lt': '<',
  164. 'gt': '>',
  165. 'nbsp': ' ',
  166. 'amp': '&',
  167. 'quot': '"'
  168. };
  169. item.说明 = item.说明.replace(/<[^>]+>/g, "").replace(/&(lt|gt|nbsp|amp|quot);/ig, function (all, t) {
  170. return arrEntities[t];
  171. });
  172. t.push(item);
  173. }
  174. return t
  175. },
  176. getVersionProblem: function () {
  177. var that = this;
  178. that.Pages++;
  179. setTimeout(function () {
  180. var self = mui('#offCanvasContentScroll').pullRefresh(); //参数为true代表没有更多数据了。
  181. mui.get("/Problem/GetVersionProblem",
  182. {
  183. SearchText: that.searchText,
  184. page: that.Pages,
  185. ProductId:that.getProductSelect(),
  186. rows: 6
  187. }, function (data) {
  188. //获得服务器响应
  189. var info = data.rows;
  190. if (info.length == 0) {//当datas.length为0时,表示没有数据了
  191. self.endPullupToRefresh(true);//当为true时,底部出现没有更多数据,并且不能滑动
  192. } else {
  193. data.rows = that.igonHtml(data.rows)
  194. that.Problem = that.Problem.concat(data.rows);
  195. self.endPullupToRefresh(false);//当为false或空时,底部出现正在加载,滑动到下一页
  196. }
  197. }, 'json');
  198. }, 1500);
  199. },
  200. DoSearch: function () {
  201. this.Pages = 0;
  202. this.Problem = [];
  203. mui('#offCanvasContentScroll').pullRefresh().refresh(true);
  204. mui('#offCanvasContentScroll').pullRefresh().pullupLoading(false);
  205. },
  206. getProduct: function () {
  207. var that = this;
  208. $.post('/Product/ProductInfoCombobox', function (data) {
  209. var t = [];
  210. for (var i in data) {
  211. var item = data[i];
  212. item.active = false;
  213. t.push(item);
  214. }
  215. that.Product = t;
  216. })
  217. },
  218. productChange: function (item) {
  219. item.active = !item.active;
  220. },
  221. popover: function () {
  222. mui('.mui-off-canvas-wrap').offCanvas('show')
  223. },
  224. defaultProduct: function () {
  225. var data = this.Product;
  226. for (var i in data) {
  227. var item = data[i];
  228. item.active = false;
  229. }
  230. },
  231. reload: function () {
  232. mui('.mui-off-canvas-wrap').offCanvas().close()
  233. this.DoSearch()
  234. },
  235. getProductSelect: function () {
  236. var t=[];
  237. for(var i in this.Product) {
  238. var item=this.Product[i];
  239. if (item.active) {
  240. t.push(item.ID)
  241. }
  242. }
  243. return t.join(',');
  244. },
  245. goDetail(id,vpid) {
  246. window.location.href = "/MobileProblem/VersionProblemDeatil/" + id + "?vpid=" + vpid;
  247. }
  248. },
  249. mounted: function () {
  250. var that = this;
  251. mui.init({
  252. pullRefresh: {
  253. container: '#offCanvasContentScroll',
  254. up: {
  255. auto: false,
  256. contentrefresh: '正在加载...',
  257. callback: that.getVersionProblem,
  258. }
  259. }
  260. });
  261. mui('.mui-scroll-wrapper').scroll();
  262. mui(".mui-scroll").on('tap', '.miniblok', function (event) {
  263. this.click();
  264. });
  265. this.getProduct();
  266. }
  267. })
  268. </script>