yq1 4 giorni fa
parent
commit
4cf73340ff
100 ha cambiato i file con 13605 aggiunte e 3051 eliminazioni
  1. 0 2640
      .idea/shelf/Uncommitted_changes_before_Update_at_2023_4_26_15_16_[Changes]/shelved.patch
  2. 0 131
      .idea/shelf/Uncommitted_changes_before_Update_at_2023_6_30_17_15_[Changes]/shelved.patch
  3. 24 22
      src/xt_pages/Pharmacy/PatientDispensing.vue
  4. 1 1
      src/xt_pages/eleFaPiao/patientSettleDetail.vue
  5. 628 0
      src/xt_pages/outpatientDoctorStation/checkTemplate/printfive.vue
  6. 256 0
      src/xt_pages/user/Informed/components/CRRT_informed.vue
  7. 263 0
      src/xt_pages/user/Informed/components/Terminate_informed.vue
  8. 311 0
      src/xt_pages/user/Informed/components/nonheparin_informed.vue
  9. 37 19
      src/xt_pages/user/Physicalexamination.vue
  10. 4249 0
      src/xt_pages/user/Physicalexamination_new.vue
  11. 25 25
      src/xt_pages/user/components/PatientDetail.vue
  12. 0 209
      src/xt_pages/user/components/PatientSidebar.1.vue
  13. 8 1
      src/xt_pages/user/components/PatientSidebar.vue
  14. 623 0
      src/xt_pages/user/components/PatientSidebar_new.vue
  15. 8 3
      src/xt_pages/user/patientInfo.vue
  16. 748 0
      src/xt_pages/user/sickHistory_new.vue
  17. 40 0
      static/ueditor/dialogs/anchor/anchor.html
  18. 681 0
      static/ueditor/dialogs/attachment/attachment.css
  19. 60 0
      static/ueditor/dialogs/attachment/attachment.html
  20. 754 0
      static/ueditor/dialogs/attachment/attachment.js
  21. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif
  22. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_default.png
  23. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif
  24. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif
  25. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif
  26. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif
  27. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif
  28. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif
  29. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif
  30. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif
  31. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif
  32. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif
  33. BIN
      static/ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif
  34. BIN
      static/ueditor/dialogs/attachment/images/alignicon.gif
  35. BIN
      static/ueditor/dialogs/attachment/images/alignicon.png
  36. BIN
      static/ueditor/dialogs/attachment/images/bg.png
  37. BIN
      static/ueditor/dialogs/attachment/images/file-icons.gif
  38. BIN
      static/ueditor/dialogs/attachment/images/file-icons.png
  39. BIN
      static/ueditor/dialogs/attachment/images/icons.gif
  40. BIN
      static/ueditor/dialogs/attachment/images/icons.png
  41. BIN
      static/ueditor/dialogs/attachment/images/image.png
  42. BIN
      static/ueditor/dialogs/attachment/images/progress.png
  43. BIN
      static/ueditor/dialogs/attachment/images/success.gif
  44. BIN
      static/ueditor/dialogs/attachment/images/success.png
  45. 94 0
      static/ueditor/dialogs/background/background.css
  46. 56 0
      static/ueditor/dialogs/background/background.html
  47. 376 0
      static/ueditor/dialogs/background/background.js
  48. BIN
      static/ueditor/dialogs/background/images/bg.png
  49. BIN
      static/ueditor/dialogs/background/images/success.png
  50. 65 0
      static/ueditor/dialogs/charts/chart.config.js
  51. 165 0
      static/ueditor/dialogs/charts/charts.css
  52. 89 0
      static/ueditor/dialogs/charts/charts.html
  53. 519 0
      static/ueditor/dialogs/charts/charts.js
  54. BIN
      static/ueditor/dialogs/charts/images/charts0.png
  55. BIN
      static/ueditor/dialogs/charts/images/charts1.png
  56. BIN
      static/ueditor/dialogs/charts/images/charts2.png
  57. BIN
      static/ueditor/dialogs/charts/images/charts3.png
  58. BIN
      static/ueditor/dialogs/charts/images/charts4.png
  59. BIN
      static/ueditor/dialogs/charts/images/charts5.png
  60. 43 0
      static/ueditor/dialogs/emotion/emotion.css
  61. 54 0
      static/ueditor/dialogs/emotion/emotion.html
  62. 186 0
      static/ueditor/dialogs/emotion/emotion.js
  63. BIN
      static/ueditor/dialogs/emotion/images/0.gif
  64. BIN
      static/ueditor/dialogs/emotion/images/bface.gif
  65. BIN
      static/ueditor/dialogs/emotion/images/cface.gif
  66. BIN
      static/ueditor/dialogs/emotion/images/fface.gif
  67. BIN
      static/ueditor/dialogs/emotion/images/jxface2.gif
  68. BIN
      static/ueditor/dialogs/emotion/images/neweditor-tab-bg.png
  69. BIN
      static/ueditor/dialogs/emotion/images/tface.gif
  70. BIN
      static/ueditor/dialogs/emotion/images/wface.gif
  71. BIN
      static/ueditor/dialogs/emotion/images/yface.gif
  72. 89 0
      static/ueditor/dialogs/gmap/gmap.html
  73. 7 0
      static/ueditor/dialogs/help/help.css
  74. 82 0
      static/ueditor/dialogs/help/help.html
  75. 56 0
      static/ueditor/dialogs/help/help.js
  76. 894 0
      static/ueditor/dialogs/image/image.css
  77. 120 0
      static/ueditor/dialogs/image/image.html
  78. 1142 0
      static/ueditor/dialogs/image/image.js
  79. BIN
      static/ueditor/dialogs/image/images/alignicon.jpg
  80. BIN
      static/ueditor/dialogs/image/images/bg.png
  81. BIN
      static/ueditor/dialogs/image/images/icons.gif
  82. BIN
      static/ueditor/dialogs/image/images/icons.png
  83. BIN
      static/ueditor/dialogs/image/images/image.png
  84. BIN
      static/ueditor/dialogs/image/images/progress.png
  85. BIN
      static/ueditor/dialogs/image/images/success.gif
  86. BIN
      static/ueditor/dialogs/image/images/success.png
  87. 98 0
      static/ueditor/dialogs/insertframe/insertframe.html
  88. 81 0
      static/ueditor/dialogs/internal.js
  89. 126 0
      static/ueditor/dialogs/link/link.html
  90. 135 0
      static/ueditor/dialogs/map/map.html
  91. 118 0
      static/ueditor/dialogs/map/show.html
  92. 30 0
      static/ueditor/dialogs/music/music.css
  93. 32 0
      static/ueditor/dialogs/music/music.html
  94. 192 0
      static/ueditor/dialogs/music/music.js
  95. 40 0
      static/ueditor/dialogs/preview/preview.html
  96. BIN
      static/ueditor/dialogs/scrawl/images/addimg.png
  97. BIN
      static/ueditor/dialogs/scrawl/images/brush.png
  98. BIN
      static/ueditor/dialogs/scrawl/images/delimg.png
  99. BIN
      static/ueditor/dialogs/scrawl/images/delimgH.png
  100. 0 0
      static/ueditor/dialogs/scrawl/images/empty.png

File diff suppressed because it is too large
+ 0 - 2640
.idea/shelf/Uncommitted_changes_before_Update_at_2023_4_26_15_16_[Changes]/shelved.patch


File diff suppressed because it is too large
+ 0 - 131
.idea/shelf/Uncommitted_changes_before_Update_at_2023_6_30_17_15_[Changes]/shelved.patch


+ 24 - 22
src/xt_pages/Pharmacy/PatientDispensing.vue Vedi File

@@ -549,7 +549,7 @@ export default {
549 549
         shift: this.shift,
550 550
         partition: this.partition,
551 551
       };
552
-     
552
+
553 553
       waitingdrug(params).then((res) => {
554 554
         if (res.data.state == 1) {
555 555
           this.waitmount_data=[]
@@ -566,7 +566,7 @@ export default {
566 566
           this.patientList = []
567 567
           this.patientList = res.data.data.patientList
568 568
           var listTwo = res.data.data.listTwo
569
-         
569
+
570 570
           var newArr =[]
571 571
           if(listTwo!=null && listTwo.length>0){
572 572
              for(let i=0;i<listTwo.length;i++){
@@ -579,34 +579,34 @@ export default {
579 579
               newArr.push(listTwo[i])
580 580
              }
581 581
           }
582
-        
582
+
583 583
           if(list!=null && list.length>0){
584 584
             for(let i=0;i<list.length;i++){
585 585
               this.waitmount_data.push(list[i])
586 586
             }
587 587
             if(newArr!=null && newArr.length>0){
588 588
                for(let i=0;i<newArr.length;i++){
589
-                this.waitmount_data.push(newArr[i]) 
589
+                this.waitmount_data.push(newArr[i])
590 590
                }
591 591
             }
592 592
           }
593 593
           if(this.waitmount_data==null){
594 594
             if(newArr!=null && newArr.length>0){
595 595
                for(let i=0;i<newArr.length;i++){
596
-                this.waitmount_data.push(newArr[i]) 
596
+                this.waitmount_data.push(newArr[i])
597 597
                }
598 598
             }
599
-           
599
+
600 600
           }
601 601
           if(list==null){
602 602
             if(newArr!=null && newArr.length>0){
603 603
                for(let i=0;i<newArr.length;i++){
604
-                this.waitmount_data.push(newArr[i]) 
604
+                this.waitmount_data.push(newArr[i])
605 605
                }
606 606
             }
607
-           
607
+
608 608
           }
609
-         
609
+
610 610
         }
611 611
       });
612 612
       issueddrugs(params).then((res) => {
@@ -614,7 +614,7 @@ export default {
614 614
           this.alreadmount_data =[]
615 615
           var list = res.data.data.list;
616 616
           var listTwo =res.data.data.listTwo
617
-          
617
+
618 618
           if (this.shift != 0 || this.partition != 0) {
619 619
             if (list == null) {
620 620
               this.alreadmount = 0;
@@ -635,32 +635,32 @@ export default {
635 635
               newArr.push(listTwo[i])
636 636
              }
637 637
           }
638
-        
638
+
639 639
           if(list!=null && list.length>0){
640 640
             for(let i=0;i<list.length;i++){
641 641
               this.alreadmount_data.push(list[i])
642 642
             }
643 643
             if(newArr!=null && newArr.length>0){
644 644
                for(let i=0;i<newArr.length;i++){
645
-                this.alreadmount_data.push(newArr[i]) 
645
+                this.alreadmount_data.push(newArr[i])
646 646
                }
647 647
             }
648 648
           }
649 649
           if(this.waitmount_data==null){
650 650
             if(newArr!=null && newArr.length>0){
651 651
                for(let i=0;i<newArr.length;i++){
652
-                this.alreadmount_data.push(newArr[i]) 
652
+                this.alreadmount_data.push(newArr[i])
653 653
                }
654 654
             }
655
-           
655
+
656 656
           }
657 657
           if(list==null){
658 658
             if(newArr!=null && newArr.length>0){
659 659
                for(let i=0;i<newArr.length;i++){
660
-                this.alreadmount_data.push(newArr[i]) 
660
+                this.alreadmount_data.push(newArr[i])
661 661
                }
662 662
             }
663
-           
663
+
664 664
           }
665 665
         }
666 666
       });
@@ -699,17 +699,17 @@ export default {
699 699
             }
700 700
             if(newArr!=null && newArr.length>0){
701 701
                for(let i=0;i<newArr.length;i++){
702
-                this.waitmount_data.push(newArr[i]) 
702
+                this.waitmount_data.push(newArr[i])
703 703
                }
704 704
             }
705 705
           }
706 706
           if(list==null){
707 707
             if(newArr!=null && newArr.length>0){
708 708
                for(let i=0;i<newArr.length;i++){
709
-                this.waitmount_data.push(newArr[i]) 
709
+                this.waitmount_data.push(newArr[i])
710 710
                }
711 711
             }
712
-           
712
+
713 713
           }
714 714
 
715 715
           console.log("1111111");
@@ -738,17 +738,17 @@ export default {
738 738
             }
739 739
             if(newArr!=null && newArr.length>0){
740 740
                for(let i=0;i<newArr.length;i++){
741
-                this.alreadmount_data.push(newArr[i]) 
741
+                this.alreadmount_data.push(newArr[i])
742 742
                }
743 743
             }
744 744
           }
745 745
           if(list==null){
746 746
             if(newArr!=null && newArr.length>0){
747 747
                for(let i=0;i<newArr.length;i++){
748
-                this.alreadmount_data.push(newArr[i]) 
748
+                this.alreadmount_data.push(newArr[i])
749 749
                }
750 750
             }
751
-           
751
+
752 752
           }
753 753
 
754 754
           console.log("1111111s");
@@ -823,6 +823,8 @@ export default {
823 823
     },
824 824
     // 跳转打印页面
825 825
     toPrint() {
826
+      console.log('10653',this.tableData);
827
+
826 828
       if (this.tableData == null) {
827 829
         this.$message.error("未选择任何数据");
828 830
         return;

+ 1 - 1
src/xt_pages/eleFaPiao/patientSettleDetail.vue Vedi File

@@ -2,7 +2,7 @@
2 2
   <div class="main-contain new-main-contain">
3 3
     <div class="position">
4 4
       <!--      <bread-crumb :crumbs='crumbs'></bread-crumb>-->
5
-      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+      <!-- <bread-crumb :crumbs="crumbs"></bread-crumb> -->
6 6
     </div>
7 7
     <div
8 8
       class="app-container"

+ 628 - 0
src/xt_pages/outpatientDoctorStation/checkTemplate/printfive.vue Vedi File

@@ -0,0 +1,628 @@
1
+<template>
2
+  <div>
3
+
4
+    <div id="prescription-print3" class="prescription-print">
5
+      <div class="printTitle">检验申请单</div>
6
+
7
+      <div style="border: 1px solid #000;margin-bottom: 10px;">
8
+        <div
9
+          style="
10
+            display: flex;
11
+            justify-content: space-between;
12
+            border-bottom: 1px solid #000;
13
+            line-height: 40px;
14
+            padding: 0 10px;
15
+          "
16
+        >
17
+          <div>是否急诊:否</div>
18
+          <div>
19
+            结算方式:{{
20
+              faber && faber.transBody
21
+                ? getName(faber.transBody.outputlist1)
22
+                : ""
23
+            }}
24
+          </div>
25
+          <div>金额:{{ total }}</div>
26
+        </div>
27
+        <div
28
+          style="
29
+            display: flex;
30
+            justify-content: space-between;
31
+            border-bottom: 1px solid #000;
32
+            line-height: 40px;
33
+            padding: 0 10px;
34
+          "
35
+        >
36
+          <div>
37
+            姓名:{{
38
+              advicePrint[0].patient.name
39
+                ? advicePrint[0].patient.name.indexOf("(") > -1
40
+                  ? advicePrint[0].patient.name.substring(
41
+                      0,
42
+                      advicePrint[0].patient.name.indexOf("(")
43
+                    )
44
+                  : advicePrint[0].patient.name
45
+                : ""
46
+            }}
47
+          </div>
48
+          <div>
49
+            性别:
50
+            <span v-if="advicePrint[0].patient.gender == 1">男</span>
51
+            <span v-if="advicePrint[0].patient.gender == 2">女</span>
52
+          </div>
53
+          <div>年龄:{{getAge(advicePrint[0].patient)?getAge(advicePrint[0].patient):""}}岁</div>
54
+
55
+        </div>
56
+        <div style="margin-bottom: 20px; padding: 10px 10px 0" v-if="org_id!=10278 && org_id!=10138 && org_id!=0">
57
+          病史摘要:{{
58
+            history.history_of_present_illness
59
+              ? history.history_of_present_illness
60
+              : ""
61
+          }}
62
+        </div>
63
+        <div style="margin-bottom: 20px; padding: 0 10px">
64
+          临床诊断:{{ getDiagnosis(advicePrint[0].info.diagnosis) }}
65
+        </div>
66
+        <div style="display: flex; margin-bottom: 20px; padding: 0 10px">
67
+          <div>检验项目:</div>
68
+          <div>
69
+            <!-- <div v-for="item in projectPrint" style="margin-bottom: 10px">
70
+              {{ item.team.project_team }}
71
+            </div> -->
72
+            <div v-for="item in singleProjectPrint" style="margin-bottom: 10px">
73
+              {{ item.project.project_name }}
74
+            </div>
75
+          </div>
76
+        </div>
77
+        <div
78
+          style=" display: flex;justify-content: space-between;
79
+            border-top: 1px solid #000;line-height: 40px;padding: 0 10px;"
80
+        >
81
+          <div>开单医生:{{ doctor ? doctor : "" }}</div>
82
+          <div>
83
+            开单日期:
84
+            {{ getTime(pre_time) ? getTime(pre_time).split(" ")[0] : "" }}
85
+          </div>
86
+          <div>
87
+            医生签字:
88
+            <img
89
+              v-if="setAdminUserES(advicePrint[0].creator)"
90
+              style="height: 30px"
91
+              :src="setAdminUserES(advicePrint[0].creator)"
92
+              alt=""
93
+              srcset=""
94
+            />
95
+            <span
96
+              style="width: 100px; display: inline-block"
97
+              v-else-if="advicePrint[0].doctor != ''"
98
+            >
99
+              {{ advicePrint[0].doctor ? advicePrint[0].doctor : "" }}
100
+            </span>
101
+            <span v-else></span>
102
+          </div>
103
+        </div>
104
+      </div>
105
+    </div>
106
+  </div>
107
+</template>
108
+<script>
109
+import { jsGetAge, uParseTime } from "@/utils/tools";
110
+import {
111
+  getAllDoctorList,
112
+  getPrescriptionPrint,
113
+  getHisPatientDetail,
114
+  getPatientCaseHistory,
115
+} from "@/api/project/project";
116
+import { getInitData } from "@/api/his/his";
117
+export default {
118
+  props: {
119
+    patient_id: Number,
120
+    record_date: String,
121
+    prescription_id: Number,
122
+    ids: String,
123
+  },
124
+  data() {
125
+    return {
126
+      doctorList_1: [],
127
+      doctorList: [],
128
+      advicePrint: {},
129
+      patient: {},
130
+      tableData: [],
131
+      prescriptionInfo: [],
132
+      hisPatient: {},
133
+      department: [],
134
+      prescriptions: [],
135
+      projectList: [],
136
+      doc_name: "",
137
+      orgname: "",
138
+      diagnoses: [],
139
+      pageArr: [],
140
+      faber: {},
141
+      total: 0,
142
+      projectPrint: [],
143
+      time: "",
144
+      doctor: "",
145
+      org_id: "",
146
+      singleProjectPrint: [],
147
+      operatorMaps: {},
148
+    };
149
+  },
150
+  methods: {
151
+    getAge(patient){
152
+      // 将时间戳转换为 Date 对象
153
+      const birthday = new Date(patient.birthday* 1000);
154
+
155
+      // 获取当前日期
156
+      const now = new Date();
157
+      // 计算年龄差
158
+      const ageDiffMs = now - birthday;
159
+      const ageDate = new Date(ageDiffMs); // 不需要减掉 1970 年的时间戳
160
+      // 提取年份
161
+      const age = ageDate.getUTCFullYear() - 1970;
162
+      return age
163
+    },
164
+    getPatientCaseHistory() {
165
+      const params = {
166
+        patient_id: this.patient_id,
167
+        record_date:this.record_date,
168
+      };
169
+      getPatientCaseHistory(params).then((response) => {
170
+        if (response.data.state == 1) {
171
+          var history = response.data.data.history;
172
+          // console.log("中国history222222", history);
173
+          this.history = history;
174
+        }
175
+      });
176
+    },
177
+    getAllDoctorList() {
178
+      getAllDoctorList().then((response) => {
179
+        if (response.data.state == 1) {
180
+          var doctor = response.data.data.doctor;
181
+
182
+          this.doctorList = doctor;
183
+        }
184
+      });
185
+    },
186
+
187
+    getDoctor(id) {
188
+      var name = "";
189
+      for (let i = 0; i < this.doctorList.length; i++) {
190
+        if (id == this.doctorList[i].admin_user_id) {
191
+          name = this.doctorList[i].user_name;
192
+        }
193
+      }
194
+      return name;
195
+    },
196
+    getTime(value, temp) {
197
+      if (value != undefined) {
198
+        return uParseTime(value, temp);
199
+      }
200
+      return "";
201
+    },
202
+
203
+    getPrescriptionPrint() {
204
+      var params = {
205
+        // patient_id:this.patient_id,
206
+        // record_date:this.record_date,
207
+        // prescription_id:this.prescription_id,
208
+        patient_id: this.patient_id,
209
+        record_date: this.record_date,
210
+        prescription_id: this.prescription_id,
211
+        ids: this.ids,
212
+        p_type: 2,
213
+      };
214
+      // console.log("params", params);
215
+      getPrescriptionPrint(params).then((response) => {
216
+        if (response.data.state == 1) {
217
+          var advicePrint = response.data.data.advicePrint;
218
+          console.log("adviceprint999933333", response.data.data);
219
+          this.advicePrint = advicePrint;
220
+          this.prescriptions = advicePrint;
221
+          // console.log("处方222222", this.prescriptions);
222
+          var hisPatient = response.data.data.hisPatient;
223
+          // console.log("hisPatient", hisPatient);
224
+          this.hisPatient = hisPatient;
225
+          let projectPrint = [];
226
+          let total = 0;
227
+          this.advicePrint.map((item) => {
228
+
229
+            if (item.project.length > 0) {
230
+              item.project.map((it) => {
231
+                if (it.type == 2) {
232
+
233
+                  //103属于韶关宜柏的检验项目类型
234
+                  if (it.project.cost_classify == 3 || it.project.cost_classify == 103
235
+                  ) {
236
+                    projectPrint.push(it);
237
+                    total += it.project.price * parseInt(it.count);
238
+                  }
239
+                }
240
+              });
241
+            }
242
+          });
243
+          console.log("imte233232323232323223", projectPrint);
244
+          this.doctorList_1 = response.data.data.eles;
245
+          // console.log(this.doctorList_1, "医生列表");
246
+          if (this.doctorList_1.length > 0) {
247
+            var operatorsLen = this.doctorList_1.length;
248
+            for (var index = 0; index < operatorsLen; index++) {
249
+              this.$set(
250
+                this.operatorMaps,
251
+                this.doctorList_1[index].creator,
252
+                this.doctorList_1[index]
253
+              );
254
+            }
255
+          }
256
+          let data = [];
257
+          let data2 = [];
258
+          let data3 = [];
259
+          projectPrint.map((item) => {
260
+            if (item.team.id != 0) {
261
+              let status = data.some((it) => it.team.id == item.team.id);
262
+              if (!status) {
263
+                data.push(item);
264
+              }
265
+            }
266
+            if (item.team.id == 0) {
267
+              data2.push(item);
268
+            }
269
+          });
270
+          this.projectPrint = data;
271
+          console.log("列表", this.projectPrint);
272
+          this.total = total.toFixed(2);
273
+          this.pre_time = this.advicePrint[0].pre_time;
274
+          this.doctor = this.advicePrint[0].doctor;
275
+          data2=data2.concat(data3)
276
+          this.singleProjectPrint = data2;
277
+          console.log("列表333", this.singleProjectPrint);
278
+          var projectlist = response.data.data.projectlist;
279
+
280
+          var projectlist = response.data.data.projectlist;
281
+          // console.log("所有项目列表", projectlist);
282
+          this.projectList = projectlist;
283
+          this.getPage();
284
+          let outputlist1Name = response.data.data.his.patient_info
285
+            ? JSON.parse(response.data.data.his.patient_info)
286
+            : {};
287
+          this.faber = outputlist1Name;
288
+        }
289
+      });
290
+    },
291
+    // 电子签名
292
+    setAdminUserES(id) {
293
+      // console.log(id, "id");
294
+      if (id == 0) {
295
+        return "";
296
+      }
297
+      if (id in this.operatorMaps) {
298
+        // console.log(this.operatorMaps, "this.operatorMaps");
299
+        return this.operatorMaps[id].url;
300
+      } else {
301
+        // console.log("po");
302
+        return "";
303
+      }
304
+    },
305
+    getHisPatientDetail() {
306
+      const params = {
307
+        patient_id: this.patient_id,
308
+      };
309
+      getHisPatientDetail(params).then((response) => {
310
+        if (response.data.state == 1) {
311
+          var hisPatient = response.data.data.hisPatient;
312
+          // console.log("挂号病人", hisPatient);
313
+          this.hisPatient = hisPatient;
314
+        }
315
+      });
316
+    },
317
+    getInitData() {
318
+      getInitData().then((response) => {
319
+        if (response.data.state == 1) {
320
+          this.department = response.data.data.department;
321
+          this.diagnoses = response.data.data.diagnose.sort(this.compare("id"));
322
+          // console.log("争端", this.diagnoses);
323
+        }
324
+      });
325
+    },
326
+    getDepart(id) {
327
+      var name = "";
328
+      for (let i = 0; i < this.department.length; i++) {
329
+        if (id == this.department[i].id) {
330
+          name = this.department[i].name;
331
+        }
332
+      }
333
+      return name;
334
+    },
335
+    getTotalOne(id) {
336
+      var total = 0;
337
+      var addtotal = 0;
338
+      for (let i = 0; i < this.prescriptions.length; i++) {
339
+        if (id == this.prescriptions[i].id) {
340
+          if (this.prescriptions[i].project != null) {
341
+            for (let a = 0; a < this.prescriptions[i].project.length; a++) {
342
+              total =
343
+                total +
344
+                this.prescriptions[i].project[a].price *
345
+                  this.prescriptions[i].project[a].count;
346
+            }
347
+          }
348
+
349
+          if (this.prescriptions[i].additionalcharge != null) {
350
+            for (
351
+              let a = 0;
352
+              a < this.prescriptions[i].additionalcharge.length;
353
+              a++
354
+            ) {
355
+              addtotal =
356
+                addtotal +
357
+                this.prescriptions[i].additionalcharge[a].price *
358
+                  this.prescriptions[i].additionalcharge[a].count;
359
+            }
360
+          }
361
+          addtotal = Math.floor(addtotal * 100) / 100;
362
+        }
363
+      }
364
+
365
+      for (let i = 0; i < this.prescriptions.length; i++) {
366
+        if (id == this.prescriptions[i].id) {
367
+          if (this.prescriptions[i].advices != null) {
368
+            for (let a = 0; a < this.prescriptions[i].advices.length; a++) {
369
+              total =
370
+                total +
371
+                this.prescriptions[i].advices[a].price *
372
+                  this.prescriptions[i].advices[a].prescribing_number;
373
+            }
374
+          }
375
+
376
+          if (this.prescriptions[i].additionalcharge != null) {
377
+            for (
378
+              let a = 0;
379
+              a < this.prescriptions[i].additionalcharge.length;
380
+              a++
381
+            ) {
382
+              addtotal =
383
+                addtotal +
384
+                this.prescriptions[i].additionalcharge[a].price *
385
+                  this.prescriptions[i].additionalcharge[a].count;
386
+            }
387
+          }
388
+          addtotal = Math.floor(addtotal * 100) / 100;
389
+        }
390
+      }
391
+
392
+      return total + addtotal;
393
+    },
394
+
395
+    getProjectName(id) {
396
+      var project_name = "";
397
+      for (let i = 0; i < this.projectList.length; i++) {
398
+        if (id == this.projectList[i].id) {
399
+          project_name = this.projectList[i].project_name;
400
+        }
401
+      }
402
+      return project_name;
403
+    },
404
+
405
+    getDiagnosis(ids) {
406
+      let newIds = ids.split(",").sort(function (a, b) {
407
+        return a - b;
408
+      });
409
+
410
+      var name = "";
411
+      let nameArr = [];
412
+      for (let i = 0; i < this.diagnoses.length; i++) {
413
+        // if(id == this.diagnoses[i].id){
414
+        //    name = this.diagnoses[i].class_name
415
+        // }
416
+
417
+        if (newIds.indexOf(this.diagnoses[i].id.toString()) > -1) {
418
+          // name += diagnoses[i].class_name + ' '
419
+          nameArr.push(this.diagnoses[i].class_name);
420
+        }
421
+      }
422
+      let newNameArr = [];
423
+      nameArr.map((item, index) => {
424
+        if (item == "尿毒症") {
425
+          newNameArr.push(item);
426
+          nameArr.splice(index, 1, "");
427
+        }
428
+      });
429
+      newNameArr.push(...nameArr);
430
+      return newNameArr.join(" ");
431
+    },
432
+    compare(property) {
433
+      return function (a, b) {
434
+        var value1 = a[property];
435
+        var value2 = b[property];
436
+        return value1 - value2; //升序排序
437
+      };
438
+    },
439
+    getPage() {
440
+      this.page = 1;
441
+      this.pageArr = [];
442
+
443
+      this.advicePrint.map((item) => {
444
+        let arr = [];
445
+        item.pageArr = [];
446
+        if (item.advices.length <= 5) {
447
+          this.page = 1;
448
+          arr.push(item.advices.length);
449
+          item.pageArr.push(arr);
450
+        } else if (item.advices.length > 5) {
451
+          this.page = parseInt(item.advices.length / 5);
452
+          let num = item.advices.length % 5;
453
+          for (var i = 0; i < this.page; i++) {
454
+            item.pageArr.push([5]);
455
+          }
456
+          if (num != 0) {
457
+            item.pageArr.push([num]);
458
+          }
459
+        }
460
+      });
461
+      // console.log('this.pageArr',this.pageArr)
462
+    },
463
+    getName(list) {
464
+      console.log("list", list);
465
+      let new_list = [];
466
+      for (let i = 0; i < list.length; i++) {
467
+        if (list[i].aac031 == "1") {
468
+          new_list.push(list[i]);
469
+        }
470
+      }
471
+
472
+      switch (new_list[0].bcc334) {
473
+        case "A31001":
474
+          return "深圳医保1档";
475
+          break;
476
+        case "A31002":
477
+          return "深圳医保2档";
478
+
479
+          break;
480
+        case "A31003":
481
+          return "深圳医保3档";
482
+
483
+          break;
484
+        case "A31004":
485
+          return "二档(少儿)";
486
+
487
+          break;
488
+        case "A31005":
489
+          return "学生二档";
490
+
491
+          break;
492
+        case "A31006":
493
+          return "大学生二档";
494
+
495
+          break;
496
+        case "A32001":
497
+          return "在职公务员";
498
+          break;
499
+        case "A32002":
500
+          return "在职驻深公务员";
501
+
502
+          break;
503
+        case "A39301":
504
+          return "家属统筹医疗";
505
+
506
+          break;
507
+        case "A41001":
508
+          return "工伤在职";
509
+
510
+          break;
511
+        case "A51001":
512
+          return "生育在职";
513
+
514
+          break;
515
+        case "A52001":
516
+          return "生育医疗一档";
517
+
518
+          break;
519
+        case "A52002":
520
+          return "生育医疗一档";
521
+
522
+          break;
523
+        case "C31001":
524
+          return "一档医疗退休";
525
+
526
+          break;
527
+        case "C31002":
528
+          return "二档医疗退休";
529
+          break;
530
+      }
531
+    },
532
+  },
533
+  created() {
534
+    this.getAllDoctorList();
535
+    this.getInitData();
536
+    this.getPrescriptionPrint();
537
+    this.getHisPatientDetail();
538
+    this.getPatientCaseHistory();
539
+    var xtuser = this.$store.getters.xt_user;
540
+    this.orgname = xtuser.org.org_name;
541
+    this.org_id = this.$store.getters.xt_user.org_id;
542
+  },
543
+  watch: {
544
+    ids: function (val) {
545
+      this.ids = val;
546
+      this.getPrescriptionPrint();
547
+    },
548
+  },
549
+};
550
+</script>
551
+
552
+
553
+<style lang="scss" scoped>
554
+.prescription-print {
555
+  -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
556
+    0 0 60px rgba(0, 0, 0, 0.06) inset;
557
+  -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27),
558
+    0 0 40px rgba(0, 0, 0, 0.06) inset;
559
+  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
560
+  margin-bottom: 20px;
561
+  padding: 20px 10px;
562
+}
563
+.printTitle {
564
+  font-size: 22px;
565
+  text-align: center;
566
+  font-weight: bold;
567
+  margin-bottom: 10px;
568
+}
569
+.infoTitle {
570
+  display: flex;
571
+  margin-top: 10px;
572
+  line-height: 24px;
573
+}
574
+.infoTitle div {
575
+  width: 200px;
576
+}
577
+.infoMain {
578
+  display: flex;
579
+  flex-wrap: wrap;
580
+  margin-top: 10px;
581
+}
582
+.infoMain div {
583
+  width: 50%;
584
+  line-height: 24px;
585
+}
586
+.prescriptionBox {
587
+  padding: 0 10px;
588
+  min-height: 400px;
589
+}
590
+.Rp {
591
+  font-size: 22px;
592
+  font-weight: bold;
593
+}
594
+.drugsBox {
595
+  padding-left: 40px;
596
+  margin-bottom: 10px;
597
+}
598
+.drugsBox div {
599
+  line-height: 20px;
600
+}
601
+.drugsOne {
602
+  line-height: 24px;
603
+}
604
+.drugsOne span {
605
+  margin-right: 20px;
606
+}
607
+.doctorBox {
608
+  display: flex;
609
+  justify-content: space-between;
610
+  padding: 0 10px;
611
+  line-height: 24px;
612
+  border-bottom: 2px solid #000;
613
+}
614
+.actionBar {
615
+  display: flex;
616
+  justify-content: space-between;
617
+  line-height: 24px;
618
+  padding: 0 10px;
619
+}
620
+.actionBar p {
621
+  width: 150px;
622
+}
623
+.under_line {
624
+  display: inline-block;
625
+  border-bottom: 1px solid #000;
626
+  flex: 1;
627
+}
628
+</style>

+ 256 - 0
src/xt_pages/user/Informed/components/CRRT_informed.vue Vedi File

@@ -0,0 +1,256 @@
1
+<!-- 危重 -->
2
+<template>
3
+  <div style="border:1px solid gainsboro ;padding:10px">
4
+      <div style="position: relative; left: 400px;width: 250px;margin: 20px 0;">
5
+        <!-- <el-button type="primary">主要按钮</el-button> -->
6
+         <el-button type="primary" style=""  @click="bianji">
7
+              编辑
8
+          </el-button>
9
+        <!--<el-button type="danger" style=""  @click="">
10
+              删除
11
+        </el-button> -->
12
+        <el-button type="success" style=""  @click="printThisPage">
13
+            打印
14
+        </el-button>
15
+      </div>
16
+      <div id="print_content">
17
+        <div class="print_page_main_content">
18
+          <div class="content">
19
+              <h2 style="text-align: center;">{{orgname}}<br/>连续肾脏替代治疗(CRRT)治疗知情同意书</h2>
20
+
21
+              <div style="text-align: right;">
22
+                透析号:{{ patient.dialysis_no }}
23
+              </div>
24
+              <div style="display: flex;margin: 10px 0;">
25
+                <div style="flex:1">姓名:
26
+                  {{ patient.name }}
27
+                </div>
28
+                <div style="flex:1">性别:
29
+                  <span v-if="patient.gender == 1">男</span>
30
+                   <span v-if="patient.gender == 2">女</span>
31
+                </div>
32
+                <div style="flex:1">年龄:
33
+                  {{ getAge(patient) }}
34
+                </div>
35
+                <div style="flex:1">住院(门诊)号:
36
+                  {{ patient.admission_number }}
37
+                </div>
38
+              </div>
39
+              <div style="border-bottom: 1px solid gainsboro;">
40
+                诊断:
41
+                {{ patient.diagnose }}
42
+              </div>
43
+              <div v-html="content" ></div>
44
+          </div>
45
+        </div>
46
+      </div>
47
+      <el-dialog
48
+        title="提示"
49
+        :visible.sync="dialogVisible"
50
+        width="60%"
51
+        >
52
+        <div>
53
+          <h2 style="text-align: center;">连续肾脏替代治疗(CRRT)治疗知情同意书</h2>
54
+
55
+          <div style="text-align: right;">
56
+            透析号:{{ patient.dialysis_no }}
57
+          </div>
58
+          <div style="display: flex;margin: 10px 0;">
59
+            <div style="flex:1">姓名:{{ patient.name }}</div>
60
+            <div style="flex:1">性别:
61
+              <span v-if="patient.gender == 1">男</span>
62
+                <span v-if="patient.gender == 2">女</span>
63
+            </div>
64
+            <div style="flex:1">年龄:
65
+              {{ getAge(patient) }}
66
+            </div>
67
+            <div style="flex:1">住院(门诊)号:
68
+              {{ patient.admission_number }}
69
+            </div>
70
+          </div>
71
+          <div style="border-bottom: 1px solid gainsboro;">
72
+            诊断:
73
+            {{ patient.diagnose }}
74
+          </div>
75
+          <keep-alive>
76
+            <editor ref="editor"
77
+                    id="editor"
78
+                    style="width: 100%"
79
+                    v-bind:r_content="content">
80
+            </editor>
81
+          </keep-alive>
82
+        </div>
83
+        <span slot="footer" class="dialog-footer">
84
+          <el-button @click="dialogVisible = false">取 消</el-button>
85
+          <el-button type="primary" @click="saveCriticalInfomed">保 存</el-button>
86
+        </span>
87
+      </el-dialog>
88
+  </div>
89
+</template>
90
+
91
+<script>
92
+import print from "print-js";
93
+import Editor from '@/components/Editor'
94
+import { getPatientDetailInformedconsent,saveCriticalInfomed  } from '@/api/patient'
95
+import { jsGetAge, uParseTime } from "@/utils/tools";
96
+const content=`
97
+  <p>
98
+    <span>
99
+      患者因病情需要,需进行连续肾脏替代治疗(CRRT),该治疗具有一定危险性及损伤性,现将于该操作有关的危险性及可能的损伤向病人及家属告知如下:
100
+    </span>
101
+  </p>
102
+  <p>
103
+    <span>
104
+      1、由于治疗过程中需使用抗凝剂,因此有引起脑出血等全身出血的可能,(如该患者APTT明显延长,拟采取无肝素化CRRT,但有可能导致管路、血滤器凝血堵塞,提前中断治疗。)
105
+    </span>
106
+  </p>
107
+  <p>
108
+    <span> 2、可能合并或加重感染的症状;</span>
109
+  </p>
110
+  <p>
111
+    <span>3、有引起空气栓塞的可能;</span>
112
+  </p>
113
+  <p>
114
+    <span>4、可能因出现生物相容性问题,而致过敏反应;</span>
115
+  </p>
116
+  <p>
117
+    <span>
118
+      以上并发症出现的概率虽低,但均有可能出现,我们将尽量避免并做好抢救准备。对上述各种可能发生的情况如患者已知情并表示理解,经过认真考虑后同意接受治疗,愿意承担以上风险,请签字为证。
119
+    </span>
120
+  </p>
121
+  <p style="padding:10px 0px;">
122
+    <span>患者本人:</span>
123
+  </p>
124
+  <p style="padding:10px 0px;display:flex;align-items: center;">
125
+      <span style="display: inline-block;flex: 1;">委托人:&nbsp;&nbsp;&nbsp;&nbsp;</span>
126
+      <span style="display: inline-block;flex: 1;">与患者的关系:&nbsp;&nbsp;&nbsp;&nbsp;</span>
127
+  </p>
128
+  <p style="padding:10px 0px;display:flex;align-items: center;">
129
+      <span>医师签名:&nbsp;&nbsp;&nbsp;&nbsp;</span>
130
+  </p>
131
+  <p style="padding:10px 0px;align-items: center;text-align: right;width: 100%;">
132
+      <span>年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;月&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日</span>
133
+  </p>`
134
+
135
+export default{
136
+  props: {
137
+    patient_id: {
138
+        type: Number,
139
+      },
140
+      criticalInforPrint:{
141
+        type:Object,
142
+      }
143
+   },
144
+   components:{
145
+    Editor
146
+   },
147
+  data(){
148
+    return{
149
+      patient:{},
150
+      dialogVisible:false,
151
+      content:content,
152
+      orgname:'',
153
+    }
154
+   },
155
+  methods:{
156
+    getlist(){
157
+
158
+      getPatientDetailInformedconsent(this.patient_id).then(response=>{
159
+        if(response.data.state == 1){
160
+          var patient =  response.data.data.patients
161
+          console.log("patinet",patient)
162
+          this.patient =patient
163
+        }
164
+      })
165
+    },
166
+    printThisPage(){
167
+        const style = '@media print {.content p{font-size: 16px;font-family: SimSun;  margin-bottom: 5px;}}'
168
+        printJS({
169
+            printable: 'print_content',
170
+            type: 'html',
171
+            documentTitle: '  ',
172
+            style: style,
173
+            scanStyles: false
174
+        })
175
+    },
176
+    getAge: function(val) {
177
+        if (val.id_card_no == undefined) {
178
+          return false
179
+        }
180
+        var thisLen = val.id_card_no.length
181
+        var birth = ''
182
+        if (thisLen == 15) {
183
+          birth = '19' + val.id_card_no.substr(6, 6)
184
+        } else {
185
+          birth = val.id_card_no.substr(6, 8)
186
+        }
187
+        var birthtwo =
188
+          birth.substr(0, 4) +
189
+          '-' +
190
+          birth.substr(4, 2) +
191
+          '-' +
192
+          birth.substr(6, 2)
193
+
194
+        var age = jsGetAge(birthtwo, '-')
195
+        return age
196
+    },
197
+    bianji(){
198
+      this.dialogVisible=true
199
+    },
200
+    show(val){
201
+
202
+       if(val!=null){
203
+        console.log("valw233223",val)
204
+         if(val.content!=""){
205
+           this.content = ""
206
+           this.content = val.content
207
+         }
208
+
209
+       }
210
+     },
211
+    saveCriticalInfomed(){
212
+        var params = {
213
+          content:this.$refs.editor.content
214
+        }
215
+      saveCriticalInfomed(params).then(response=>{
216
+         if(response.data.state ==1){
217
+           var list = response.data.data.list
218
+           this.$message.success("保存成功")
219
+           this.dialogVisible = false
220
+           this.$emit("getCriticalInformed","");
221
+         }
222
+      })
223
+    }
224
+  },
225
+  created(){
226
+    this.orgname = this.$store.getters.xt_user.org.org_name;
227
+    console.log("haaaaaaaaaaaaaaaaaaa",this.criticalInforPrint)
228
+    if(this.criticalInforPrint!=null && this.criticalInforPrint.id>0){
229
+        this.content = ""
230
+        this.content = this.criticalInforPrint.content
231
+    }
232
+    this.getlist()
233
+  }
234
+}
235
+</script>
236
+<style lang="scss" scoped>
237
+
238
+*{
239
+  // margin: 0;
240
+  // padding: 0;
241
+  border: 0;
242
+}
243
+  .content{
244
+      p{
245
+        font-size: 16px;
246
+        font-family: '新宋体';
247
+        line-height: 22px;
248
+        // padding-left: 20px;
249
+        margin-bottom: 5px;
250
+        text-align: justify;
251
+      }
252
+  }
253
+.wrapper {
254
+  white-space: pre-wrap;
255
+}
256
+</style>

+ 263 - 0
src/xt_pages/user/Informed/components/Terminate_informed.vue Vedi File

@@ -0,0 +1,263 @@
1
+<!-- 透析器(滤器) -->
2
+<!-- 自带 -->
3
+<template>
4
+  <div style="border:1px solid gainsboro ;padding:10px">
5
+      <div style="position: relative; left: 400px;width: 250px;margin: 20px 0;">
6
+        <!-- <el-button type="primary">主要按钮</el-button> -->
7
+         <el-button type="primary" style=""  @click="bianji">
8
+              编辑
9
+          </el-button>
10
+        <!--<el-button type="danger" style=""  @click="">
11
+              删除
12
+        </el-button> -->
13
+        <el-button type="success" style=""  @click="printThisPage">
14
+            打印
15
+        </el-button>
16
+      </div>
17
+      <div id="print_content">
18
+          <div class="print_page_main_content">
19
+          <div class="content">
20
+            <div style="text-align: center;font-size: 20px;">{{ orgname }}</div>
21
+              <h2 style="text-align: center;">患方要求终止治疗及风险、责任承担承诺书</h2>
22
+
23
+              <div style="text-align: right;">
24
+                透析号:{{ patient.dialysis_no }}
25
+              </div>
26
+              <div style="display: flex;margin: 10px 0;">
27
+                <div style="flex:1">姓名:
28
+                  {{ patient.name }}
29
+                </div>
30
+                <div style="flex:1">性别:
31
+                  <span v-if="patient.gender == 1">男</span>
32
+                   <span v-if="patient.gender == 2">女</span>
33
+                </div>
34
+                <div style="flex:1">年龄:
35
+                  {{ getAge(patient) }}
36
+                </div>
37
+                <div style="flex:1">住院(门诊)号:
38
+                  {{ patient.admission_number }}
39
+                </div>
40
+              </div>
41
+              <div style="border-bottom: 1px solid gainsboro;">
42
+                诊断:
43
+                {{ patient.diagnose }}
44
+              </div>
45
+              <div v-html="content"></div>
46
+
47
+          </div>
48
+          </div>
49
+      </div>
50
+      <el-dialog
51
+        title="提示"
52
+        :visible.sync="dialogVisible"
53
+        width="60%"
54
+        >
55
+        <div>
56
+          <h2 style="text-align: center;">患方要求终止治疗及风险、责任承担承诺书</h2>
57
+
58
+          <div style="text-align: right;">
59
+            透析号:{{ patient.dialysis_no }}
60
+          </div>
61
+          <div style="display: flex;margin: 10px 0;">
62
+            <div style="flex:1">姓名:{{ patient.name }}</div>
63
+            <div style="flex:1">性别:
64
+              <span v-if="patient.gender == 1">男</span>
65
+                <span v-if="patient.gender == 2">女</span>
66
+            </div>
67
+            <div style="flex:1">年龄:
68
+              {{ getAge(patient) }}
69
+            </div>
70
+            <div style="flex:1">住院(门诊)号:
71
+              {{ patient.admission_number }}
72
+            </div>
73
+          </div>
74
+          <div style="border-bottom: 1px solid gainsboro;">
75
+            诊断:
76
+            {{ patient.diagnose }}
77
+          </div>
78
+          <keep-alive>
79
+            <editor ref="editor"
80
+                    id="editor"
81
+                    style="width: 100%"
82
+                    v-bind:r_content="content">
83
+            </editor>
84
+          </keep-alive>
85
+        </div>
86
+        <span slot="footer" class="dialog-footer">
87
+          <el-button @click="dialogVisible = false">取 消</el-button>
88
+          <el-button type="primary" @click="saveDialyzerInformed">保 存</el-button>
89
+        </span>
90
+      </el-dialog>
91
+  </div>
92
+</template>
93
+
94
+<script>
95
+import print from "print-js";
96
+import Editor from '@/components/Editor'
97
+import { getPatientDetailInformedconsent,saveDialyzerInformed  } from '@/api/patient'
98
+import { jsGetAge, uParseTime } from "@/utils/tools";
99
+const content=`
100
+    <p style="text-indent:20px">
101
+      <span >
102
+        医院在任何情况下都是以抢救患者生命为己任,院方不支持、不主张放弃对任何患者的治疗和抢救,但医院会尊重患者及家属在治疗上的选择权,包括终止治疗的选择权。
103
+      </span>
104
+    </p>
105
+    <p style="text-indent:20px">
106
+      <span >
107
+        医院要遵守相应的诊疗规范,有权利和义务对患者积极抢救和治疗,在某些特殊情况下,出于某些特殊的原因,患者和家属要求终止治疗、撤销对患者的生命支持、放弃临终前的抢救。例如恶性肿瘤终末期患者、脑死亡患者、某些重要器官功能衰竭终末期又没有可能寻求替代疗法等。医生对这些患者只可能尽量减轻其痛苦、给患者的生命维持、支持治疗,进行必要的心肺复苏抢救。只要不违背人道主义和国家法律法规,医方将尊重患者和家属的意愿和选择。
108
+      </span>
109
+    </p>
110
+    <p style="text-indent:20px">
111
+      <span>如果您和全家一致要求终止对患者的治疗,我们确认:</span>
112
+    </p>
113
+    <p>
114
+      <span>1、此决定没有违背患者本人的意愿。</span>
115
+    </p>
116
+    <p>
117
+      <span>2、如果患者本人已经无法履行这样权利时,要有一份正式的授权委托书,证明您有权替患者做出这样的决定。</span>
118
+    </p>
119
+    <p>
120
+      <span>患方须承担相关医疗风险和法律责任,患方承诺同意承担,方可签字。</span>
121
+    </p>
122
+    <p>
123
+      <span>我们要求在患者死亡前放弃对患者的心肺复苏相关抢救。</span>
124
+    </p>
125
+    <p>
126
+      <span>我们要求撤销目前对患者的生命支持治疗。</span>
127
+    </p>
128
+    <p>
129
+      <span>我们要求终止目前对患者治疗。</span>
130
+    </p>
131
+    <p>
132
+      <span>其他:  </span>
133
+    </p>
134
+    <p style="padding:10px 0px;display:flex;align-items: center;">
135
+        <span style="display: inline-block;flex: 1;">患者签名:&nbsp;&nbsp;&nbsp;&nbsp;</span>
136
+        <span style="display: inline-block;flex: 1;">医生签名:&nbsp;&nbsp;&nbsp;&nbsp;</span>
137
+    </p>
138
+    <p style="padding:10px 0px;display:flex;align-items: center;">
139
+        <span>家属签名:&nbsp;&nbsp;&nbsp;&nbsp;</span>
140
+    </p>
141
+    <p style="padding:10px 0px;display:flex;align-items: center;">
142
+        <span style="display: inline-block;flex: 1;">与患者关系:&nbsp;&nbsp;&nbsp;&nbsp;</span>
143
+        <span style="display: inline-block;flex: 1;">日期及时间:&nbsp;&nbsp;&nbsp;&nbsp;</span>
144
+    </p>`
145
+export default{
146
+  props: {
147
+    patient_id: {
148
+        type: Number,
149
+      },
150
+      dialyzerInformedPrint:{
151
+        type:Object
152
+      }
153
+   },
154
+   components:{
155
+    Editor
156
+   },
157
+  data(){
158
+    return{
159
+      patient:{},
160
+      dialogVisible:false,
161
+      content:content,
162
+      orgname:'',
163
+    }
164
+   },
165
+  methods:{
166
+      getlist(){
167
+        getPatientDetailInformedconsent(this.patient_id).then(response=>{
168
+          if(response.data.state == 1){
169
+            var patient =  response.data.data.patients
170
+            console.log("patinet",patient)
171
+            this.patient =patient
172
+          }
173
+        })
174
+      },
175
+      printThisPage(){
176
+          const style = '@media print {.content p{font-size: 16px;font-family: 新宋体;  margin-bottom: 5px;}}'
177
+          printJS({
178
+              printable: 'print_content',
179
+              type: 'html',
180
+              documentTitle: '  ',
181
+              style: style,
182
+              scanStyles: false
183
+          })
184
+      },
185
+      getAge: function(val) {
186
+          if (val.id_card_no == undefined) {
187
+            return false
188
+          }
189
+          var thisLen = val.id_card_no.length
190
+          var birth = ''
191
+          if (thisLen == 15) {
192
+            birth = '19' + val.id_card_no.substr(6, 6)
193
+          } else {
194
+            birth = val.id_card_no.substr(6, 8)
195
+          }
196
+          var birthtwo =
197
+            birth.substr(0, 4) +
198
+            '-' +
199
+            birth.substr(4, 2) +
200
+            '-' +
201
+            birth.substr(6, 2)
202
+
203
+          var age = jsGetAge(birthtwo, '-')
204
+          return age
205
+      },
206
+      bianji(){
207
+        this.dialogVisible=true
208
+      },
209
+      show(val){
210
+
211
+       if(val!=null){
212
+        console.log("valw233223",val)
213
+         if(val.content!=""){
214
+           this.content = ""
215
+           this.content = val.content
216
+         }
217
+
218
+       }
219
+     },
220
+      saveDialyzerInformed(){
221
+         var params = {
222
+          content:this.$refs.editor.content,
223
+         }
224
+        saveDialyzerInformed(params).then(response=>{
225
+           if(response.data.state ==1){
226
+             var list = response.data.data.list
227
+            this.$message.success("保存成功!")
228
+            this.dialogVisible = false
229
+            this.$emit("getDialyzerInformed","");
230
+           }
231
+        })
232
+      }
233
+
234
+  },
235
+  created(){
236
+    this.orgname = this.$store.getters.xt_user.org.org_name;
237
+    console.log("hhahdfhahdfhahdf",this.dialyzerInformedPrint)
238
+    if(this.dialyzerInformedPrint!=null&& this.dialyzerInformedPrint.id >0){
239
+        this.content = ""
240
+        this.content =this.dialyzerInformedPrint.content
241
+    }
242
+    this.getlist()
243
+  }
244
+}
245
+</script>
246
+<style lang="scss" scoped>
247
+
248
+*{
249
+  // margin: 0;
250
+  // padding: 0;
251
+  border: 0;
252
+}
253
+  .content{
254
+      p{
255
+        font-size: 16px;
256
+        font-family: '新宋体';
257
+        line-height: 22px;
258
+        // padding-left: 20px;
259
+        margin-bottom: 5px;
260
+        text-align: justify;
261
+      }
262
+  }
263
+</style>

+ 311 - 0
src/xt_pages/user/Informed/components/nonheparin_informed.vue Vedi File

@@ -0,0 +1,311 @@
1
+<!-- 危重 -->
2
+<template>
3
+  <div style="border:1px solid gainsboro ;padding:10px">
4
+      <div style="position: relative; left: 400px;width: 250px;margin: 20px 0;">
5
+        <!-- <el-button type="primary">主要按钮</el-button> -->
6
+         <el-button type="primary" style=""  @click="bianji">
7
+              编辑
8
+          </el-button>
9
+        <!--<el-button type="danger" style=""  @click="">
10
+              删除
11
+        </el-button> -->
12
+        <el-button type="success" style=""  @click="printThisPage">
13
+            打印
14
+        </el-button>
15
+      </div>
16
+      <div id="print_content">
17
+        <div class="print_page_main_content">
18
+          <div class="content" style="font-family:SimSun;">
19
+              <div> </div>
20
+              <h2 style="text-align: center;">{{ orgname }}<br/>无肝素血液透析风险知情同意书</h2>
21
+
22
+              <div style="text-align: right;">
23
+                透析号:{{ patient.dialysis_no }}
24
+              </div>
25
+
26
+                <table border="1" style="border-collapse: collapse;width: 100%;">
27
+                  <tr>
28
+                    <td width="30" style="padding: 3px;line-height: 40px;">姓名:{{ patient.name }}</td>
29
+                    <td width="15" style="padding: 3px;line-height: 40px;">性别:{{ patient.gender == 1 ? '男' : '女' }}</td>
30
+                    <td width="15" style="padding: 3px;line-height: 40px;">年龄:{{getAge(patient)}}</td>
31
+                    <td width="40" style="padding: 3px;line-height: 40px;">门诊住院号:{{ patient.admission_number }}</td>
32
+                  </tr>
33
+                  <tr>
34
+                    <td colspan="4" style="padding: 3px;line-height: 40px;">住址或单位:{{patient.home_address}}</td>
35
+                  </tr>
36
+                  <tr>
37
+                    <td colspan="4" style="padding: 3px;line-height: 40px;">身份证号:{{patient.id_card_no}}</td>
38
+                  </tr>
39
+                  <tr>
40
+                    <td colspan="4" style="padding: 3px;line-height: 40px;">临床诊断:{{ patient.diagnose }}</td>
41
+                  </tr>
42
+                  <tr>
43
+                    <td colspan="4" style="padding: 3px;">
44
+                      <div v-html="content"></div>
45
+                    </td>
46
+                  </tr>
47
+                </table>
48
+
49
+              <!-- <div style="display: flex;margin: 10px 0;">
50
+                <div style="flex:1">姓名:
51
+                  {{ patient.name }}
52
+                </div>
53
+                <div style="flex:1">性别:
54
+                  <span v-if="patient.gender == 1">男</span>
55
+                   <span v-if="patient.gender == 2">女</span>
56
+                </div>
57
+                <div style="flex:1">年龄:
58
+                  {{ getAge(patient) }}
59
+                </div>
60
+                <div style="flex:1">住院(门诊)号:
61
+                  {{ patient.admission_number }}
62
+                </div>
63
+              </div>
64
+              <div style="border-bottom: 1px solid gainsboro;">
65
+                诊断:
66
+                {{ patient.diagnose }}
67
+              </div>
68
+              <div v-html="content"></div> -->
69
+          </div>
70
+        </div>
71
+      </div>
72
+      <el-dialog
73
+        title="提示"
74
+        :visible.sync="dialogVisible"
75
+        width="60%"
76
+        >
77
+        <div>
78
+          <h2 style="text-align: center;">{{ orgname }}<br/>无肝素血液透析风险知情同意书</h2>
79
+          <table border="1" style="border-collapse: collapse;width: 100%;">
80
+            <tr>
81
+              <td width="30" style="padding: 3px;line-height: 40px;">姓名:{{ patient.name }}</td>
82
+              <td width="15" style="padding: 3px;line-height: 40px;">性别:{{ patient.gender == 1 ? '男' : '女' }}</td>
83
+              <td width="15" style="padding: 3px;line-height: 40px;">年龄:{{getAge(patient)}}</td>
84
+              <td width="40" style="padding: 3px;line-height: 40px;">门诊住院号:{{ patient.admission_number }}</td>
85
+            </tr>
86
+            <tr>
87
+              <td colspan="4" style="padding: 3px;line-height: 40px;">住址或单位:{{patient.home_address}}</td>
88
+            </tr>
89
+            <tr>
90
+              <td colspan="4" style="padding: 3px;line-height: 40px;">身份证号:{{patient.id_card_no}}</td>
91
+            </tr>
92
+            <tr>
93
+              <td colspan="4" style="padding: 3px;line-height: 40px;">临床诊断:{{ patient.diagnose }}</td>
94
+            </tr>
95
+            <tr>
96
+              <td colspan="4">
97
+                <keep-alive>
98
+                  <editor ref="editor"
99
+                          id="editor"
100
+                          style="width: 100%"
101
+                          v-bind:r_content="content">
102
+                  </editor>
103
+                </keep-alive>
104
+              </td>
105
+            </tr>
106
+          </table>
107
+
108
+          <!-- <div style="text-align: right;">
109
+            透析号:{{ patient.dialysis_no }}
110
+          </div>
111
+          <div style="display: flex;margin: 10px 0;">
112
+            <div style="flex:1">姓名:{{ patient.name }}</div>
113
+            <div style="flex:1">性别:
114
+              <span v-if="patient.gender == 1">男</span>
115
+                <span v-if="patient.gender == 2">女</span>
116
+            </div>
117
+            <div style="flex:1">年龄:
118
+              {{ getAge(patient) }}
119
+            </div>
120
+            <div style="flex:1">住院(门诊)号:
121
+              {{ patient.admission_number }}
122
+            </div>
123
+          </div>
124
+          <div style="border-bottom: 1px solid gainsboro;">
125
+            诊断:
126
+            {{ patient.diagnose }}
127
+          </div> -->
128
+
129
+        </div>
130
+        <span slot="footer" class="dialog-footer">
131
+          <el-button @click="dialogVisible = false">取 消</el-button>
132
+          <el-button type="primary" @click="saveCriticalInfomed">保 存</el-button>
133
+        </span>
134
+      </el-dialog>
135
+  </div>
136
+</template>
137
+
138
+<script>
139
+import print from "print-js";
140
+import Editor from '@/components/Editor'
141
+import { getPatientDetailInformedconsent,saveCriticalInfomed  } from '@/api/patient'
142
+import { jsGetAge, uParseTime } from "@/utils/tools";
143
+const content=`
144
+  <p>
145
+    <span>您/您的亲属因患:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;需进行肾代替治疗,由于您/您的家属因凝血功能异常
146
+      或身体某脏器出血,需进行无肝素血液透析治疗,此方法治疗的目的以及可能存在的风险如下;
147
+    </span>
148
+  </p>
149
+  <p>
150
+    <span>
151
+      一、尿毒症(包括急性或慢性肾功能衰竭),急性中毒以及其他重症需血液净化的患者由于凝血功能较差应用肝素透析可引起出血,使贫血加重。使用肝素透析,可使身体某脏器出血加重,严重者危及生命。
152
+    </span>
153
+  </p>
154
+  <p>
155
+    <span>
156
+      二、可能出现管路凝血血液无法回入血管,使血液丢失,贫血加重。
157
+    </span>
158
+  </p>
159
+  <p>
160
+    <span>
161
+      三、透析过程中,由于透析器,管路或者两者同时因血凝块堵塞,使透析无法进行,需终止透析。
162
+    </span>
163
+  </p>
164
+  <p>
165
+    <span>
166
+      四、透析中及透析后出现透析失衡综合征,如呕吐、头痛、头晕等;
167
+    </span>
168
+  </p>
169
+  <p>
170
+    <span>
171
+      五、用盐水冲洗管路及透析器,超滤量过大,可能造成脱水不够,不能达到干体重。由于脱水不够,而引起血压升高,或心力衰竭
172
+    </span>
173
+  </p>
174
+  <p>
175
+    <span>
176
+      六、透析器.管路有凝血堵块,不能复用,需要新换透析器,管路增加患者的费用。透析器.管路有小血栓形成,随血路进入血液循环,引起肺栓塞.脑栓塞.心血管栓塞等并发症。
177
+    </span>
178
+  </p>
179
+  <p>
180
+    <span>
181
+      患者和/或家属已接受医疗风险的告知并要求接受血液透析治疗。
182
+    </span>
183
+  </p>
184
+  <p style="padding:10px 20px;display:flex;justify-content: space-around;align-items: center;">
185
+      <span>患者/家属意见:&nbsp;&nbsp;&nbsp;&nbsp;</span>
186
+      <span>患者/家属签名:&nbsp;&nbsp;&nbsp;&nbsp;</span>
187
+  </p>
188
+  <p style="padding:10px 20px;display:flex;justify-content: space-around;align-items: center;">
189
+      <span>与患者关系:&nbsp;&nbsp;&nbsp;&nbsp;</span>
190
+      <span>告知医师签名:&nbsp;&nbsp;&nbsp;&nbsp;</span>
191
+  </p>`
192
+
193
+export default{
194
+  props: {
195
+    patient_id: {
196
+        type: Number,
197
+      },
198
+      criticalInforPrint:{
199
+        type:Object,
200
+      }
201
+   },
202
+   components:{
203
+    Editor
204
+   },
205
+  data(){
206
+    return{
207
+      patient:{},
208
+      dialogVisible:false,
209
+      content:content,
210
+      orgname:'',
211
+    }
212
+   },
213
+  methods:{
214
+    getlist(){
215
+
216
+      getPatientDetailInformedconsent(this.patient_id).then(response=>{
217
+        if(response.data.state == 1){
218
+          var patient =  response.data.data.patients
219
+          console.log("patinet",patient)
220
+          this.patient =patient
221
+        }
222
+      })
223
+    },
224
+    printThisPage(){
225
+        const style = '@media print {.content p{font-size: 16px;font-family: SimSun; padding: 5px; margin-bottom: 5px;}}'
226
+        printJS({
227
+            printable: 'print_content',
228
+            type: 'html',
229
+            documentTitle: '  ',
230
+            style: style,
231
+            scanStyles: false
232
+        })
233
+    },
234
+    getAge: function(val) {
235
+        if (val.id_card_no == undefined) {
236
+          return false
237
+        }
238
+        var thisLen = val.id_card_no.length
239
+        var birth = ''
240
+        if (thisLen == 15) {
241
+          birth = '19' + val.id_card_no.substr(6, 6)
242
+        } else {
243
+          birth = val.id_card_no.substr(6, 8)
244
+        }
245
+        var birthtwo =
246
+          birth.substr(0, 4) +
247
+          '-' +
248
+          birth.substr(4, 2) +
249
+          '-' +
250
+          birth.substr(6, 2)
251
+
252
+        var age = jsGetAge(birthtwo, '-')
253
+        return age
254
+    },
255
+    bianji(){
256
+      this.dialogVisible=true
257
+    },
258
+    show(val){
259
+
260
+       if(val!=null){
261
+        console.log("valw233223",val)
262
+         if(val.content!=""){
263
+           this.content = ""
264
+           this.content = val.content
265
+         }
266
+
267
+       }
268
+     },
269
+    saveCriticalInfomed(){
270
+        var params = {
271
+          content:this.$refs.editor.content
272
+        }
273
+      saveCriticalInfomed(params).then(response=>{
274
+         if(response.data.state ==1){
275
+           var list = response.data.data.list
276
+           this.$message.success("保存成功")
277
+           this.dialogVisible = false
278
+           this.$emit("getCriticalInformed","");
279
+         }
280
+      })
281
+    }
282
+  },
283
+  created(){
284
+    this.orgname = this.$store.getters.xt_user.org.org_name;
285
+    console.log("haaaaaaaaaaaaaaaaaaa",this.criticalInforPrint)
286
+    if(this.criticalInforPrint!=null && this.criticalInforPrint.id>0){
287
+        this.content = ""
288
+        this.content = this.criticalInforPrint.content
289
+    }
290
+    this.getlist()
291
+  }
292
+}
293
+</script>
294
+<style lang="scss" scoped>
295
+
296
+*{
297
+  // margin: 0;
298
+  // padding: 0;
299
+  //border: 0;
300
+}
301
+  .content{
302
+      p{
303
+        font-size: 16px;
304
+        // font-family: '新宋体';
305
+        line-height: 22px;
306
+        padding: 5px;
307
+        margin-bottom: 5px;
308
+        text-align: justify;
309
+      }
310
+  }
311
+</style>

+ 37 - 19
src/xt_pages/user/Physicalexamination.vue Vedi File

@@ -9,17 +9,17 @@
9 9
       <div v-loading="loading">
10 10
         <div class="patient-app-container advice-container app-container">
11 11
           <div>
12
-                      <span style="margin-left: 10px;float:right;">
13
-                          <el-button type="primary" icon="el-icon-circle-plus-outline" size="small"
14
-                                     @click="show_dialog = true">新增</el-button>
15
-
16
-                          <el-button type="primary" icon="el-icon-edit-outline" size="small"
17
-                                     @click="showEdit">修改</el-button>
18
-                        <el-button type="primary" icon="el-icon-printer" size="small"
19
-                                   @click="print">打印</el-button>
20
-                          <el-button size="small" v-show="selectingRows.length > 0" type="danger"
21
-                                     @click="deleteAction">删除</el-button>
22
-                      </span>
12
+              <span style="margin-left: 10px;float:right;">
13
+                  <el-button type="primary" icon="el-icon-circle-plus-outline" size="small"
14
+                              @click="show_dialog = true">新增</el-button>
15
+
16
+                  <el-button type="primary" icon="el-icon-edit-outline" size="small"
17
+                              @click="showEdit">修改</el-button>
18
+                  <el-button type="primary" icon="el-icon-printer" size="small"
19
+                            @click="print">打印</el-button>
20
+                  <el-button size="small" v-show="selectingRows.length > 0" type="danger"
21
+                              @click="deleteAction">删除</el-button>
22
+              </span>
23 23
             <!--<span class="filter_title">日期查询</span>-->
24 24
             <!--<el-date-picker size="small" v-model="date" type="daterange" range-separator="至" start-placeholde="开始日期" end-placeholde="结束日期" value-format="timestamp" :clearable="false" @change="requestCourseRecords()"></el-date-picker>-->
25 25
           </div>
@@ -665,15 +665,18 @@
665 665
             </el-row>
666 666
           </div>
667 667
         </div>
668
-        <el-dialog title="新增体格检查" width="70%" top="5vh" :visible.sync="show_dialog">
668
+        <el-dialog title="新增体格检查" width="80%" top="5vh" :visible.sync="show_dialog">
669 669
           <div>
670 670
             <div class="new_record_form">
671 671
               <div class="record_content_panel">
672
-                <div style="background-color:rgb(245, 247, 250)" class="title">体格检查</div>
672
+                <div style="background-color:rgb(245, 247, 250);margin-bottom: 10px;" class="title">体格检查</div>
673 673
 
674
-                <el-form>
675
-                  <el-row style="margin-top: 20px;">
676
-                    <el-col :span="9" >
674
+                <el-form class="form" label-position="right" label-width="130px">
675
+
676
+
677
+
678
+                  <el-row style="margin-top: 20px;margin-left: 20px;">
679
+                    <el-col :span="8" >
677 680
                       <el-form-item label="日期:">
678 681
                         <el-date-picker v-model="add_form.record_time" prefix-icon="el-icon-date" :editable="false"
679 682
                                         style="width: 200px;"
@@ -681,13 +684,15 @@
681 684
                                         value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
682 685
                       </el-form-item>
683 686
                     </el-col>
684
-                    <el-col :span="6" >
687
+                    <el-col :span="8" >
685 688
                       <el-form-item label="医生:">
686 689
                         <el-select style="width: 100px;" v-model="add_form.doctor_id" placeholder="请选择医生">
687 690
                           <el-option v-for="(item,index) in doctorOptions" :label="item.name" :value="item.id" :key="index"></el-option>
688 691
                         </el-select>
689 692
                       </el-form-item>
690 693
                     </el-col>
694
+                    <el-col :span="8"></el-col>
695
+                    <el-col :span="8"></el-col>
691 696
                   </el-row>
692 697
 
693 698
                   <el-row   style="margin-left: 20px;">
@@ -3087,9 +3092,17 @@
3087 3092
     }
3088 3093
 
3089 3094
     }
3090
-
3095
+    .Second_title{
3096
+      border-left: 5px solid rgb(58, 142, 230);
3097
+      width: 85px;
3098
+      text-align: left;
3099
+      padding: 5px;
3100
+      margin-left: 10px;
3101
+      margin-bottom: 18px;
3102
+      font-size: 16px;
3103
+    }
3091 3104
   </style>
3092
-  <style>
3105
+  <style lang="scss">
3093 3106
   /* .el-input--medium .el-input__inner {
3094 3107
       padding:0px 0px;
3095 3108
       text-align: center;
@@ -3105,4 +3118,9 @@
3105 3118
   .el-table::before {
3106 3119
     background-color: #d0d3da;
3107 3120
   }
3121
+  .form{
3122
+    .el-form-item__label{
3123
+      padding: 0 0 0 0 !important;
3124
+    }
3125
+  }
3108 3126
   </style>

File diff suppressed because it is too large
+ 4249 - 0
src/xt_pages/user/Physicalexamination_new.vue


+ 25 - 25
src/xt_pages/user/components/PatientDetail.vue Vedi File

@@ -393,23 +393,23 @@
393 393
               </el-form-item>
394 394
             </el-col>
395 395
 
396
-            <el-col :span="24" :style="isEdit ? 'width:600px' : ''">
397
-                <el-form-item
398
-                  label="患者类型 : "
399
-                  class="is-required"
400
-                  prop="source"
401
-                >
402
-                  <el-radio-group v-model="form.patient_type">
403
-                    <el-radio
404
-                      v-for="item in patientType"
405
-                      :key="item.value"
406
-                      :label="item.value"
407
-                      :value="item.value"
408
-                      >{{ item.label }}</el-radio
409
-                    >
410
-                  </el-radio-group>
411
-                </el-form-item>
412
-              </el-col>
396
+            <!-- <el-col :span="24" :style="isEdit ? 'width:600px' : ''">
397
+              <el-form-item
398
+                label="患者类型 : "
399
+                class="is-required"
400
+                prop="source"
401
+              >
402
+                <el-radio-group v-model="form.patient_type">
403
+                  <el-radio
404
+                    v-for="item in patientType"
405
+                    :key="item.value"
406
+                    :label="item.value"
407
+                    :value="item.value"
408
+                    >{{ item.label }}</el-radio
409
+                  >
410
+                </el-radio-group>
411
+              </el-form-item>
412
+            </el-col> -->
413 413
 
414 414
 
415 415
             <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
@@ -990,7 +990,7 @@
990 990
           ></el-button>
991 991
         </el-form-item>
992 992
       </el-col> -->
993
-      
993
+
994 994
       <el-row>
995 995
         <el-col :span="24" style="height:100%;">
996 996
           <el-form-item label="家族史 : " prop="famality_record" style="height:100%;">
@@ -1006,7 +1006,7 @@
1006 1006
           </el-form-item>
1007 1007
        </el-col>
1008 1008
       </el-row>
1009
-      
1009
+
1010 1010
       <el-row>
1011 1011
         <el-col :span="24" style="height:100%;">
1012 1012
           <el-form-item label="登记人员 : " style="height:100%;">
@@ -1029,7 +1029,7 @@
1029 1029
           </el-form-item>
1030 1030
        </el-col>
1031 1031
       </el-row>
1032
-      
1032
+
1033 1033
     </el-form>
1034 1034
     <!-- 打印预览 style="display: none"-->
1035 1035
     <div style="display: none">
@@ -1841,13 +1841,13 @@ export default {
1841 1841
     const birthYear = parseInt(idNumber.substring(6, 10), 10);
1842 1842
     const birthMonth = parseInt(idNumber.substring(10, 12), 10);
1843 1843
     const birthDay = parseInt(idNumber.substring(12, 14), 10);
1844
- 
1844
+
1845 1845
     const today = new Date();
1846 1846
     // console.log("today============",today)
1847 1847
     var ageYear = year - birthYear;
1848 1848
     let ageMonth = month - birthMonth; // 月份是从0开始的
1849 1849
     let ageDay = day - birthDay;
1850
- 
1850
+
1851 1851
     // 调整月份和日期,以便于正确计算
1852 1852
       if (ageDay < 0) {
1853 1853
           ageMonth -= 1;
@@ -1859,8 +1859,8 @@ export default {
1859 1859
           ageYear -= 1;
1860 1860
           ageMonth += 12;
1861 1861
       }
1862
-   
1863
-     return ageYear 
1862
+
1863
+     return ageYear
1864 1864
     },
1865 1865
     getTime(val) {
1866 1866
       return uParseTime(val, "{y}年{m}月{d}日");
@@ -2431,7 +2431,7 @@ export default {
2431 2431
             } else {
2432 2432
               this.patientPrint.hospital_first_dialysis_date = "";
2433 2433
             }
2434
-          
2434
+
2435 2435
             // this.checkIdCardNo();
2436 2436
           } else {
2437 2437
             console.log("patient get err state");

+ 0 - 209
src/xt_pages/user/components/PatientSidebar.1.vue Vedi File

@@ -1,209 +0,0 @@
1
-<template>
2
-  <div>
3
-    <div class="patient-menu">
4
-      <el-autocomplete
5
-        style="margin:16px 5px"
6
-        popper-class="my-autocomplete"
7
-        v-model.trim="value"
8
-        :fetch-suggestions="querySearchAsync"
9
-        :trigger-on-focus="false"
10
-        placeholder="病人名字或者透析号"
11
-        @select="handleSelect"
12
-       >
13
-        <i
14
-          class="el-icon-search el-input__icon"
15
-          slot="suffix"
16
-         >
17
-        </i>
18
-        <template slot-scope="{ item }">
19
-          <div class="name">{{ item.name }}</div>
20
-        </template>
21
-      </el-autocomplete>
22
-
23
-      <el-select v-model="selectID" style="margin:0 5px 0px 5px;text-align: center;" @change="changePatient"
24
-                 placeholder="请选择">
25
-        <el-option
26
-          v-for="item in patientsList"
27
-          :key="item.id"
28
-          :label="item.name"
29
-          :value="item.id">
30
-        </el-option>
31
-      </el-select>
32
-
33
-      <el-menu :default-active="defaultActive" class="el-menu-vertical-demo patient-center-menu">
34
-        <el-submenu index="1">
35
-          <template slot="title">
36
-            <i class="el-icon-setting"></i>
37
-            <span>电子病历</span>
38
-          </template>
39
-          <router-link :to="'/patients/patient/'+this.id">
40
-            <el-menu-item index="1-1">基本信息</el-menu-item>
41
-          </router-link>
42
-          <router-link :to="'/patients/patient/'+this.id+'/doctorAdvice'">
43
-            <el-menu-item index="1-4">医嘱管理</el-menu-item>
44
-          </router-link>
45
-          <router-link :to="'/patients/patient/'+this.id+'/dryWeight'">
46
-            <el-menu-item index="1-6">干体重</el-menu-item>
47
-          </router-link>
48
-          <router-link :to="'/patients/course?id='+this.id">
49
-            <el-menu-item index="1-2">病程管理</el-menu-item>
50
-          </router-link>
51
-          <router-link :to="'/patients/inspection?id='+this.id">
52
-            <el-menu-item index="1-3">检验检查</el-menu-item>
53
-          </router-link>
54
-          <router-link :to="'/patients/rescue?id='+this.id">
55
-            <el-menu-item index="1-5">抢救记录</el-menu-item>
56
-          </router-link>
57
-          <!-- <router-link :to="'/patients/patient/'+this.id+'/weight'">
58
-              <el-menu-item  index="2-5">干体重</el-menu-item>
59
-          </router-link> -->
60
-        </el-submenu>
61
-        <el-submenu index="2">
62
-          <template slot="title">
63
-            <i class="el-icon-setting"></i>
64
-            <span>透析管理</span>
65
-          </template>
66
-          <router-link :to="'/patients/patient/'+this.id+'/dialysisSolution'">
67
-            <el-menu-item index="2-1">长期透析处方</el-menu-item>
68
-          </router-link>
69
-          <router-link :to="'/patients/patient/'+this.id+'/dialysisRecord'">
70
-            <el-menu-item index="2-2">透析记录</el-menu-item>
71
-          </router-link>
72
-          <router-link :to="'/patients/patient/'+this.id+'/scheduling'">
73
-            <el-menu-item index="2-4">排班信息</el-menu-item>
74
-          </router-link>
75
-          <router-link :to="'/patients/patient/'+this.id+'/proeducation'">
76
-            <el-menu-item index="2-5">宣教信息</el-menu-item>
77
-          </router-link>
78
-          <!-- <router-link :to="'/patients/patient/'+this.id+'/weight'">
79
-              <el-menu-item  index="2-5">干体重</el-menu-item>
80
-          </router-link> -->
81
-        </el-submenu>
82
-     
83
-      </el-menu>
84
-    </div>
85
-    <div class="patient-app-container ">
86
-      <span class="patient-name">姓名:{{currentPatient.name}} &nbsp;&nbsp; 性别:{{tranSex(currentPatient.gender)}} &nbsp;&nbsp; 年龄:{{tranAge(currentPatient.birthday)}} &nbsp;&nbsp; 透析号:{{currentPatient.dialysis_no}} </span>
87
-    </div>
88
-  </div>
89
-
90
-</template>
91
-<script>
92
-  import { fetchAllList, PostSearch } from '@/api/patient'
93
-import { jsGetAge, uParseTime } from '@/utils/tools'
94
-
95
-export default {
96
-    name: 'patientSidebar',
97
-    value: '',
98
-    searchArray: [],
99
-    props: {
100
-      id: 0,
101
-      defaultActive: {
102
-        type: String,
103
-        default: '1-1'
104
-      }
105
-
106
-    },
107
-    data() {
108
-      return {
109
-        thedefaultActive: 1,
110
-        patientsList: null,
111
-        currentPatient: {},
112
-        selectID: 0,
113
-        keyword: '',
114
-        value: ''
115
-      }
116
-    },
117
-    methods: {
118
-      changePatient(value) {
119
-        console.log(value)
120
-        this.$router.push('/patients/patient/' + value)
121
-      },
122
-      getList() {
123
-        fetchAllList().then(response => {
124
-          if (response.data.state == 1) {
125
-            this.patientsList = response.data.data.patients
126
-            console.log("哈哈哈哈哈",this.patientsList)
127
-            var len = this.patientsList.length
128
-            if (len > 0) {
129
-              for (let index = 0; index < len; index++) {
130
-                if (this.patientsList[index].id == this.id) {
131
-                  this.currentPatient = this.patientsList[index]
132
-
133
-                  this.selectID = this.patientsList[index].id
134
-                  this.$emit('tran-patient', this.currentPatient)
135
-                  break
136
-                }
137
-              }
138
-            }
139
-          }
140
-        })
141
-      },
142
-      tranAge(birthday) {
143
-        var birth = uParseTime(birthday, '{y}-{m}-{d}')
144
-        return jsGetAge(birth, '-')
145
-      },
146
-      tranSex(gender) {
147
-        var sex = '未知'
148
-        switch (gender) {
149
-          case 1:
150
-            sex = '男'
151
-            break
152
-          case 2:
153
-            sex = '女'
154
-            break
155
-          default:
156
-            break
157
-        }
158
-        return sex
159
-      },
160
-       querySearchAsync(keyword, cb) {
161
-        let key = ''
162
-        if (keyword != undefined) {
163
-          key = keyword
164
-        }
165
-        let searchArray = []
166
-        PostSearch(key).then(response => {
167
-          if (response.data.state == 1) {
168
-            searchArray = response.data.data.patient
169
-            cb(searchArray)
170
-          } else {
171
-            this.$message.error(response.data.msg)
172
-            cb([])
173
-          }
174
-        })
175
-      },
176
-       handleSelect(val) {
177
-        this.$router.push('/patients/patient/' + val.id)
178
-      }
179
-
180
-    },
181
-    created() {
182
-      this.getList()
183
-  }
184
-  }
185
-</script>
186
-
187
-<style>
188
-
189
-  .patient-menu {
190
-    -webkit-transition: width 0.28s;
191
-    transition: width 0.28s;
192
-    width: 180px !important;
193
-    height: 100%;
194
-    position: relative;
195
-    font-size: 0px;
196
-    top: 0;
197
-    float: left;
198
-    bottom: 0;
199
-    left: 0;
200
-    /* z-index: 99; */
201
-    overflow: hidden;
202
-  }
203
-
204
-  .patient-center-menu .el-icon-arrow-down:before {
205
-    content: '';
206
-  }
207
-
208
- 
209
-</style>

+ 8 - 1
src/xt_pages/user/components/PatientSidebar.vue Vedi File

@@ -163,6 +163,10 @@ export default {
163 163
               name: '3-2',
164 164
               label: '体格检查'
165 165
             },
166
+            {
167
+              name: '3-3',
168
+              label: '体格检查新'
169
+            },
166 170
             {
167 171
               name: '1-11',
168 172
               label: '首次病程记录'
@@ -291,7 +295,7 @@ export default {
291 295
   },
292 296
   methods: {
293 297
     handleNodeClick(data) {
294
-     
298
+
295 299
       var name = data.name
296 300
       this.name = data.name
297 301
       window.sessionStorage.setItem('patientKey',data.name)
@@ -343,6 +347,9 @@ export default {
343 347
       } else if(name == '3-2'){
344 348
         this.$router.push({path:'/patients/physicalexamination?id='+this.id})
345 349
 
350
+      } else if(name == '3-3'){
351
+        this.$router.push({path:'/patients/new_physicalexamination?id='+this.id})
352
+
346 353
       } else if(name == '4-1'){
347 354
         this.$router.push({path:'/patients/inspection_check?id='+this.id})
348 355
       } else if(name == '4-3'){

+ 623 - 0
src/xt_pages/user/components/PatientSidebar_new.vue Vedi File

@@ -0,0 +1,623 @@
1
+<template>
2
+  <div>
3
+    <div class="patient-menu">
4
+      <el-autocomplete
5
+        style="margin:16px 5px"
6
+        popper-class="my-autocomplete"
7
+        v-model.trim="value"
8
+        :fetch-suggestions="querySearchAsync"
9
+        :trigger-on-focus="false"
10
+        placeholder="病人名字或者透析号"
11
+        @select="handleSelect"
12
+      >
13
+        <i class="el-icon-search el-input__icon" slot="suffix"> </i>
14
+        <template slot-scope="{ item }">
15
+          <div class="name">{{ item.name }}</div>
16
+        </template>
17
+      </el-autocomplete>
18
+      <el-select
19
+        v-model="selectID"
20
+        style="margin:0 5px 0px 5px;text-align: center;"
21
+        @change="changePatient"
22
+        placeholder="请选择"
23
+      >
24
+        <el-option
25
+          v-for="item in patientsList"
26
+          :key="item.id"
27
+          :label="item.name"
28
+          :value="item.id"
29
+        >
30
+        </el-option>
31
+      </el-select>
32
+
33
+      <el-tree
34
+        :data="treeData"
35
+        accordion
36
+        node-key="name"
37
+        :key="treeKey"
38
+        :current-node-key="treeKey"
39
+        :default-expanded-keys="[defaultActive]"
40
+        @node-click="handleNodeClick"
41
+      >
42
+      </el-tree>
43
+    </div>
44
+    <div class="patient-app-container" :style="{width:treeKey!='3-4' ?'100vw':''}">
45
+      <span class="patient-name"
46
+        >姓名:{{ currentPatient.name }} &nbsp;&nbsp; 性别:{{
47
+          tranSex(currentPatient.gender)
48
+        }}
49
+        &nbsp;&nbsp; 年龄:{{ getAge(currentPatient) }} &nbsp;&nbsp; 透析号:{{
50
+          currentPatient.dialysis_no
51
+        }}
52
+      </span>
53
+    </div>
54
+  </div>
55
+</template>
56
+<script>
57
+import { fetchAllList, PostSearch } from '@/api/patient'
58
+import { jsGetAge, uParseTime } from '@/utils/tools'
59
+
60
+export default {
61
+  name: 'patientSidebar',
62
+  value: '',
63
+  searchArray: [],
64
+  props: {
65
+    id: 0,
66
+    defaultActive: {
67
+      type: String,
68
+      default: '1-1'
69
+    }
70
+  },
71
+  data() {
72
+    return {
73
+      thedefaultActive: 1,
74
+      patientsList: [],
75
+      currentPatient: {},
76
+      selectID: 0,
77
+      keyword: '',
78
+      value: '',
79
+      treeKey: '',
80
+      org_id:0,
81
+      treeData: [
82
+        {
83
+          name: '1',
84
+          label: '电子病历',
85
+          children: [
86
+            {
87
+              name: '1-1',
88
+              label: '基本信息'
89
+            },
90
+            {
91
+              name: '1-4',
92
+              label: '医嘱管理'
93
+            },
94
+            {
95
+              name: '1-6',
96
+              label: '干体重'
97
+            },
98
+            {
99
+              name:'1-7',
100
+              label:'血管通路'
101
+            },
102
+            // {
103
+            //   name: '1-2',
104
+            //   label: '病程管理'
105
+            // },
106
+            // {
107
+            //   name: '1-9',
108
+            //   label: '阶段小结'
109
+            // },
110
+            // {
111
+            //   name: '1-10',
112
+            //   label: '出院小结'
113
+            // },
114
+            // {
115
+            //   name: '1-3',
116
+            //   label: '检验检查'
117
+            // },
118
+            // {
119
+            //   name:'1-8',
120
+            //   label:'传染病管理'
121
+            // },
122
+            // {
123
+            //   name: '1-5',
124
+            //   label: '抢救记录'
125
+            // },
126
+            // {
127
+            //   name: '1-11',
128
+            //   label: '首次病程记录'
129
+            // }
130
+          ]
131
+        },
132
+        {
133
+          name: '2',
134
+          label: '透析管理',
135
+          children: [
136
+            {
137
+              name: '2-1',
138
+              label: '长期透析处方'
139
+            },
140
+            {
141
+              name: '2-2',
142
+              label: '透析记录'
143
+            },
144
+            {
145
+              name: '2-4',
146
+              label: '排班信息'
147
+            },
148
+            {
149
+              name: '2-5',
150
+              label: '宣教信息'
151
+            }
152
+          ]
153
+        },
154
+        {
155
+          name: '3',
156
+          label: '病情记录',
157
+          children: [
158
+            {
159
+              name: '3-1',
160
+              label: '病史'
161
+            },
162
+            {
163
+              name: '3-4',
164
+              label: '病史新'
165
+            },
166
+            {
167
+              name: '3-2',
168
+              label: '体格检查'
169
+            },
170
+            {
171
+              name: '3-3',
172
+              label: '体格检查新'
173
+            },
174
+            {
175
+              name: '1-11',
176
+              label: '首次病程记录'
177
+            },
178
+            {
179
+              name: '1-2',
180
+              label: '病程记录'
181
+            }, {
182
+              name: '1-5',
183
+              label: '抢救记录'
184
+            }, {
185
+              name: '1-9',
186
+              label: '阶段小结'
187
+            }, {
188
+              name: '1-10',
189
+              label: '出院小结'
190
+            },
191
+          ]
192
+        },
193
+        {
194
+          name: '4',
195
+          label: '检验检查',
196
+          children: [
197
+            {
198
+              name: '1-3',
199
+              label: '肾科检验'
200
+            },
201
+            // {
202
+            //   name: '4-12',
203
+            //   label: '新版肾科检验'
204
+            // },
205
+            {
206
+              name: '4-1',
207
+              label: '肾科检查'
208
+            },
209
+            {
210
+              name: '4-3',
211
+              label: 'KT/V'
212
+            },
213
+            {
214
+              name: '1-8',
215
+              label: '传染病管理'
216
+            },
217
+          ]
218
+        },
219
+         {
220
+          name: '5',
221
+          label: '评估工具',
222
+          children: [
223
+            {
224
+              name: '5-1',
225
+              label: '跌倒评估'
226
+            },
227
+            {
228
+              name: '5-2',
229
+              label: '小儿跌倒风险评估'
230
+            },
231
+            {
232
+              name: '5-3',
233
+              label: '压疮风险评估'
234
+            },
235
+            {
236
+              name: '5-4',
237
+              label: 'OH压疮评估'
238
+            },
239
+            {
240
+              name: '5-5',
241
+              label: '日常生活能力评估'
242
+            },
243
+            {
244
+              name: '5-6',
245
+              label: '导管脱落风险评估'
246
+            },
247
+            {
248
+              name: '5-7',
249
+              label: 'RASS及疼痛评估'
250
+            },
251
+            {
252
+              name: '5-8',
253
+              label: '营养状况评估'
254
+            },
255
+            // {
256
+            //   name: '5-9',
257
+            //   label: '约束告知单'
258
+            // },
259
+            {
260
+              name: '5-10',
261
+              label: '心理评估'
262
+            },
263
+            {
264
+              name: '5-11',
265
+              label: '瘙痒评估'
266
+            },
267
+            {
268
+              name: '5-12',
269
+              label: '血液透析患者评估'
270
+            },
271
+            {
272
+              name: '5-13',
273
+              label: 'Glasgow昏迷评分量表'
274
+            },
275
+            {
276
+              name: '5-14',
277
+              label: '肌力评估表'
278
+            },
279
+           ]
280
+         },
281
+        {
282
+          name: '6',
283
+          label: '文书管理',
284
+          children: [
285
+            {
286
+              name: '6-1',
287
+              label: '知情同意书'
288
+            },
289
+          ]
290
+        },
291
+        {
292
+          name: '7',
293
+          label: '转归记录',
294
+        },
295
+
296
+      ],
297
+      name:""
298
+    }
299
+  },
300
+  methods: {
301
+    handleNodeClick(data) {
302
+
303
+      var name = data.name
304
+      this.name = data.name
305
+      window.sessionStorage.setItem('patientKey',data.name)
306
+      if (name == '1-1') {
307
+        this.$router.push({ path: '/patients/patient/' + this.id })
308
+      } else if (name == '1-2') {
309
+        this.$router.push({ path: '/patients/course?id=' + this.id })
310
+      } else if (name == '1-3') {
311
+        this.$router.push({ path: '/patients/inspection?id=' + this.id })
312
+      } else if (name == '1-4') {
313
+        this.$router.push({
314
+          path: '/patients/patient/' + this.id + '/doctorAdvice'
315
+        })
316
+      } else if (name == '1-6') {
317
+        this.$router.push({
318
+          path: '/patients/patient/' + this.id + '/dryWeight'
319
+        })
320
+      } else if (name == '1-5') {
321
+        this.$router.push({ path: '/patients/rescue?id=' + this.id })
322
+      } else if (name == '2-1') {
323
+        this.$router.push({
324
+          path: '/patients/patient/' + this.id + '/dialysisSolution'
325
+        })
326
+      } else if (name == '2-2') {
327
+        this.$router.push({
328
+          path: '/patients/patient/' + this.id + '/dialysisRecord'
329
+        })
330
+      } else if (name == '2-4') {
331
+        this.$router.push({
332
+          path: '/patients/patient/' + this.id + '/scheduling'
333
+        })
334
+      } else if (name == '2-5') {
335
+        this.$router.push({
336
+          path: '/patients/patient/' + this.id + '/proeducation'
337
+        })
338
+      } else if (name == '1-7'){
339
+        this.$router.push({path:'/patients/patient/'+this.id+'/vascularAccess'})
340
+      } else if (name == '1-8'){
341
+        this.$router.push({path:'/patients/patients/'+this.id+'/inspectionInfectious'})
342
+      } else if (name == '1-9'){
343
+        this.$router.push({path:'/patient/patient/'+this.id+'/templateSummary'})
344
+      } else if(name == '1-10'){
345
+        this.$router.push({path:'/patient/patient/'+this.id+'/hospitalSummary'})
346
+      } else if(name == '1-11'){
347
+        this.$router.push({path:'/patient/patient/'+this.id+'/firstDisease'})
348
+      } else if(name == '3-1'){
349
+        this.$router.push({ path: '/patients/sickhistory?id=' + this.id })
350
+      } else if(name == '3-2'){
351
+        this.$router.push({path:'/patients/physicalexamination?id='+this.id})
352
+      } else if(name == '3-3'){
353
+        this.$router.push({path:'/patients/new_physicalexamination?id='+this.id})
354
+      } else if(name == '3-4'){
355
+        this.$router.push({ path: '/patients/sickHistory_new?id='+ this.id })
356
+      } else if(name == '4-1'){
357
+        this.$router.push({path:'/patients/inspection_check?id='+this.id})
358
+      } else if(name == '4-3'){
359
+        this.$router.push({path:'/patients/ktv?id='+this.id})
360
+      }else if(name == '4-12'){
361
+        this.$router.push({path:'/patients/newInspection?id='+this.id})
362
+      }
363
+      else if (name == '5-1') {
364
+        this.$router.push({
365
+          path: '/patients/patient/'+ this.id +'/Fallassessment'
366
+        })
367
+      } else if (name == '5-2') {
368
+        this.$router.push({
369
+          path: '/patients/patient/' + this.id + '/pediatricFallAssessment'
370
+        })
371
+      } else if (name == '5-3') {
372
+        this.$router.push({
373
+          path: '/patients/patient/' + this.id + '/pressuresore'
374
+        })
375
+      } else if (name == '5-4') {
376
+        this.$router.push({
377
+          path: '/patients/patient/' + this.id + '/OHpressuresore'
378
+        })
379
+      } else if (name == '5-5'){
380
+        this.$router.push({path:'/patients/patient/'+this.id+'/dailyLife'})
381
+      } else if (name == '5-6'){
382
+        this.$router.push({path:'/patients/patient/'+this.id+'/Cathetershedding'})
383
+      } else if (name == '5-7'){
384
+        this.$router.push({path:'/patients/patient/'+this.id+'/RassAssessment'})
385
+      } else if(name == '5-8'){
386
+        this.$router.push({path:'/patients/patient/'+this.id+'/nourishmentAssessment'})
387
+      } else if(name == '5-9'){
388
+        this.$router.push({path:'/patients/patient/'+this.id+'/Constraintnotification'})
389
+      } else if(name == '5-10'){
390
+        this.$router.push({ path: '/patients/patient/' + this.id+'/mindAssessment'})
391
+      } else if(name == '5-11'){
392
+        this.$router.push({path:'/patients/patient/' + this.id+'/pruritusAssessment'})
393
+
394
+      } else if(name == '5-12'){
395
+        this.$router.push({path:'/patients/patient/' + this.id+'/hemodialysis'})
396
+      } else if(name == '5-13'){
397
+        this.$router.push({path:'/patients/patient/' + this.id+'/Glasgow'})
398
+      } else if(name == '5-14'){
399
+        this.$router.push({path:'/patients/patient/' + this.id+'/Muscleforce'})
400
+      }else if(name == '6-1'){
401
+        this.$router.push({path: '/patients/patient/' + this.id+ '/Informedconsent'})
402
+      }else if(name == '7'){
403
+        this.$router.push({path:'/patient/patient/'+this.id+'/lapsoSummary'})
404
+      }
405
+
406
+    },
407
+    changePatient(value) {
408
+      console.log(value)
409
+      if(this.$route.path.indexOf('edit') > -1){
410
+        this.$confirm('是否保存当前病历', '保存', {
411
+          confirmButtonText: '确 定',
412
+          cancelButtonText: '取 消',
413
+          type: 'warning'
414
+        }).then(() => {
415
+            this.$emit('updateInfo')
416
+            setTimeout(() => {
417
+              this.$router.push('/patients/patient/' + value)
418
+            },1000)
419
+        }).catch(() => {
420
+          this.$router.push('/patients/patient/' + value)
421
+        })
422
+      }else{
423
+        this.$router.push('/patients/patient/' + value)
424
+      }
425
+
426
+
427
+    },
428
+    getList() {
429
+      fetchAllList().then(response => {
430
+        if (response.data.state == 1) {
431
+          if(this.org_id ==10191){
432
+             var patients = response.data.data.patients
433
+            //  console.log("patients",patients)
434
+             for(let i=0;i<patients.length;i++){
435
+               if(patients[i].lapseto ==1){
436
+                this.patientsList.push(patients[i])
437
+               }
438
+
439
+             }
440
+          }else{
441
+            this.patientsList = response.data.data.patients
442
+          }
443
+
444
+
445
+          var len = this.patientsList.length
446
+          if (len > 0) {
447
+            for (let index = 0; index < len; index++) {
448
+              if (this.patientsList[index].id == this.id) {
449
+                this.currentPatient = this.patientsList[index]
450
+                // console.log("curr", this.currentPatient);
451
+                this.selectID = this.patientsList[index].id
452
+                this.$emit('tran-patient', this.currentPatient)
453
+                break
454
+              }
455
+            }
456
+          }
457
+        }
458
+      })
459
+    },
460
+    tranAge(birthday) {
461
+      var birth = uParseTime(birthday, '{y}-{m}-{d}')
462
+      return jsGetAge(birth, '-')
463
+    },
464
+    tranSex(gender) {
465
+      var sex = '未知'
466
+      switch (gender) {
467
+        case 1:
468
+          sex = '男'
469
+          break
470
+        case 2:
471
+          sex = '女'
472
+          break
473
+        default:
474
+          break
475
+      }
476
+      return sex
477
+    },
478
+    querySearchAsync(keyword, cb) {
479
+
480
+      let key = ''
481
+      if (keyword != undefined) {
482
+        key = keyword
483
+      }
484
+      let searchArray = []
485
+      PostSearch(key).then(response => {
486
+        if (response.data.state == 1) {
487
+          searchArray = response.data.data.patient
488
+          cb(searchArray)
489
+        } else {
490
+          this.$message.error(response.data.msg)
491
+          cb([])
492
+        }
493
+      })
494
+    },
495
+    handleSelect(val) {
496
+      this.$router.push('/patients/patient/' + val.id)
497
+    },
498
+    getAge: function(val) {
499
+      if (val.id_card_no == undefined) {
500
+        return false
501
+      }
502
+      var thisLen = val.id_card_no.length
503
+      var birth = ''
504
+      if (thisLen == 15) {
505
+        birth = '19' + val.id_card_no.substr(6, 6)
506
+      } else {
507
+        birth = val.id_card_no.substr(6, 8)
508
+      }
509
+      var birthtwo =
510
+        birth.substr(0, 4) +
511
+        '-' +
512
+        birth.substr(4, 2) +
513
+        '-' +
514
+        birth.substr(6, 2)
515
+
516
+      var age = jsGetAge(birthtwo, '-')
517
+      return age
518
+    }
519
+  },
520
+  created() {
521
+    var patientKey = window.sessionStorage.getItem('patientKey')
522
+    console.log("patient-----------------",patientKey)
523
+    this.org_id = this.$store.getters.xt_user.template_info.org_id
524
+    var query = this.$route.path
525
+    console.log("query",this.$route.path)
526
+    if(patientKey){
527
+     this.treeKey = patientKey
528
+     if(query.indexOf('edit') == -1){
529
+      if (patientKey == '1-1') {
530
+        this.$router.push({ path: '/patients/patient/' + this.id })
531
+      } else if (patientKey == '1-2') {
532
+        this.$router.push({ path: '/patients/course?id=' + this.id })
533
+      } else if (patientKey == '1-3') {
534
+        this.$router.push({ path: '/patients/inspection?id=' + this.id })
535
+      } else if (patientKey == '1-4') {
536
+        this.$router.push({
537
+          path: '/patients/patient/' + this.id + '/doctorAdvice'
538
+        })
539
+      } else if (patientKey == '1-6') {
540
+        this.$router.push({
541
+          path: '/patients/patient/' + this.id + '/dryWeight'
542
+        })
543
+      }else if(patientKey == '1-11'){
544
+       this.$router.push({path: '/patients/patient/' + this.id + '/firstDisease'})
545
+      }else if (patientKey == '1-5') {
546
+        this.$router.push({ path: '/patients/rescue?id=' + this.id })
547
+      } else if (patientKey == '2-1') {
548
+        this.$router.push({
549
+          path: '/patients/patient/' + this.id + '/dialysisSolution'
550
+        })
551
+      } else if (patientKey == '2-2') {
552
+        this.$router.push({
553
+          path: '/patients/patient/' + this.id + '/dialysisRecord'
554
+        })
555
+      } else if (patientKey == '2-4') {
556
+        this.$router.push({
557
+          path: '/patients/patient/' + this.id + '/scheduling'
558
+        })
559
+      } else if (patientKey == '2-5') {
560
+        this.$router.push({
561
+          path: '/patients/patient/' + this.id + '/proeducation'
562
+        })
563
+      } else if (patientKey == '3-1') {
564
+        this.$router.push({ path: '/patients/sickhistory?id=' + this.id })
565
+      }else if(patientKey == '7'){
566
+        this.$router.push({path:'/patient/patient/'+this.id+'/lapsoSummary'})
567
+      }else if(patientKey == '4-12'){
568
+        this.$router.push({path:'/patients/newInspection?id='+this.id})
569
+      }
570
+
571
+     }else{
572
+       this.treeKey = "1-1"
573
+
574
+     }
575
+    }else{
576
+       this.treeKey = this.defaultActive
577
+
578
+    }
579
+
580
+
581
+    this.getList()
582
+  },
583
+
584
+}
585
+</script>
586
+
587
+<style>
588
+.patient-menu .el-tree-node__content {
589
+  font-size: 14px;
590
+  height: 40px;
591
+  font-weight: 400;
592
+}
593
+.patient-menu .el-tree-node__label:hover {
594
+  color: #409eff;
595
+}
596
+.patient-menu .el-tree-node:focus > .el-tree-node__content {
597
+  color: #409eff;
598
+}
599
+.patient-menu .el-tree-node .el-tree-node.is-current > .el-tree-node__content {
600
+  color: #409eff;
601
+}
602
+.patient-menu .el-tree {
603
+  background: #f6f8f9;
604
+}
605
+.patient-menu {
606
+  -webkit-transition: width 0.28s;
607
+  transition: width 0.28s;
608
+  width: 180px !important;
609
+  height: 100%;
610
+  position: relative;
611
+  font-size: 0px;
612
+  top: 0;
613
+  float: left;
614
+  bottom: 0;
615
+  left: 0;
616
+  /* z-index: 99; */
617
+  overflow: hidden;
618
+}
619
+
620
+.patient-center-menu .el-icon-arrow-down:before {
621
+  content: "";
622
+}
623
+</style>

+ 8 - 3
src/xt_pages/user/patientInfo.vue Vedi File

@@ -1,7 +1,8 @@
1 1
 
2 2
 <template>
3 3
   <div class="patient-container">
4
-  <patient-sidebar :id="patientID"></patient-sidebar>
4
+  <!-- <patient-sidebar :id="patientID"></patient-sidebar> -->
5
+   <PatientSidebar_new :id="patientID"></PatientSidebar_new>
5 6
   <patient-detail :is-edit='true' :class='panelClass' v-on:tran-patient-info="patientInfo=$event"></patient-detail>
6 7
   </div>
7 8
 </template>
@@ -9,10 +10,14 @@
9 10
 <script>
10 11
 import PatientDetail from './components/PatientDetail'
11 12
 import PatientSidebar from './components/PatientSidebar'
12
-
13
+import PatientSidebar_new from './components/PatientSidebar_new'
13 14
 export default {
14 15
    name: 'editForm',
15
-  components: { PatientDetail, PatientSidebar},
16
+  components: {
17
+    PatientDetail,
18
+    PatientSidebar,
19
+    PatientSidebar_new
20
+  },
16 21
   data() {
17 22
     return {
18 23
       patientID: 0,

+ 748 - 0
src/xt_pages/user/sickHistory_new.vue Vedi File

@@ -0,0 +1,748 @@
1
+<template>
2
+  <div class="patient-container">
3
+    <!-- <patient-sidebar :id="patient_id" defaultActive="3-1"></patient-sidebar> -->
4
+        <PatientSidebar_new :id="patient_id" defaultActive="3-4"></PatientSidebar_new>
5
+    <!-- <div class="app-container"> -->
6
+    <div v-loading="loading">
7
+      <div class="patient-app-container advice-container app-container">
8
+        <div style="display: flex;">
9
+          <div style="width: 25%;">
10
+            <div style="display: flex;">
11
+              <div style="flex: 1.1;">
12
+                <span style="display: inline-block;border-left: 5px solid #3891f1f5;padding-left: 5px;">病史列表</span>
13
+              </div>
14
+              <div style="flex: 0.9;text-align: right;">
15
+                <el-button type="primary" size="small" @click="add_click">添加</el-button>
16
+              </div>
17
+            </div>
18
+            <div>
19
+              <el-table class="table"
20
+                ref="phy_table"
21
+                :data="tableData"
22
+                :highlight-current-row="true"
23
+                @row-click="rowclick"
24
+                style="width: 100%">
25
+                <el-table-column
26
+                  prop="index"
27
+                  label="序号"
28
+                  width="50">
29
+                </el-table-column>
30
+                <el-table-column
31
+                  prop="date"
32
+                  label="时间"
33
+                  width="">
34
+                </el-table-column>
35
+                <el-table-column
36
+                  prop="doctor"
37
+                  label="医生">
38
+                </el-table-column>
39
+              </el-table>
40
+            </div>
41
+          </div>
42
+          <div style="width: 75%;margin-left: 10px;">
43
+            <div style="display: flex;">
44
+              <div style="flex: 1;">
45
+                <span style="display: inline-block;border-left: 5px solid #3891f1f5;padding-left: 5px;">详情</span>
46
+              </div>
47
+              <div style="flex: 1;text-align: right;">
48
+                <div v-if='add_index == 0'>
49
+                  <el-button type="primary" size="small" @click="showEdit">修改</el-button>
50
+                  <el-button size="small" type="danger" @click="deleteAction">删除</el-button>
51
+                  <el-button type="primary" size="small" @click="prints">打印</el-button>
52
+                </div>
53
+                <div v-if="add_index == 1">
54
+                  <el-button type="primary" size="small" @click="showSave">保存</el-button>
55
+                  <el-button size="small" @click="showCancel">取消</el-button>
56
+                </div>
57
+              </div>
58
+            </div>
59
+            <div style="display: flex;margin: 20px 0;">
60
+              <div style="flex: 1;">
61
+                日期:
62
+                <el-date-picker
63
+                  v-model="history_date"
64
+                  type="date"
65
+                  :disabled="disabled"
66
+                  style="width: 150px;"
67
+                  placeholder="选择日期">
68
+                </el-date-picker>
69
+              </div>
70
+              <div style="flex: 1;">
71
+                肾移植史:
72
+                <el-select v-model="shen_yizhi" placeholder="请选择" style="width: 120px;" :disabled="disabled">
73
+                  <el-option
74
+                    v-for="item in yizhi_options"
75
+                    :key="item.value"
76
+                    :label="item.label"
77
+                    :value="item.value">
78
+                  </el-option>
79
+                </el-select>
80
+              </div>
81
+              <div style="flex: 1;">
82
+                腹膜透析史:
83
+                <el-select v-model="shen_fumo" placeholder="请选择" style="width: 120px;" :disabled="disabled">
84
+                  <el-option
85
+                    v-for="item in yizhi_options"
86
+                    :key="item.value"
87
+                    :label="item.label"
88
+                    :value="item.value">
89
+                  </el-option>
90
+                </el-select>
91
+              </div>
92
+            </div>
93
+            <div style="display: flex;">
94
+              <div style="width: 30%;">
95
+                医生:
96
+                <el-select v-model="shen_yishen" placeholder="请选择" style="width: 120px;" :disabled="disabled">
97
+                  <el-option
98
+                    v-for="item in yishen_options"
99
+                    :key="item.value"
100
+                    :label="item.label"
101
+                    :value="item.value">
102
+                  </el-option>
103
+                </el-select>
104
+              </div>
105
+              <div style="width: 30%;">
106
+                过敏药物:
107
+                <el-select v-model="shen_guomi" placeholder="请选择" style="width: 120px;" :disabled="disabled">
108
+                  <el-option
109
+                    v-for="item in guomi_options"
110
+                    :key="item.value"
111
+                    :label="item.label"
112
+                    :value="item.value">
113
+                  </el-option>
114
+                </el-select>
115
+              </div>
116
+            </div>
117
+
118
+            <div style="margin-top: 30px;">
119
+              <span style="display: inline-block;border-left: 5px solid #3891f1f5;padding-left: 5px;margin-bottom: 5px;">详情</span>
120
+              <keep-alive>
121
+                <ueditor ref="ue" :content="new_content" id="editor"></ueditor>
122
+              </keep-alive>
123
+            </div>
124
+          </div>
125
+        </div>
126
+
127
+      </div>
128
+      <!-- </div> -->
129
+      <el-dialog title="新增病史记录" width="70%" top="5vh" :visible.sync="show_dialog">
130
+        <div>
131
+          <div class="new_record_form">
132
+            <div class="cell clearfix" style="margin-bottom: 20px;">
133
+              <label class="title"><span class="name">病程标题</span> : </label>
134
+              <el-input v-model="title" style="width: 150px"></el-input>
135
+
136
+              <label class="title" style="margin-left: 20px;"><span class="name">日期</span> : </label>
137
+              <el-date-picker v-model="sick_history_time" prefix-icon="el-icon-date" :editable="false"
138
+                              style="width: 150px;"
139
+                              type="datetime" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
140
+                              value-format="yyyy-MM-dd "></el-date-picker>
141
+
142
+
143
+              <label class="title" style="margin-left: 20px;"><span class="name">肾移植史</span> : </label>
144
+              <el-select style="width: 150px;" v-model="is_shenyizhishi" placeholder="选择肾移植史" >
145
+                <el-option label="无" value="0"></el-option>
146
+                <el-option label="有" value="1"></el-option>
147
+              </el-select>
148
+            </div>
149
+
150
+            <div class="cell clearfix" style="margin-bottom: 20px;">
151
+
152
+              <label class="title" ><span class="name">腹膜透析史</span> : </label>
153
+              <el-select style="width: 150px;" v-model="is_fumotouxishi" placeholder="选择腹膜透析史" >
154
+                <el-option label="无" value="0"></el-option>
155
+                <el-option label="有" value="1"></el-option>
156
+              </el-select>
157
+
158
+              <label class="title" style="margin-left: 20px;"><span class="name">医生</span> : </label>
159
+              <el-select style="width: 100px;" v-model="doctor_id" placeholder="请选择医生">
160
+                <el-option v-for="(item,index) in doctorOptions" :label="item.name" :value="item.id" :key="index"></el-option>
161
+              </el-select>
162
+
163
+              <label class="title" style="margin-left: 20px;"><span class="name">过敏药物</span> : </label>
164
+              <el-select style="width: 100px;" v-model="is_guominyaowu" placeholder="选择过敏药物">
165
+                <el-option label="无" value="0"></el-option>
166
+                <el-option label="有" value="1"></el-option>
167
+                <el-option label="不详" value="2"></el-option>
168
+
169
+              </el-select>
170
+              <el-input v-if="is_guominyaowu == 1" v-model="guominyaowu_desc"></el-input>
171
+
172
+            </div>
173
+
174
+            <div class="cell clearfix" >
175
+              <label class="title"><span class="name">病史模版</span> : </label>
176
+              <el-select v-model="select_template" placeholder="选择病史模板" @change="didSelectTemplate">
177
+                <el-option v-for="(option, index) in templates" :key="index" :label="option.title"
178
+                           :value="option.content"></el-option>
179
+              </el-select>
180
+            </div>
181
+
182
+            <div class="textarea_panel">
183
+              <keep-alive>
184
+                <editor ref="editor"
185
+                        id="editors"
186
+                        style="width: 100%"
187
+                        v-bind:r_content="new_content"
188
+                >
189
+                </editor>
190
+              </keep-alive>
191
+            </div>
192
+
193
+            <div style="text-align: right; padding-right: 0px; padding-top: 20px; padding-bottom: 10px;">
194
+              <el-button @click="show_dialog = false">取消</el-button>
195
+              <el-button :disabled="$store.getters.xt_user.subscibe.state==3?true:false" type="primary"
196
+                         @click="createAction" :loading="uploading_new_record">保存
197
+              </el-button>
198
+            </div>
199
+          </div>
200
+        </div>
201
+      </el-dialog>
202
+
203
+      <el-dialog title="修改病史记录" width="50%" top="5vh" :visible.sync="show_edit_dialog">
204
+        <div>
205
+          <div class="new_record_form">
206
+            <div class="cell clearfix" style="margin-bottom: 20px;">
207
+              <label class="title"><span class="name">病程标题</span> : </label>
208
+              <el-input v-model="edit_title" style="width: 150px"></el-input>
209
+
210
+              <label class="title" style="margin-left: 20px;"><span class="name">日期</span> : </label>
211
+              <el-date-picker v-model="edit_sick_history_time" prefix-icon="el-icon-date" :editable="false"
212
+                              style="width: 150px;"
213
+                              type="datetime" placeholder="选择日期时间" align="right" format="yyyy-MM-dd "
214
+                              value-format="yyyy-MM-dd "></el-date-picker>
215
+
216
+
217
+              <label class="title" style="margin-left: 20px;"><span class="name">肾移植史</span> : </label>
218
+              <el-select style="width: 150px;" v-model="edit_is_shenyizhishi" placeholder="选择肾移植史" >
219
+                <el-option label="无" value="0"></el-option>
220
+                <el-option label="有" value="1"></el-option>
221
+              </el-select>
222
+            </div>
223
+
224
+            <div class="cell clearfix" style="margin-bottom: 20px;">
225
+
226
+              <label class="title" ><span class="name">腹膜透析史</span> : </label>
227
+              <el-select style="width: 150px;" v-model="edit_is_fumotouxishi" placeholder="选择腹膜透析史" >
228
+                <el-option label="无" value="0"></el-option>
229
+                <el-option label="有" value="1"></el-option>
230
+              </el-select>
231
+
232
+              <label class="title" style="margin-left: 20px;"><span class="name">医生</span> : </label>
233
+              <el-select style="width: 100px;" v-model="edit_doctor_id" placeholder="请选择医生">
234
+                <el-option v-for="(item,index) in doctorOptions" :label="item.name" :value="item.id" :key="index"></el-option>
235
+              </el-select>
236
+
237
+              <label class="title" style="margin-left: 20px;"><span class="name">过敏药物</span> : </label>
238
+              <el-select style="width: 100px;" v-model="edit_is_guominyaowu" placeholder="选择过敏药物">
239
+                <el-option label="无" value="0"></el-option>
240
+                <el-option label="有" value="1"></el-option>
241
+              </el-select>
242
+              <el-input v-if="edit_is_guominyaowu == 1" v-model="edit_guominyaowu_desc"></el-input>
243
+
244
+            </div>
245
+
246
+            <div class="cell clearfix">
247
+              <label class="title"><span class="name">病史模版</span> : </label>
248
+              <el-select v-model="select_template" placeholder="选择病史模板" @change="didSelectTemplate">
249
+                <el-option v-for="(option, index) in templates" :key="index" :label="option.title"
250
+                           :value="option.content"></el-option>
251
+              </el-select>
252
+            </div>
253
+
254
+            <div class="textarea_panel">
255
+              <keep-alive>
256
+                <editor ref="edit_neditor"
257
+                        id="editors"
258
+                        style="width: 100%"
259
+                        v-bind:r_content="edit_new_content"
260
+                >
261
+                </editor>
262
+              </keep-alive>
263
+            </div>
264
+
265
+
266
+            <div style="text-align: right; padding-right: 0px; padding-top: 20px; padding-bottom: 10px;">
267
+              <el-button @click="show_edit_dialog = false">取消</el-button>
268
+              <el-button type="primary"
269
+                         @click="modifyAction" :loading="uploading_new_record">保存
270
+              </el-button>
271
+            </div>
272
+          </div>
273
+        </div>
274
+      </el-dialog>
275
+    </div>
276
+  </div>
277
+
278
+  <!-- </div> -->
279
+</template>
280
+
281
+<script>
282
+import PatientSidebar from './components/PatientSidebar'
283
+import PatientSidebar_new from './components/PatientSidebar_new'
284
+import Editor from '@/components/Editor'
285
+import ueditor from '@/components/Uedtior'
286
+import { fetchAllDoctorAndNurse } from "@/api/doctor";
287
+ import print from 'print-js'
288
+import {
289
+  createSickHistoryRecord,
290
+  deleteSickHistoryRecords,
291
+  GetSickHistoryRecords,
292
+  ModifySickHistoryRecord,
293
+} from '@/api/patient'
294
+import { parseTime } from '@/utils'
295
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
296
+
297
+export default {
298
+  name: 'CourseOfDisease',
299
+  components: {
300
+    PatientSidebar,
301
+    BreadCrumb,
302
+    Editor,
303
+    ueditor,
304
+    PatientSidebar_new
305
+  },
306
+  data() {
307
+    return {
308
+      loading: false,
309
+      title: '',
310
+      patient_id: 0,
311
+      date: [],
312
+      start_time: '',
313
+      end_time: '',
314
+      sick_history_time: '',
315
+      is_shenyizhishi:'',
316
+      is_fumotouxishi:'',
317
+      is_guominyaowu:'',
318
+      guominyaowu_desc:"",
319
+
320
+      edit_is_shenyizhishi:'',
321
+      edit_is_fumotouxishi:'',
322
+      edit_is_guominyaowu:'',
323
+      edit_guominyaowu_desc:"",
324
+
325
+      doctor_id:"",
326
+      doctorOptions:null,
327
+      records: [],
328
+      doctors: [],
329
+      current_select_record: null,
330
+      show_dialog: false,
331
+      show_edit_dialog: false,
332
+      uploading_new_record: false,
333
+      templates: this.$store.getters.configlist.sick_history,
334
+      select_template:"",
335
+      new_content: '111111',
336
+      edit_new_content: '',
337
+      edit_sick_history_time: '',
338
+      selectingRows: [],
339
+      table_current_index: -1,
340
+      edit_current_id: 0,
341
+      edit_doctor_id:0,
342
+      edit_title: '',
343
+      ids:"",
344
+      idArr:[],
345
+
346
+      add_index:0,
347
+      disabled:true,
348
+      history_date:'',
349
+      shen_yizhi:'',
350
+      shen_fumo:'',
351
+      shen_yishen:'',
352
+      shen_guomi:'',
353
+      yizhi_options:[{value:1,label:'无'},{value:2,label:'有'}],
354
+      yishen_options:[],
355
+      guomi_options:[{value:1,label:'无'},{value:2,label:'有'},{value:3,label:'不详'}],
356
+      tableData:[{index:1,date:'2024-11-12',doctor:'王启年'}],
357
+    }
358
+  },
359
+  created() {
360
+    this.patient_id = parseInt(this.$route.query.id)
361
+    if (isNaN(this.patient_id) || this.patient_id <= 0) {
362
+      this.$notify.error({
363
+        title: '错误',
364
+        message: '无效的id'
365
+      })
366
+      this.$router.push('/patients/patients')
367
+      return
368
+    }
369
+    var now = new Date()
370
+    this.date = [now.getTime() - (7 * 24 * 60 * 60 * 1000), now.getTime()]
371
+
372
+    var nowDate = new Date()
373
+    var nowYear = nowDate.getFullYear()
374
+    var nowMonth = nowDate.getMonth() + 1
375
+    var nowDay = nowDate.getDate()
376
+    this.end_time =
377
+      nowYear +
378
+      '-' +
379
+      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
380
+      '-' +
381
+      (nowDay < 10 ? '0' + nowDay : nowDay)
382
+    nowDate.setMonth(nowDate.getMonth() - 1)
383
+    nowYear = nowDate.getFullYear()
384
+    nowMonth = nowDate.getMonth() + 1
385
+    nowDay = nowDate.getDate()
386
+    this.start_time =
387
+      nowYear +
388
+      '-' +
389
+      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
390
+      '-' +
391
+      (nowDay < 10 ? '0' + nowDay : nowDay)
392
+
393
+    this.requestSickHistory()
394
+    this.fetchAllDoctorAndNurse()
395
+
396
+  },
397
+  methods: {
398
+    add_click(){
399
+      this.disabled = false
400
+      this.add_index = 1
401
+    },
402
+    showSave(){
403
+      // this.disabled = true
404
+      this.add_index = 0
405
+    },
406
+    showCancel(){
407
+      this.add_index = 0
408
+    },
409
+    rowclick(row,column, eventc){
410
+      console.log('row',row);
411
+      // this.edit_index = row.index
412
+    },
413
+    template_click(){
414
+      console.log('this.add_index',this.add_index);
415
+
416
+      if(this.add_index ==0){
417
+        this.template_dialog = true
418
+      }else{
419
+        this.library_dialog = true
420
+      }
421
+
422
+    },
423
+    template_save(){
424
+      this.template_dialog = false
425
+      this.$message({
426
+        message: '模板设置成功',
427
+        type: 'success'
428
+      })
429
+    },
430
+    prints(){
431
+      const style ='@media print{.content{width:960px;margin:0 auto;font-size: 23px;}}'
432
+      printJS({
433
+        printable: 'Physical_print_content',
434
+        type: 'html',
435
+        style: style,
436
+        scanStyles: false
437
+      })
438
+    },
439
+
440
+
441
+
442
+
443
+    fetchAllDoctorAndNurse() {
444
+      fetchAllDoctorAndNurse().then(response => {
445
+        if (response.data.state == 1) {
446
+          this.doctorOptions = response.data.data.doctors;
447
+        }
448
+      });
449
+    },
450
+    requestSickHistory: function() {
451
+      this.loading = true
452
+      let params = {
453
+        patient_id:this.patient_id,
454
+        start_time:this.start_time,
455
+        end_time:this.end_time,
456
+      }
457
+      GetSickHistoryRecords(params).then(rs => {
458
+        this.loading = false
459
+        var resp = rs.data
460
+        if (resp.state == 1) {
461
+          this.current_select_record = null
462
+          this.records = resp.data.records
463
+          this.doctors = resp.data.doctors
464
+          this.$refs.record_table.setCurrentRow(this.records[0])
465
+        } else {
466
+          this.$message.error(resp.msg)
467
+        }
468
+      }).catch(error => {
469
+        this.loading = false
470
+        this.$message.error(error)
471
+      })
472
+    },
473
+
474
+    didChangeCurrentRecord: function(record) {
475
+      this.current_select_record = record
476
+    },
477
+    recordTime: function(timestamp) {
478
+      var time = new Date(timestamp * 1000)
479
+      return parseTime(time, '{y}-{m}-{d} {h}:{i}:{s}')
480
+    },
481
+    doctorName: function(doctor_id) {
482
+      for (let index = 0; index < this.doctorOptions.length; index++) {
483
+        const doctor = this.doctorOptions[index]
484
+        if (doctor.id == doctor_id) {
485
+          return doctor.name
486
+        }
487
+      }
488
+      return ''
489
+    },
490
+    modifyAction: function() {
491
+      this.edit_new_content = this.$refs.edit_neditor.content
492
+      if (this.edit_new_content.length == 0) {
493
+        this.$message.error('请填写病程内容')
494
+        return
495
+      }
496
+      this.uploading_new_record = true
497
+      let params = {
498
+        id:this.edit_current_id,
499
+        patient_id: this.patient_id,
500
+        content: this.edit_new_content,
501
+        record_time: this.edit_sick_history_time + " 00:00:00",
502
+        title: this.edit_title,
503
+        is_shenyizhishi:this.edit_is_shenyizhishi,
504
+        is_fumotouxishi:this.edit_is_fumotouxishi,
505
+        is_guominyaowu:this.edit_is_guominyaowu,
506
+        guominyaowu_desc:this.edit_guominyaowu_desc,
507
+        doctor_id: this.edit_doctor_id
508
+      }
509
+
510
+      ModifySickHistoryRecord(params).then(rs => {
511
+        this.uploading_new_record = false
512
+        var resp = rs.data
513
+        if (resp.state == 1) {
514
+          this.records[this.table_current_index].content = resp.data.record.content
515
+          this.records[this.table_current_index].record_time = resp.data.record.record_time
516
+          this.records[this.table_current_index].recorder = resp.data.record.recorder
517
+          this.records[this.table_current_index].title = resp.data.record.title
518
+          this.records[this.table_current_index].doctor_id = resp.data.record.doctor_id
519
+          this.records[this.table_current_index].is_shenyizhi_history = resp.data.record.is_shenyizhi_history
520
+          this.records[this.table_current_index].is_fumo_dialysis_history = resp.data.record.is_fumo_dialysis_history
521
+          this.records[this.table_current_index].is_hypersusceptibility = resp.data.record.is_hypersusceptibility
522
+          this.records[this.table_current_index].hypersusceptibility_desc = resp.data.record.hypersusceptibility_desc
523
+          this.show_edit_dialog = false
524
+          this.edit_new_content = ''
525
+          this.table_current_index = -1
526
+        } else {
527
+          this.table_current_index = -1
528
+          this.$message.error(resp.msg)
529
+        }
530
+
531
+      }).catch(error => {
532
+        this.table_current_index = -1
533
+        this.uploading_new_record = false
534
+        this.$message.error(error)
535
+      })
536
+
537
+    },
538
+
539
+    createAction: function() {
540
+      this.new_content = this.$refs.editor.content
541
+      if (this.new_content.length == 0) {
542
+        this.$message.error('请填写病程内容')
543
+        return
544
+      }
545
+      this.uploading_new_record = true
546
+      let params = {
547
+        patient_id: this.patient_id,
548
+        content: this.new_content,
549
+        record_time: this.sick_history_time +" 00:00:00",
550
+        title: this.title,
551
+        is_shenyizhishi:this.is_shenyizhishi,
552
+        is_fumotouxishi:this.is_fumotouxishi,
553
+        is_guominyaowu:this.is_guominyaowu,
554
+        guominyaowu_desc:this.guominyaowu_desc,
555
+        doctor_id: this.doctor_id
556
+      }
557
+      createSickHistoryRecord(params).then(rs => {
558
+        this.uploading_new_record = false
559
+        this.$message.success("新增成功")
560
+        var resp = rs.data
561
+        if (resp.state == 1) {
562
+          this.records.unshift(resp.data.record)
563
+          this.show_dialog = false
564
+          this.new_content = ''
565
+          this.title = ''
566
+          this.$refs.record_table.setCurrentRow(this.records[0])
567
+        } else {
568
+          this.$message.error(resp.msg)
569
+        }
570
+
571
+      }).catch(error => {
572
+        this.uploading_new_record = false
573
+        this.$message.error(error)
574
+      })
575
+    },
576
+    didSelectTemplate: function(templateContent) {
577
+      this.new_content = this.new_content.length > 0 ? (this.new_content + templateContent) : templateContent
578
+
579
+    }, didEditSelectTemplate: function(templateContent) {
580
+      this.edit_new_content = this.edit_new_content.length > 0 ? (this.edit_new_content + templateContent) : templateContent
581
+    },
582
+
583
+    didSelectionChange: function(selectRows) {
584
+
585
+      var arr = []
586
+      for(let i=0;i<selectRows.length;i++){
587
+        arr.push(selectRows[i].id)
588
+      }
589
+      var newArr = arr.join(',')
590
+      this.ids = newArr
591
+      console.log("select23322332",this.ids)
592
+      this.selectingRows = selectRows
593
+    },
594
+    deleteAction: function() {
595
+      if (this.selectingRows.length == 0) {
596
+        return
597
+      }
598
+      var ids = []
599
+      for (let index = 0; index < this.selectingRows.length; index++) {
600
+        const row = this.selectingRows[index]
601
+        ids.push(row.id)
602
+      }
603
+      var ids_str = ids.join(',')
604
+      this.loading = true
605
+
606
+      let params={
607
+        patient_id:this.patient_id,
608
+        ids:ids_str,
609
+      }
610
+
611
+      deleteSickHistoryRecords(params).then(rs => {
612
+        var resp = rs.data
613
+        if (resp.state == 1) {
614
+          for (let id_index = 0; id_index < ids.length; id_index++) {
615
+            for (let record_index = 0; record_index < this.records.length; record_index++) {
616
+              if (ids[id_index] == this.records[record_index].id) {
617
+                this.records.splice(record_index, 1)
618
+                break
619
+              }
620
+            }
621
+          }
622
+          this.selectingRows = []
623
+          this.$message.success('已删除')
624
+
625
+        } else {
626
+          this.$message.error(resp.msg)
627
+        }
628
+        this.loading = false
629
+      }).catch(err => {
630
+        this.loading = false
631
+        this.$message.error(err)
632
+      })
633
+    }, startTimeChange(val) {
634
+      this.requestSickHistory()
635
+    }, endTimeChange(val) {
636
+      this.requestSickHistory()
637
+    },
638
+    showDialog(){
639
+      for(let i = 0; i < this.doctorOptions.length; i++){
640
+        if(this.doctorOptions[i].id == this.$store.getters.xt_user.user.id){
641
+          this.doctor_id =this.$store.getters.xt_user.user.id
642
+        }
643
+      }
644
+      this.show_dialog = true
645
+
646
+    },showEdit() {
647
+      if (this.table_current_index == -1) {
648
+        this.$message.error('请选择要修改的病程内容')
649
+        return
650
+      }
651
+      this.edit_is_shenyizhishi = this.records[this.table_current_index].is_shenyizhi_history.toString()
652
+      this.edit_is_fumotouxishi = this.records[this.table_current_index].is_fumo_dialysis_history.toString()
653
+      this.edit_is_guominyaowu = this.records[this.table_current_index].is_hypersusceptibility.toString()
654
+      this.edit_guominyaowu_desc = this.records[this.table_current_index].hypersusceptibility_desc
655
+      this.edit_sick_history_time = this.recordTime(this.records[this.table_current_index].record_time)
656
+      this.edit_new_content = this.records[this.table_current_index].content
657
+      this.edit_current_id = this.records[this.table_current_index].id
658
+      this.edit_doctor_id = this.records[this.table_current_index].doctor_id
659
+      console.log(this.edit_new_content )
660
+      this.edit_title = this.records[this.table_current_index].title//
661
+      this.show_edit_dialog = true
662
+
663
+      this.$refs.record_table.setCurrentRow(null)
664
+
665
+    }, tableRow({ row, rowIndex }) {
666
+      // 把每一行的索引放进row
667
+      row.index = rowIndex
668
+    }, onRowClick(row, event, column) {
669
+      this.table_current_index = row.index
670
+    },
671
+    print(){
672
+      // if (this.table_current_index == -1) {
673
+      //   this.$message.error('请选择要打印的病程')
674
+      //   return
675
+      // }
676
+      if(this.ids.length == 0){
677
+        this.$message.error('请选择要打印的病程')
678
+        return
679
+      }
680
+      this.$router.push({ path: "/sickhistory/print?ids="+this.ids+"&patient_id="+this.patient_id});
681
+    }
682
+  }
683
+}
684
+</script>
685
+
686
+<style rel="stylesheet/css" lang="scss" scoped>
687
+.container {
688
+  margin-left: 180px;
689
+  padding: 20px;
690
+  background: #fff;
691
+  min-height: calc(100vh - 173px);
692
+  margin-bottom: 15px;
693
+
694
+.record {
695
+  padding-top: 20px;
696
+}
697
+
698
+}
699
+.record_content_panel {
700
+  border-width: 1px;
701
+  border-style: solid;
702
+  border-color: #ebeef5;
703
+  min-height: 200px;
704
+
705
+.title {
706
+  font-size: 14px;
707
+  font-weight: 500;
708
+  color: #909399;
709
+  line-height: 44px;
710
+  height: 44px;
711
+  text-align: center;
712
+  border-bottom-width: 1px;
713
+  border-bottom-style: solid;
714
+  border-bottom-color: #ebeef5;
715
+}
716
+
717
+.content {
718
+  padding: 12px 15px;
719
+  font-size: 15px;
720
+  color: gray;
721
+  line-height: 22px;
722
+}
723
+
724
+}
725
+
726
+.new_record_form {
727
+
728
+/*/ / padding: 10 px, 25 px;*/
729
+
730
+.textarea_panel {
731
+  margin-top: 10px;
732
+}
733
+
734
+}
735
+</style>
736
+<style>
737
+.el-table td,
738
+.el-table th.is-leaf,
739
+.el-table--border,
740
+.el-table--group {
741
+  border-color: #d0d3da;
742
+}
743
+.el-table--border::after,
744
+.el-table--group::after,
745
+.el-table::before {
746
+  background-color: #d0d3da;
747
+}
748
+</style>

+ 40 - 0
static/ueditor/dialogs/anchor/anchor.html Vedi File

@@ -0,0 +1,40 @@
1
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
+    "http://www.w3.org/TR/html4/loose.dtd">
3
+<html>
4
+    <head>
5
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+        <title></title>
7
+        <style type="text/css">
8
+            *{color: #838383;margin: 0;padding: 0}
9
+            html,body {font-size: 12px;overflow: hidden; }
10
+            .content{padding:5px 0 0 15px;}
11
+            input{width:210px;height:21px;line-height:21px;margin-left: 4px;}
12
+        </style>
13
+    </head>
14
+    <body>
15
+        <div class="content">
16
+            <span><var id="lang_input_anchorName"></var></span><input id="anchorName"  value="" />
17
+        </div>
18
+        <script type="text/javascript" src="../internal.js"></script>
19
+        <script type="text/javascript">
20
+            var anchorInput = $G('anchorName'),
21
+                node = editor.selection.getRange().getClosedNode();
22
+            if(node && node.tagName == 'IMG' && (node = node.getAttribute('anchorname'))){
23
+                anchorInput.value = node;
24
+            }
25
+            anchorInput.onkeydown = function(evt){
26
+                evt = evt || window.event;
27
+                if(evt.keyCode == 13){
28
+                    editor.execCommand('anchor', anchorInput.value);
29
+                    dialog.close();
30
+                    domUtils.preventDefault(evt)
31
+                }
32
+            };
33
+            dialog.onok = function (){
34
+                editor.execCommand('anchor', anchorInput.value);
35
+                dialog.close();
36
+            };
37
+            $focus(anchorInput);
38
+        </script>
39
+    </body>
40
+</html>

+ 681 - 0
static/ueditor/dialogs/attachment/attachment.css Vedi File

@@ -0,0 +1,681 @@
1
+@charset "utf-8";
2
+/* dialog样式 */
3
+.wrapper {
4
+    zoom: 1;
5
+    width: 630px;
6
+    *width: 626px;
7
+    height: 380px;
8
+    margin: 0 auto;
9
+    padding: 10px;
10
+    position: relative;
11
+    font-family: sans-serif;
12
+}
13
+
14
+/*tab样式框大小*/
15
+.tabhead {
16
+    float:left;
17
+}
18
+.tabbody {
19
+    width: 100%;
20
+    height: 346px;
21
+    position: relative;
22
+    clear: both;
23
+}
24
+
25
+.tabbody .panel {
26
+    position: absolute;
27
+    width: 0;
28
+    height: 0;
29
+    background: #fff;
30
+    overflow: hidden;
31
+    display: none;
32
+}
33
+
34
+.tabbody .panel.focus {
35
+    width: 100%;
36
+    height: 346px;
37
+    display: block;
38
+}
39
+
40
+/* 上传附件 */
41
+.tabbody #upload.panel {
42
+    width: 0;
43
+    height: 0;
44
+    overflow: hidden;
45
+    position: absolute !important;
46
+    clip: rect(1px, 1px, 1px, 1px);
47
+    background: #fff;
48
+    display: block;
49
+}
50
+
51
+.tabbody #upload.panel.focus {
52
+    width: 100%;
53
+    height: 346px;
54
+    display: block;
55
+    clip: auto;
56
+}
57
+
58
+#upload .queueList {
59
+    margin: 0;
60
+    width: 100%;
61
+    height: 100%;
62
+    position: absolute;
63
+    overflow: hidden;
64
+}
65
+
66
+#upload p {
67
+    margin: 0;
68
+}
69
+
70
+.element-invisible {
71
+    width: 0 !important;
72
+    height: 0 !important;
73
+    border: 0;
74
+    padding: 0;
75
+    margin: 0;
76
+    overflow: hidden;
77
+    position: absolute !important;
78
+    clip: rect(1px, 1px, 1px, 1px);
79
+}
80
+
81
+#upload .placeholder {
82
+    margin: 10px;
83
+    border: 2px dashed #e6e6e6;
84
+    *border: 0px dashed #e6e6e6;
85
+    height: 172px;
86
+    padding-top: 150px;
87
+    text-align: center;
88
+    background: url(./images/image.png) center 70px no-repeat;
89
+    color: #cccccc;
90
+    font-size: 18px;
91
+    position: relative;
92
+    top:0;
93
+    *top: 10px;
94
+}
95
+
96
+#upload .placeholder .webuploader-pick {
97
+    font-size: 18px;
98
+    background: #00b7ee;
99
+    border-radius: 3px;
100
+    line-height: 44px;
101
+    padding: 0 30px;
102
+    *width: 120px;
103
+    color: #fff;
104
+    display: inline-block;
105
+    margin: 0 auto 20px auto;
106
+    cursor: pointer;
107
+    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
108
+}
109
+
110
+#upload .placeholder .webuploader-pick-hover {
111
+    background: #00a2d4;
112
+}
113
+
114
+
115
+#filePickerContainer {
116
+    text-align: center;
117
+}
118
+
119
+#upload .placeholder .flashTip {
120
+    color: #666666;
121
+    font-size: 12px;
122
+    position: absolute;
123
+    width: 100%;
124
+    text-align: center;
125
+    bottom: 20px;
126
+}
127
+
128
+#upload .placeholder .flashTip a {
129
+    color: #0785d1;
130
+    text-decoration: none;
131
+}
132
+
133
+#upload .placeholder .flashTip a:hover {
134
+    text-decoration: underline;
135
+}
136
+
137
+#upload .placeholder.webuploader-dnd-over {
138
+    border-color: #999999;
139
+}
140
+
141
+#upload .filelist {
142
+    list-style: none;
143
+    margin: 0;
144
+    padding: 0;
145
+    overflow-x: hidden;
146
+    overflow-y: auto;
147
+    position: relative;
148
+    height: 300px;
149
+}
150
+
151
+#upload .filelist:after {
152
+    content: '';
153
+    display: block;
154
+    width: 0;
155
+    height: 0;
156
+    overflow: hidden;
157
+    clear: both;
158
+}
159
+
160
+#upload .filelist li {
161
+    width: 113px;
162
+    height: 113px;
163
+    background: url(./images/bg.png);
164
+    text-align: center;
165
+    margin: 9px 0 0 9px;
166
+    *margin: 6px 0 0 6px;
167
+    position: relative;
168
+    display: block;
169
+    float: left;
170
+    overflow: hidden;
171
+    font-size: 12px;
172
+}
173
+
174
+#upload .filelist li p.log {
175
+    position: relative;
176
+    top: -45px;
177
+}
178
+
179
+#upload .filelist li p.title {
180
+    position: absolute;
181
+    top: 0;
182
+    left: 0;
183
+    width: 100%;
184
+    overflow: hidden;
185
+    white-space: nowrap;
186
+    text-overflow: ellipsis;
187
+    top: 5px;
188
+    text-indent: 5px;
189
+    text-align: left;
190
+}
191
+
192
+#upload .filelist li p.progress {
193
+    position: absolute;
194
+    width: 100%;
195
+    bottom: 0;
196
+    left: 0;
197
+    height: 8px;
198
+    overflow: hidden;
199
+    z-index: 50;
200
+    margin: 0;
201
+    border-radius: 0;
202
+    background: none;
203
+    -webkit-box-shadow: 0 0 0;
204
+}
205
+
206
+#upload .filelist li p.progress span {
207
+    display: none;
208
+    overflow: hidden;
209
+    width: 0;
210
+    height: 100%;
211
+    background: #1483d8 url(./images/progress.png) repeat-x;
212
+
213
+    -webit-transition: width 200ms linear;
214
+    -moz-transition: width 200ms linear;
215
+    -o-transition: width 200ms linear;
216
+    -ms-transition: width 200ms linear;
217
+    transition: width 200ms linear;
218
+
219
+    -webkit-animation: progressmove 2s linear infinite;
220
+    -moz-animation: progressmove 2s linear infinite;
221
+    -o-animation: progressmove 2s linear infinite;
222
+    -ms-animation: progressmove 2s linear infinite;
223
+    animation: progressmove 2s linear infinite;
224
+
225
+    -webkit-transform: translateZ(0);
226
+}
227
+
228
+@-webkit-keyframes progressmove {
229
+    0% {
230
+        background-position: 0 0;
231
+    }
232
+    100% {
233
+        background-position: 17px 0;
234
+    }
235
+}
236
+
237
+@-moz-keyframes progressmove {
238
+    0% {
239
+        background-position: 0 0;
240
+    }
241
+    100% {
242
+        background-position: 17px 0;
243
+    }
244
+}
245
+
246
+@keyframes progressmove {
247
+    0% {
248
+        background-position: 0 0;
249
+    }
250
+    100% {
251
+        background-position: 17px 0;
252
+    }
253
+}
254
+
255
+#upload .filelist li p.imgWrap {
256
+    position: relative;
257
+    z-index: 2;
258
+    line-height: 113px;
259
+    vertical-align: middle;
260
+    overflow: hidden;
261
+    width: 113px;
262
+    height: 113px;
263
+
264
+    -webkit-transform-origin: 50% 50%;
265
+    -moz-transform-origin: 50% 50%;
266
+    -o-transform-origin: 50% 50%;
267
+    -ms-transform-origin: 50% 50%;
268
+    transform-origin: 50% 50%;
269
+
270
+    -webit-transition: 200ms ease-out;
271
+    -moz-transition: 200ms ease-out;
272
+    -o-transition: 200ms ease-out;
273
+    -ms-transition: 200ms ease-out;
274
+    transition: 200ms ease-out;
275
+}
276
+#upload .filelist li p.imgWrap.notimage {
277
+    margin-top: 0;
278
+    width: 111px;
279
+    height: 111px;
280
+    border: 1px #eeeeee solid;
281
+}
282
+#upload .filelist li p.imgWrap.notimage i.file-preview {
283
+    margin-top: 15px;
284
+}
285
+
286
+#upload .filelist li img {
287
+    width: 100%;
288
+}
289
+
290
+#upload .filelist li p.error {
291
+    background: #f43838;
292
+    color: #fff;
293
+    position: absolute;
294
+    bottom: 0;
295
+    left: 0;
296
+    height: 28px;
297
+    line-height: 28px;
298
+    width: 100%;
299
+    z-index: 100;
300
+    display:none;
301
+}
302
+
303
+#upload .filelist li .success {
304
+    display: block;
305
+    position: absolute;
306
+    left: 0;
307
+    bottom: 0;
308
+    height: 40px;
309
+    width: 100%;
310
+    z-index: 200;
311
+    background: url(./images/success.png) no-repeat right bottom;
312
+    background-image: url(./images/success.gif) \9;
313
+}
314
+
315
+#upload .filelist li.filePickerBlock {
316
+    width: 113px;
317
+    height: 113px;
318
+    background: url(./images/image.png) no-repeat center 12px;
319
+    border: 1px solid #eeeeee;
320
+    border-radius: 0;
321
+}
322
+#upload .filelist li.filePickerBlock div.webuploader-pick  {
323
+    width: 100%;
324
+    height: 100%;
325
+    margin: 0;
326
+    padding: 0;
327
+    opacity: 0;
328
+    background: none;
329
+    font-size: 0;
330
+}
331
+
332
+#upload .filelist div.file-panel {
333
+    position: absolute;
334
+    height: 0;
335
+    filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0;
336
+    background: rgba(0, 0, 0, 0.5);
337
+    width: 100%;
338
+    top: 0;
339
+    left: 0;
340
+    overflow: hidden;
341
+    z-index: 300;
342
+}
343
+
344
+#upload .filelist div.file-panel span {
345
+    width: 24px;
346
+    height: 24px;
347
+    display: inline;
348
+    float: right;
349
+    text-indent: -9999px;
350
+    overflow: hidden;
351
+    background: url(./images/icons.png) no-repeat;
352
+    background: url(./images/icons.gif) no-repeat \9;
353
+    margin: 5px 1px 1px;
354
+    cursor: pointer;
355
+    -webkit-tap-highlight-color: rgba(0,0,0,0);
356
+    -webkit-user-select: none;
357
+    -moz-user-select: none;
358
+    -ms-user-select: none;
359
+    user-select: none;
360
+}
361
+
362
+#upload .filelist div.file-panel span.rotateLeft {
363
+    display:none;
364
+    background-position: 0 -24px;
365
+}
366
+
367
+#upload .filelist div.file-panel span.rotateLeft:hover {
368
+    background-position: 0 0;
369
+}
370
+
371
+#upload .filelist div.file-panel span.rotateRight {
372
+    display:none;
373
+    background-position: -24px -24px;
374
+}
375
+
376
+#upload .filelist div.file-panel span.rotateRight:hover {
377
+    background-position: -24px 0;
378
+}
379
+
380
+#upload .filelist div.file-panel span.cancel {
381
+    background-position: -48px -24px;
382
+}
383
+
384
+#upload .filelist div.file-panel span.cancel:hover {
385
+    background-position: -48px 0;
386
+}
387
+
388
+#upload .statusBar {
389
+    height: 45px;
390
+    border-bottom: 1px solid #dadada;
391
+    margin: 0 10px;
392
+    padding: 0;
393
+    line-height: 45px;
394
+    vertical-align: middle;
395
+    position: relative;
396
+}
397
+
398
+#upload .statusBar .progress {
399
+    border: 1px solid #1483d8;
400
+    width: 198px;
401
+    background: #fff;
402
+    height: 18px;
403
+    position: absolute;
404
+    top: 12px;
405
+    display: none;
406
+    text-align: center;
407
+    line-height: 18px;
408
+    color: #6dbfff;
409
+    margin: 0 10px 0 0;
410
+}
411
+#upload .statusBar .progress span.percentage {
412
+    width: 0;
413
+    height: 100%;
414
+    left: 0;
415
+    top: 0;
416
+    background: #1483d8;
417
+    position: absolute;
418
+}
419
+#upload .statusBar .progress span.text {
420
+    position: relative;
421
+    z-index: 10;
422
+}
423
+
424
+#upload .statusBar .info {
425
+    display: inline-block;
426
+    font-size: 14px;
427
+    color: #666666;
428
+}
429
+
430
+#upload .statusBar .btns {
431
+    position: absolute;
432
+    top: 7px;
433
+    right: 0;
434
+    line-height: 30px;
435
+}
436
+
437
+#filePickerBtn {
438
+    display: inline-block;
439
+    float: left;
440
+}
441
+#upload .statusBar .btns .webuploader-pick,
442
+#upload .statusBar .btns .uploadBtn,
443
+#upload .statusBar .btns .uploadBtn.state-uploading,
444
+#upload .statusBar .btns .uploadBtn.state-paused {
445
+    background: #ffffff;
446
+    border: 1px solid #cfcfcf;
447
+    color: #565656;
448
+    padding: 0 18px;
449
+    display: inline-block;
450
+    border-radius: 3px;
451
+    margin-left: 10px;
452
+    cursor: pointer;
453
+    font-size: 14px;
454
+    float: left;
455
+    -webkit-user-select: none;
456
+    -moz-user-select: none;
457
+    -ms-user-select: none;
458
+    user-select: none;
459
+}
460
+#upload .statusBar .btns .webuploader-pick-hover,
461
+#upload .statusBar .btns .uploadBtn:hover,
462
+#upload .statusBar .btns .uploadBtn.state-uploading:hover,
463
+#upload .statusBar .btns .uploadBtn.state-paused:hover {
464
+    background: #f0f0f0;
465
+}
466
+
467
+#upload .statusBar .btns .uploadBtn,
468
+#upload .statusBar .btns .uploadBtn.state-paused{
469
+    background: #00b7ee;
470
+    color: #fff;
471
+    border-color: transparent;
472
+}
473
+#upload .statusBar .btns .uploadBtn:hover,
474
+#upload .statusBar .btns .uploadBtn.state-paused:hover{
475
+    background: #00a2d4;
476
+}
477
+
478
+#upload .statusBar .btns .uploadBtn.disabled {
479
+    pointer-events: none;
480
+    filter:alpha(opacity=60);
481
+    -moz-opacity:0.6;
482
+    -khtml-opacity: 0.6;
483
+    opacity: 0.6;
484
+}
485
+
486
+
487
+
488
+/* 图片管理样式 */
489
+#online {
490
+    width: 100%;
491
+    height: 336px;
492
+    padding: 10px 0 0 0;
493
+}
494
+#online #fileList{
495
+    width: 100%;
496
+    height: 100%;
497
+    overflow-x: hidden;
498
+    overflow-y: auto;
499
+    position: relative;
500
+}
501
+#online ul {
502
+    display: block;
503
+    list-style: none;
504
+    margin: 0;
505
+    padding: 0;
506
+}
507
+#online li {
508
+    float: left;
509
+    display: block;
510
+    list-style: none;
511
+    padding: 0;
512
+    width: 113px;
513
+    height: 113px;
514
+    margin: 0 0 9px 9px;
515
+    *margin: 0 0 6px 6px;
516
+    background-color: #eee;
517
+    overflow: hidden;
518
+    cursor: pointer;
519
+    position: relative;
520
+}
521
+#online li.clearFloat {
522
+    float: none;
523
+    clear: both;
524
+    display: block;
525
+    width:0;
526
+    height:0;
527
+    margin: 0;
528
+    padding: 0;
529
+}
530
+#online li img {
531
+    cursor: pointer;
532
+}
533
+#online li div.file-wrapper {
534
+    cursor: pointer;
535
+    position: absolute;
536
+    display: block;
537
+    width: 111px;
538
+    height: 111px;
539
+    border: 1px solid #eee;
540
+    background: url("./images/bg.png") repeat;
541
+}
542
+#online li div span.file-title{
543
+    display: block;
544
+    padding: 0 3px;
545
+    margin: 3px 0 0 0;
546
+    font-size: 12px;
547
+    height: 13px;
548
+    color: #555555;
549
+    text-align: center;
550
+    width: 107px;
551
+    white-space: nowrap;
552
+    word-break: break-all;
553
+    overflow: hidden;
554
+    text-overflow: ellipsis;
555
+}
556
+#online li .icon {
557
+    cursor: pointer;
558
+    width: 113px;
559
+    height: 113px;
560
+    position: absolute;
561
+    top: 0;
562
+    left: 0;
563
+    z-index: 2;
564
+    border: 0;
565
+    background-repeat: no-repeat;
566
+}
567
+#online li .icon:hover {
568
+    width: 107px;
569
+    height: 107px;
570
+    border: 3px solid #1094fa;
571
+}
572
+#online li.selected .icon {
573
+    background-image: url(images/success.png);
574
+    background-image: url(images/success.gif) \9;
575
+    background-position: 75px 75px;
576
+}
577
+#online li.selected .icon:hover {
578
+    width: 107px;
579
+    height: 107px;
580
+    border: 3px solid #1094fa;
581
+    background-position: 72px 72px;
582
+}
583
+
584
+
585
+/* 在线文件的文件预览图标 */
586
+i.file-preview {
587
+    display: block;
588
+    margin: 10px auto;
589
+    width: 70px;
590
+    height: 70px;
591
+    background-image: url("./images/file-icons.png");
592
+    background-image: url("./images/file-icons.gif") \9;
593
+    background-position: -140px center;
594
+    background-repeat: no-repeat;
595
+}
596
+i.file-preview.file-type-dir{
597
+    background-position: 0 center;
598
+}
599
+i.file-preview.file-type-file{
600
+    background-position: -140px center;
601
+}
602
+i.file-preview.file-type-filelist{
603
+    background-position: -210px center;
604
+}
605
+i.file-preview.file-type-zip,
606
+i.file-preview.file-type-rar,
607
+i.file-preview.file-type-7z,
608
+i.file-preview.file-type-tar,
609
+i.file-preview.file-type-gz,
610
+i.file-preview.file-type-bz2{
611
+    background-position: -280px center;
612
+}
613
+i.file-preview.file-type-xls,
614
+i.file-preview.file-type-xlsx{
615
+    background-position: -350px center;
616
+}
617
+i.file-preview.file-type-doc,
618
+i.file-preview.file-type-docx{
619
+    background-position: -420px center;
620
+}
621
+i.file-preview.file-type-ppt,
622
+i.file-preview.file-type-pptx{
623
+    background-position: -490px center;
624
+}
625
+i.file-preview.file-type-vsd{
626
+    background-position: -560px center;
627
+}
628
+i.file-preview.file-type-pdf{
629
+    background-position: -630px center;
630
+}
631
+i.file-preview.file-type-txt,
632
+i.file-preview.file-type-md,
633
+i.file-preview.file-type-json,
634
+i.file-preview.file-type-htm,
635
+i.file-preview.file-type-xml,
636
+i.file-preview.file-type-html,
637
+i.file-preview.file-type-js,
638
+i.file-preview.file-type-css,
639
+i.file-preview.file-type-php,
640
+i.file-preview.file-type-jsp,
641
+i.file-preview.file-type-asp{
642
+    background-position: -700px center;
643
+}
644
+i.file-preview.file-type-apk{
645
+    background-position: -770px center;
646
+}
647
+i.file-preview.file-type-exe{
648
+    background-position: -840px center;
649
+}
650
+i.file-preview.file-type-ipa{
651
+    background-position: -910px center;
652
+}
653
+i.file-preview.file-type-mp4,
654
+i.file-preview.file-type-swf,
655
+i.file-preview.file-type-mkv,
656
+i.file-preview.file-type-avi,
657
+i.file-preview.file-type-flv,
658
+i.file-preview.file-type-mov,
659
+i.file-preview.file-type-mpg,
660
+i.file-preview.file-type-mpeg,
661
+i.file-preview.file-type-ogv,
662
+i.file-preview.file-type-webm,
663
+i.file-preview.file-type-rm,
664
+i.file-preview.file-type-rmvb{
665
+    background-position: -980px center;
666
+}
667
+i.file-preview.file-type-ogg,
668
+i.file-preview.file-type-wav,
669
+i.file-preview.file-type-wmv,
670
+i.file-preview.file-type-mid,
671
+i.file-preview.file-type-mp3{
672
+    background-position: -1050px center;
673
+}
674
+i.file-preview.file-type-jpg,
675
+i.file-preview.file-type-jpeg,
676
+i.file-preview.file-type-gif,
677
+i.file-preview.file-type-bmp,
678
+i.file-preview.file-type-png,
679
+i.file-preview.file-type-psd{
680
+    background-position: -140px center;
681
+}

+ 60 - 0
static/ueditor/dialogs/attachment/attachment.html Vedi File

@@ -0,0 +1,60 @@
1
+<!doctype html>
2
+<html>
3
+<head>
4
+    <meta charset="UTF-8">
5
+    <title>ueditor图片对话框</title>
6
+    <script type="text/javascript" src="../internal.js"></script>
7
+
8
+    <!-- jquery -->
9
+    <script type="text/javascript" src="../../third-party/jquery-1.10.2.min.js"></script>
10
+
11
+    <!-- webuploader -->
12
+    <script src="../../third-party/webuploader/webuploader.min.js"></script>
13
+    <link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css">
14
+
15
+    <!-- attachment dialog -->
16
+    <link rel="stylesheet" href="attachment.css" type="text/css" />
17
+</head>
18
+<body>
19
+
20
+    <div class="wrapper">
21
+        <div id="tabhead" class="tabhead">
22
+            <span class="tab focus" data-content-id="upload"><var id="lang_tab_upload"></var></span>
23
+            <span class="tab" data-content-id="online"><var id="lang_tab_online"></var></span>
24
+        </div>
25
+        <div id="tabbody" class="tabbody">
26
+            <!-- 上传图片 -->
27
+            <div id="upload" class="panel focus">
28
+                <div id="queueList" class="queueList">
29
+                    <div class="statusBar element-invisible">
30
+                        <div class="progress">
31
+                            <span class="text">0%</span>
32
+                            <span class="percentage"></span>
33
+                        </div><div class="info"></div>
34
+                        <div class="btns">
35
+                            <div id="filePickerBtn"></div>
36
+                            <div class="uploadBtn"><var id="lang_start_upload"></var></div>
37
+                        </div>
38
+                    </div>
39
+                    <div id="dndArea" class="placeholder">
40
+                        <div class="filePickerContainer">
41
+                            <div id="filePickerReady"></div>
42
+                        </div>
43
+                    </div>
44
+                    <ul class="filelist element-invisible">
45
+                        <li id="filePickerBlock" class="filePickerBlock"></li>
46
+                    </ul>
47
+                </div>
48
+            </div>
49
+
50
+            <!-- 在线图片 -->
51
+            <div id="online" class="panel">
52
+                <div id="fileList"><var id="lang_imgLoading"></var></div>
53
+            </div>
54
+
55
+        </div>
56
+    </div>
57
+    <script type="text/javascript" src="attachment.js"></script>
58
+
59
+</body>
60
+</html>

+ 754 - 0
static/ueditor/dialogs/attachment/attachment.js Vedi File

@@ -0,0 +1,754 @@
1
+/**
2
+ * User: Jinqn
3
+ * Date: 14-04-08
4
+ * Time: 下午16:34
5
+ * 上传图片对话框逻辑代码,包括tab: 远程图片/上传图片/在线图片/搜索图片
6
+ */
7
+
8
+(function () {
9
+
10
+    var uploadFile,
11
+        onlineFile;
12
+
13
+    window.onload = function () {
14
+        initTabs();
15
+        initButtons();
16
+    };
17
+
18
+    /* 初始化tab标签 */
19
+    function initTabs() {
20
+        var tabs = $G('tabhead').children;
21
+        for (var i = 0; i < tabs.length; i++) {
22
+            domUtils.on(tabs[i], "click", function (e) {
23
+                var target = e.target || e.srcElement;
24
+                setTabFocus(target.getAttribute('data-content-id'));
25
+            });
26
+        }
27
+
28
+        setTabFocus('upload');
29
+    }
30
+
31
+    /* 初始化tabbody */
32
+    function setTabFocus(id) {
33
+        if(!id) return;
34
+        var i, bodyId, tabs = $G('tabhead').children;
35
+        for (i = 0; i < tabs.length; i++) {
36
+            bodyId = tabs[i].getAttribute('data-content-id')
37
+            if (bodyId == id) {
38
+                domUtils.addClass(tabs[i], 'focus');
39
+                domUtils.addClass($G(bodyId), 'focus');
40
+            } else {
41
+                domUtils.removeClasses(tabs[i], 'focus');
42
+                domUtils.removeClasses($G(bodyId), 'focus');
43
+            }
44
+        }
45
+        switch (id) {
46
+            case 'upload':
47
+                uploadFile = uploadFile || new UploadFile('queueList');
48
+                break;
49
+            case 'online':
50
+                onlineFile = onlineFile || new OnlineFile('fileList');
51
+                break;
52
+        }
53
+    }
54
+
55
+    /* 初始化onok事件 */
56
+    function initButtons() {
57
+
58
+        dialog.onok = function () {
59
+            var list = [], id, tabs = $G('tabhead').children;
60
+            for (var i = 0; i < tabs.length; i++) {
61
+                if (domUtils.hasClass(tabs[i], 'focus')) {
62
+                    id = tabs[i].getAttribute('data-content-id');
63
+                    break;
64
+                }
65
+            }
66
+
67
+            switch (id) {
68
+                case 'upload':
69
+                    list = uploadFile.getInsertList();
70
+                    var count = uploadFile.getQueueCount();
71
+                    if (count) {
72
+                        $('.info', '#queueList').html('<span style="color:red;">' + '还有2个未上传文件'.replace(/[\d]/, count) + '</span>');
73
+                        return false;
74
+                    }
75
+                    break;
76
+                case 'online':
77
+                    list = onlineFile.getInsertList();
78
+                    break;
79
+            }
80
+
81
+            editor.execCommand('insertfile', list);
82
+        };
83
+    }
84
+
85
+
86
+    /* 上传附件 */
87
+    function UploadFile(target) {
88
+        this.$wrap = target.constructor == String ? $('#' + target) : $(target);
89
+        this.init();
90
+    }
91
+    UploadFile.prototype = {
92
+        init: function () {
93
+            this.fileList = [];
94
+            this.initContainer();
95
+            this.initUploader();
96
+        },
97
+        initContainer: function () {
98
+            this.$queue = this.$wrap.find('.filelist');
99
+        },
100
+        /* 初始化容器 */
101
+        initUploader: function () {
102
+            var _this = this,
103
+                $ = jQuery,    // just in case. Make sure it's not an other libaray.
104
+                $wrap = _this.$wrap,
105
+            // 图片容器
106
+                $queue = $wrap.find('.filelist'),
107
+            // 状态栏,包括进度和控制按钮
108
+                $statusBar = $wrap.find('.statusBar'),
109
+            // 文件总体选择信息。
110
+                $info = $statusBar.find('.info'),
111
+            // 上传按钮
112
+                $upload = $wrap.find('.uploadBtn'),
113
+            // 上传按钮
114
+                $filePickerBtn = $wrap.find('.filePickerBtn'),
115
+            // 上传按钮
116
+                $filePickerBlock = $wrap.find('.filePickerBlock'),
117
+            // 没选择文件之前的内容。
118
+                $placeHolder = $wrap.find('.placeholder'),
119
+            // 总体进度条
120
+                $progress = $statusBar.find('.progress').hide(),
121
+            // 添加的文件数量
122
+                fileCount = 0,
123
+            // 添加的文件总大小
124
+                fileSize = 0,
125
+            // 优化retina, 在retina下这个值是2
126
+                ratio = window.devicePixelRatio || 1,
127
+            // 缩略图大小
128
+                thumbnailWidth = 113 * ratio,
129
+                thumbnailHeight = 113 * ratio,
130
+            // 可能有pedding, ready, uploading, confirm, done.
131
+                state = '',
132
+            // 所有文件的进度信息,key为file id
133
+                percentages = {},
134
+                supportTransition = (function () {
135
+                    var s = document.createElement('p').style,
136
+                        r = 'transition' in s ||
137
+                            'WebkitTransition' in s ||
138
+                            'MozTransition' in s ||
139
+                            'msTransition' in s ||
140
+                            'OTransition' in s;
141
+                    s = null;
142
+                    return r;
143
+                })(),
144
+            // WebUploader实例
145
+                uploader,
146
+                actionUrl = editor.getActionUrl(editor.getOpt('fileActionName')),
147
+                fileMaxSize = editor.getOpt('fileMaxSize'),
148
+                acceptExtensions = (editor.getOpt('fileAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');;
149
+
150
+            if (!WebUploader.Uploader.support()) {
151
+                $('#filePickerReady').after($('<div>').html(lang.errorNotSupport)).hide();
152
+                return;
153
+            } else if (!editor.getOpt('fileActionName')) {
154
+                $('#filePickerReady').after($('<div>').html(lang.errorLoadConfig)).hide();
155
+                return;
156
+            }
157
+
158
+            uploader = _this.uploader = WebUploader.create({
159
+                pick: {
160
+                    id: '#filePickerReady',
161
+                    label: lang.uploadSelectFile
162
+                },
163
+                swf: '../../third-party/webuploader/Uploader.swf',
164
+                server: actionUrl,
165
+                fileVal: editor.getOpt('fileFieldName'),
166
+                duplicate: true,
167
+                fileSingleSizeLimit: fileMaxSize,
168
+                compress: false
169
+            });
170
+            uploader.addButton({
171
+                id: '#filePickerBlock'
172
+            });
173
+            uploader.addButton({
174
+                id: '#filePickerBtn',
175
+                label: lang.uploadAddFile
176
+            });
177
+
178
+            setState('pedding');
179
+
180
+            // 当有文件添加进来时执行,负责view的创建
181
+            function addFile(file) {
182
+                var $li = $('<li id="' + file.id + '">' +
183
+                        '<p class="title">' + file.name + '</p>' +
184
+                        '<p class="imgWrap"></p>' +
185
+                        '<p class="progress"><span></span></p>' +
186
+                        '</li>'),
187
+
188
+                    $btns = $('<div class="file-panel">' +
189
+                        '<span class="cancel">' + lang.uploadDelete + '</span>' +
190
+                        '<span class="rotateRight">' + lang.uploadTurnRight + '</span>' +
191
+                        '<span class="rotateLeft">' + lang.uploadTurnLeft + '</span></div>').appendTo($li),
192
+                    $prgress = $li.find('p.progress span'),
193
+                    $wrap = $li.find('p.imgWrap'),
194
+                    $info = $('<p class="error"></p>').hide().appendTo($li),
195
+
196
+                    showError = function (code) {
197
+                        switch (code) {
198
+                            case 'exceed_size':
199
+                                text = lang.errorExceedSize;
200
+                                break;
201
+                            case 'interrupt':
202
+                                text = lang.errorInterrupt;
203
+                                break;
204
+                            case 'http':
205
+                                text = lang.errorHttp;
206
+                                break;
207
+                            case 'not_allow_type':
208
+                                text = lang.errorFileType;
209
+                                break;
210
+                            default:
211
+                                text = lang.errorUploadRetry;
212
+                                break;
213
+                        }
214
+                        $info.text(text).show();
215
+                    };
216
+
217
+                if (file.getStatus() === 'invalid') {
218
+                    showError(file.statusText);
219
+                } else {
220
+                    $wrap.text(lang.uploadPreview);
221
+                    if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|'+file.ext.toLowerCase()+'|') == -1) {
222
+                        $wrap.empty().addClass('notimage').append('<i class="file-preview file-type-' + file.ext.toLowerCase() + '"></i>' +
223
+                        '<span class="file-title" title="' + file.name + '">' + file.name + '</span>');
224
+                    } else {
225
+                        if (browser.ie && browser.version <= 7) {
226
+                            $wrap.text(lang.uploadNoPreview);
227
+                        } else {
228
+                            uploader.makeThumb(file, function (error, src) {
229
+                                if (error || !src) {
230
+                                    $wrap.text(lang.uploadNoPreview);
231
+                                } else {
232
+                                    var $img = $('<img src="' + src + '">');
233
+                                    $wrap.empty().append($img);
234
+                                    $img.on('error', function () {
235
+                                        $wrap.text(lang.uploadNoPreview);
236
+                                    });
237
+                                }
238
+                            }, thumbnailWidth, thumbnailHeight);
239
+                        }
240
+                    }
241
+                    percentages[ file.id ] = [ file.size, 0 ];
242
+                    file.rotation = 0;
243
+
244
+                    /* 检查文件格式 */
245
+                    if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) {
246
+                        showError('not_allow_type');
247
+                        uploader.removeFile(file);
248
+                    }
249
+                }
250
+
251
+                file.on('statuschange', function (cur, prev) {
252
+                    if (prev === 'progress') {
253
+                        $prgress.hide().width(0);
254
+                    } else if (prev === 'queued') {
255
+                        $li.off('mouseenter mouseleave');
256
+                        $btns.remove();
257
+                    }
258
+                    // 成功
259
+                    if (cur === 'error' || cur === 'invalid') {
260
+                        showError(file.statusText);
261
+                        percentages[ file.id ][ 1 ] = 1;
262
+                    } else if (cur === 'interrupt') {
263
+                        showError('interrupt');
264
+                    } else if (cur === 'queued') {
265
+                        percentages[ file.id ][ 1 ] = 0;
266
+                    } else if (cur === 'progress') {
267
+                        $info.hide();
268
+                        $prgress.css('display', 'block');
269
+                    } else if (cur === 'complete') {
270
+                    }
271
+
272
+                    $li.removeClass('state-' + prev).addClass('state-' + cur);
273
+                });
274
+
275
+                $li.on('mouseenter', function () {
276
+                    $btns.stop().animate({height: 30});
277
+                });
278
+                $li.on('mouseleave', function () {
279
+                    $btns.stop().animate({height: 0});
280
+                });
281
+
282
+                $btns.on('click', 'span', function () {
283
+                    var index = $(this).index(),
284
+                        deg;
285
+
286
+                    switch (index) {
287
+                        case 0:
288
+                            uploader.removeFile(file);
289
+                            return;
290
+                        case 1:
291
+                            file.rotation += 90;
292
+                            break;
293
+                        case 2:
294
+                            file.rotation -= 90;
295
+                            break;
296
+                    }
297
+
298
+                    if (supportTransition) {
299
+                        deg = 'rotate(' + file.rotation + 'deg)';
300
+                        $wrap.css({
301
+                            '-webkit-transform': deg,
302
+                            '-mos-transform': deg,
303
+                            '-o-transform': deg,
304
+                            'transform': deg
305
+                        });
306
+                    } else {
307
+                        $wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')');
308
+                    }
309
+
310
+                });
311
+
312
+                $li.insertBefore($filePickerBlock);
313
+            }
314
+
315
+            // 负责view的销毁
316
+            function removeFile(file) {
317
+                var $li = $('#' + file.id);
318
+                delete percentages[ file.id ];
319
+                updateTotalProgress();
320
+                $li.off().find('.file-panel').off().end().remove();
321
+            }
322
+
323
+            function updateTotalProgress() {
324
+                var loaded = 0,
325
+                    total = 0,
326
+                    spans = $progress.children(),
327
+                    percent;
328
+
329
+                $.each(percentages, function (k, v) {
330
+                    total += v[ 0 ];
331
+                    loaded += v[ 0 ] * v[ 1 ];
332
+                });
333
+
334
+                percent = total ? loaded / total : 0;
335
+
336
+                spans.eq(0).text(Math.round(percent * 100) + '%');
337
+                spans.eq(1).css('width', Math.round(percent * 100) + '%');
338
+                updateStatus();
339
+            }
340
+
341
+            function setState(val, files) {
342
+
343
+                if (val != state) {
344
+
345
+                    var stats = uploader.getStats();
346
+
347
+                    $upload.removeClass('state-' + state);
348
+                    $upload.addClass('state-' + val);
349
+
350
+                    switch (val) {
351
+
352
+                        /* 未选择文件 */
353
+                        case 'pedding':
354
+                            $queue.addClass('element-invisible');
355
+                            $statusBar.addClass('element-invisible');
356
+                            $placeHolder.removeClass('element-invisible');
357
+                            $progress.hide(); $info.hide();
358
+                            uploader.refresh();
359
+                            break;
360
+
361
+                        /* 可以开始上传 */
362
+                        case 'ready':
363
+                            $placeHolder.addClass('element-invisible');
364
+                            $queue.removeClass('element-invisible');
365
+                            $statusBar.removeClass('element-invisible');
366
+                            $progress.hide(); $info.show();
367
+                            $upload.text(lang.uploadStart);
368
+                            uploader.refresh();
369
+                            break;
370
+
371
+                        /* 上传中 */
372
+                        case 'uploading':
373
+                            $progress.show(); $info.hide();
374
+                            $upload.text(lang.uploadPause);
375
+                            break;
376
+
377
+                        /* 暂停上传 */
378
+                        case 'paused':
379
+                            $progress.show(); $info.hide();
380
+                            $upload.text(lang.uploadContinue);
381
+                            break;
382
+
383
+                        case 'confirm':
384
+                            $progress.show(); $info.hide();
385
+                            $upload.text(lang.uploadStart);
386
+
387
+                            stats = uploader.getStats();
388
+                            if (stats.successNum && !stats.uploadFailNum) {
389
+                                setState('finish');
390
+                                return;
391
+                            }
392
+                            break;
393
+
394
+                        case 'finish':
395
+                            $progress.hide(); $info.show();
396
+                            if (stats.uploadFailNum) {
397
+                                $upload.text(lang.uploadRetry);
398
+                            } else {
399
+                                $upload.text(lang.uploadStart);
400
+                            }
401
+                            break;
402
+                    }
403
+
404
+                    state = val;
405
+                    updateStatus();
406
+
407
+                }
408
+
409
+                if (!_this.getQueueCount()) {
410
+                    $upload.addClass('disabled')
411
+                } else {
412
+                    $upload.removeClass('disabled')
413
+                }
414
+
415
+            }
416
+
417
+            function updateStatus() {
418
+                var text = '', stats;
419
+
420
+                if (state === 'ready') {
421
+                    text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize));
422
+                } else if (state === 'confirm') {
423
+                    stats = uploader.getStats();
424
+                    if (stats.uploadFailNum) {
425
+                        text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum);
426
+                    }
427
+                } else {
428
+                    stats = uploader.getStats();
429
+                    text = lang.updateStatusFinish.replace('_', fileCount).
430
+                        replace('_KB', WebUploader.formatSize(fileSize)).
431
+                        replace('_', stats.successNum);
432
+
433
+                    if (stats.uploadFailNum) {
434
+                        text += lang.updateStatusError.replace('_', stats.uploadFailNum);
435
+                    }
436
+                }
437
+
438
+                $info.html(text);
439
+            }
440
+
441
+            uploader.on('fileQueued', function (file) {
442
+                fileCount++;
443
+                fileSize += file.size;
444
+
445
+                if (fileCount === 1) {
446
+                    $placeHolder.addClass('element-invisible');
447
+                    $statusBar.show();
448
+                }
449
+
450
+                addFile(file);
451
+            });
452
+
453
+            uploader.on('fileDequeued', function (file) {
454
+                fileCount--;
455
+                fileSize -= file.size;
456
+
457
+                removeFile(file);
458
+                updateTotalProgress();
459
+            });
460
+
461
+            uploader.on('filesQueued', function (file) {
462
+                if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) {
463
+                    setState('ready');
464
+                }
465
+                updateTotalProgress();
466
+            });
467
+
468
+            uploader.on('all', function (type, files) {
469
+                switch (type) {
470
+                    case 'uploadFinished':
471
+                        setState('confirm', files);
472
+                        break;
473
+                    case 'startUpload':
474
+                        /* 添加额外的GET参数 */
475
+                        var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '',
476
+                            url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + 'encode=utf-8&' + params);
477
+                        uploader.option('server', url);
478
+                        setState('uploading', files);
479
+                        break;
480
+                    case 'stopUpload':
481
+                        setState('paused', files);
482
+                        break;
483
+                }
484
+            });
485
+
486
+            uploader.on('uploadBeforeSend', function (file, data, header) {
487
+                //这里可以通过data对象添加POST参数
488
+                header['X_Requested_With'] = 'XMLHttpRequest';
489
+            });
490
+
491
+            uploader.on('uploadProgress', function (file, percentage) {
492
+                var $li = $('#' + file.id),
493
+                    $percent = $li.find('.progress span');
494
+
495
+                $percent.css('width', percentage * 100 + '%');
496
+                percentages[ file.id ][ 1 ] = percentage;
497
+                updateTotalProgress();
498
+            });
499
+
500
+            uploader.on('uploadSuccess', function (file, ret) {
501
+                var $file = $('#' + file.id);
502
+                try {
503
+                    var responseText = (ret._raw || ret),
504
+                        json = utils.str2json(responseText);
505
+                    if (json.state == 'SUCCESS') {
506
+                        _this.fileList.push(json);
507
+                        $file.append('<span class="success"></span>');
508
+                    } else {
509
+                        $file.find('.error').text(json.state).show();
510
+                    }
511
+                } catch (e) {
512
+                    $file.find('.error').text(lang.errorServerUpload).show();
513
+                }
514
+            });
515
+
516
+            uploader.on('uploadError', function (file, code) {
517
+            });
518
+            uploader.on('error', function (code, file) {
519
+                if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') {
520
+                    addFile(file);
521
+                }
522
+            });
523
+            uploader.on('uploadComplete', function (file, ret) {
524
+            });
525
+
526
+            $upload.on('click', function () {
527
+                if ($(this).hasClass('disabled')) {
528
+                    return false;
529
+                }
530
+
531
+                if (state === 'ready') {
532
+                    uploader.upload();
533
+                } else if (state === 'paused') {
534
+                    uploader.upload();
535
+                } else if (state === 'uploading') {
536
+                    uploader.stop();
537
+                }
538
+            });
539
+
540
+            $upload.addClass('state-' + state);
541
+            updateTotalProgress();
542
+        },
543
+        getQueueCount: function () {
544
+            var file, i, status, readyFile = 0, files = this.uploader.getFiles();
545
+            for (i = 0; file = files[i++]; ) {
546
+                status = file.getStatus();
547
+                if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
548
+            }
549
+            return readyFile;
550
+        },
551
+        getInsertList: function () {
552
+            var i, link, data, list = [],
553
+                prefix = editor.getOpt('fileUrlPrefix');
554
+            for (i = 0; i < this.fileList.length; i++) {
555
+                data = this.fileList[i];
556
+                link = data.url;
557
+                list.push({
558
+                    title: data.original || link.substr(link.lastIndexOf('/') + 1),
559
+                    url: prefix + link
560
+                });
561
+            }
562
+            return list;
563
+        }
564
+    };
565
+
566
+
567
+    /* 在线附件 */
568
+    function OnlineFile(target) {
569
+        this.container = utils.isString(target) ? document.getElementById(target) : target;
570
+        this.init();
571
+    }
572
+    OnlineFile.prototype = {
573
+        init: function () {
574
+            this.initContainer();
575
+            this.initEvents();
576
+            this.initData();
577
+        },
578
+        /* 初始化容器 */
579
+        initContainer: function () {
580
+            this.container.innerHTML = '';
581
+            this.list = document.createElement('ul');
582
+            this.clearFloat = document.createElement('li');
583
+
584
+            domUtils.addClass(this.list, 'list');
585
+            domUtils.addClass(this.clearFloat, 'clearFloat');
586
+
587
+            this.list.appendChild(this.clearFloat);
588
+            this.container.appendChild(this.list);
589
+        },
590
+        /* 初始化滚动事件,滚动到地步自动拉取数据 */
591
+        initEvents: function () {
592
+            var _this = this;
593
+
594
+            /* 滚动拉取图片 */
595
+            domUtils.on($G('fileList'), 'scroll', function(e){
596
+                var panel = this;
597
+                if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) {
598
+                    _this.getFileData();
599
+                }
600
+            });
601
+            /* 选中图片 */
602
+            domUtils.on(this.list, 'click', function (e) {
603
+                var target = e.target || e.srcElement,
604
+                    li = target.parentNode;
605
+
606
+                if (li.tagName.toLowerCase() == 'li') {
607
+                    if (domUtils.hasClass(li, 'selected')) {
608
+                        domUtils.removeClasses(li, 'selected');
609
+                    } else {
610
+                        domUtils.addClass(li, 'selected');
611
+                    }
612
+                }
613
+            });
614
+        },
615
+        /* 初始化第一次的数据 */
616
+        initData: function () {
617
+
618
+            /* 拉取数据需要使用的值 */
619
+            this.state = 0;
620
+            this.listSize = editor.getOpt('fileManagerListSize');
621
+            this.listIndex = 0;
622
+            this.listEnd = false;
623
+
624
+            /* 第一次拉取数据 */
625
+            this.getFileData();
626
+        },
627
+        /* 向后台拉取图片列表数据 */
628
+        getFileData: function () {
629
+            var _this = this;
630
+
631
+            if(!_this.listEnd && !this.isLoadingData) {
632
+                this.isLoadingData = true;
633
+                ajax.request(editor.getActionUrl(editor.getOpt('fileManagerActionName')), {
634
+                    timeout: 100000,
635
+                    data: utils.extend({
636
+                            start: this.listIndex,
637
+                            size: this.listSize
638
+                        }, editor.queryCommandValue('serverparam')),
639
+                    method: 'get',
640
+                    onsuccess: function (r) {
641
+                        try {
642
+                            var json = eval('(' + r.responseText + ')');
643
+                            if (json.state == 'SUCCESS') {
644
+                                _this.pushData(json.list);
645
+                                _this.listIndex = parseInt(json.start) + parseInt(json.list.length);
646
+                                if(_this.listIndex >= json.total) {
647
+                                    _this.listEnd = true;
648
+                                }
649
+                                _this.isLoadingData = false;
650
+                            }
651
+                        } catch (e) {
652
+                            if(r.responseText.indexOf('ue_separate_ue') != -1) {
653
+                                var list = r.responseText.split(r.responseText);
654
+                                _this.pushData(list);
655
+                                _this.listIndex = parseInt(list.length);
656
+                                _this.listEnd = true;
657
+                                _this.isLoadingData = false;
658
+                            }
659
+                        }
660
+                    },
661
+                    onerror: function () {
662
+                        _this.isLoadingData = false;
663
+                    }
664
+                });
665
+            }
666
+        },
667
+        /* 添加图片到列表界面上 */
668
+        pushData: function (list) {
669
+            var i, item, img, filetype, preview, icon, _this = this,
670
+                urlPrefix = editor.getOpt('fileManagerUrlPrefix');
671
+            for (i = 0; i < list.length; i++) {
672
+                if(list[i] && list[i].url) {
673
+                    item = document.createElement('li');
674
+                    icon = document.createElement('span');
675
+                    filetype = list[i].url.substr(list[i].url.lastIndexOf('.') + 1);
676
+
677
+                    if ( "png|jpg|jpeg|gif|bmp".indexOf(filetype) != -1 ) {
678
+                        preview = document.createElement('img');
679
+                        domUtils.on(preview, 'load', (function(image){
680
+                            return function(){
681
+                                _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight);
682
+                            };
683
+                        })(preview));
684
+                        preview.width = 113;
685
+                        preview.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) );
686
+                    } else {
687
+                        var ic = document.createElement('i'),
688
+                            textSpan = document.createElement('span');
689
+                        textSpan.innerHTML = list[i].url.substr(list[i].url.lastIndexOf('/') + 1);
690
+                        preview = document.createElement('div');
691
+                        preview.appendChild(ic);
692
+                        preview.appendChild(textSpan);
693
+                        domUtils.addClass(preview, 'file-wrapper');
694
+                        domUtils.addClass(textSpan, 'file-title');
695
+                        domUtils.addClass(ic, 'file-type-' + filetype);
696
+                        domUtils.addClass(ic, 'file-preview');
697
+                    }
698
+                    domUtils.addClass(icon, 'icon');
699
+                    item.setAttribute('data-url', urlPrefix + list[i].url);
700
+                    if (list[i].original) {
701
+                        item.setAttribute('data-title', list[i].original);
702
+                    }
703
+
704
+                    item.appendChild(preview);
705
+                    item.appendChild(icon);
706
+                    this.list.insertBefore(item, this.clearFloat);
707
+                }
708
+            }
709
+        },
710
+        /* 改变图片大小 */
711
+        scale: function (img, w, h, type) {
712
+            var ow = img.width,
713
+                oh = img.height;
714
+
715
+            if (type == 'justify') {
716
+                if (ow >= oh) {
717
+                    img.width = w;
718
+                    img.height = h * oh / ow;
719
+                    img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px';
720
+                } else {
721
+                    img.width = w * ow / oh;
722
+                    img.height = h;
723
+                    img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px';
724
+                }
725
+            } else {
726
+                if (ow >= oh) {
727
+                    img.width = w * ow / oh;
728
+                    img.height = h;
729
+                    img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px';
730
+                } else {
731
+                    img.width = w;
732
+                    img.height = h * oh / ow;
733
+                    img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px';
734
+                }
735
+            }
736
+        },
737
+        getInsertList: function () {
738
+            var i, lis = this.list.children, list = [];
739
+            for (i = 0; i < lis.length; i++) {
740
+                if (domUtils.hasClass(lis[i], 'selected')) {
741
+                    var url = lis[i].getAttribute('data-url');
742
+                    var title = lis[i].getAttribute('data-title') || url.substr(url.lastIndexOf('/') + 1);
743
+                    list.push({
744
+                        title: title,
745
+                        url: url
746
+                    });
747
+                }
748
+            }
749
+            return list;
750
+        }
751
+    };
752
+
753
+
754
+})();

BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_default.png Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif Vedi File


BIN
static/ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif Vedi File


BIN
static/ueditor/dialogs/attachment/images/alignicon.gif Vedi File


BIN
static/ueditor/dialogs/attachment/images/alignicon.png Vedi File


BIN
static/ueditor/dialogs/attachment/images/bg.png Vedi File


BIN
static/ueditor/dialogs/attachment/images/file-icons.gif Vedi File


BIN
static/ueditor/dialogs/attachment/images/file-icons.png Vedi File


BIN
static/ueditor/dialogs/attachment/images/icons.gif Vedi File


BIN
static/ueditor/dialogs/attachment/images/icons.png Vedi File


BIN
static/ueditor/dialogs/attachment/images/image.png Vedi File


BIN
static/ueditor/dialogs/attachment/images/progress.png Vedi File


BIN
static/ueditor/dialogs/attachment/images/success.gif Vedi File


BIN
static/ueditor/dialogs/attachment/images/success.png Vedi File


+ 94 - 0
static/ueditor/dialogs/background/background.css Vedi File

@@ -0,0 +1,94 @@
1
+.wrapper{ width: 424px;margin: 10px auto; zoom:1;position: relative}
2
+.tabbody{height:225px;}
3
+.tabbody .panel { position: absolute;width:100%; height:100%;background: #fff; display: none;}
4
+.tabbody .focus { display: block;}
5
+
6
+body{font-size: 12px;color: #888;overflow: hidden;}
7
+input,label{vertical-align:middle}
8
+.clear{clear: both;}
9
+.pl{padding-left: 18px;padding-left: 23px\9;}
10
+
11
+#imageList {width: 420px;height: 215px;margin-top: 10px;overflow: hidden;overflow-y: auto;}
12
+#imageList div {float: left;width: 100px;height: 95px;margin: 5px 10px;}
13
+#imageList img {cursor: pointer;border: 2px solid white;}
14
+
15
+.bgarea{margin: 10px;padding: 5px;height: 84%;border: 1px solid #A8A297;}
16
+.content div{margin: 10px 0 10px 5px;}
17
+.content .iptradio{margin: 0px 5px 5px 0px;}
18
+.txt{width:280px;}
19
+
20
+.wrapcolor{height: 19px;}
21
+div.color{float: left;margin: 0;}
22
+#colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;margin: 0;float: left;}
23
+div.alignment,#custom{margin-left: 23px;margin-left: 28px\9;}
24
+#custom input{height: 15px;min-height: 15px;width:20px;}
25
+#repeatType{width:100px;}
26
+
27
+
28
+/* 图片管理样式 */
29
+#imgManager {
30
+    width: 100%;
31
+    height: 225px;
32
+}
33
+#imgManager #imageList{
34
+    width: 100%;
35
+    overflow-x: hidden;
36
+    overflow-y: auto;
37
+}
38
+#imgManager ul {
39
+    display: block;
40
+    list-style: none;
41
+    margin: 0;
42
+    padding: 0;
43
+}
44
+#imgManager li {
45
+    float: left;
46
+    display: block;
47
+    list-style: none;
48
+    padding: 0;
49
+    width: 113px;
50
+    height: 113px;
51
+    margin: 9px 0 0 19px;
52
+    background-color: #eee;
53
+    overflow: hidden;
54
+    cursor: pointer;
55
+    position: relative;
56
+}
57
+#imgManager li.clearFloat {
58
+    float: none;
59
+    clear: both;
60
+    display: block;
61
+    width:0;
62
+    height:0;
63
+    margin: 0;
64
+    padding: 0;
65
+}
66
+#imgManager li img {
67
+    cursor: pointer;
68
+}
69
+#imgManager li .icon {
70
+    cursor: pointer;
71
+    width: 113px;
72
+    height: 113px;
73
+    position: absolute;
74
+    top: 0;
75
+    left: 0;
76
+    z-index: 2;
77
+    border: 0;
78
+    background-repeat: no-repeat;
79
+}
80
+#imgManager li .icon:hover {
81
+    width: 107px;
82
+    height: 107px;
83
+    border: 3px solid #1094fa;
84
+}
85
+#imgManager li.selected .icon {
86
+    background-image: url(images/success.png);
87
+    background-position: 75px 75px;
88
+}
89
+#imgManager li.selected .icon:hover {
90
+    width: 107px;
91
+    height: 107px;
92
+    border: 3px solid #1094fa;
93
+    background-position: 72px 72px;
94
+}

+ 56 - 0
static/ueditor/dialogs/background/background.html Vedi File

@@ -0,0 +1,56 @@
1
+<!DOCTYPE HTML>
2
+<html>
3
+<head>
4
+    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
5
+    <script type="text/javascript" src="../internal.js"></script>
6
+    <link rel="stylesheet" type="text/css" href="background.css">
7
+</head>
8
+<body>
9
+    <div id="bg_container" class="wrapper">
10
+        <div id="tabHeads" class="tabhead">
11
+            <span class="focus" data-content-id="normal"><var id="lang_background_normal"></var></span>
12
+            <span class="" data-content-id="imgManager"><var id="lang_background_local"></var></span>
13
+        </div>
14
+        <div id="tabBodys" class="tabbody">
15
+            <div id="normal" class="panel focus">
16
+                <fieldset class="bgarea">
17
+                    <legend><var id="lang_background_set"></var></legend>
18
+                    <div class="content">
19
+                        <div>
20
+                            <label><input id="nocolorRadio" class="iptradio" type="radio" name="t" value="none" checked="checked"><var id="lang_background_none"></var></label>
21
+                            <label><input id="coloredRadio" class="iptradio" type="radio" name="t" value="color"><var id="lang_background_colored"></var></label>
22
+                        </div>
23
+                        <div class="wrapcolor pl">
24
+                            <div class="color">
25
+                                <var id="lang_background_color"></var>:
26
+                            </div>
27
+                            <div id="colorPicker"></div>
28
+                            <div class="clear"></div>
29
+                        </div>
30
+                        <div class="wrapcolor pl">
31
+                            <label><var id="lang_background_netimg"></var>:</label><input class="txt" type="text" id="url">
32
+                        </div>
33
+                        <div id="alignment" class="alignment">
34
+                            <var id="lang_background_align"></var>:<select id="repeatType">
35
+                                <option value="center"></option>
36
+                                <option value="repeat-x"></option>
37
+                                <option value="repeat-y"></option>
38
+                                <option value="repeat"></option>
39
+                                <option value="self"></option>
40
+                            </select>
41
+                        </div>
42
+                        <div id="custom" >
43
+                            <var id="lang_background_position"></var>:x:<input type="text" size="1" id="x" maxlength="4" value="0">px&nbsp;&nbsp;y:<input type="text" size="1" id="y" maxlength="4" value="0">px
44
+                        </div>
45
+                    </div>
46
+                </fieldset>
47
+
48
+            </div>
49
+            <div id="imgManager" class="panel">
50
+                <div id="imageList" style=""></div>
51
+            </div>
52
+        </div>
53
+    </div>
54
+    <script type="text/javascript" src="background.js"></script>
55
+</body>
56
+</html>

+ 376 - 0
static/ueditor/dialogs/background/background.js Vedi File

@@ -0,0 +1,376 @@
1
+(function () {
2
+
3
+    var onlineImage,
4
+        backupStyle = editor.queryCommandValue('background');
5
+
6
+    window.onload = function () {
7
+        initTabs();
8
+        initColorSelector();
9
+    };
10
+
11
+    /* 初始化tab标签 */
12
+    function initTabs(){
13
+        var tabs = $G('tabHeads').children;
14
+        for (var i = 0; i < tabs.length; i++) {
15
+            domUtils.on(tabs[i], "click", function (e) {
16
+                var target = e.target || e.srcElement;
17
+                for (var j = 0; j < tabs.length; j++) {
18
+                    if(tabs[j] == target){
19
+                        tabs[j].className = "focus";
20
+                        var contentId = tabs[j].getAttribute('data-content-id');
21
+                        $G(contentId).style.display = "block";
22
+                        if(contentId == 'imgManager') {
23
+                            initImagePanel();
24
+                        }
25
+                    }else {
26
+                        tabs[j].className = "";
27
+                        $G(tabs[j].getAttribute('data-content-id')).style.display = "none";
28
+                    }
29
+                }
30
+            });
31
+        }
32
+    }
33
+
34
+    /* 初始化颜色设置 */
35
+    function initColorSelector () {
36
+        var obj = editor.queryCommandValue('background');
37
+        if (obj) {
38
+            var color = obj['background-color'],
39
+                repeat = obj['background-repeat'] || 'repeat',
40
+                image = obj['background-image'] || '',
41
+                position = obj['background-position'] || 'center center',
42
+                pos = position.split(' '),
43
+                x = parseInt(pos[0]) || 0,
44
+                y = parseInt(pos[1]) || 0;
45
+
46
+            if(repeat == 'no-repeat' && (x || y)) repeat = 'self';
47
+
48
+            image = image.match(/url[\s]*\(([^\)]*)\)/);
49
+            image = image ? image[1]:'';
50
+            updateFormState('colored', color, image, repeat, x, y);
51
+        } else {
52
+            updateFormState();
53
+        }
54
+
55
+        var updateHandler = function () {
56
+            updateFormState();
57
+            updateBackground();
58
+        }
59
+        domUtils.on($G('nocolorRadio'), 'click', updateBackground);
60
+        domUtils.on($G('coloredRadio'), 'click', updateHandler);
61
+        domUtils.on($G('url'), 'keyup', function(){
62
+            if($G('url').value && $G('alignment').style.display == "none") {
63
+                utils.each($G('repeatType').children, function(item){
64
+                    item.selected = ('repeat' == item.getAttribute('value') ? 'selected':false);
65
+                });
66
+            }
67
+            updateHandler();
68
+        });
69
+        domUtils.on($G('repeatType'), 'change', updateHandler);
70
+        domUtils.on($G('x'), 'keyup', updateBackground);
71
+        domUtils.on($G('y'), 'keyup', updateBackground);
72
+
73
+        initColorPicker();
74
+    }
75
+
76
+    /* 初始化颜色选择器 */
77
+    function initColorPicker() {
78
+        var me = editor,
79
+            cp = $G("colorPicker");
80
+
81
+        /* 生成颜色选择器ui对象 */
82
+        var popup = new UE.ui.Popup({
83
+            content: new UE.ui.ColorPicker({
84
+                noColorText: me.getLang("clearColor"),
85
+                editor: me,
86
+                onpickcolor: function (t, color) {
87
+                    updateFormState('colored', color);
88
+                    updateBackground();
89
+                    UE.ui.Popup.postHide();
90
+                },
91
+                onpicknocolor: function (t, color) {
92
+                    updateFormState('colored', 'transparent');
93
+                    updateBackground();
94
+                    UE.ui.Popup.postHide();
95
+                }
96
+            }),
97
+            editor: me,
98
+            onhide: function () {
99
+            }
100
+        });
101
+
102
+        /* 设置颜色选择器 */
103
+        domUtils.on(cp, "click", function () {
104
+            popup.showAnchor(this);
105
+        });
106
+        domUtils.on(document, 'mousedown', function (evt) {
107
+            var el = evt.target || evt.srcElement;
108
+            UE.ui.Popup.postHide(el);
109
+        });
110
+        domUtils.on(window, 'scroll', function () {
111
+            UE.ui.Popup.postHide();
112
+        });
113
+    }
114
+
115
+    /* 初始化在线图片列表 */
116
+    function initImagePanel() {
117
+        onlineImage = onlineImage || new OnlineImage('imageList');
118
+    }
119
+
120
+    /* 更新背景色设置面板 */
121
+    function updateFormState (radio, color, url, align, x, y) {
122
+        var nocolorRadio = $G('nocolorRadio'),
123
+            coloredRadio = $G('coloredRadio');
124
+
125
+        if(radio) {
126
+            nocolorRadio.checked = (radio == 'colored' ? false:'checked');
127
+            coloredRadio.checked = (radio == 'colored' ? 'checked':false);
128
+        }
129
+        if(color) {
130
+            domUtils.setStyle($G("colorPicker"), "background-color", color);
131
+        }
132
+
133
+        if(url && /^\//.test(url)) {
134
+            var a = document.createElement('a');
135
+            a.href = url;
136
+            browser.ie && (a.href = a.href);
137
+            url = browser.ie ? a.href:(a.protocol + '//' + a.host + a.pathname + a.search + a.hash);
138
+        }
139
+
140
+        if(url || url === '') {
141
+            $G('url').value = url;
142
+        }
143
+        if(align) {
144
+            utils.each($G('repeatType').children, function(item){
145
+                item.selected = (align == item.getAttribute('value') ? 'selected':false);
146
+            });
147
+        }
148
+        if(x || y) {
149
+            $G('x').value = parseInt(x) || 0;
150
+            $G('y').value = parseInt(y) || 0;
151
+        }
152
+
153
+        $G('alignment').style.display = coloredRadio.checked && $G('url').value ? '':'none';
154
+        $G('custom').style.display = coloredRadio.checked && $G('url').value && $G('repeatType').value == 'self' ? '':'none';
155
+    }
156
+
157
+    /* 更新背景颜色 */
158
+    function updateBackground () {
159
+        if ($G('coloredRadio').checked) {
160
+            var color = domUtils.getStyle($G("colorPicker"), "background-color"),
161
+                bgimg = $G("url").value,
162
+                align = $G("repeatType").value,
163
+                backgroundObj = {
164
+                    "background-repeat": "no-repeat",
165
+                    "background-position": "center center"
166
+                };
167
+
168
+            if (color) backgroundObj["background-color"] = color;
169
+            if (bgimg) backgroundObj["background-image"] = 'url(' + bgimg + ')';
170
+            if (align == 'self') {
171
+                backgroundObj["background-position"] = $G("x").value + "px " + $G("y").value + "px";
172
+            } else if (align == 'repeat-x' || align == 'repeat-y' || align == 'repeat') {
173
+                backgroundObj["background-repeat"] = align;
174
+            }
175
+
176
+            editor.execCommand('background', backgroundObj);
177
+        } else {
178
+            editor.execCommand('background', null);
179
+        }
180
+    }
181
+
182
+
183
+    /* 在线图片 */
184
+    function OnlineImage(target) {
185
+        this.container = utils.isString(target) ? document.getElementById(target) : target;
186
+        this.init();
187
+    }
188
+    OnlineImage.prototype = {
189
+        init: function () {
190
+            this.reset();
191
+            this.initEvents();
192
+        },
193
+        /* 初始化容器 */
194
+        initContainer: function () {
195
+            this.container.innerHTML = '';
196
+            this.list = document.createElement('ul');
197
+            this.clearFloat = document.createElement('li');
198
+
199
+            domUtils.addClass(this.list, 'list');
200
+            domUtils.addClass(this.clearFloat, 'clearFloat');
201
+
202
+            this.list.id = 'imageListUl';
203
+            this.list.appendChild(this.clearFloat);
204
+            this.container.appendChild(this.list);
205
+        },
206
+        /* 初始化滚动事件,滚动到地步自动拉取数据 */
207
+        initEvents: function () {
208
+            var _this = this;
209
+
210
+            /* 滚动拉取图片 */
211
+            domUtils.on($G('imageList'), 'scroll', function(e){
212
+                var panel = this;
213
+                if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) {
214
+                    _this.getImageData();
215
+                }
216
+            });
217
+            /* 选中图片 */
218
+            domUtils.on(this.container, 'click', function (e) {
219
+                var target = e.target || e.srcElement,
220
+                    li = target.parentNode,
221
+                    nodes = $G('imageListUl').childNodes;
222
+
223
+                if (li.tagName.toLowerCase() == 'li') {
224
+                    updateFormState('nocolor', null, '');
225
+                    for (var i = 0, node; node = nodes[i++];) {
226
+                        if (node == li && !domUtils.hasClass(node, 'selected')) {
227
+                            domUtils.addClass(node, 'selected');
228
+                            updateFormState('colored', null, li.firstChild.getAttribute("_src"), 'repeat');
229
+                        } else {
230
+                            domUtils.removeClasses(node, 'selected');
231
+                        }
232
+                    }
233
+                    updateBackground();
234
+                }
235
+            });
236
+        },
237
+        /* 初始化第一次的数据 */
238
+        initData: function () {
239
+
240
+            /* 拉取数据需要使用的值 */
241
+            this.state = 0;
242
+            this.listSize = editor.getOpt('imageManagerListSize');
243
+            this.listIndex = 0;
244
+            this.listEnd = false;
245
+
246
+            /* 第一次拉取数据 */
247
+            this.getImageData();
248
+        },
249
+        /* 重置界面 */
250
+        reset: function() {
251
+            this.initContainer();
252
+            this.initData();
253
+        },
254
+        /* 向后台拉取图片列表数据 */
255
+        getImageData: function () {
256
+            var _this = this;
257
+
258
+            if(!_this.listEnd && !this.isLoadingData) {
259
+                this.isLoadingData = true;
260
+                var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')),
261
+                    isJsonp = utils.isCrossDomainUrl(url);
262
+                ajax.request(url, {
263
+                    'timeout': 100000,
264
+                    'dataType': isJsonp ? 'jsonp':'',
265
+                    'data': utils.extend({
266
+                            start: this.listIndex,
267
+                            size: this.listSize
268
+                        }, editor.queryCommandValue('serverparam')),
269
+                    'method': 'get',
270
+                    'onsuccess': function (r) {
271
+                        try {
272
+                            var json = isJsonp ? r:eval('(' + r.responseText + ')');
273
+                            if (json.state == 'SUCCESS') {
274
+                                _this.pushData(json.list);
275
+                                _this.listIndex = parseInt(json.start) + parseInt(json.list.length);
276
+                                if(_this.listIndex >= json.total) {
277
+                                    _this.listEnd = true;
278
+                                }
279
+                                _this.isLoadingData = false;
280
+                            }
281
+                        } catch (e) {
282
+                            if(r.responseText.indexOf('ue_separate_ue') != -1) {
283
+                                var list = r.responseText.split(r.responseText);
284
+                                _this.pushData(list);
285
+                                _this.listIndex = parseInt(list.length);
286
+                                _this.listEnd = true;
287
+                                _this.isLoadingData = false;
288
+                            }
289
+                        }
290
+                    },
291
+                    'onerror': function () {
292
+                        _this.isLoadingData = false;
293
+                    }
294
+                });
295
+            }
296
+        },
297
+        /* 添加图片到列表界面上 */
298
+        pushData: function (list) {
299
+            var i, item, img, icon, _this = this,
300
+                urlPrefix = editor.getOpt('imageManagerUrlPrefix');
301
+            for (i = 0; i < list.length; i++) {
302
+                if(list[i] && list[i].url) {
303
+                    item = document.createElement('li');
304
+                    img = document.createElement('img');
305
+                    icon = document.createElement('span');
306
+
307
+                    domUtils.on(img, 'load', (function(image){
308
+                        return function(){
309
+                            _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight);
310
+                        }
311
+                    })(img));
312
+                    img.width = 113;
313
+                    img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) );
314
+                    img.setAttribute('_src', urlPrefix + list[i].url);
315
+                    domUtils.addClass(icon, 'icon');
316
+
317
+                    item.appendChild(img);
318
+                    item.appendChild(icon);
319
+                    this.list.insertBefore(item, this.clearFloat);
320
+                }
321
+            }
322
+        },
323
+        /* 改变图片大小 */
324
+        scale: function (img, w, h, type) {
325
+            var ow = img.width,
326
+                oh = img.height;
327
+
328
+            if (type == 'justify') {
329
+                if (ow >= oh) {
330
+                    img.width = w;
331
+                    img.height = h * oh / ow;
332
+                    img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px';
333
+                } else {
334
+                    img.width = w * ow / oh;
335
+                    img.height = h;
336
+                    img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px';
337
+                }
338
+            } else {
339
+                if (ow >= oh) {
340
+                    img.width = w * ow / oh;
341
+                    img.height = h;
342
+                    img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px';
343
+                } else {
344
+                    img.width = w;
345
+                    img.height = h * oh / ow;
346
+                    img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px';
347
+                }
348
+            }
349
+        },
350
+        getInsertList: function () {
351
+            var i, lis = this.list.children, list = [], align = getAlign();
352
+            for (i = 0; i < lis.length; i++) {
353
+                if (domUtils.hasClass(lis[i], 'selected')) {
354
+                    var img = lis[i].firstChild,
355
+                        src = img.getAttribute('_src');
356
+                    list.push({
357
+                        src: src,
358
+                        _src: src,
359
+                        floatStyle: align
360
+                    });
361
+                }
362
+
363
+            }
364
+            return list;
365
+        }
366
+    };
367
+
368
+    dialog.onok = function () {
369
+        updateBackground();
370
+        editor.fireEvent('saveScene');
371
+    };
372
+    dialog.oncancel = function () {
373
+        editor.execCommand('background', backupStyle);
374
+    };
375
+
376
+})();

BIN
static/ueditor/dialogs/background/images/bg.png Vedi File


BIN
static/ueditor/dialogs/background/images/success.png Vedi File


+ 65 - 0
static/ueditor/dialogs/charts/chart.config.js Vedi File

@@ -0,0 +1,65 @@
1
+/*
2
+ * 图表配置文件
3
+ * */
4
+
5
+
6
+//不同类型的配置
7
+var typeConfig = [
8
+    {
9
+        chart: {
10
+            type: 'line'
11
+        },
12
+        plotOptions: {
13
+            line: {
14
+                dataLabels: {
15
+                    enabled: false
16
+                },
17
+                enableMouseTracking: true
18
+            }
19
+        }
20
+    }, {
21
+        chart: {
22
+            type: 'line'
23
+        },
24
+        plotOptions: {
25
+            line: {
26
+                dataLabels: {
27
+                    enabled: true
28
+                },
29
+                enableMouseTracking: false
30
+            }
31
+        }
32
+    }, {
33
+        chart: {
34
+            type: 'area'
35
+        }
36
+    }, {
37
+        chart: {
38
+            type: 'bar'
39
+        }
40
+    }, {
41
+        chart: {
42
+            type: 'column'
43
+        }
44
+    }, {
45
+        chart: {
46
+            plotBackgroundColor: null,
47
+            plotBorderWidth: null,
48
+            plotShadow: false
49
+        },
50
+        plotOptions: {
51
+            pie: {
52
+                allowPointSelect: true,
53
+                cursor: 'pointer',
54
+                dataLabels: {
55
+                    enabled: true,
56
+                    color: '#000000',
57
+                    connectorColor: '#000000',
58
+                    formatter: function() {
59
+                        return '<b>'+ this.point.name +'</b>: '+ ( Math.round( this.point.percentage*100 ) / 100 ) +' %';
60
+                    }
61
+                }
62
+            }
63
+        }
64
+    }
65
+];

+ 165 - 0
static/ueditor/dialogs/charts/charts.css Vedi File

@@ -0,0 +1,165 @@
1
+html, body {
2
+    width: 100%;
3
+    height: 100%;
4
+    margin: 0;
5
+    padding: 0;
6
+    overflow-x: hidden;
7
+}
8
+
9
+.main {
10
+    width: 100%;
11
+    overflow: hidden;
12
+}
13
+
14
+.table-view {
15
+    height: 100%;
16
+    float: left;
17
+    margin: 20px;
18
+    width: 40%;
19
+}
20
+
21
+.table-view .table-container {
22
+    width: 100%;
23
+    margin-bottom: 50px;
24
+    overflow: scroll;
25
+}
26
+
27
+.table-view th {
28
+    padding: 5px 10px;
29
+    background-color: #F7F7F7;
30
+}
31
+
32
+.table-view td {
33
+    width: 50px;
34
+    text-align: center;
35
+    padding:0;
36
+}
37
+
38
+.table-container input {
39
+    width: 40px;
40
+    padding: 5px;
41
+    border: none;
42
+    outline: none;
43
+}
44
+
45
+.table-view caption {
46
+    font-size: 18px;
47
+    text-align: left;
48
+}
49
+
50
+.charts-view {
51
+    /*margin-left: 49%!important;*/
52
+    width: 50%;
53
+    margin-left: 49%;
54
+    height: 400px;
55
+}
56
+
57
+.charts-container {
58
+    border-left: 1px solid #c3c3c3;
59
+}
60
+
61
+.charts-format fieldset {
62
+    padding-left: 20px;
63
+    margin-bottom: 50px;
64
+}
65
+
66
+.charts-format legend {
67
+    padding-left: 10px;
68
+    padding-right: 10px;
69
+}
70
+
71
+.format-item-container {
72
+    padding: 20px;
73
+}
74
+
75
+.format-item-container label {
76
+    display: block;
77
+    margin: 10px 0;
78
+}
79
+
80
+.charts-format .data-item {
81
+    border: 1px solid black;
82
+    outline: none;
83
+    padding: 2px 3px;
84
+}
85
+
86
+/* 图表类型 */
87
+
88
+.charts-type {
89
+    margin-top: 50px;
90
+    height: 300px;
91
+}
92
+
93
+.scroll-view {
94
+    border: 1px solid #c3c3c3;
95
+    border-left: none;
96
+    border-right: none;
97
+    overflow: hidden;
98
+}
99
+
100
+.scroll-container {
101
+    margin: 20px;
102
+    width: 100%;
103
+    overflow: hidden;
104
+}
105
+
106
+.scroll-bed {
107
+    width: 10000px;
108
+    _margin-top: 20px;
109
+    -webkit-transition: margin-left .5s ease;
110
+    -moz-transition: margin-left .5s ease;
111
+    transition: margin-left .5s ease;
112
+}
113
+
114
+.view-box {
115
+    display: inline-block;
116
+    *display: inline;
117
+    *zoom: 1;
118
+    margin-right: 20px;
119
+    border: 2px solid white;
120
+    line-height: 0;
121
+    overflow: hidden;
122
+    cursor: pointer;
123
+}
124
+
125
+.view-box img {
126
+    border: 1px solid #cecece;
127
+}
128
+
129
+.view-box.selected {
130
+    border-color: #7274A7;
131
+}
132
+
133
+.button-container {
134
+    margin-bottom: 20px;
135
+    text-align: center;
136
+}
137
+
138
+.button-container a {
139
+    display: inline-block;
140
+    width: 100px;
141
+    height: 25px;
142
+    line-height: 25px;
143
+    border: 1px solid #c2ccd1;
144
+    margin-right: 30px;
145
+    text-decoration: none;
146
+    color: black;
147
+    -webkit-border-radius: 2px;
148
+    -moz-border-radius: 2px;
149
+    border-radius: 2px;
150
+}
151
+
152
+.button-container a:HOVER {
153
+    background: #fcfcfc;
154
+}
155
+
156
+.button-container a:ACTIVE {
157
+    border-top-color: #c2ccd1;
158
+    box-shadow:inset 0 5px 4px -4px rgba(49, 49, 64, 0.1);
159
+}
160
+
161
+.edui-charts-not-data {
162
+    height: 100px;
163
+    line-height: 100px;
164
+    text-align: center;
165
+}

+ 89 - 0
static/ueditor/dialogs/charts/charts.html Vedi File

@@ -0,0 +1,89 @@
1
+<!DOCTYPE html>
2
+<html>
3
+    <head>
4
+        <title>chart</title>
5
+        <meta chartset="utf-8">
6
+        <link rel="stylesheet" type="text/css" href="charts.css">
7
+        <script type="text/javascript" src="../internal.js"></script>
8
+    </head>
9
+    <body>
10
+        <div class="main">
11
+            <div class="table-view">
12
+                <h3><var id="lang_data_source"></var></h3>
13
+                <div id="tableContainer" class="table-container"></div>
14
+                <h3><var id="lang_chart_format"></var></h3>
15
+                <form name="data-form">
16
+                    <div class="charts-format">
17
+                        <fieldset>
18
+                            <legend><var id="lang_data_align"></var></legend>
19
+                            <div class="format-item-container">
20
+                                <label>
21
+                                    <input type="radio" class="format-ctrl not-pie-item" name="charts-format" value="1" checked="checked">
22
+                                    <var id="lang_chart_align_same"></var>
23
+                                </label>
24
+                                <label>
25
+                                    <input type="radio" class="format-ctrl not-pie-item" name="charts-format" value="-1">
26
+                                    <var id="lang_chart_align_reverse"></var>
27
+                                </label>
28
+                                <br>
29
+                            </div>
30
+                        </fieldset>
31
+                        <fieldset>
32
+                            <legend><var id="lang_chart_title"></var></legend>
33
+                            <div class="format-item-container">
34
+                                <label>
35
+                                    <var id="lang_chart_main_title"></var><input type="text" name="title" class="data-item">
36
+                                </label>
37
+                                <label>
38
+                                    <var id="lang_chart_sub_title"></var><input type="text" name="sub-title" class="data-item not-pie-item">
39
+                                </label>
40
+                                <label>
41
+                                    <var id="lang_chart_x_title"></var><input type="text" name="x-title" class="data-item not-pie-item">
42
+                                </label>
43
+                                <label>
44
+                                    <var id="lang_chart_y_title"></var><input type="text" name="y-title" class="data-item not-pie-item">
45
+                                </label>
46
+                            </div>
47
+                        </fieldset>
48
+                        <fieldset>
49
+                            <legend><var id="lang_chart_tip"></var></legend>
50
+                            <div class="format-item-container">
51
+                                <label>
52
+                                    <var id="lang_cahrt_tip_prefix"></var>
53
+                                    <input type="text" id="tipInput" name="tip" class="data-item" disabled="disabled">
54
+                                </label>
55
+                                <p><var id="lang_cahrt_tip_description"></var></p>
56
+                            </div>
57
+                        </fieldset>
58
+                        <fieldset>
59
+                            <legend><var id="lang_chart_data_unit"></var></legend>
60
+                            <div class="format-item-container">
61
+                                <label><var id="lang_chart_data_unit_title"></var><input type="text" name="unit" class="data-item"></label>
62
+                                <p><var id="lang_chart_data_unit_description"></var></p>
63
+                            </div>
64
+                        </fieldset>
65
+                    </div>
66
+                </form>
67
+            </div>
68
+            <div class="charts-view">
69
+                <div id="chartsContainer" class="charts-container"></div>
70
+                <div id="chartsType" class="charts-type">
71
+                    <h3><var id="lang_chart_type"></var></h3>
72
+                    <div class="scroll-view">
73
+                        <div class="scroll-container">
74
+                            <div id="scrollBed" class="scroll-bed"></div>
75
+                        </div>
76
+                        <div id="buttonContainer" class="button-container">
77
+                            <a href="#" data-title="prev"><var id="lang_prev_btn"></var></a>
78
+                            <a href="#" data-title="next"><var id="lang_next_btn"></var></a>
79
+                        </div>
80
+                    </div>
81
+                </div>
82
+            </div>
83
+        </div>
84
+        <script src="../../third-party/jquery-1.10.2.min.js"></script>
85
+        <script src="../../third-party/highcharts/highcharts.js"></script>
86
+        <script src="chart.config.js"></script>
87
+        <script src="charts.js"></script>
88
+    </body>
89
+</html>

+ 519 - 0
static/ueditor/dialogs/charts/charts.js Vedi File

@@ -0,0 +1,519 @@
1
+/*
2
+ * 图片转换对话框脚本
3
+ **/
4
+
5
+var tableData = [],
6
+    //编辑器页面table
7
+    editorTable = null,
8
+    chartsConfig = window.typeConfig,
9
+    resizeTimer = null,
10
+    //初始默认图表类型
11
+    currentChartType = 0;
12
+
13
+window.onload = function () {
14
+
15
+    editorTable = domUtils.findParentByTagName( editor.selection.getRange().startContainer, 'table', true);
16
+
17
+    //未找到表格, 显示错误页面
18
+    if ( !editorTable ) {
19
+        document.body.innerHTML = "<div class='edui-charts-not-data'>未找到数据</div>";
20
+        return;
21
+    }
22
+
23
+    //初始化图表类型选择
24
+    initChartsTypeView();
25
+    renderTable( editorTable );
26
+    initEvent();
27
+    initUserConfig( editorTable.getAttribute( "data-chart" ) );
28
+    $( "#scrollBed .view-box:eq("+ currentChartType +")" ).trigger( "click" );
29
+    updateViewType( currentChartType );
30
+
31
+    dialog.addListener( "resize", function () {
32
+
33
+        if ( resizeTimer != null ) {
34
+            window.clearTimeout( resizeTimer );
35
+        }
36
+
37
+        resizeTimer = window.setTimeout( function () {
38
+
39
+            resizeTimer = null;
40
+
41
+            renderCharts();
42
+
43
+        }, 500 );
44
+
45
+    } );
46
+
47
+};
48
+
49
+function initChartsTypeView () {
50
+
51
+    var contents = [];
52
+
53
+    for ( var i = 0, len = chartsConfig.length; i<len; i++ ) {
54
+
55
+        contents.push( '<div class="view-box" data-chart-type="'+ i +'"><img width="300" src="images/charts'+ i +'.png"></div>' );
56
+
57
+    }
58
+
59
+    $( "#scrollBed" ).html( contents.join( "" ) );
60
+
61
+}
62
+
63
+//渲染table, 以便用户修改数据
64
+function renderTable ( table ) {
65
+
66
+    var tableHtml = [];
67
+
68
+    //构造数据
69
+    for ( var i = 0, row; row = table.rows[ i ]; i++ ) {
70
+
71
+        tableData[ i ] = [];
72
+        tableHtml[ i ] = [];
73
+
74
+        for ( var j = 0, cell; cell = row.cells[ j ]; j++ ) {
75
+
76
+            var value = getCellValue( cell );
77
+
78
+            if ( i > 0 && j > 0 ) {
79
+                value = +value;
80
+            }
81
+
82
+            if ( i === 0 || j === 0 ) {
83
+                tableHtml[ i ].push( '<th>'+ value +'</th>' );
84
+            } else {
85
+                tableHtml[ i ].push( '<td><input type="text" class="data-item" value="'+ value +'"></td>' );
86
+            }
87
+
88
+            tableData[ i ][ j ] = value;
89
+
90
+        }
91
+
92
+        tableHtml[ i ] = tableHtml[ i ].join( "" );
93
+
94
+    }
95
+
96
+    //draw 表格
97
+    $( "#tableContainer" ).html( '<table id="showTable" border="1"><tbody><tr>'+ tableHtml.join( "</tr><tr>" ) +'</tr></tbody></table>' );
98
+
99
+}
100
+
101
+/*
102
+ * 根据表格已有的图表属性初始化当前图表属性
103
+ */
104
+function initUserConfig ( config ) {
105
+
106
+    var parsedConfig = {};
107
+
108
+    if ( !config ) {
109
+        return;
110
+    }
111
+
112
+    config = config.split( ";" );
113
+
114
+    $.each( config, function ( index, item ) {
115
+
116
+        item = item.split( ":" );
117
+        parsedConfig[ item[ 0 ] ] = item[ 1 ];
118
+
119
+    } );
120
+
121
+    setUserConfig( parsedConfig );
122
+
123
+}
124
+
125
+function initEvent () {
126
+
127
+    var cacheValue = null,
128
+        //图表类型数
129
+        typeViewCount = chartsConfig.length- 1,
130
+        $chartsTypeViewBox = $( '#scrollBed .view-box' );
131
+
132
+    $( ".charts-format" ).delegate( ".format-ctrl", "change", function () {
133
+
134
+        renderCharts();
135
+
136
+    } )
137
+
138
+    $( ".table-view" ).delegate( ".data-item", "focus", function () {
139
+
140
+        cacheValue = this.value;
141
+
142
+    } ).delegate( ".data-item", "blur", function () {
143
+
144
+        if ( this.value !== cacheValue ) {
145
+            renderCharts();
146
+        }
147
+
148
+        cacheValue = null;
149
+
150
+    } );
151
+
152
+    $( "#buttonContainer" ).delegate( "a", "click", function (e) {
153
+
154
+        e.preventDefault();
155
+
156
+        if ( this.getAttribute( "data-title" ) === 'prev' ) {
157
+
158
+            if ( currentChartType > 0 ) {
159
+                currentChartType--;
160
+                updateViewType( currentChartType );
161
+            }
162
+
163
+        } else {
164
+
165
+            if ( currentChartType < typeViewCount ) {
166
+                currentChartType++;
167
+                updateViewType( currentChartType );
168
+            }
169
+
170
+        }
171
+
172
+    } );
173
+
174
+    //图表类型变化
175
+    $( '#scrollBed' ).delegate( ".view-box", "click", function (e) {
176
+
177
+        var index = $( this ).attr( "data-chart-type" );
178
+        $chartsTypeViewBox.removeClass( "selected" );
179
+        $( $chartsTypeViewBox[ index ] ).addClass( "selected" );
180
+
181
+        currentChartType = index | 0;
182
+
183
+        //饼图, 禁用部分配置
184
+        if ( currentChartType === chartsConfig.length - 1 ) {
185
+
186
+            disableNotPieConfig();
187
+
188
+        //启用完整配置
189
+        } else {
190
+
191
+            enableNotPieConfig();
192
+
193
+        }
194
+
195
+        renderCharts();
196
+
197
+    } );
198
+
199
+}
200
+
201
+function renderCharts () {
202
+
203
+    var data = collectData();
204
+
205
+    $('#chartsContainer').highcharts( $.extend( {}, chartsConfig[ currentChartType ], {
206
+
207
+        credits: {
208
+            enabled: false
209
+        },
210
+        exporting: {
211
+            enabled: false
212
+        },
213
+        title: {
214
+            text: data.title,
215
+            x: -20 //center
216
+        },
217
+        subtitle: {
218
+            text: data.subTitle,
219
+            x: -20
220
+        },
221
+        xAxis: {
222
+            title: {
223
+                text: data.xTitle
224
+            },
225
+            categories: data.categories
226
+        },
227
+        yAxis: {
228
+            title: {
229
+                text: data.yTitle
230
+            },
231
+            plotLines: [{
232
+                value: 0,
233
+                width: 1,
234
+                color: '#808080'
235
+            }]
236
+        },
237
+        tooltip: {
238
+            enabled: true,
239
+            valueSuffix: data.suffix
240
+        },
241
+        legend: {
242
+            layout: 'vertical',
243
+            align: 'right',
244
+            verticalAlign: 'middle',
245
+            borderWidth: 1
246
+        },
247
+        series: data.series
248
+
249
+    } ));
250
+
251
+}
252
+
253
+function updateViewType ( index ) {
254
+
255
+    $( "#scrollBed" ).css( 'marginLeft', -index*324+'px' );
256
+
257
+}
258
+
259
+function collectData () {
260
+
261
+    var form = document.forms[ 'data-form' ],
262
+        data = null;
263
+
264
+    if ( currentChartType !== chartsConfig.length - 1 ) {
265
+
266
+        data = getSeriesAndCategories();
267
+        $.extend( data, getUserConfig() );
268
+
269
+    //饼图数据格式
270
+    } else {
271
+        data = getSeriesForPieChart();
272
+        data.title = form[ 'title' ].value;
273
+        data.suffix = form[ 'unit' ].value;
274
+    }
275
+
276
+    return data;
277
+
278
+}
279
+
280
+/**
281
+ * 获取用户配置信息
282
+ */
283
+function getUserConfig () {
284
+
285
+    var form = document.forms[ 'data-form' ],
286
+        info = {
287
+            title: form[ 'title' ].value,
288
+            subTitle: form[ 'sub-title' ].value,
289
+            xTitle: form[ 'x-title' ].value,
290
+            yTitle: form[ 'y-title' ].value,
291
+            suffix: form[ 'unit' ].value,
292
+            //数据对齐方式
293
+            tableDataFormat: getTableDataFormat (),
294
+            //饼图提示文字
295
+            tip: $( "#tipInput" ).val()
296
+        };
297
+
298
+    return info;
299
+
300
+}
301
+
302
+function setUserConfig ( config ) {
303
+
304
+    var form = document.forms[ 'data-form' ];
305
+
306
+    config.title && ( form[ 'title' ].value = config.title );
307
+    config.subTitle && ( form[ 'sub-title' ].value = config.subTitle );
308
+    config.xTitle && ( form[ 'x-title' ].value = config.xTitle );
309
+    config.yTitle && ( form[ 'y-title' ].value = config.yTitle );
310
+    config.suffix && ( form[ 'unit' ].value = config.suffix );
311
+    config.dataFormat == "-1" && ( form[ 'charts-format' ][ 1 ].checked = true );
312
+    config.tip && ( form[ 'tip' ].value = config.tip );
313
+    currentChartType = config.chartType || 0;
314
+
315
+}
316
+
317
+function getSeriesAndCategories () {
318
+
319
+    var form = document.forms[ 'data-form' ],
320
+        series = [],
321
+        categories = [],
322
+        tmp = [],
323
+        tableData = getTableData();
324
+
325
+    //反转数据
326
+    if ( getTableDataFormat() === "-1" ) {
327
+
328
+        for ( var i = 0, len = tableData.length; i < len; i++ ) {
329
+
330
+            for ( var j = 0, jlen = tableData[ i ].length; j < jlen; j++ ) {
331
+
332
+                if ( !tmp[ j ] ) {
333
+                    tmp[ j ] = [];
334
+                }
335
+
336
+                tmp[ j ][ i ] = tableData[ i ][ j ];
337
+
338
+            }
339
+
340
+        }
341
+
342
+        tableData = tmp;
343
+
344
+    }
345
+
346
+    categories = tableData[0].slice( 1 );
347
+
348
+    for ( var i = 1, data; data = tableData[ i ]; i++ ) {
349
+
350
+        series.push( {
351
+            name: data[ 0 ],
352
+            data: data.slice( 1 )
353
+        } );
354
+
355
+    }
356
+
357
+    return {
358
+        series: series,
359
+        categories: categories
360
+    };
361
+
362
+}
363
+
364
+/*
365
+ * 获取数据源数据对齐方式
366
+ */
367
+function getTableDataFormat () {
368
+
369
+    var form = document.forms[ 'data-form' ],
370
+        items = form['charts-format'];
371
+
372
+    return items[ 0 ].checked ? items[ 0 ].value : items[ 1 ].value;
373
+
374
+}
375
+
376
+/*
377
+ * 禁用非饼图类型的配置项
378
+ */
379
+function disableNotPieConfig() {
380
+
381
+    updateConfigItem( 'disable' );
382
+
383
+}
384
+
385
+/*
386
+ * 启用非饼图类型的配置项
387
+ */
388
+function enableNotPieConfig() {
389
+
390
+    updateConfigItem( 'enable' );
391
+
392
+}
393
+
394
+function updateConfigItem ( value ) {
395
+
396
+    var table = $( "#showTable" )[ 0 ],
397
+        isDisable = value === 'disable' ? true : false;
398
+
399
+    //table中的input处理
400
+    for ( var i = 2 , row; row = table.rows[ i ]; i++ ) {
401
+
402
+        for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) {
403
+
404
+            $( "input", cell ).attr( "disabled", isDisable );
405
+
406
+        }
407
+
408
+    }
409
+
410
+    //其他项处理
411
+    $( "input.not-pie-item" ).attr( "disabled", isDisable );
412
+    $( "#tipInput" ).attr( "disabled", !isDisable )
413
+
414
+}
415
+
416
+/*
417
+ * 获取饼图数据
418
+ * 饼图的数据只取第一行的
419
+ **/
420
+function getSeriesForPieChart () {
421
+
422
+    var series = {
423
+            type: 'pie',
424
+            name: $("#tipInput").val(),
425
+            data: []
426
+        },
427
+        tableData = getTableData();
428
+
429
+
430
+    for ( var j = 1, jlen = tableData[ 0 ].length; j < jlen; j++ ) {
431
+
432
+        var title = tableData[ 0 ][ j ],
433
+            val = tableData[ 1 ][ j ];
434
+
435
+        series.data.push( [ title, val ] );
436
+
437
+    }
438
+
439
+    return {
440
+        series: [ series ]
441
+    };
442
+
443
+}
444
+
445
+function getTableData () {
446
+
447
+    var table = document.getElementById( "showTable" ),
448
+        xCount = table.rows[0].cells.length - 1,
449
+        values = getTableInputValue();
450
+
451
+    for ( var i = 0, value; value = values[ i ]; i++ ) {
452
+
453
+        tableData[ Math.floor( i / xCount ) + 1 ][ i % xCount + 1 ] = values[ i ];
454
+
455
+    }
456
+
457
+    return tableData;
458
+
459
+}
460
+
461
+function getTableInputValue () {
462
+
463
+    var table = document.getElementById( "showTable" ),
464
+        inputs = table.getElementsByTagName( "input" ),
465
+        values = [];
466
+
467
+    for ( var i = 0, input; input = inputs[ i ]; i++ ) {
468
+        values.push( input.value | 0 );
469
+    }
470
+
471
+    return values;
472
+
473
+}
474
+
475
+function getCellValue ( cell ) {
476
+
477
+    var value = utils.trim( ( cell.innerText || cell.textContent || '' ) );
478
+
479
+    return value.replace( new RegExp( UE.dom.domUtils.fillChar, 'g' ), '' ).replace( /^\s+|\s+$/g, '' );
480
+
481
+}
482
+
483
+
484
+//dialog确认事件
485
+dialog.onok = function () {
486
+
487
+    //收集信息
488
+    var form = document.forms[ 'data-form' ],
489
+        info = getUserConfig();
490
+
491
+    //添加图表类型
492
+    info.chartType = currentChartType;
493
+
494
+    //同步表格数据到编辑器
495
+    syncTableData();
496
+
497
+    //执行图表命令
498
+    editor.execCommand( 'charts', info );
499
+
500
+};
501
+
502
+/*
503
+ * 同步图表编辑视图的表格数据到编辑器里的原始表格
504
+ */
505
+function syncTableData () {
506
+
507
+    var tableData = getTableData();
508
+
509
+    for ( var i = 1, row; row = editorTable.rows[ i ]; i++ ) {
510
+
511
+        for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) {
512
+
513
+            cell.innerHTML = tableData[ i ] [ j ];
514
+
515
+        }
516
+
517
+    }
518
+
519
+}

BIN
static/ueditor/dialogs/charts/images/charts0.png Vedi File


BIN
static/ueditor/dialogs/charts/images/charts1.png Vedi File


BIN
static/ueditor/dialogs/charts/images/charts2.png Vedi File


BIN
static/ueditor/dialogs/charts/images/charts3.png Vedi File


BIN
static/ueditor/dialogs/charts/images/charts4.png Vedi File


BIN
static/ueditor/dialogs/charts/images/charts5.png Vedi File


+ 43 - 0
static/ueditor/dialogs/emotion/emotion.css Vedi File

@@ -0,0 +1,43 @@
1
+.jd img{
2
+    background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top;
3
+    cursor:pointer;width:35px;height:35px;display:block;
4
+}
5
+.pp img{
6
+    background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top;
7
+    cursor:pointer;width:25px;height:25px;display:block;
8
+}
9
+.ldw img{
10
+    background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top;
11
+    cursor:pointer;width:35px;height:35px;display:block;
12
+}
13
+.tsj img{
14
+    background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top;
15
+    cursor:pointer;width:35px;height:35px;display:block;
16
+}
17
+.cat img{
18
+    background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top;
19
+    cursor:pointer;width:35px;height:35px;display:block;
20
+}
21
+.bb img{
22
+    background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top;
23
+    cursor:pointer;width:35px;height:35px;display:block;
24
+}
25
+.youa img{
26
+    background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top;
27
+    cursor:pointer;width:35px;height:35px;display:block;
28
+}
29
+
30
+.smileytable td {height: 37px;}
31
+#tabPanel{margin-left:5px;overflow: hidden;}
32
+#tabContent {float:left;background:#FFFFFF;}
33
+#tabContent div{display: none;width:480px;overflow:hidden;}
34
+#tabIconReview.show{left:17px;display:block;}
35
+.menuFocus{background:#ACCD3C;}
36
+.menuDefault{background:#FFFFFF;}
37
+#tabIconReview{position:absolute;left:406px;left:398px \9;top:41px;z-index:65533;width:90px;height:76px;}
38
+img.review{width:90px;height:76px;border:2px solid #9cb945;background:#FFFFFF;background-position:center;background-repeat:no-repeat;}
39
+
40
+.wrapper .tabbody{position:relative;float:left;clear:both;padding:10px;width: 95%;}
41
+.tabbody table{width: 100%;}
42
+.tabbody td{border:1px solid #BAC498;}
43
+.tabbody td span{display: block;zoom:1;padding:0 4px;}

+ 54 - 0
static/ueditor/dialogs/emotion/emotion.html Vedi File

@@ -0,0 +1,54 @@
1
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
2
+<html xmlns="http://www.w3.org/1999/xhtml">
3
+<head>
4
+    <title></title>
5
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+    <meta name="robots" content="noindex, nofollow"/>
7
+    <script type="text/javascript" src="../internal.js"></script>
8
+    <link rel="stylesheet" type="text/css" href="emotion.css">
9
+</head>
10
+<body>
11
+<div id="tabPanel" class="wrapper">
12
+    <div id="tabHeads" class="tabhead">
13
+        <span><var id="lang_input_choice"></var></span>
14
+        <span><var id="lang_input_Tuzki"></var></span>
15
+        <span><var id="lang_input_lvdouwa"></var></span>
16
+        <span><var id="lang_input_BOBO"></var></span>
17
+        <span><var id="lang_input_babyCat"></var></span>
18
+        <span><var id="lang_input_bubble"></var></span>
19
+        <span><var id="lang_input_youa"></var></span>
20
+    </div>
21
+    <div id="tabBodys" class="tabbody">
22
+        <div id="tab0"></div>
23
+        <div id="tab1"></div>
24
+        <div id="tab2"></div>
25
+        <div id="tab3"></div>
26
+        <div id="tab4"></div>
27
+        <div id="tab5"></div>
28
+        <div id="tab6"></div>
29
+    </div>
30
+</div>
31
+<div id="tabIconReview">
32
+    <img id='faceReview' class='review' src="../../themes/default/images/spacer.gif"/>
33
+</div>
34
+<script type="text/javascript" src="emotion.js"></script>
35
+<script type="text/javascript">
36
+    var emotion = {
37
+        tabNum:7, //切换面板数量
38
+        SmilmgName:{ tab0:['j_00', 84], tab1:['t_00', 40], tab2:['w_00', 52], tab3:['B_00', 63], tab4:['C_00', 20], tab5:['i_f', 50], tab6:['y_00', 40] }, //图片前缀名
39
+        imageFolders:{ tab0:'jx2/', tab1:'tsj/', tab2:'ldw/', tab3:'bobo/', tab4:'babycat/', tab5:'face/', tab6:'youa/'}, //图片对应文件夹路径
40
+        imageCss:{tab0:'jd', tab1:'tsj', tab2:'ldw', tab3:'bb', tab4:'cat', tab5:'pp', tab6:'youa'}, //图片css类名
41
+        imageCssOffset:{tab0:35, tab1:35, tab2:35, tab3:35, tab4:35, tab5:25, tab6:35}, //图片偏移
42
+        SmileyInfor:{
43
+            tab0:['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '打酱油', '俯卧撑', '气愤', '?', '吻', '怒', '胜利', 'HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '微笑', '亲吻', '调皮', '惊恐', '耍酷', '发火', '害羞', '汗水', '大哭', '', '加油', '困', '你NB', '晕倒', '开心', '偷笑', '大哭', '滴汗', '叹气', '超赞', '??', '飞吻', '天使', '撒花', '生气', '被砸', '吓傻', '随意吐'],
44
+            tab1:['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '摊手', '睡觉', '瘫坐', '无聊', '星星闪', '旋转', '也不行', '郁闷', '正Music', '抓墙', '撞墙至死', '歪头', '戳眼', '飘过', '互相拍砖', '砍死你', '扔桌子', '少林寺', '什么?', '转头', '我爱牛奶', '我踢', '摇晃', '晕厥', '在笼子里', '震荡'],
45
+            tab2:['大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '我错了', 'money', '气愤', '挑逗', '吻', '怒', '胜利', '委屈', '受伤', '说啥呢?', '闭嘴', '不', '逗你玩儿', '飞吻', '眩晕', '魔法', '我来了', '睡了', '我打', '闭嘴', '打', '打晕了', '刷牙', '爆揍', '炸弹', '倒立', '刮胡子', '邪恶的笑', '不要不要', '爱恋中', '放大仔细看', '偷窥', '超高兴', '晕', '松口气', '我跑', '享受', '修养', '哭', '汗', '啊~', '热烈欢迎', '打酱油', '俯卧撑', '?'],
46
+            tab3:['HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '泪眼', '流泪', '生气', '吐舌', '喜欢', '旋转', '再见', '抓狂', '汗', '鄙视', '拜', '吐血', '嘘', '打人', '蹦跳', '变脸', '扯肉', '吃To', '吃花', '吹泡泡糖', '大变身', '飞天舞', '回眸', '可怜', '猛抽', '泡泡', '苹果', '亲', '', '骚舞', '烧香', '睡', '套娃娃', '捅捅', '舞倒', '西红柿', '爱慕', '摇', '摇摆', '杂耍', '招财', '被殴', '被球闷', '大惊', '理想', '欧打', '呕吐', '碎', '吐痰'],
47
+            tab4:['发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '顶', '幸运', '爱心', '躲', '送花', '选择'],
48
+            tab5:['微笑', '亲吻', '调皮', '惊讶', '耍酷', '发火', '害羞', '汗水', '大哭', '得意', '鄙视', '困', '夸奖', '晕倒', '疑问', '媒婆', '狂吐', '青蛙', '发愁', '亲吻', '', '爱心', '心碎', '玫瑰', '礼物', '哭', '奸笑', '可爱', '得意', '呲牙', '暴汗', '楚楚可怜', '困', '哭', '生气', '惊讶', '口水', '彩虹', '夜空', '太阳', '钱钱', '灯泡', '咖啡', '蛋糕', '音乐', '爱', '胜利', '赞', '鄙视', 'OK'],
49
+            tab6:['男兜', '女兜', '开心', '乖乖', '偷笑', '大笑', '抽泣', '大哭', '无奈', '滴汗', '叹气', '狂晕', '委屈', '超赞', '??', '疑问', '飞吻', '天使', '撒花', '生气', '被砸', '口水', '泪奔', '吓傻', '吐舌头', '点头', '随意吐', '旋转', '困困', '鄙视', '狂顶', '篮球', '再见', '欢迎光临', '恭喜发财', '稍等', '我在线', '恕不议价', '库房有货', '货在路上']
50
+        }
51
+    };
52
+</script>
53
+</body>
54
+</html>

+ 186 - 0
static/ueditor/dialogs/emotion/emotion.js Vedi File

@@ -0,0 +1,186 @@
1
+window.onload = function () {
2
+    editor.setOpt({
3
+        emotionLocalization:false
4
+    });
5
+
6
+    emotion.SmileyPath = editor.options.emotionLocalization === true ? 'images/' : "http://img.baidu.com/hi/";
7
+    emotion.SmileyBox = createTabList( emotion.tabNum );
8
+    emotion.tabExist = createArr( emotion.tabNum );
9
+
10
+    initImgName();
11
+    initEvtHandler( "tabHeads" );
12
+};
13
+
14
+function initImgName() {
15
+    for ( var pro in emotion.SmilmgName ) {
16
+        var tempName = emotion.SmilmgName[pro],
17
+                tempBox = emotion.SmileyBox[pro],
18
+                tempStr = "";
19
+
20
+        if ( tempBox.length ) return;
21
+        for ( var i = 1; i <= tempName[1]; i++ ) {
22
+            tempStr = tempName[0];
23
+            if ( i < 10 ) tempStr = tempStr + '0';
24
+            tempStr = tempStr + i + '.gif';
25
+            tempBox.push( tempStr );
26
+        }
27
+    }
28
+}
29
+
30
+function initEvtHandler( conId ) {
31
+    var tabHeads = $G( conId );
32
+    for ( var i = 0, j = 0; i < tabHeads.childNodes.length; i++ ) {
33
+        var tabObj = tabHeads.childNodes[i];
34
+        if ( tabObj.nodeType == 1 ) {
35
+            domUtils.on( tabObj, "click", (function ( index ) {
36
+                return function () {
37
+                    switchTab( index );
38
+                };
39
+            })( j ) );
40
+            j++;
41
+        }
42
+    }
43
+    switchTab( 0 );
44
+    $G( "tabIconReview" ).style.display = 'none';
45
+}
46
+
47
+function InsertSmiley( url, evt ) {
48
+    var obj = {
49
+        src:editor.options.emotionLocalization ? editor.options.UEDITOR_HOME_URL + "dialogs/emotion/" + url : url
50
+    };
51
+    obj._src = obj.src;
52
+    editor.execCommand( 'insertimage', obj );
53
+    if ( !evt.ctrlKey ) {
54
+        dialog.popup.hide();
55
+    }
56
+}
57
+
58
+function switchTab( index ) {
59
+
60
+    autoHeight( index );
61
+    if ( emotion.tabExist[index] == 0 ) {
62
+        emotion.tabExist[index] = 1;
63
+        createTab( 'tab' + index );
64
+    }
65
+    //获取呈现元素句柄数组
66
+    var tabHeads = $G( "tabHeads" ).getElementsByTagName( "span" ),
67
+            tabBodys = $G( "tabBodys" ).getElementsByTagName( "div" ),
68
+            i = 0, L = tabHeads.length;
69
+    //隐藏所有呈现元素
70
+    for ( ; i < L; i++ ) {
71
+        tabHeads[i].className = "";
72
+        tabBodys[i].style.display = "none";
73
+    }
74
+    //显示对应呈现元素
75
+    tabHeads[index].className = "focus";
76
+    tabBodys[index].style.display = "block";
77
+}
78
+
79
+function autoHeight( index ) {
80
+    var iframe = dialog.getDom( "iframe" ),
81
+            parent = iframe.parentNode.parentNode;
82
+    switch ( index ) {
83
+        case 0:
84
+            iframe.style.height = "380px";
85
+            parent.style.height = "392px";
86
+            break;
87
+        case 1:
88
+            iframe.style.height = "220px";
89
+            parent.style.height = "232px";
90
+            break;
91
+        case 2:
92
+            iframe.style.height = "260px";
93
+            parent.style.height = "272px";
94
+            break;
95
+        case 3:
96
+            iframe.style.height = "300px";
97
+            parent.style.height = "312px";
98
+            break;
99
+        case 4:
100
+            iframe.style.height = "140px";
101
+            parent.style.height = "152px";
102
+            break;
103
+        case 5:
104
+            iframe.style.height = "260px";
105
+            parent.style.height = "272px";
106
+            break;
107
+        case 6:
108
+            iframe.style.height = "230px";
109
+            parent.style.height = "242px";
110
+            break;
111
+        default:
112
+
113
+    }
114
+}
115
+
116
+
117
+function createTab( tabName ) {
118
+    var faceVersion = "?v=1.1", //版本号
119
+            tab = $G( tabName ), //获取将要生成的Div句柄
120
+            imagePath = emotion.SmileyPath + emotion.imageFolders[tabName], //获取显示表情和预览表情的路径
121
+            positionLine = 11 / 2, //中间数
122
+            iWidth = iHeight = 35, //图片长宽
123
+            iColWidth = 3, //表格剩余空间的显示比例
124
+            tableCss = emotion.imageCss[tabName],
125
+            cssOffset = emotion.imageCssOffset[tabName],
126
+            textHTML = ['<table class="smileytable">'],
127
+            i = 0, imgNum = emotion.SmileyBox[tabName].length, imgColNum = 11, faceImage,
128
+            sUrl, realUrl, posflag, offset, infor;
129
+
130
+    for ( ; i < imgNum; ) {
131
+        textHTML.push( '<tr>' );
132
+        for ( var j = 0; j < imgColNum; j++, i++ ) {
133
+            faceImage = emotion.SmileyBox[tabName][i];
134
+            if ( faceImage ) {
135
+                sUrl = imagePath + faceImage + faceVersion;
136
+                realUrl = imagePath + faceImage;
137
+                posflag = j < positionLine ? 0 : 1;
138
+                offset = cssOffset * i * (-1) - 1;
139
+                infor = emotion.SmileyInfor[tabName][i];
140
+
141
+                textHTML.push( '<td  class="' + tableCss + '"   border="1" width="' + iColWidth + '%" style="border-collapse:collapse;" align="center"  bgcolor="transparent" onclick="InsertSmiley(\'' + realUrl.replace( /'/g, "\\'" ) + '\',event)" onmouseover="over(this,\'' + sUrl + '\',\'' + posflag + '\')" onmouseout="out(this)">' );
142
+                textHTML.push( '<span>' );
143
+                textHTML.push( '<img  style="background-position:left ' + offset + 'px;" title="' + infor + '" src="' + emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif" width="' : 'default/0.gif" width="') + iWidth + '" height="' + iHeight + '"></img>' );
144
+                textHTML.push( '</span>' );
145
+            } else {
146
+                textHTML.push( '<td width="' + iColWidth + '%"   bgcolor="#FFFFFF">' );
147
+            }
148
+            textHTML.push( '</td>' );
149
+        }
150
+        textHTML.push( '</tr>' );
151
+    }
152
+    textHTML.push( '</table>' );
153
+    textHTML = textHTML.join( "" );
154
+    tab.innerHTML = textHTML;
155
+}
156
+
157
+function over( td, srcPath, posFlag ) {
158
+    td.style.backgroundColor = "#ACCD3C";
159
+    $G( 'faceReview' ).style.backgroundImage = "url(" + srcPath + ")";
160
+    if ( posFlag == 1 ) $G( "tabIconReview" ).className = "show";
161
+    $G( "tabIconReview" ).style.display = 'block';
162
+}
163
+
164
+function out( td ) {
165
+    td.style.backgroundColor = "transparent";
166
+    var tabIconRevew = $G( "tabIconReview" );
167
+    tabIconRevew.className = "";
168
+    tabIconRevew.style.display = 'none';
169
+}
170
+
171
+function createTabList( tabNum ) {
172
+    var obj = {};
173
+    for ( var i = 0; i < tabNum; i++ ) {
174
+        obj["tab" + i] = [];
175
+    }
176
+    return obj;
177
+}
178
+
179
+function createArr( tabNum ) {
180
+    var arr = [];
181
+    for ( var i = 0; i < tabNum; i++ ) {
182
+        arr[i] = 0;
183
+    }
184
+    return arr;
185
+}
186
+

BIN
static/ueditor/dialogs/emotion/images/0.gif Vedi File


BIN
static/ueditor/dialogs/emotion/images/bface.gif Vedi File


BIN
static/ueditor/dialogs/emotion/images/cface.gif Vedi File


BIN
static/ueditor/dialogs/emotion/images/fface.gif Vedi File


BIN
static/ueditor/dialogs/emotion/images/jxface2.gif Vedi File


BIN
static/ueditor/dialogs/emotion/images/neweditor-tab-bg.png Vedi File


BIN
static/ueditor/dialogs/emotion/images/tface.gif Vedi File


BIN
static/ueditor/dialogs/emotion/images/wface.gif Vedi File


BIN
static/ueditor/dialogs/emotion/images/yface.gif Vedi File


+ 89 - 0
static/ueditor/dialogs/gmap/gmap.html Vedi File

@@ -0,0 +1,89 @@
1
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
+        "http://www.w3.org/TR/html4/loose.dtd">
3
+<html>
4
+<head>
5
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+    <title></title>
7
+    <script type="text/javascript" src="../internal.js"></script>
8
+    <style type="text/css">
9
+        .content{width:530px; height: 350px;margin: 10px auto;}
10
+        .content table{width: 100%}
11
+        .content table td{vertical-align: middle;}
12
+        #address{width:220px;height:21px;background: #FFF;border:1px solid #d7d7d7; line-height: 21px;}
13
+    </style>
14
+    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
15
+</head>
16
+<body>
17
+<div class="content">
18
+    <table>
19
+        <tr>
20
+            <td><label for="address"><var id="lang_input_address"></var></label></td>
21
+            <td><input id="address" type="text" /></td>
22
+            <td><a id="doSearch" href="javascript:void(0)" class="button"><var id="lang_input_search"></var></a></td>
23
+        </tr>
24
+    </table>
25
+    <div id="container" style="width: 100%; height: 340px;margin: 5px auto; border: 1px solid gray;"></div>
26
+</div>
27
+<script type="text/javascript">
28
+    domUtils.on(window,"load",function(){
29
+        var map = new google.maps.Map(document.getElementById('container'), {
30
+                zoom: 3,
31
+                streetViewControl: false,
32
+                scaleControl: true,
33
+                mapTypeId: google.maps.MapTypeId.ROADMAP
34
+            });
35
+            var imgcss;
36
+            var marker = new google.maps.Marker({
37
+                map: map,
38
+                draggable: true
39
+            });
40
+            function doSearch(){
41
+                var address = document.getElementById('address').value;
42
+                var geocoder = new google.maps.Geocoder();
43
+                geocoder.geocode( { 'address': address}, function (results, status) {
44
+                    if (status == google.maps.GeocoderStatus.OK) {
45
+                        var bounds = results[0].geometry.viewport;
46
+                        map.fitBounds(bounds);
47
+                        marker.setPosition(results[0].geometry.location);
48
+                        marker.setTitle(address);
49
+                    } else alert(lang.searchError);
50
+                });
51
+            }
52
+            $G('address').onkeydown = function (evt){
53
+                evt = evt || event;
54
+                if (evt.keyCode == 13) {
55
+                    doSearch();
56
+                }
57
+            };
58
+            $G("doSearch").onclick = doSearch;
59
+            dialog.onok = function (){
60
+                var center = map.getCenter();
61
+                var point = marker.getPosition();
62
+                var url = "http://maps.googleapis.com/maps/api/staticmap?center=" + center.lat() + ',' + center.lng() + "&zoom=" + map.zoom + "&size=520x340&maptype=" + map.getMapTypeId() + "&markers=" + point.lat() + ',' + point.lng() + "&sensor=false";
63
+                editor.execCommand('inserthtml', '<img width="520" height="340" src="' + url + '"' + (imgcss ? ' style="' + imgcss + '"' :'') + '/>');
64
+            };
65
+
66
+            function getPars(str,par){
67
+                var reg = new RegExp(par+"=((\\d+|[.,])*)","g");
68
+                return reg.exec(str)[1];
69
+            }
70
+            var img = editor.selection.getRange().getClosedNode();
71
+            if(img && img.src.indexOf("http://maps.googleapis.com/maps/api/staticmap")!=-1){
72
+                var url = img.getAttribute("src");
73
+                var centers = getPars(url,"center").split(",");
74
+                point = new google.maps.LatLng(Number(centers[0]),Number(centers[1]));
75
+                map.setCenter(point);
76
+                map.setZoom(Number(getPars(url,"zoom")));
77
+                centers = getPars(url,"markers").split(",");
78
+                marker.setPosition(new google.maps.LatLng(Number(centers[0]),Number(centers[1])));
79
+                imgcss = img.style.cssText;
80
+            }else{
81
+                setTimeout(function(){
82
+                    doSearch();
83
+                },30)
84
+            }
85
+    });
86
+
87
+</script>
88
+</body>
89
+</html>

+ 7 - 0
static/ueditor/dialogs/help/help.css Vedi File

@@ -0,0 +1,7 @@
1
+.wrapper{width: 370px;margin: 10px auto;zoom: 1;}
2
+.tabbody{height: 360px;}
3
+.tabbody .panel{width:100%;height: 360px;position: absolute;background: #fff;}
4
+.tabbody .panel h1{font-size:26px;margin: 5px 0 0 5px;}
5
+.tabbody .panel p{font-size:12px;margin: 5px 0 0 5px;}
6
+.tabbody table{width:90%;line-height: 20px;margin: 5px 0 0 5px;;}
7
+.tabbody table thead{font-weight: bold;line-height: 25px;}

+ 82 - 0
static/ueditor/dialogs/help/help.html Vedi File

@@ -0,0 +1,82 @@
1
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
+        "http://www.w3.org/TR/html4/loose.dtd">
3
+<html>
4
+<head>
5
+    <title>帮助</title>
6
+    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
7
+    <script type="text/javascript" src="../internal.js"></script>
8
+    <link rel="stylesheet" type="text/css" href="help.css">
9
+</head>
10
+<body>
11
+<div class="wrapper" id="helptab">
12
+    <div id="tabHeads" class="tabhead">
13
+        <span class="focus" tabsrc="about"><var id="lang_input_about"></var></span>
14
+        <span tabsrc="shortcuts"><var id="lang_input_shortcuts"></var></span>
15
+    </div>
16
+    <div id="tabBodys" class="tabbody">
17
+        <div id="about" class="panel">
18
+            <h1>UEditor</h1>
19
+            <p id="version"></p>
20
+            <p><var id="lang_input_introduction"></var></p>
21
+        </div>
22
+        <div id="shortcuts" class="panel">
23
+            <table>
24
+                <thead>
25
+                <tr>
26
+                    <td><var id="lang_Txt_shortcuts"></var></td>
27
+                    <td><var id="lang_Txt_func"></var></td>
28
+                </tr>
29
+                </thead>
30
+                <tbody>
31
+                <tr>
32
+                    <td>ctrl+b</td>
33
+                    <td><var id="lang_Txt_bold"></var></td>
34
+                </tr>
35
+                <tr>
36
+                    <td>ctrl+c</td>
37
+                    <td><var id="lang_Txt_copy"></var></td>
38
+                </tr>
39
+                <tr>
40
+                    <td>ctrl+x</td>
41
+                    <td><var id="lang_Txt_cut"></var></td>
42
+                </tr>
43
+                <tr>
44
+                    <td>ctrl+v</td>
45
+                    <td><var id="lang_Txt_Paste"></var></td>
46
+                </tr>
47
+                <tr>
48
+                    <td>ctrl+y</td>
49
+                    <td><var id="lang_Txt_undo"></var></td>
50
+                </tr>
51
+                <tr>
52
+                    <td>ctrl+z</td>
53
+                    <td><var id="lang_Txt_redo"></var></td>
54
+                </tr>
55
+                <tr>
56
+                    <td>ctrl+i</td>
57
+                    <td><var id="lang_Txt_italic"></var></td>
58
+                </tr>
59
+                <tr>
60
+                    <td>ctrl+u</td>
61
+                    <td><var id="lang_Txt_underline"></var></td>
62
+                </tr>
63
+                <tr>
64
+                    <td>ctrl+a</td>
65
+                    <td><var id="lang_Txt_selectAll"></var></td>
66
+                </tr>
67
+                <tr>
68
+                    <td>shift+enter</td>
69
+                    <td><var id="lang_Txt_visualEnter"></var></td>
70
+                </tr>
71
+                <tr>
72
+                    <td>alt+z</td>
73
+                    <td><var id="lang_Txt_fullscreen"></var></td>
74
+                </tr>
75
+                </tbody>
76
+            </table>
77
+        </div>
78
+    </div>
79
+</div>
80
+<script type="text/javascript" src="help.js"></script>
81
+</body>
82
+</html>

+ 56 - 0
static/ueditor/dialogs/help/help.js Vedi File

@@ -0,0 +1,56 @@
1
+/**
2
+ * Created with JetBrains PhpStorm.
3
+ * User: xuheng
4
+ * Date: 12-9-26
5
+ * Time: 下午1:06
6
+ * To change this template use File | Settings | File Templates.
7
+ */
8
+/**
9
+ * tab点击处理事件
10
+ * @param tabHeads
11
+ * @param tabBodys
12
+ * @param obj
13
+ */
14
+function clickHandler( tabHeads,tabBodys,obj ) {
15
+    //head样式更改
16
+    for ( var k = 0, len = tabHeads.length; k < len; k++ ) {
17
+        tabHeads[k].className = "";
18
+    }
19
+    obj.className = "focus";
20
+    //body显隐
21
+    var tabSrc = obj.getAttribute( "tabSrc" );
22
+    for ( var j = 0, length = tabBodys.length; j < length; j++ ) {
23
+        var body = tabBodys[j],
24
+            id = body.getAttribute( "id" );
25
+        body.onclick = function(){
26
+            this.style.zoom = 1;
27
+        };
28
+        if ( id != tabSrc ) {
29
+            body.style.zIndex = 1;
30
+        } else {
31
+            body.style.zIndex = 200;
32
+        }
33
+    }
34
+
35
+}
36
+
37
+/**
38
+ * TAB切换
39
+ * @param tabParentId  tab的父节点ID或者对象本身
40
+ */
41
+function switchTab( tabParentId ) {
42
+    var tabElements = $G( tabParentId ).children,
43
+        tabHeads = tabElements[0].children,
44
+        tabBodys = tabElements[1].children;
45
+
46
+    for ( var i = 0, length = tabHeads.length; i < length; i++ ) {
47
+        var head = tabHeads[i];
48
+        if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head );
49
+        head.onclick = function () {
50
+            clickHandler(tabHeads,tabBodys,this);
51
+        }
52
+    }
53
+}
54
+switchTab("helptab");
55
+
56
+document.getElementById('version').innerHTML = parent.UE.version;

+ 894 - 0
static/ueditor/dialogs/image/image.css Vedi File

@@ -0,0 +1,894 @@
1
+@charset "utf-8";
2
+/* dialog样式 */
3
+.wrapper {
4
+    zoom: 1;
5
+    width: 630px;
6
+    *width: 626px;
7
+    height: 380px;
8
+    margin: 0 auto;
9
+    padding: 10px;
10
+    position: relative;
11
+    font-family: sans-serif;
12
+}
13
+
14
+/*tab样式框大小*/
15
+.tabhead {
16
+    float:left;
17
+}
18
+.tabbody {
19
+    width: 100%;
20
+    height: 346px;
21
+    position: relative;
22
+    clear: both;
23
+}
24
+
25
+.tabbody .panel {
26
+    position: absolute;
27
+    width: 0;
28
+    height: 0;
29
+    background: #fff;
30
+    overflow: hidden;
31
+    display: none;
32
+}
33
+
34
+.tabbody .panel.focus {
35
+    width: 100%;
36
+    height: 346px;
37
+    display: block;
38
+}
39
+
40
+/* 图片对齐方式 */
41
+.alignBar{
42
+    float:right;
43
+    margin-top: 5px;
44
+    position: relative;
45
+}
46
+
47
+.alignBar .algnLabel{
48
+    float:left;
49
+    height: 20px;
50
+    line-height: 20px;
51
+}
52
+
53
+.alignBar #alignIcon{
54
+    zoom:1;
55
+    _display: inline;
56
+    display: inline-block;
57
+    position: relative;
58
+}
59
+.alignBar #alignIcon span{
60
+    float: left;
61
+    cursor: pointer;
62
+    display: block;
63
+    width: 19px;
64
+    height: 17px;
65
+    margin-right: 3px;
66
+    margin-left: 3px;
67
+    background-image: url(./images/alignicon.jpg);
68
+}
69
+.alignBar #alignIcon .none-align{
70
+    background-position: 0 -18px;
71
+}
72
+.alignBar #alignIcon .left-align{
73
+    background-position: -20px -18px;
74
+}
75
+.alignBar #alignIcon .right-align{
76
+    background-position: -40px -18px;
77
+}
78
+.alignBar #alignIcon .center-align{
79
+    background-position: -60px -18px;
80
+}
81
+.alignBar #alignIcon .none-align.focus{
82
+    background-position: 0 0;
83
+}
84
+.alignBar #alignIcon .left-align.focus{
85
+    background-position: -20px 0;
86
+}
87
+.alignBar #alignIcon .right-align.focus{
88
+    background-position: -40px 0;
89
+}
90
+.alignBar #alignIcon .center-align.focus{
91
+    background-position: -60px 0;
92
+}
93
+
94
+
95
+
96
+
97
+/* 远程图片样式 */
98
+#remote {
99
+    z-index: 200;
100
+}
101
+
102
+#remote .top{
103
+    width: 100%;
104
+    margin-top: 25px;
105
+}
106
+#remote .left{
107
+    display: block;
108
+    float: left;
109
+    width: 300px;
110
+    height:10px;
111
+}
112
+#remote .right{
113
+    display: block;
114
+    float: right;
115
+    width: 300px;
116
+    height:10px;
117
+}
118
+#remote .row{
119
+    margin-left: 20px;
120
+    clear: both;
121
+    height: 40px;
122
+}
123
+
124
+#remote .row label{
125
+    text-align: center;
126
+    width: 50px;
127
+    zoom:1;
128
+    _display: inline;
129
+    display:inline-block;
130
+    vertical-align: middle;
131
+}
132
+#remote .row label.algnLabel{
133
+    float: left;
134
+
135
+}
136
+
137
+#remote input.text{
138
+    width: 150px;
139
+    padding: 3px 6px;
140
+    font-size: 14px;
141
+    line-height: 1.42857143;
142
+    color: #555;
143
+    background-color: #fff;
144
+    background-image: none;
145
+    border: 1px solid #ccc;
146
+    border-radius: 4px;
147
+    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
148
+    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
149
+    -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
150
+    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
151
+}
152
+#remote input.text:focus {
153
+    border-color: #66afe9;
154
+    outline: 0;
155
+    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
156
+    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
157
+}
158
+#remote #url{
159
+    width: 500px;
160
+    margin-bottom: 2px;
161
+}
162
+#remote #width,
163
+#remote #height{
164
+    width: 20px;
165
+    margin-left: 2px;
166
+    margin-right: 2px;
167
+}
168
+#remote #border,
169
+#remote #vhSpace,
170
+#remote #title{
171
+    width: 180px;
172
+    margin-right: 5px;
173
+}
174
+#remote #lock{
175
+}
176
+#remote #lockicon{
177
+    zoom: 1;
178
+    _display:inline;
179
+    display: inline-block;
180
+    width: 20px;
181
+    height: 20px;
182
+    background: url("../../themes/default/images/lock.gif") -13px -13px no-repeat;
183
+    vertical-align: middle;
184
+}
185
+#remote #preview{
186
+    clear: both;
187
+    width: 260px;
188
+    height: 240px;
189
+    z-index: 9999;
190
+    margin-top: 10px;
191
+    background-color: #eee;
192
+    overflow: hidden;
193
+}
194
+
195
+/* 上传图片 */
196
+.tabbody #upload.panel {
197
+    width: 0;
198
+    height: 0;
199
+    overflow: hidden;
200
+    position: absolute !important;
201
+    clip: rect(1px, 1px, 1px, 1px);
202
+    background: #fff;
203
+    display: block;
204
+}
205
+
206
+.tabbody #upload.panel.focus {
207
+    width: 100%;
208
+    height: 346px;
209
+    display: block;
210
+    clip: auto;
211
+}
212
+
213
+#upload .queueList {
214
+    margin: 0;
215
+    width: 100%;
216
+    height: 100%;
217
+    position: absolute;
218
+    overflow: hidden;
219
+}
220
+
221
+#upload p {
222
+    margin: 0;
223
+}
224
+
225
+.element-invisible {
226
+    width: 0 !important;
227
+    height: 0 !important;
228
+    border: 0;
229
+    padding: 0;
230
+    margin: 0;
231
+    overflow: hidden;
232
+    position: absolute !important;
233
+    clip: rect(1px, 1px, 1px, 1px);
234
+}
235
+
236
+#upload .placeholder {
237
+    margin: 10px;
238
+    border: 2px dashed #e6e6e6;
239
+    *border: 0px dashed #e6e6e6;
240
+    height: 172px;
241
+    padding-top: 150px;
242
+    text-align: center;
243
+    background: url(./images/image.png) center 70px no-repeat;
244
+    color: #cccccc;
245
+    font-size: 18px;
246
+    position: relative;
247
+    top:0;
248
+    *top: 10px;
249
+}
250
+
251
+#upload .placeholder .webuploader-pick {
252
+    font-size: 18px;
253
+    background: #00b7ee;
254
+    border-radius: 3px;
255
+    line-height: 44px;
256
+    padding: 0 30px;
257
+    *width: 120px;
258
+    color: #fff;
259
+    display: inline-block;
260
+    margin: 0 auto 20px auto;
261
+    cursor: pointer;
262
+    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
263
+}
264
+
265
+#upload .placeholder .webuploader-pick-hover {
266
+    background: #00a2d4;
267
+}
268
+
269
+
270
+#filePickerContainer {
271
+    text-align: center;
272
+}
273
+
274
+#upload .placeholder .flashTip {
275
+    color: #666666;
276
+    font-size: 12px;
277
+    position: absolute;
278
+    width: 100%;
279
+    text-align: center;
280
+    bottom: 20px;
281
+}
282
+
283
+#upload .placeholder .flashTip a {
284
+    color: #0785d1;
285
+    text-decoration: none;
286
+}
287
+
288
+#upload .placeholder .flashTip a:hover {
289
+    text-decoration: underline;
290
+}
291
+
292
+#upload .placeholder.webuploader-dnd-over {
293
+    border-color: #999999;
294
+}
295
+
296
+#upload .filelist {
297
+    list-style: none;
298
+    margin: 0;
299
+    padding: 0;
300
+    overflow-x: hidden;
301
+    overflow-y: auto;
302
+    position: relative;
303
+    height: 300px;
304
+}
305
+
306
+#upload .filelist:after {
307
+    content: '';
308
+    display: block;
309
+    width: 0;
310
+    height: 0;
311
+    overflow: hidden;
312
+    clear: both;
313
+    position: relative;
314
+}
315
+
316
+#upload .filelist li {
317
+    width: 113px;
318
+    height: 113px;
319
+    background: url(./images/bg.png);
320
+    text-align: center;
321
+    margin: 9px 0 0 9px;
322
+    *margin: 6px 0 0 6px;
323
+    position: relative;
324
+    display: block;
325
+    float: left;
326
+    overflow: hidden;
327
+    font-size: 12px;
328
+}
329
+
330
+#upload .filelist li p.log {
331
+    position: relative;
332
+    top: -45px;
333
+}
334
+
335
+#upload .filelist li p.title {
336
+    position: absolute;
337
+    top: 0;
338
+    left: 0;
339
+    width: 100%;
340
+    overflow: hidden;
341
+    white-space: nowrap;
342
+    text-overflow: ellipsis;
343
+    top: 5px;
344
+    text-indent: 5px;
345
+    text-align: left;
346
+}
347
+
348
+#upload .filelist li p.progress {
349
+    position: absolute;
350
+    width: 100%;
351
+    bottom: 0;
352
+    left: 0;
353
+    height: 8px;
354
+    overflow: hidden;
355
+    z-index: 50;
356
+    margin: 0;
357
+    border-radius: 0;
358
+    background: none;
359
+    -webkit-box-shadow: 0 0 0;
360
+}
361
+
362
+#upload .filelist li p.progress span {
363
+    display: none;
364
+    overflow: hidden;
365
+    width: 0;
366
+    height: 100%;
367
+    background: #1483d8 url(./images/progress.png) repeat-x;
368
+
369
+    -webit-transition: width 200ms linear;
370
+    -moz-transition: width 200ms linear;
371
+    -o-transition: width 200ms linear;
372
+    -ms-transition: width 200ms linear;
373
+    transition: width 200ms linear;
374
+
375
+    -webkit-animation: progressmove 2s linear infinite;
376
+    -moz-animation: progressmove 2s linear infinite;
377
+    -o-animation: progressmove 2s linear infinite;
378
+    -ms-animation: progressmove 2s linear infinite;
379
+    animation: progressmove 2s linear infinite;
380
+
381
+    -webkit-transform: translateZ(0);
382
+}
383
+
384
+@-webkit-keyframes progressmove {
385
+    0% {
386
+        background-position: 0 0;
387
+    }
388
+    100% {
389
+        background-position: 17px 0;
390
+    }
391
+}
392
+
393
+@-moz-keyframes progressmove {
394
+    0% {
395
+        background-position: 0 0;
396
+    }
397
+    100% {
398
+        background-position: 17px 0;
399
+    }
400
+}
401
+
402
+@keyframes progressmove {
403
+    0% {
404
+        background-position: 0 0;
405
+    }
406
+    100% {
407
+        background-position: 17px 0;
408
+    }
409
+}
410
+
411
+#upload .filelist li p.imgWrap {
412
+    position: relative;
413
+    z-index: 2;
414
+    line-height: 113px;
415
+    vertical-align: middle;
416
+    overflow: hidden;
417
+    width: 113px;
418
+    height: 113px;
419
+
420
+    -webkit-transform-origin: 50% 50%;
421
+    -moz-transform-origin: 50% 50%;
422
+    -o-transform-origin: 50% 50%;
423
+    -ms-transform-origin: 50% 50%;
424
+    transform-origin: 50% 50%;
425
+
426
+    -webit-transition: 200ms ease-out;
427
+    -moz-transition: 200ms ease-out;
428
+    -o-transition: 200ms ease-out;
429
+    -ms-transition: 200ms ease-out;
430
+    transition: 200ms ease-out;
431
+}
432
+
433
+#upload .filelist li img {
434
+    width: 100%;
435
+}
436
+
437
+#upload .filelist li p.error {
438
+    background: #f43838;
439
+    color: #fff;
440
+    position: absolute;
441
+    bottom: 0;
442
+    left: 0;
443
+    height: 28px;
444
+    line-height: 28px;
445
+    width: 100%;
446
+    z-index: 100;
447
+    display:none;
448
+}
449
+
450
+#upload .filelist li .success {
451
+    display: block;
452
+    position: absolute;
453
+    left: 0;
454
+    bottom: 0;
455
+    height: 40px;
456
+    width: 100%;
457
+    z-index: 200;
458
+    background: url(./images/success.png) no-repeat right bottom;
459
+    background: url(./images/success.gif) no-repeat right bottom \9;
460
+}
461
+
462
+#upload .filelist li.filePickerBlock {
463
+    width: 113px;
464
+    height: 113px;
465
+    background: url(./images/image.png) no-repeat center 12px;
466
+    border: 1px solid #eeeeee;
467
+    border-radius: 0;
468
+}
469
+#upload .filelist li.filePickerBlock div.webuploader-pick  {
470
+    width: 100%;
471
+    height: 100%;
472
+    margin: 0;
473
+    padding: 0;
474
+    opacity: 0;
475
+    background: none;
476
+    font-size: 0;
477
+}
478
+
479
+#upload .filelist div.file-panel {
480
+    position: absolute;
481
+    height: 0;
482
+    filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0;
483
+    background: rgba(0, 0, 0, 0.5);
484
+    width: 100%;
485
+    top: 0;
486
+    left: 0;
487
+    overflow: hidden;
488
+    z-index: 300;
489
+}
490
+
491
+#upload .filelist div.file-panel span {
492
+    width: 24px;
493
+    height: 24px;
494
+    display: inline;
495
+    float: right;
496
+    text-indent: -9999px;
497
+    overflow: hidden;
498
+    background: url(./images/icons.png) no-repeat;
499
+    background: url(./images/icons.gif) no-repeat \9;
500
+    margin: 5px 1px 1px;
501
+    cursor: pointer;
502
+    -webkit-tap-highlight-color: rgba(0,0,0,0);
503
+    -webkit-user-select: none;
504
+    -moz-user-select: none;
505
+    -ms-user-select: none;
506
+    user-select: none;
507
+}
508
+
509
+#upload .filelist div.file-panel span.rotateLeft {
510
+    display:none;
511
+    background-position: 0 -24px;
512
+}
513
+
514
+#upload .filelist div.file-panel span.rotateLeft:hover {
515
+    background-position: 0 0;
516
+}
517
+
518
+#upload .filelist div.file-panel span.rotateRight {
519
+    display:none;
520
+    background-position: -24px -24px;
521
+}
522
+
523
+#upload .filelist div.file-panel span.rotateRight:hover {
524
+    background-position: -24px 0;
525
+}
526
+
527
+#upload .filelist div.file-panel span.cancel {
528
+    background-position: -48px -24px;
529
+}
530
+
531
+#upload .filelist div.file-panel span.cancel:hover {
532
+    background-position: -48px 0;
533
+}
534
+
535
+#upload .statusBar {
536
+    height: 45px;
537
+    border-bottom: 1px solid #dadada;
538
+    margin: 0 10px;
539
+    padding: 0;
540
+    line-height: 45px;
541
+    vertical-align: middle;
542
+    position: relative;
543
+}
544
+
545
+#upload .statusBar .progress {
546
+    border: 1px solid #1483d8;
547
+    width: 198px;
548
+    background: #fff;
549
+    height: 18px;
550
+    position: absolute;
551
+    top: 12px;
552
+    display: none;
553
+    text-align: center;
554
+    line-height: 18px;
555
+    color: #6dbfff;
556
+    margin: 0 10px 0 0;
557
+}
558
+#upload .statusBar .progress span.percentage {
559
+    width: 0;
560
+    height: 100%;
561
+    left: 0;
562
+    top: 0;
563
+    background: #1483d8;
564
+    position: absolute;
565
+}
566
+#upload .statusBar .progress span.text {
567
+    position: relative;
568
+    z-index: 10;
569
+}
570
+
571
+#upload .statusBar .info {
572
+    display: inline-block;
573
+    font-size: 14px;
574
+    color: #666666;
575
+}
576
+
577
+#upload .statusBar .btns {
578
+    position: absolute;
579
+    top: 7px;
580
+    right: 0;
581
+    line-height: 30px;
582
+}
583
+
584
+#filePickerBtn {
585
+    display: inline-block;
586
+    float: left;
587
+}
588
+#upload .statusBar .btns .webuploader-pick,
589
+#upload .statusBar .btns .uploadBtn,
590
+#upload .statusBar .btns .uploadBtn.state-uploading,
591
+#upload .statusBar .btns .uploadBtn.state-paused {
592
+    background: #ffffff;
593
+    border: 1px solid #cfcfcf;
594
+    color: #565656;
595
+    padding: 0 18px;
596
+    display: inline-block;
597
+    border-radius: 3px;
598
+    margin-left: 10px;
599
+    cursor: pointer;
600
+    font-size: 14px;
601
+    float: left;
602
+    -webkit-user-select: none;
603
+    -moz-user-select: none;
604
+    -ms-user-select: none;
605
+    user-select: none;
606
+}
607
+#upload .statusBar .btns .webuploader-pick-hover,
608
+#upload .statusBar .btns .uploadBtn:hover,
609
+#upload .statusBar .btns .uploadBtn.state-uploading:hover,
610
+#upload .statusBar .btns .uploadBtn.state-paused:hover {
611
+    background: #f0f0f0;
612
+}
613
+
614
+#upload .statusBar .btns .uploadBtn,
615
+#upload .statusBar .btns .uploadBtn.state-paused{
616
+    background: #00b7ee;
617
+    color: #fff;
618
+    border-color: transparent;
619
+}
620
+#upload .statusBar .btns .uploadBtn:hover,
621
+#upload .statusBar .btns .uploadBtn.state-paused:hover{
622
+    background: #00a2d4;
623
+}
624
+
625
+#upload .statusBar .btns .uploadBtn.disabled {
626
+    pointer-events: none;
627
+    filter:alpha(opacity=60);
628
+    -moz-opacity:0.6;
629
+    -khtml-opacity: 0.6;
630
+    opacity: 0.6;
631
+}
632
+
633
+
634
+
635
+/* 图片管理样式 */
636
+#online {
637
+    width: 100%;
638
+    height: 336px;
639
+    padding: 10px 0 0 0;
640
+}
641
+#online #imageList{
642
+    width: 100%;
643
+    height: 100%;
644
+    overflow-x: hidden;
645
+    overflow-y: auto;
646
+    position: relative;
647
+}
648
+#online ul {
649
+    display: block;
650
+    list-style: none;
651
+    margin: 0;
652
+    padding: 0;
653
+}
654
+#online li {
655
+    float: left;
656
+    display: block;
657
+    list-style: none;
658
+    padding: 0;
659
+    width: 113px;
660
+    height: 113px;
661
+    margin: 0 0 9px 9px;
662
+    *margin: 0 0 6px 6px;
663
+    background-color: #eee;
664
+    overflow: hidden;
665
+    cursor: pointer;
666
+    position: relative;
667
+}
668
+#online li.clearFloat {
669
+    float: none;
670
+    clear: both;
671
+    display: block;
672
+    width:0;
673
+    height:0;
674
+    margin: 0;
675
+    padding: 0;
676
+}
677
+#online li img {
678
+    cursor: pointer;
679
+}
680
+#online li .icon {
681
+    cursor: pointer;
682
+    width: 113px;
683
+    height: 113px;
684
+    position: absolute;
685
+    top: 0;
686
+    left: 0;
687
+    z-index: 2;
688
+    border: 0;
689
+    background-repeat: no-repeat;
690
+}
691
+#online li .icon:hover {
692
+    width: 107px;
693
+    height: 107px;
694
+    border: 3px solid #1094fa;
695
+}
696
+#online li.selected .icon {
697
+    background-image: url(images/success.png);
698
+    background-image: url(images/success.gif)\9;
699
+    background-position: 75px 75px;
700
+}
701
+#online li.selected .icon:hover {
702
+    width: 107px;
703
+    height: 107px;
704
+    border: 3px solid #1094fa;
705
+    background-position: 72px 72px;
706
+}
707
+
708
+
709
+/* 图片搜索样式 */
710
+#search .searchBar {
711
+    width: 100%;
712
+    height: 30px;
713
+    margin: 10px 0 5px 0;
714
+    padding: 0;
715
+}
716
+
717
+#search input.text{
718
+    width: 150px;
719
+    padding: 3px 6px;
720
+    font-size: 14px;
721
+    line-height: 1.42857143;
722
+    color: #555;
723
+    background-color: #fff;
724
+    background-image: none;
725
+    border: 1px solid #ccc;
726
+    border-radius: 4px;
727
+    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
728
+    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
729
+    -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
730
+    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
731
+}
732
+#search input.text:focus {
733
+    border-color: #66afe9;
734
+    outline: 0;
735
+    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
736
+    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
737
+}
738
+#search input.searchTxt {
739
+    margin-left:5px;
740
+    padding-left: 5px;
741
+    background: #FFF;
742
+    width: 300px;
743
+    *width: 260px;
744
+    height: 21px;
745
+    line-height: 21px;
746
+    float: left;
747
+    dislay: block;
748
+}
749
+
750
+#search .searchType {
751
+    width: 65px;
752
+    height: 28px;
753
+    padding:0;
754
+    line-height: 28px;
755
+    border: 1px solid #d7d7d7;
756
+    border-radius: 0;
757
+    vertical-align: top;
758
+    margin-left: 5px;
759
+    float: left;
760
+    dislay: block;
761
+}
762
+
763
+#search #searchBtn,
764
+#search #searchReset {
765
+    display: inline-block;
766
+    margin-bottom: 0;
767
+    margin-right: 5px;
768
+    padding: 4px 10px;
769
+    font-weight: 400;
770
+    text-align: center;
771
+    vertical-align: middle;
772
+    cursor: pointer;
773
+    background-image: none;
774
+    border: 1px solid transparent;
775
+    white-space: nowrap;
776
+    font-size: 14px;
777
+    border-radius: 4px;
778
+    -webkit-user-select: none;
779
+    -moz-user-select: none;
780
+    -ms-user-select: none;
781
+    user-select: none;
782
+    vertical-align: top;
783
+    float: right;
784
+}
785
+
786
+#search #searchBtn {
787
+    color: white;
788
+    border-color: #285e8e;
789
+    background-color: #3b97d7;
790
+}
791
+#search #searchReset {
792
+    color: #333;
793
+    border-color: #ccc;
794
+    background-color: #fff;
795
+}
796
+#search #searchBtn:hover {
797
+    background-color: #3276b1;
798
+}
799
+#search #searchReset:hover {
800
+    background-color: #eee;
801
+}
802
+
803
+#search .msg {
804
+    margin-left: 5px;
805
+}
806
+
807
+#search .searchList{
808
+    width: 100%;
809
+    height: 300px;
810
+    overflow: hidden;
811
+    clear: both;
812
+}
813
+#search .searchList ul{
814
+    margin:0;
815
+    padding:0;
816
+    list-style:none;
817
+    clear: both;
818
+    width: 100%;
819
+    height: 100%;
820
+    overflow-x: hidden;
821
+    overflow-y: auto;
822
+    zoom: 1;
823
+    position: relative;
824
+}
825
+
826
+#search .searchList li {
827
+    list-style:none;
828
+    float: left;
829
+    display: block;
830
+    width: 115px;
831
+    margin: 5px 10px 5px 20px;
832
+    *margin: 5px 10px 5px 15px;
833
+    padding:0;
834
+    font-size: 12px;
835
+    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
836
+    -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
837
+    -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
838
+    position: relative;
839
+    vertical-align: top;
840
+    text-align: center;
841
+    overflow: hidden;
842
+    cursor: pointer;
843
+    filter: alpha(Opacity=100);
844
+    -moz-opacity: 1;
845
+    opacity: 1;
846
+    border: 2px solid #eee;
847
+}
848
+
849
+#search .searchList li.selected {
850
+    filter: alpha(Opacity=40);
851
+    -moz-opacity: 0.4;
852
+    opacity: 0.4;
853
+    border: 2px solid #00a0e9;
854
+}
855
+
856
+#search .searchList li p {
857
+    background-color: #eee;
858
+    margin: 0;
859
+    padding: 0;
860
+    position: relative;
861
+    width:100%;
862
+    height:115px;
863
+    overflow: hidden;
864
+}
865
+
866
+#search .searchList li p img {
867
+    cursor: pointer;
868
+    border: 0;
869
+}
870
+
871
+#search .searchList li a {
872
+    color: #999;
873
+    border-top: 1px solid #F2F2F2;
874
+    background: #FAFAFA;
875
+    text-align: center;
876
+    display: block;
877
+    padding: 0 5px;
878
+    width: 105px;
879
+    height:32px;
880
+    line-height:32px;
881
+    white-space:nowrap;
882
+    text-overflow:ellipsis;
883
+    text-decoration: none;
884
+    overflow: hidden;
885
+    word-break: break-all;
886
+}
887
+
888
+#search .searchList a:hover {
889
+    text-decoration: underline;
890
+    color: #333;
891
+}
892
+#search .searchList .clearFloat{
893
+    clear: both;
894
+}

+ 120 - 0
static/ueditor/dialogs/image/image.html Vedi File

@@ -0,0 +1,120 @@
1
+<!doctype html>
2
+<html>
3
+<head>
4
+    <meta charset="UTF-8">
5
+    <title>ueditor图片对话框</title>
6
+    <script type="text/javascript" src="../internal.js"></script>
7
+
8
+    <!-- jquery -->
9
+    <script type="text/javascript" src="../../third-party/jquery-1.10.2.min.js"></script>
10
+
11
+    <!-- webuploader -->
12
+    <script src="../../third-party/webuploader/webuploader.min.js"></script>
13
+    <link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css">
14
+
15
+    <!-- image dialog -->
16
+    <link rel="stylesheet" href="image.css" type="text/css" />
17
+</head>
18
+<body>
19
+
20
+    <div class="wrapper">
21
+        <div id="tabhead" class="tabhead">
22
+            <span class="tab" data-content-id="remote"><var id="lang_tab_remote"></var></span>
23
+            <span class="tab focus" data-content-id="upload"><var id="lang_tab_upload"></var></span>
24
+            <span class="tab" data-content-id="online"><var id="lang_tab_online"></var></span>
25
+            <span class="tab" data-content-id="search"><var id="lang_tab_search"></var></span>
26
+        </div>
27
+        <div class="alignBar">
28
+            <label class="algnLabel"><var id="lang_input_align"></var></label>
29
+                    <span id="alignIcon">
30
+                        <span id="noneAlign" class="none-align focus" data-align="none"></span>
31
+                        <span id="leftAlign" class="left-align" data-align="left"></span>
32
+                        <span id="rightAlign" class="right-align" data-align="right"></span>
33
+                        <span id="centerAlign" class="center-align" data-align="center"></span>
34
+                    </span>
35
+            <input id="align" name="align" type="hidden" value="none"/>
36
+        </div>
37
+        <div id="tabbody" class="tabbody">
38
+
39
+            <!-- 远程图片 -->
40
+            <div id="remote" class="panel">
41
+                <div class="top">
42
+                    <div class="row">
43
+                        <label for="url"><var id="lang_input_url"></var></label>
44
+                        <span><input class="text" id="url" type="text"/></span>
45
+                    </div>
46
+                </div>
47
+                <div class="left">
48
+                    <div class="row">
49
+                        <label><var id="lang_input_size"></var></label>
50
+                        <span><var id="lang_input_width">&nbsp;&nbsp;</var><input class="text" type="text" id="width"/>px </span>
51
+                        <span><var id="lang_input_height">&nbsp;&nbsp;</var><input class="text" type="text" id="height"/>px </span>
52
+                        <span><input id="lock" type="checkbox" disabled="disabled"><span id="lockicon"></span></span>
53
+                    </div>
54
+                    <div class="row">
55
+                        <label><var id="lang_input_border"></var></label>
56
+                        <span><input class="text" type="text" id="border"/>px </span>
57
+                    </div>
58
+                    <div class="row">
59
+                        <label><var id="lang_input_vhspace"></var></label>
60
+                        <span><input class="text" type="text" id="vhSpace"/>px </span>
61
+                    </div>
62
+                    <div class="row">
63
+                        <label><var id="lang_input_title"></var></label>
64
+                        <span><input class="text" type="text" id="title"/></span>
65
+                    </div>
66
+                </div>
67
+                <div class="right"><div id="preview"></div></div>
68
+            </div>
69
+
70
+            <!-- 上传图片 -->
71
+            <div id="upload" class="panel focus">
72
+                <div id="queueList" class="queueList">
73
+                    <div class="statusBar element-invisible">
74
+                        <div class="progress">
75
+                            <span class="text">0%</span>
76
+                            <span class="percentage"></span>
77
+                        </div><div class="info"></div>
78
+                        <div class="btns">
79
+                            <div id="filePickerBtn"></div>
80
+                            <div class="uploadBtn"><var id="lang_start_upload"></var></div>
81
+                        </div>
82
+                    </div>
83
+                    <div id="dndArea" class="placeholder">
84
+                        <div class="filePickerContainer">
85
+                            <div id="filePickerReady"></div>
86
+                        </div>
87
+                    </div>
88
+                    <ul class="filelist element-invisible">
89
+                        <li id="filePickerBlock" class="filePickerBlock"></li>
90
+                    </ul>
91
+                </div>
92
+            </div>
93
+
94
+            <!-- 在线图片 -->
95
+            <div id="online" class="panel">
96
+                <div id="imageList"><var id="lang_imgLoading"></var></div>
97
+            </div>
98
+
99
+            <!-- 搜索图片 -->
100
+            <div id="search" class="panel">
101
+                <div class="searchBar">
102
+                    <input id="searchTxt" class="searchTxt text" type="text" />
103
+                    <select id="searchType" class="searchType">
104
+                        <option value="&s=4&z=0"></option>
105
+                        <option value="&s=1&z=19"></option>
106
+                        <option value="&s=2&z=0"></option>
107
+                        <option value="&s=3&z=0"></option>
108
+                    </select>
109
+                    <input id="searchReset" type="button"  />
110
+                    <input id="searchBtn" type="button"  />
111
+                </div>
112
+                <div id="searchList" class="searchList"><ul id="searchListUl"></ul></div>
113
+            </div>
114
+
115
+        </div>
116
+    </div>
117
+    <script type="text/javascript" src="image.js"></script>
118
+
119
+</body>
120
+</html>

File diff suppressed because it is too large
+ 1142 - 0
static/ueditor/dialogs/image/image.js


BIN
static/ueditor/dialogs/image/images/alignicon.jpg Vedi File


BIN
static/ueditor/dialogs/image/images/bg.png Vedi File


BIN
static/ueditor/dialogs/image/images/icons.gif Vedi File


BIN
static/ueditor/dialogs/image/images/icons.png Vedi File


BIN
static/ueditor/dialogs/image/images/image.png Vedi File


BIN
static/ueditor/dialogs/image/images/progress.png Vedi File


BIN
static/ueditor/dialogs/image/images/success.gif Vedi File


BIN
static/ueditor/dialogs/image/images/success.png Vedi File


+ 98 - 0
static/ueditor/dialogs/insertframe/insertframe.html Vedi File

@@ -0,0 +1,98 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5
+    <title></title>
6
+    <script type="text/javascript" src="../internal.js"></script>
7
+    <style type="text/css">
8
+        .warp {width: 320px;height: 153px;margin-left:5px;padding: 20px 0 0 15px;position: relative;}
9
+        #url {width: 290px; margin-bottom: 2px; margin-left: -6px; margin-left: -2px\9;*margin-left:0;_margin-left:0; }
10
+        .format span{display: inline-block; width: 58px;text-align: center; zoom:1;}
11
+        table td{padding:5px 0;}
12
+        #align{width: 65px;height: 23px;line-height: 22px;}
13
+    </style>
14
+</head>
15
+<body>
16
+<div class="warp">
17
+        <table width="300" cellpadding="0" cellspacing="0">
18
+            <tr>
19
+                <td colspan="2" class="format">
20
+                    <span><var id="lang_input_address"></var></span>
21
+                    <input style="width:200px" id="url" type="text" value=""/>
22
+                </td>
23
+            </tr>
24
+            <tr>
25
+                <td colspan="2" class="format"><span><var id="lang_input_width"></var></span><input style="width:200px" type="text" id="width"/> px</td>
26
+
27
+            </tr>
28
+            <tr>
29
+                <td colspan="2" class="format"><span><var id="lang_input_height"></var></span><input style="width:200px" type="text" id="height"/> px</td>
30
+            </tr>
31
+            <tr>
32
+                <td><span><var id="lang_input_isScroll"></var></span><input type="checkbox" id="scroll"/> </td>
33
+                <td><span><var id="lang_input_frameborder"></var></span><input type="checkbox" id="frameborder"/> </td>
34
+            </tr>
35
+
36
+            <tr>
37
+                <td colspan="2"><span><var id="lang_input_alignMode"></var></span>
38
+                    <select id="align">
39
+                        <option value=""></option>
40
+                        <option value="left"></option>
41
+                        <option value="right"></option>
42
+                    </select>
43
+                </td>
44
+            </tr>
45
+        </table>
46
+</div>
47
+<script type="text/javascript">
48
+    var iframe = editor._iframe;
49
+    if(iframe){
50
+        $G("url").value = iframe.getAttribute("src")||"";
51
+        $G("width").value = iframe.getAttribute("width")||iframe.style.width.replace("px","")||"";
52
+        $G("height").value = iframe.getAttribute("height") || iframe.style.height.replace("px","") ||"";
53
+        $G("scroll").checked = (iframe.getAttribute("scrolling") == "yes") ? true : false;
54
+        $G("frameborder").checked = (iframe.getAttribute("frameborder") == "1") ? true : false;
55
+        $G("align").value = iframe.align ? iframe.align : "";
56
+    }
57
+    function queding(){
58
+        var  url = $G("url").value.replace(/^\s*|\s*$/ig,""),
59
+                width = $G("width").value,
60
+                height = $G("height").value,
61
+                scroll = $G("scroll"),
62
+                frameborder = $G("frameborder"),
63
+                float = $G("align").value,
64
+                newIframe = editor.document.createElement("iframe"),
65
+                div;
66
+        if(!url){
67
+            alert(lang.enterAddress);
68
+            return false;
69
+        }
70
+        newIframe.setAttribute("src",/http:\/\/|https:\/\//ig.test(url) ? url : "http://"+url);
71
+        /^[1-9]+[.]?\d*$/g.test( width ) ? newIframe.setAttribute("width",width) : "";
72
+        /^[1-9]+[.]?\d*$/g.test( height ) ? newIframe.setAttribute("height",height) : "";
73
+        scroll.checked ?  newIframe.setAttribute("scrolling","yes") : newIframe.setAttribute("scrolling","no");
74
+        frameborder.checked ?  newIframe.setAttribute("frameborder","1",0) : newIframe.setAttribute("frameborder","0",0);
75
+        float ? newIframe.setAttribute("align",float) :  newIframe.setAttribute("align","");
76
+        if(iframe){
77
+            iframe.parentNode.insertBefore(newIframe,iframe);
78
+            domUtils.remove(iframe);
79
+        }else{
80
+            div = editor.document.createElement("div");
81
+            div.appendChild(newIframe);
82
+            editor.execCommand("inserthtml",div.innerHTML);
83
+        }
84
+        editor._iframe = null;
85
+        dialog.close();
86
+    }
87
+    dialog.onok = queding;
88
+    $G("url").onkeydown = function(evt){
89
+        evt = evt || event;
90
+        if(evt.keyCode == 13){
91
+            queding();
92
+        }
93
+    };
94
+    $focus($G( "url" ));
95
+
96
+</script>
97
+</body>
98
+</html>

+ 81 - 0
static/ueditor/dialogs/internal.js Vedi File

@@ -0,0 +1,81 @@
1
+(function () {
2
+    var parent = window.parent;
3
+    //dialog对象
4
+    dialog = parent.$EDITORUI[window.frameElement.id.replace( /_iframe$/, '' )];
5
+    //当前打开dialog的编辑器实例
6
+    editor = dialog.editor;
7
+
8
+    UE = parent.UE;
9
+
10
+    domUtils = UE.dom.domUtils;
11
+
12
+    utils = UE.utils;
13
+
14
+    browser = UE.browser;
15
+
16
+    ajax = UE.ajax;
17
+
18
+    $G = function ( id ) {
19
+        return document.getElementById( id )
20
+    };
21
+    //focus元素
22
+    $focus = function ( node ) {
23
+        setTimeout( function () {
24
+            if ( browser.ie ) {
25
+                var r = node.createTextRange();
26
+                r.collapse( false );
27
+                r.select();
28
+            } else {
29
+                node.focus()
30
+            }
31
+        }, 0 )
32
+    };
33
+    utils.loadFile(document,{
34
+        href:editor.options.themePath + editor.options.theme + "/dialogbase.css?cache="+Math.random(),
35
+        tag:"link",
36
+        type:"text/css",
37
+        rel:"stylesheet"
38
+    });
39
+    lang = editor.getLang(dialog.className.split( "-" )[2]);
40
+    if(lang){
41
+        domUtils.on(window,'load',function () {
42
+
43
+            var langImgPath = editor.options.langPath + editor.options.lang + "/images/";
44
+            //针对静态资源
45
+            for ( var i in lang["static"] ) {
46
+                var dom = $G( i );
47
+                if(!dom) continue;
48
+                var tagName = dom.tagName,
49
+                    content = lang["static"][i];
50
+                if(content.src){
51
+                    //clone
52
+                    content = utils.extend({},content,false);
53
+                    content.src = langImgPath + content.src;
54
+                }
55
+                if(content.style){
56
+                    content = utils.extend({},content,false);
57
+                    content.style = content.style.replace(/url\s*\(/g,"url(" + langImgPath)
58
+                }
59
+                switch ( tagName.toLowerCase() ) {
60
+                    case "var":
61
+                        dom.parentNode.replaceChild( document.createTextNode( content ), dom );
62
+                        break;
63
+                    case "select":
64
+                        var ops = dom.options;
65
+                        for ( var j = 0, oj; oj = ops[j]; ) {
66
+                            oj.innerHTML = content.options[j++];
67
+                        }
68
+                        for ( var p in content ) {
69
+                            p != "options" && dom.setAttribute( p, content[p] );
70
+                        }
71
+                        break;
72
+                    default :
73
+                        domUtils.setAttributes( dom, content);
74
+                }
75
+            }
76
+        } );
77
+    }
78
+
79
+
80
+})();
81
+

+ 126 - 0
static/ueditor/dialogs/link/link.html Vedi File

@@ -0,0 +1,126 @@
1
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
+        "http://www.w3.org/TR/html4/loose.dtd">
3
+<html>
4
+<head>
5
+    <title></title>
6
+    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
7
+    <script type="text/javascript" src="../internal.js"></script>
8
+    <style type="text/css">
9
+        *{margin:0;padding:0;color: #838383;}
10
+        table{font-size: 12px;margin: 10px;line-height: 30px}
11
+        .txt{width:300px;height:21px;line-height:21px;border:1px solid #d7d7d7;}
12
+    </style>
13
+</head>
14
+<body>
15
+    <table>
16
+        <tr>
17
+            <td><label for="text"> <var id="lang_input_text"></var></label></td>
18
+            <td><input class="txt" id="text" type="text" disabled="true"/></td>
19
+        </tr>
20
+        <tr>
21
+            <td><label for="href"> <var id="lang_input_url"></var></label></td>
22
+            <td><input class="txt" id="href" type="text" /></td>
23
+        </tr>
24
+        <tr>
25
+            <td><label for="title"> <var id="lang_input_title"></var></label></td>
26
+            <td><input class="txt" id="title" type="text"/></td>
27
+        </tr>
28
+        <tr>
29
+             <td colspan="2">
30
+                 <label for="target"><var id="lang_input_target"></var></label>
31
+                 <input id="target" type="checkbox"/>
32
+             </td>
33
+        </tr>
34
+        <tr>
35
+            <td colspan="2" id="msg"></td>
36
+        </tr>
37
+    </table>
38
+<script type="text/javascript">
39
+    var range = editor.selection.getRange(),
40
+        link = range.collapsed ? editor.queryCommandValue( "link" ) : editor.selection.getStart(),
41
+        url,
42
+        text = $G('text'),
43
+        rangeLink = domUtils.findParentByTagName(range.getCommonAncestor(),'a',true),
44
+        orgText;
45
+    link = domUtils.findParentByTagName( link, "a", true );
46
+    if(link){
47
+        url = utils.html(link.getAttribute( '_href' ) || link.getAttribute( 'href', 2 ));
48
+
49
+        if(rangeLink === link && !link.getElementsByTagName('img').length){
50
+            text.removeAttribute('disabled');
51
+            orgText = text.value = link[browser.ie ? 'innerText':'textContent'];
52
+        }else{
53
+            text.setAttribute('disabled','true');
54
+            text.value = lang.validLink;
55
+        }
56
+
57
+    }else{
58
+        if(range.collapsed){
59
+            text.removeAttribute('disabled');
60
+            text.value = '';
61
+        }else{
62
+            text.setAttribute('disabled','true');
63
+            text.value = lang.validLink;
64
+        }
65
+
66
+    }
67
+    $G("title").value = url ? link.title : "";
68
+    $G("href").value = url ? url: '';
69
+    $G("target").checked = url && link.target == "_blank" ? true :  false;
70
+    $focus($G("href"));
71
+
72
+    function handleDialogOk(){
73
+        var href =$G('href').value.replace(/^\s+|\s+$/g, '');
74
+        if(href){
75
+            if(!hrefStartWith(href,["http","/","ftp://",'#'])) {
76
+                href  = "http://" + href;
77
+            }
78
+            var obj = {
79
+                'href' : href,
80
+                'target' : $G("target").checked ? "_blank" : '_self',
81
+                'title' : $G("title").value.replace(/^\s+|\s+$/g, ''),
82
+                '_href':href
83
+            };
84
+            //修改链接内容的情况太特殊了,所以先做到这里了
85
+            //todo:情况多的时候,做到command里
86
+            if(orgText && text.value != orgText){
87
+                link[browser.ie ? 'innerText' : 'textContent'] =  obj.textValue = text.value;
88
+                range.selectNode(link).select()
89
+            }
90
+            if(range.collapsed){
91
+                obj.textValue = text.value;
92
+            }
93
+            editor.execCommand('link',utils.clearEmptyAttrs(obj) );
94
+            dialog.close();
95
+        }
96
+    }
97
+    dialog.onok = handleDialogOk;
98
+    $G('href').onkeydown = $G('title').onkeydown = function(evt){
99
+        evt = evt || window.event;
100
+        if (evt.keyCode == 13) {
101
+            handleDialogOk();
102
+            return false;
103
+        }
104
+    };
105
+    $G('href').onblur = function(){
106
+        if(!hrefStartWith(this.value,["http","/","ftp://",'#'])){
107
+            $G("msg").innerHTML = "<span style='color: red'>"+lang.httpPrompt+"</span>";
108
+        }else{
109
+            $G("msg").innerHTML = "";
110
+        }
111
+    };
112
+
113
+    function hrefStartWith(href,arr){
114
+        href = href.replace(/^\s+|\s+$/g, '');
115
+        for(var i=0,ai;ai=arr[i++];){
116
+            if(href.indexOf(ai)==0){
117
+                return true;
118
+            }
119
+        }
120
+        return false;
121
+    }
122
+
123
+
124
+</script>
125
+</body>
126
+</html>

+ 135 - 0
static/ueditor/dialogs/map/map.html Vedi File

@@ -0,0 +1,135 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+    <title></title>
6
+    <script type="text/javascript" src="../internal.js"></script>
7
+    <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.1&services=true"></script>
8
+    <style type="text/css">
9
+        .content{width:530px; height: 350px;margin: 10px auto;}
10
+        .content table{width: 100%}
11
+        .content table td{vertical-align: middle;}
12
+        #city,#address{height:21px;background: #FFF;border:1px solid #d7d7d7; line-height: 21px;}
13
+        #city{width:60px}
14
+        #address{width:130px}
15
+        #is_dynamic_label span{vertical-align:middle;margin: 3px 0px 3px 3px;}
16
+        #is_dynamic_label input{vertical-align:middle;margin: 3px 3px 3px 50px;}
17
+    </style>
18
+</head>
19
+<body>
20
+<div class="content">
21
+    <table>
22
+        <tr>
23
+            <td><var id="lang_city"></var>:</td>
24
+            <td><input id="city" type="text" /></td>
25
+            <td><var id="lang_address"></var>:</td>
26
+            <td><input id="address" type="text" value="" /></td>
27
+            <td><a href="javascript:doSearch()" class="button"><var id="lang_search"></var></a></td>
28
+            <td><label id="is_dynamic_label" for="is_dynamic"><input id="is_dynamic" type="checkbox" name="is_dynamic" /><span><var id="lang_dynamicmap"></var></span></label></td>
29
+        </tr>
30
+    </table>
31
+    <div style="width:100%;height:340px;margin:5px auto;border:1px solid gray" id="container"></div>
32
+
33
+</div>
34
+<script type="text/javascript">
35
+    var map = new BMap.Map("container"),marker,point,styleStr;
36
+    map.enableScrollWheelZoom();
37
+    map.enableContinuousZoom();
38
+    function doSearch(){
39
+        if (!document.getElementById('city').value) {
40
+            alert(lang.cityMsg);
41
+            return;
42
+        }
43
+        var search = new BMap.LocalSearch(document.getElementById('city').value, {
44
+            onSearchComplete: function (results){
45
+                if (results && results.getNumPois()) {
46
+                    var points = [];
47
+                    for (var i=0; i<results.getCurrentNumPois(); i++) {
48
+                        points.push(results.getPoi(i).point);
49
+                    }
50
+                    if (points.length > 1) {
51
+                        map.setViewport(points);
52
+                    } else {
53
+                        map.centerAndZoom(points[0], 13);
54
+                    }
55
+                    point = map.getCenter();
56
+                    marker.setPoint(point);
57
+                } else {
58
+                    alert(lang.errorMsg);
59
+                }
60
+            }
61
+        });
62
+        search.search(document.getElementById('address').value || document.getElementById('city').value);
63
+    }
64
+    //获得参数
65
+    function getPars(str,par){
66
+        var reg = new RegExp(par+"=((\\d+|[.,])*)","g");
67
+        return reg.exec(str)[1];
68
+    }
69
+    function init(){
70
+        var mapNode = editor.selection.getRange().getClosedNode(),
71
+            isMapImg = mapNode && /api[.]map[.]baidu[.]com/ig.test(mapNode.getAttribute("src")),
72
+            isMapIframe = mapNode && domUtils.hasClass(mapNode, 'ueditor_baidumap');
73
+        if(isMapImg || isMapIframe){
74
+            var url, centerPos, markerPos;
75
+            if(isMapIframe) {
76
+                url = decodeURIComponent(mapNode.getAttribute("src"));
77
+                $G('is_dynamic').checked = true;
78
+                styleStr = mapNode.style.cssText;
79
+            } else {
80
+                url = mapNode.getAttribute("src");
81
+                styleStr = mapNode.style.cssText;
82
+            }
83
+
84
+            centerPos = getPars(url,"center").split(",");
85
+            markerPos = getPars(url, "markers").split(",");
86
+            point = new BMap.Point(Number(centerPos[0]),Number(centerPos[1]));
87
+            marker = new BMap.Marker(new BMap.Point(Number(markerPos[0]), Number(markerPos[1])));
88
+            map.addControl(new BMap.NavigationControl());
89
+            map.centerAndZoom(point, Number(getPars(url,"zoom")));
90
+        }else{
91
+            point = new BMap.Point(116.404, 39.915);    // 创建点坐标
92
+            marker = new BMap.Marker(point);
93
+            map.addControl(new BMap.NavigationControl());
94
+            map.centerAndZoom(point, 10);                     // 初始化地图,设置中心点坐标和地图级别。
95
+        }
96
+        marker.enableDragging();
97
+        map.addOverlay(marker);
98
+    }
99
+    init();
100
+    document.getElementById('address').onkeydown = function (evt){
101
+        evt = evt || event;
102
+        if (evt.keyCode == 13) {
103
+            doSearch();
104
+        }
105
+    };
106
+    dialog.onok = function (){
107
+        var center = map.getCenter();
108
+        var zoom = map.zoomLevel;
109
+        var size = map.getSize();
110
+        var mapWidth = size.width;
111
+        var mapHeight = size.height;
112
+        var point = marker.getPoint();
113
+
114
+        if($G('is_dynamic').checked) {
115
+            var URL = editor.options.UEDITOR_HOME_URL,
116
+                url = [URL + (/\/$/.test(URL) ? '':'/') + "dialogs/map/show.html" +
117
+                    '#center=' + center.lng + ',' + center.lat,
118
+                    '&zoom=' + zoom,
119
+                    '&width=' + mapWidth,
120
+                    '&height=' + mapHeight,
121
+                    '&markers=' + point.lng + ',' + point.lat,
122
+                    '&markerStyles=' + 'l,A'].join('');
123
+            editor.execCommand('inserthtml', '<iframe class="ueditor_baidumap" src="' + url + '"' + (styleStr ? ' style="' + styleStr + '"' :'') + ' frameborder="0" width="' + (mapWidth+4) + '" height="' + (mapHeight+4) + '"></iframe>');
124
+        } else {
125
+            var url = "http://api.map.baidu.com/staticimage?center=" + center.lng + ',' + center.lat +
126
+                    "&zoom=" + zoom + "&width=" + size.width + '&height=' + size.height + "&markers=" + point.lng + ',' + point.lat;
127
+            editor.execCommand('inserthtml', '<img width="'+ size.width +'"height="'+ size.height +'" src="' + url + '"' + (styleStr ? ' style="' + styleStr + '"' :'') + '/>');
128
+        }
129
+    };
130
+    document.getElementById("address").focus();
131
+</script>
132
+
133
+
134
+</body>
135
+</html>

+ 118 - 0
static/ueditor/dialogs/map/show.html Vedi File

@@ -0,0 +1,118 @@
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+<html xmlns="http://www.w3.org/1999/xhtml">
4
+<head>
5
+    <meta charset="utf-8"/>
6
+    <meta name="keywords" content="百度地图,百度地图API,百度地图自定义工具,百度地图所见即所得工具"/>
7
+    <meta name="description" content="百度地图API自定义地图,帮助用户在可视化操作下生成百度地图"/>
8
+    <title>百度地图API自定义地图</title>
9
+    <!--引用百度地图API-->
10
+    <style type="text/css">
11
+        html, body {
12
+            margin: 0;
13
+            padding: 0;
14
+            overflow: hidden;
15
+        }
16
+    </style>
17
+    <script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script>
18
+</head>
19
+
20
+<body onload="initMap();">
21
+<!--百度地图容器-->
22
+<div style="width:697px;height:550px;border:#ccc solid 1px;" id="dituContent"></div>
23
+</body>
24
+<script type="text/javascript">
25
+    function getParam(name) {
26
+        return location.href.match(new RegExp('[?#&]' + name + '=([^?#&]+)', 'i')) ? RegExp.$1 : '';
27
+    }
28
+    var map, marker;
29
+    var centerParam = getParam('center');
30
+    var zoomParam = getParam('zoom');
31
+    var widthParam = getParam('width');
32
+    var heightParam = getParam('height');
33
+    var markersParam = getParam('markers');
34
+    var markerStylesParam = getParam('markerStyles');
35
+
36
+    //创建和初始化地图函数:
37
+    function initMap() {
38
+        // [FF]切换模式后报错
39
+        if (!window.BMap) {
40
+            return;
41
+        }
42
+        var dituContent = document.getElementById('dituContent');
43
+        dituContent.style.width = widthParam + 'px';
44
+        dituContent.style.height = heightParam + 'px';
45
+
46
+        createMap();//创建地图
47
+        setMapEvent();//设置地图事件
48
+        addMapControl();//向地图添加控件
49
+
50
+        // 创建标注
51
+        var markersArr = markersParam.split(',');
52
+        var point = new BMap.Point(markersArr[0], markersArr[1]);
53
+        marker = new BMap.Marker(point);
54
+        marker.enableDragging();
55
+        map.addOverlay(marker); // 将标注添加到地图中
56
+
57
+        if(parent.editor && parent.document.body.contentEditable=="true") { //在编辑状态下
58
+            setMapListener();//地图改变修改外层的iframe标签src属性
59
+        }
60
+    }
61
+
62
+    //创建地图函数:
63
+    function createMap() {
64
+        map = new BMap.Map("dituContent");//在百度地图容器中创建一个地图
65
+        var centerArr = centerParam.split(',');
66
+        var point = new BMap.Point(parseFloat(centerArr[0]), parseFloat(centerArr[1]));//定义一个中心点坐标
67
+        map.centerAndZoom(point, parseInt(zoomParam));//设定地图的中心点和坐标并将地图显示在地图容器中
68
+    }
69
+
70
+    //地图事件设置函数:
71
+    function setMapEvent() {
72
+        map.enableDragging();//启用地图拖拽事件,默认启用(可不写)
73
+        map.enableScrollWheelZoom();//启用地图滚轮放大缩小
74
+        map.enableDoubleClickZoom();//启用鼠标双击放大,默认启用(可不写)
75
+        map.enableKeyboard();//启用键盘上下左右键移动地图
76
+    }
77
+
78
+    //地图控件添加函数:
79
+    function addMapControl() {
80
+        //向地图中添加缩放控件
81
+        var ctrl_nav = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_LEFT, type: BMAP_NAVIGATION_CONTROL_LARGE});
82
+        map.addControl(ctrl_nav);
83
+        //向地图中添加缩略图控件
84
+        var ctrl_ove = new BMap.OverviewMapControl({anchor: BMAP_ANCHOR_BOTTOM_RIGHT, isOpen: 1});
85
+        map.addControl(ctrl_ove);
86
+        //向地图中添加比例尺控件
87
+        var ctrl_sca = new BMap.ScaleControl({anchor: BMAP_ANCHOR_BOTTOM_LEFT});
88
+        map.addControl(ctrl_sca);
89
+    }
90
+
91
+    function setMapListener() {
92
+        var editor = parent.editor, containerIframe,
93
+            iframes = parent.document.getElementsByTagName('iframe');
94
+        for (var key in iframes) {
95
+            if (iframes[key].contentWindow == window) {
96
+                containerIframe = iframes[key];
97
+                break;
98
+            }
99
+        }
100
+        if (containerIframe) {
101
+            map.addEventListener('moveend', mapListenerHandler);
102
+            map.addEventListener('zoomend', mapListenerHandler);
103
+            marker.addEventListener('dragend', mapListenerHandler);
104
+        }
105
+
106
+        function mapListenerHandler() {
107
+            var zoom = map.getZoom(),
108
+                center = map.getCenter(),
109
+                marker = window.marker.getPoint();
110
+            containerIframe.src = containerIframe.src.
111
+                replace(new RegExp('([?#&])center=([^?#&]+)', 'i'), '$1center=' + center.lng + ',' + center.lat).
112
+                replace(new RegExp('([?#&])markers=([^?#&]+)', 'i'), '$1markers=' + marker.lng + ',' + marker.lat).
113
+                replace(new RegExp('([?#&])zoom=([^?#&]+)', 'i'), '$1zoom=' + zoom);
114
+            editor.fireEvent('saveScene');
115
+        }
116
+    }
117
+</script>
118
+</html>

+ 30 - 0
static/ueditor/dialogs/music/music.css Vedi File

@@ -0,0 +1,30 @@
1
+.wrapper{margin: 5px 10px;}
2
+
3
+.searchBar{height:30px;padding:7px 0 3px;text-align:center;}
4
+.searchBtn{font-size:13px;height:24px;}
5
+
6
+.resultBar{width:460px;margin:5px auto;border: 1px solid #CCC;border-radius: 5px;box-shadow: 2px 2px 5px #D3D6DA;overflow: hidden;}
7
+
8
+.listPanel{overflow: hidden;}
9
+.panelon{display:block;}
10
+.paneloff{display:none}
11
+
12
+.page{width:220px;margin:20px auto;overflow: hidden;}
13
+.pageon{float:right;width:24px;line-height:24px;height:24px;margin-right: 5px;background: none;border: none;color: #000;font-weight: bold;text-align:center}
14
+.pageoff{float:right;width:24px;line-height:24px;height:24px;cursor:pointer;background-color: #fff;
15
+   border: 1px solid #E7ECF0;color: #2D64B3;margin-right: 5px;text-decoration: none;text-align:center;}
16
+
17
+.m-box{width:460px;}
18
+.m-m{float: left;line-height: 20px;height: 20px;}
19
+.m-h{height:24px;line-height:24px;padding-left: 46px;background-color:#FAFAFA;border-bottom: 1px solid #DAD8D8;font-weight: bold;font-size: 12px;color: #333;}
20
+.m-l{float:left;width:40px; }
21
+.m-t{float:left;width:140px;}
22
+.m-s{float:left;width:110px;}
23
+.m-z{float:left;width:100px;}
24
+.m-try-t{float: left;width: 60px;;}
25
+
26
+.m-try{float:left;width:20px;height:20px;background:url('http://static.tieba.baidu.com/tb/editor/images/try_music.gif') no-repeat ;}
27
+.m-trying{float:left;width:20px;height:20px;background:url('http://static.tieba.baidu.com/tb/editor/images/stop_music.gif') no-repeat ;}
28
+
29
+.loading{width:95px;height:7px;font-size:7px;margin:60px auto;background:url(http://static.tieba.baidu.com/tb/editor/images/loading.gif) no-repeat}
30
+.empty{width:300px;height:40px;padding:2px;margin:50px auto;line-height:40px; color:#006699;text-align:center;}

+ 32 - 0
static/ueditor/dialogs/music/music.html Vedi File

@@ -0,0 +1,32 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+    <meta http-equiv="content-type" content="text/html; charset=utf-8">
5
+    <title>插入音乐</title>
6
+    <script type="text/javascript" src="../internal.js"></script>
7
+    <link rel="stylesheet" type="text/css" href="music.css">
8
+</head>
9
+<body>
10
+<div class="wrapper">
11
+    <div class="searchBar">
12
+        <input id="J_searchName" type="text"/>
13
+        <input type="button" class="searchBtn" id="J_searchBtn">
14
+    </div>
15
+    <div class="resultBar" id="J_resultBar">
16
+        <div class="loading" style="display:none"></div>
17
+        <div class="empty"><var id="lang_input_tips"></var></div>
18
+    </div>
19
+    <div id="J_preview"></div>
20
+</div>
21
+<script type="text/javascript" src="music.js"></script>
22
+<script type="text/javascript">
23
+    var music = new Music;
24
+    dialog.onok = function () {
25
+        music.exec();
26
+    };
27
+    dialog.oncancel = function () {
28
+        $G('J_preview').innerHTML = "";
29
+    };
30
+</script>
31
+</body>
32
+</html>

+ 192 - 0
static/ueditor/dialogs/music/music.js Vedi File

@@ -0,0 +1,192 @@
1
+function Music() {
2
+    this.init();
3
+}
4
+(function () {
5
+    var pages = [],
6
+        panels = [],
7
+        selectedItem = null;
8
+    Music.prototype = {
9
+        total:70,
10
+        pageSize:10,
11
+        dataUrl:"http://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.search.common",
12
+        playerUrl:"http://box.baidu.com/widget/flash/bdspacesong.swf",
13
+
14
+        init:function () {
15
+            var me = this;
16
+            domUtils.on($G("J_searchName"), "keyup", function (event) {
17
+                var e = window.event || event;
18
+                if (e.keyCode == 13) {
19
+                    me.dosearch();
20
+                }
21
+            });
22
+            domUtils.on($G("J_searchBtn"), "click", function () {
23
+                me.dosearch();
24
+            });
25
+        },
26
+        callback:function (data) {
27
+            var me = this;
28
+            me.data = data.song_list;
29
+            setTimeout(function () {
30
+                $G('J_resultBar').innerHTML = me._renderTemplate(data.song_list);
31
+            }, 300);
32
+        },
33
+        dosearch:function () {
34
+            var me = this;
35
+            selectedItem = null;
36
+            var key = $G('J_searchName').value;
37
+            if (utils.trim(key) == "")return false;
38
+            key = encodeURIComponent(key);
39
+            me._sent(key);
40
+        },
41
+        doselect:function (i) {
42
+            var me = this;
43
+            if (typeof i == 'object') {
44
+                selectedItem = i;
45
+            } else if (typeof i == 'number') {
46
+                selectedItem = me.data[i];
47
+            }
48
+        },
49
+        onpageclick:function (id) {
50
+            var me = this;
51
+            for (var i = 0; i < pages.length; i++) {
52
+                $G(pages[i]).className = 'pageoff';
53
+                $G(panels[i]).className = 'paneloff';
54
+            }
55
+            $G('page' + id).className = 'pageon';
56
+            $G('panel' + id).className = 'panelon';
57
+        },
58
+        listenTest:function (elem) {
59
+            var me = this,
60
+                view = $G('J_preview'),
61
+                is_play_action = (elem.className == 'm-try'),
62
+                old_trying = me._getTryingElem();
63
+
64
+            if (old_trying) {
65
+                old_trying.className = 'm-try';
66
+                view.innerHTML = '';
67
+            }
68
+            if (is_play_action) {
69
+                elem.className = 'm-trying';
70
+                view.innerHTML = me._buildMusicHtml(me._getUrl(true));
71
+            }
72
+        },
73
+        _sent:function (param) {
74
+            var me = this;
75
+            $G('J_resultBar').innerHTML = '<div class="loading"></div>';
76
+
77
+            utils.loadFile(document, {
78
+                src:me.dataUrl + '&query=' + param + '&page_size=' + me.total + '&callback=music.callback&.r=' + Math.random(),
79
+                tag:"script",
80
+                type:"text/javascript",
81
+                defer:"defer"
82
+            });
83
+        },
84
+        _removeHtml:function (str) {
85
+            var reg = /<\s*\/?\s*[^>]*\s*>/gi;
86
+            return str.replace(reg, "");
87
+        },
88
+        _getUrl:function (isTryListen) {
89
+            var me = this;
90
+            var param = 'from=tiebasongwidget&url=&name=' + encodeURIComponent(me._removeHtml(selectedItem.title)) + '&artist='
91
+                + encodeURIComponent(me._removeHtml(selectedItem.author)) + '&extra='
92
+                + encodeURIComponent(me._removeHtml(selectedItem.album_title))
93
+                + '&autoPlay='+isTryListen+'' + '&loop=true';
94
+            return  me.playerUrl + "?" + param;
95
+        },
96
+        _getTryingElem:function () {
97
+            var s = $G('J_listPanel').getElementsByTagName('span');
98
+
99
+            for (var i = 0; i < s.length; i++) {
100
+                if (s[i].className == 'm-trying')
101
+                    return s[i];
102
+            }
103
+            return null;
104
+        },
105
+        _buildMusicHtml:function (playerUrl) {
106
+            var html = '<embed class="BDE_try_Music" allowfullscreen="false" pluginspage="http://www.macromedia.com/go/getflashplayer"';
107
+            html += ' src="' + playerUrl + '"';
108
+            html += ' width="1" height="1" style="position:absolute;left:-2000px;"';
109
+            html += ' type="application/x-shockwave-flash" wmode="transparent" play="true" loop="false"';
110
+            html += ' menu="false" allowscriptaccess="never" scale="noborder">';
111
+            return html;
112
+        },
113
+        _byteLength:function (str) {
114
+            return str.replace(/[^\u0000-\u007f]/g, "\u0061\u0061").length;
115
+        },
116
+        _getMaxText:function (s) {
117
+            var me = this;
118
+            s = me._removeHtml(s);
119
+            if (me._byteLength(s) > 12)
120
+                return s.substring(0, 5) + '...';
121
+            if (!s) s = "&nbsp;";
122
+            return s;
123
+        },
124
+        _rebuildData:function (data) {
125
+            var me = this,
126
+                newData = [],
127
+                d = me.pageSize,
128
+                itembox;
129
+            for (var i = 0; i < data.length; i++) {
130
+                if ((i + d) % d == 0) {
131
+                    itembox = [];
132
+                    newData.push(itembox)
133
+                }
134
+                itembox.push(data[i]);
135
+            }
136
+            return newData;
137
+        },
138
+        _renderTemplate:function (data) {
139
+            var me = this;
140
+            if (data.length == 0)return '<div class="empty">' + lang.emptyTxt + '</div>';
141
+            data = me._rebuildData(data);
142
+            var s = [], p = [], t = [];
143
+            s.push('<div id="J_listPanel" class="listPanel">');
144
+            p.push('<div class="page">');
145
+            for (var i = 0, tmpList; tmpList = data[i++];) {
146
+                panels.push('panel' + i);
147
+                pages.push('page' + i);
148
+                if (i == 1) {
149
+                    s.push('<div id="panel' + i + '" class="panelon">');
150
+                    if (data.length != 1) {
151
+                        t.push('<div id="page' + i + '" onclick="music.onpageclick(' + i + ')" class="pageon">' + (i ) + '</div>');
152
+                    }
153
+                } else {
154
+                    s.push('<div id="panel' + i + '" class="paneloff">');
155
+                    t.push('<div id="page' + i + '" onclick="music.onpageclick(' + i + ')" class="pageoff">' + (i ) + '</div>');
156
+                }
157
+                s.push('<div class="m-box">');
158
+                s.push('<div class="m-h"><span class="m-t">' + lang.chapter + '</span><span class="m-s">' + lang.singer
159
+                    + '</span><span class="m-z">' + lang.special + '</span><span class="m-try-t">' + lang.listenTest + '</span></div>');
160
+                for (var j = 0, tmpObj; tmpObj = tmpList[j++];) {
161
+                    s.push('<label for="radio-' + i + '-' + j + '" class="m-m">');
162
+                    s.push('<input type="radio" id="radio-' + i + '-' + j + '" name="musicId" class="m-l" onclick="music.doselect(' + (me.pageSize * (i-1) + (j-1)) + ')"/>');
163
+                    s.push('<span class="m-t">' + me._getMaxText(tmpObj.title) + '</span>');
164
+                    s.push('<span class="m-s">' + me._getMaxText(tmpObj.author) + '</span>');
165
+                    s.push('<span class="m-z">' + me._getMaxText(tmpObj.album_title) + '</span>');
166
+                    s.push('<span class="m-try" onclick="music.doselect(' + (me.pageSize * (i-1) + (j-1)) + ');music.listenTest(this)"></span>');
167
+                    s.push('</label>');
168
+                }
169
+                s.push('</div>');
170
+                s.push('</div>');
171
+            }
172
+            t.reverse();
173
+            p.push(t.join(''));
174
+            s.push('</div>');
175
+            p.push('</div>');
176
+            return s.join('') + p.join('');
177
+        },
178
+        exec:function () {
179
+            var me = this;
180
+            if (selectedItem == null)   return;
181
+            $G('J_preview').innerHTML = "";
182
+            editor.execCommand('music', {
183
+                url:me._getUrl(false),
184
+                width:400,
185
+                height:95
186
+            });
187
+        }
188
+    };
189
+})();
190
+
191
+
192
+

+ 40 - 0
static/ueditor/dialogs/preview/preview.html Vedi File

@@ -0,0 +1,40 @@
1
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
+    "http://www.w3.org/TR/html4/loose.dtd">
3
+<html>
4
+    <head>
5
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+        <style>
7
+            html,body{
8
+                height:100%;
9
+                width:100%;
10
+                padding:0;
11
+                margin:0;
12
+            }
13
+            #preview{
14
+                width:100%;
15
+                height:100%;
16
+                padding:0;
17
+                margin:0;
18
+            }
19
+            #preview *{font-family:sans-serif;font-size:16px;}
20
+        </style>
21
+        <script type="text/javascript" src="../internal.js"></script>
22
+        <script src="../../ueditor.parse.js"></script>
23
+        <title></title>
24
+    </head>
25
+    <body class="view">
26
+        <div id="preview" style="margin:8px">
27
+
28
+        </div>
29
+    </body>
30
+    <script>
31
+        document.getElementById('preview').innerHTML = editor.getContent();
32
+        uParse('#preview',{
33
+            rootPath : '../../',
34
+            chartContainerHeight:500
35
+        })
36
+        dialog.oncancel = function(){
37
+            document.getElementById('preview').innerHTML = '';
38
+        }
39
+    </script>
40
+</html>

BIN
static/ueditor/dialogs/scrawl/images/addimg.png Vedi File


BIN
static/ueditor/dialogs/scrawl/images/brush.png Vedi File


BIN
static/ueditor/dialogs/scrawl/images/delimg.png Vedi File


BIN
static/ueditor/dialogs/scrawl/images/delimgH.png Vedi File


+ 0 - 0
static/ueditor/dialogs/scrawl/images/empty.png Vedi File


Some files were not shown because too many files changed in this diff