rehabilitation_guidance_preview.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. var httpData = GetRequest();
  2. console.log('httpData',httpData)
  3. var docInfo = JSON.parse(window.localStorage.getItem('wlyyAgent'));
  4. function showSuccessMessage(msg) {
  5. layer.msg(msg, {
  6. icon: 1
  7. })
  8. }
  9. function showErrorMessage(msg) {
  10. layer.msg(msg, {
  11. icon: 5
  12. })
  13. }
  14. new Vue({
  15. el: "#app",
  16. data: {
  17. modelName: '',
  18. content: '',
  19. curTemplate: undefined,
  20. modelCode: httpData['modelCode']||'',
  21. imagesUrls: []
  22. },
  23. mounted: function() {
  24. this.selectGuidances();
  25. },
  26. methods: {
  27. selectGuidances: function(){
  28. var vm=this;
  29. var params={
  30. type: '',
  31. id: vm.modelCode,
  32. title: '',
  33. page: 1,
  34. pagesize: 1
  35. }
  36. rehaAPI.selectGuidances(params).then(function(res){
  37. if(res.status==200){
  38. if(res.data && res.data.length) {
  39. var data = res.data[0]
  40. vm.curTemplate = data
  41. vm.content = data.content
  42. vm.modelName = data.title
  43. // vm.imgs = _.map(data.imagesUrls, function(s) {
  44. // return httpRequest.getImgUrl(s)
  45. // })
  46. }
  47. } else {
  48. showErrorMessage(res.msg)
  49. }
  50. })
  51. },
  52. // 关闭窗口
  53. onClose: function(){
  54. window.parent.closeGuidancePreview()
  55. }
  56. }
  57. })