safecheck-client 3.0.34-1 → 3.0.34-100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/package.json +1 -1
  2. package/src/App-/345/215/225/351/241/265/351/235/242/346/211/223/345/214/205/347/224/250.vue +55 -0
  3. package/src/assets/123.png +0 -0
  4. package/src/assets/f8632d3c8c4c1cb68e99da754cab1a7.png +0 -0
  5. package/src/components/LoadData.vue +62 -0
  6. package/src/components/NewDefectList/DefectListNew.vue +1 -0
  7. package/src/components/android/AddPlanItemYy.vue +451 -0
  8. package/src/components/android/AndroidDefectDeal.vue +1 -0
  9. package/src/components/android/AndroidDefectDealBeforeSafe.vue +502 -0
  10. package/src/components/android/AreaPlan.vue +1 -7
  11. package/src/components/android/AreaSelect.vue +198 -0
  12. package/src/components/android/BuildingSelect.vue +192 -0
  13. package/src/components/android/CheckPlanSelect.vue +229 -0
  14. package/src/components/android/CurrentCreateYy.vue +1051 -0
  15. package/src/components/android/ImgSelfAndroid.vue +181 -181
  16. package/src/components/android/PaperFeedback.vue +34 -1
  17. package/src/components/android/PaperFeedbackTemp.vue +1 -1
  18. package/src/components/android/QRCode/QRCodeBinding.vue +300 -0
  19. package/src/components/android/QRCode/QRCodePage.vue +212 -0
  20. package/src/components/android/SafecheckDevices.vue +4 -4
  21. package/src/components/android/SafecheckDevicesTemp.vue +1 -1
  22. package/src/components/android/SafecheckOrderV.vue +8 -12
  23. package/src/components/android/UserinfoSelect.vue +714 -0
  24. package/src/components/android/examples/410.png +0 -0
  25. package/src/components/android/examples/SafeListExamples.vue +296 -0
  26. package/src/components/android/examples/UserExamples.vue +137 -0
  27. package/src/components/android/examples/ViewDetailsExamples.vue +1235 -0
  28. package/src/components/android/examples/touxiang.png +0 -0
  29. package/src/components/android/userinfo/SafecheckUserInfo.vue +1 -1
  30. package/src/components/pc/SafeVisitInfo.vue +261 -0
  31. package/src/components/rongcheng/AddPlanItem.vue +8 -0
  32. package/src/components/rongcheng/AspiratedAreaPlan.vue +574 -464
  33. package/src/components/rongcheng/AspiratedUserInfo.vue +1 -1
  34. package/src/components/rongcheng/CheckSearchUser.vue +46 -16
  35. package/src/components/rongcheng/PaperStatem.vue +6 -1
  36. package/src/components/rongcheng/PhoneDevicesInfo.vue +16 -1
  37. package/src/components/rongcheng/PhoneUpUserinfo.vue +1236 -1328
  38. package/src/components/rongcheng/SafecheckOrderV.vue +12 -3
  39. package/src/components/rongcheng/SafecheckOrderVCli.vue +9 -0
  40. package/src/filiale/baiyin/android/AndroidDefectDeal.vue +633 -633
  41. package/src/filiale/baiyin/android/SafecheckOrderV.vue +2785 -0
  42. package/src/filiale/baiyin/android.js +11 -10
  43. package/src/filiale/baiyin/pc/CheckPlanAreaList.vue +485 -485
  44. package/src/filiale/baiyin/pc/CheckSearchUser.vue +1067 -1067
  45. package/src/filiale/baiyin/pc/DefectListNew.vue +597 -597
  46. package/src/filiale/baiyin/pc/DefectMainNew.vue +63 -63
  47. package/src/filiale/baiyin/pc/DefectPaperNew.vue +1052 -1052
  48. package/src/filiale/baiyin/pc/PaperList.vue +790 -790
  49. package/src/filiale/baiyin/pc/PlanChooser.vue +167 -167
  50. package/src/filiale/baiyin/pc/PlanManage.vue +834 -834
  51. package/src/filiale/baiyin/pc/RightTreeSafe.vue +348 -348
  52. package/src/filiale/baiyin/pc/RoleSelector.vue +160 -160
  53. package/src/filiale/bayan/android/AddPlanItem.vue +8 -0
  54. package/src/filiale/bayan/android/PaperFeedback.vue +68 -50
  55. package/src/filiale/bayan/android/PhoneUpUserinfo.vue +40 -40
  56. package/src/filiale/bayan/android/SafecheckDevices.vue +1 -1
  57. package/src/filiale/bayan/android/SafecheckOrderV.vue +58 -58
  58. package/src/filiale/bayan/android/SafecheckUserInfo.vue +6 -1
  59. package/src/filiale/bayan/pc/NewCheckpaper.vue +50 -46
  60. package/src/filiale/bayan/pc/PaperList.vue +1 -0
  61. package/src/filiale/dexin/android/SafecheckDevices.vue +1 -1
  62. package/src/filiale/fugou/pc/CheckBookSearchUser.vue +35 -15
  63. package/src/filiale/hanzhong/android/PaperFeedback.vue +1 -1
  64. package/src/filiale/hanzhong/android/SafecheckDevices.vue +1 -1
  65. package/src/filiale/hanzhong/android/SafecheckUserInfo.vue +1 -1
  66. package/src/filiale/huaran/android/SafecheckOrderV.vue +2803 -0
  67. package/src/filiale/huaran/android.js +12 -0
  68. package/src/filiale/huaran/pc/CheckBook.vue +313 -0
  69. package/src/filiale/huaran/pc/CheckBookAll.vue +69 -0
  70. package/src/filiale/huaran/pc/CheckBookArea.vue +170 -0
  71. package/src/filiale/huaran/pc/CheckBookCompany.vue +166 -0
  72. package/src/filiale/huaran/pc/CheckBookDetails.vue +196 -0
  73. package/src/filiale/huaran/pc/CheckBookEntry.vue +61 -0
  74. package/src/filiale/huaran/pc/CheckBookList.vue +386 -0
  75. package/src/filiale/huaran/pc/CheckBookSearchArea.vue +564 -0
  76. package/src/filiale/huaran/pc/CheckBookSearchUnit.vue +229 -0
  77. package/src/filiale/huaran/pc/CheckBookSearchUser.vue +604 -0
  78. package/src/filiale/huaran/pc/CheckBookUser.vue +112 -0
  79. package/src/filiale/huaran/pc/PaperList.vue +822 -0
  80. package/src/filiale/huaran/pc/PlanManage.vue +887 -0
  81. package/src/filiale/huaran/pc/checkPlanList.vue +419 -0
  82. package/src/filiale/huaran/pc/checkUserList.vue +867 -0
  83. package/src/filiale/huaran/pc.js +27 -0
  84. package/src/filiale/jiaxian/android/AddPlanItem.vue +447 -0
  85. package/src/filiale/jiaxian/android/PhoneUpUserinfo.vue +1229 -0
  86. package/src/filiale/jiaxian/android/SafecheckDevices.vue +1298 -1298
  87. package/src/filiale/jiaxian/android/SafecheckOrderV.vue +2807 -0
  88. package/src/filiale/jiaxian/android/SafecheckUserInfo.vue +784 -0
  89. package/src/filiale/jiaxian/android.js +14 -10
  90. package/src/filiale/jiaxian/pc.js +12 -12
  91. package/src/filiale/jingyang/android/PaperFeedback.vue +1 -1
  92. package/src/filiale/jingyang/android/SafecheckUserInfo.vue +1 -1
  93. package/src/filiale/kelai/pc/CheckPlanAreaList.vue +15 -7
  94. package/src/filiale/pingxiang/android/PaperFeedback.vue +1 -1
  95. package/src/filiale/qianneng/android/SafecheckOrderV.vue +1 -1
  96. package/src/filiale/qingjian/android/PhoneUpUserinfo.vue +1270 -1270
  97. package/src/filiale/qingjian/android/SafecheckDevices.vue +1 -1
  98. package/src/filiale/qingjian/android/SafecheckOrderV.vue +2844 -2844
  99. package/src/filiale/qingjian/android/SafecheckUserInfo.vue +1 -1
  100. package/src/filiale/qingtongxia/android/AddPlanItem.vue +450 -0
  101. package/src/filiale/qingtongxia/android/CurrentCreate.vue +1053 -0
  102. package/src/filiale/qingtongxia/android/PhoneUpUserinfo.vue +1230 -0
  103. package/src/filiale/qingtongxia/android/SafecheckUserInfo.vue +782 -0
  104. package/src/filiale/qingtongxia/android.js +4 -0
  105. package/src/filiale/ruihua/android/SafecheckOrderV.vue +2747 -0
  106. package/src/filiale/ruihua/android/SafecheckUserInfo.vue +804 -0
  107. package/src/filiale/ruihua/android.js +11 -0
  108. package/src/filiale/shanxian/android/AddPlanItem.vue +447 -0
  109. package/src/filiale/shanxian/android/SafecheckOrderV.vue +1 -1
  110. package/src/filiale/shanxian/android.js +1 -0
  111. package/src/filiale/shanxian/pc/PaperList.vue +785 -0
  112. package/src/filiale/shanxian/pc/checkUserList.vue +4 -4
  113. package/src/filiale/shanxian/pc.js +2 -2
  114. package/src/filiale/shiquan/android/SafecheckDevices.vue +1 -1
  115. package/src/filiale/siyang/android/AddPlanItem.vue +450 -0
  116. package/src/filiale/siyang/android/AppCheckPlan.vue +246 -0
  117. package/src/filiale/siyang/android/CurrentCreate.vue +1051 -0
  118. package/src/filiale/siyang/android/SafecheckUserInfo.vue +1 -1
  119. package/src/filiale/siyang/android.js +4 -0
  120. package/src/filiale/siyang/pc/CheckBookList.vue +396 -0
  121. package/src/filiale/siyang/pc/CheckBookSearchArea.vue +667 -0
  122. package/src/filiale/siyang/pc/CheckPlanAreaList.vue +512 -0
  123. package/src/filiale/siyang/pc/CheckSearchUser.vue +1035 -0
  124. package/src/filiale/siyang/pc/HiddenSituation.vue +167 -0
  125. package/src/filiale/siyang/pc/checkPlanList.vue +367 -0
  126. package/src/filiale/siyang/pc/checkUserList.vue +22 -18
  127. package/src/filiale/siyang/pc.js +6 -0
  128. package/src/filiale/tongchuan/android/SafecheckDevices.vue +2 -2
  129. package/src/filiale/tongchuan/android/Select.vue +421 -0
  130. package/src/filiale/tongchuan/android.js +1 -0
  131. package/src/filiale/tongchuan/pc/CheckPlanCountChartArea.vue +3 -1
  132. package/src/filiale/tongchuan/pc/DefectPaperWeiXiu.vue +6 -2
  133. package/src/filiale/tongchuan/pc/HiddenSituation.vue +3 -1
  134. package/src/filiale/tongchuan/pc/NewCheckpaper.vue +13 -22
  135. package/src/filiale/tongchuan/pc/PaperDefectMain.vue +1 -1
  136. package/src/filiale/tongchuan/pc/SelectCheckPlan.vue +5 -2
  137. package/src/filiale/tongchuan/pc/checkUserList.vue +30 -0
  138. package/src/filiale/tongchuan/utils/EventListener.js +29 -0
  139. package/src/filiale/tongchuan/utils/coerceBoolean.js +7 -0
  140. package/src/filiale/weinan/android/SafecheckDevices.vue +1 -1
  141. package/src/filiale/weinan/android/SafecheckOrderV.vue +6 -2
  142. package/src/filiale/weinan/pc/CheckBookSearchUserList.vue +75 -62
  143. package/src/filiale/weinan/pc/CheckDetail.vue +11 -11
  144. package/src/filiale/weinan/pc/DefectPaperNew.vue +31 -0
  145. package/src/filiale/weinan/pc/DeviceChange.vue +1088 -0
  146. package/src/filiale/weinan/pc/checkUserList.vue +49 -113
  147. package/src/filiale/weinan/pc.js +1 -0
  148. package/src/filiale/wuan/android/SafecheckOrderV.vue +5 -1
  149. package/src/filiale/wuan/android/SafecheckUserInfo.vue +10 -5
  150. package/src/filiale/xilan/android/AddPlanItem.vue +457 -0
  151. package/src/filiale/xilan/android/CurrentCreate.vue +1063 -0
  152. package/src/filiale/xilan/android.js +11 -0
  153. package/src/filiale/xilan/pc/checkUserList.vue +772 -0
  154. package/src/filiale/xilan/pc.js +12 -0
  155. package/src/filiale/yangchunboneng/android/CurrentCreate.vue +8 -11
  156. package/src/filiale/yangchunboneng/android/DailyworkloadQuery.vue +8 -13
  157. package/src/filiale/yangchunboneng/android/NewCheckpaperAndroid.vue +1362 -1362
  158. package/src/filiale/yangchunboneng/android/PaperFeedback.vue +1731 -1731
  159. package/src/filiale/yangchunboneng/android/PhoneUpUserinfo.vue +1235 -1235
  160. package/src/filiale/yangchunboneng/android/SafecheckDevices.vue +1336 -1332
  161. package/src/filiale/yangchunboneng/android/SafecheckOrderV.vue +2865 -2845
  162. package/src/filiale/yangchunboneng/android/SafecheckUserInfo.vue +887 -887
  163. package/src/filiale/yangchunboneng/android/safeHistoryLook.vue +8 -13
  164. package/src/filiale/yangchunboneng/pc/CheckBookSearchUser.vue +23 -11
  165. package/src/filiale/yangchunboneng/pc/CheckBookUser.vue +9 -9
  166. package/src/filiale/yangchunboneng/pc/CheckPlanAreaList.vue +96 -30
  167. package/src/filiale/yangchunboneng/pc/CheckSearchUser.vue +1192 -1192
  168. package/src/filiale/yangchunboneng/pc/DefectPaperNew.vue +54 -3
  169. package/src/filiale/yangchunboneng/pc/PaperDefectMain.vue +1046 -944
  170. package/src/filiale/yangchunboneng/pc/PaperList.vue +29 -0
  171. package/src/filiale/yongzhou/android/PaperFeedback.vue +1 -1
  172. package/src/filiale/yongzhou/android/SafecheckDevices.vue +1 -1
  173. package/src/filiale/yongzhou/android/SafecheckUserInfo.vue +1 -1
  174. package/src/filiale/yuansheng/android/SafecheckDevices.vue +11 -1
  175. package/src/filiale/yuansheng/pc/NewCheckpaper.vue +10 -2
  176. package/src/filiale/yunchengminsheng/android/PaperFeedback.vue +1 -1
  177. package/src/filiale/yunchengminsheng/android/SafecheckDevices.vue +1 -1
  178. package/src/filiale/yunchengminsheng/android/SafecheckUserInfo.vue +1 -1
  179. package/src/main-/345/215/225/351/241/265/351/235/242/346/211/223/345/214/205/347/224/250.js +24 -0
  180. package/src/main.js +33 -33
  181. package/src/safecheck-android.js +307 -296
  182. package/src/safecheck-page.js +12 -0
  183. package/src/safecheck.js +3 -0
@@ -1,348 +1,348 @@
1
- <template>
2
- <dropdown :model='model' class="auto" id="res-tree" v-if="!islist" v-el:dropdown :style="{width:width}">
3
- <button type="button" class="btn btn-default dropdown-toggle select-style" data-toggle="dropdown" style="width: 100%">
4
- <span class='btn-content' :style="{textOverflow:'ellipsis',overflow: 'hidden'}">{{ orgnames }}</span>
5
- <span class="caret"></span>
6
- </button>
7
- <div class="dropdown-menu auto" style="width:auto;max-height: 500px;overflow: auto" >
8
- <input type="text" placeholder="Search"
9
- placeholder='请输入'
10
- slot="dropdown-menu"
11
- v-model="searchText"
12
- class="form-control" autocomplete="off"
13
- @keydown.enter="buluer(searchText)">
14
- <tree :filter="strsign" :model='model' v-ref:tree :is-click="false" role="menu">
15
- <span partial>
16
- <span class="glyphicon glyphicon-chevron-down" v-show="row.open&&row.data.children.length>0" style="color:balck;"></span>
17
- <span class="glyphicon glyphicon-chevron-right" v-show="!row.open&&row.data.children.length>0" style="color:balck;"></span>
18
- <span class="RightTreeCanSelect" v-if="row.data.hasright" @click.stop="$parent.$parent.$parent.selectclick(row.data)">{{row.data.name}}</span>
19
- <span class="RightTreeCanNotSelect" v-else>{{row.data.name}}</span>
20
- <span class="glyphicon glyphicon-ok " v-if="$parent.$parent.$parent.isSelect(row.data.id)" style="color:balck;"></span>
21
- </span>
22
- </tree>
23
- </div>
24
-
25
- </dropdown>
26
- <v-select v-if="islist"
27
- placeholder='请选择'
28
- :options='childrenOptions'
29
- @change="selectclick"
30
- :value-single="true"
31
- close-on-select></v-select>
32
- </template>
33
- <script>
34
- import Vue from 'vue';
35
- import co from 'co'
36
- import { PagedList, HttpResetClass } from 'vue-client'
37
- import * as ldapHelper from '../../../utils/LdapHelper'
38
- let saveGen = function * (self) {
39
- //获取分公司树
40
- let data = {
41
- source: self.source,
42
- userid: self.userid
43
- }
44
- // if(self.$treeorg==null || (self.$treeorg!=null&&self.$treeorg.length==0)){
45
- let http = new HttpResetClass()
46
- let ret = yield http.load('POST', `${self.Url}/rs/search`, data, {resolveMsg: null, rejectMsg: null})
47
- // 去掉前面的两层节点
48
- ret.data[0].children[0].children.forEach((item) => {
49
- self.model.push(item)
50
- })
51
- Vue.$treeorg = Vue.prototype.$treeorg = self.model;
52
- // }
53
- //if(self.$treeorg!=null){
54
- // self.model = self.$treeorg;
55
- //}
56
- // 给资源添加父关系
57
- ldapHelper.procParent(self.model)
58
- // 树转列
59
- // if (self.islist) {
60
- // self.treetoList(self.model)
61
- // }
62
- if(self.initresid.length>0){
63
- if(self.initresid[0] == ''){
64
- self.initresid[0] = self.$login.f.f_orgids.substring(0,this.$login.f.f_orgids.length-1);
65
- }
66
- }else{
67
- self.initresid = [];
68
- self.initresid[0] = self.$login.f.f_orgids.substring(0,this.$login.f.f_orgids.length-1);
69
- }
70
- if(self.initresid&&self.initresid.length>0){
71
- self.isselect = false;
72
- self.initTreetoList(self.model)
73
- self.initregion(self.childrenOptions)
74
- self.childrenOptions.forEach((item) => {
75
- if(item.id == null && item.value !=null ){
76
- item = item.value
77
- }
78
- if(item.id==self.initresid[0]){
79
- //默认加载如果已选中的和传入参数相等会取消选择,这种操作不应该被允许
80
- if(self.orgids==item.id){
81
- self.initdataone(item);
82
- return;
83
- }
84
- self.selectclick(item);
85
- self.isselect = true;
86
- return;
87
- }
88
- })
89
- //如果没有找到公司,说明是选择的是大区
90
- if(!self.isselect){
91
- self.childrenregionOption.forEach((item) => {
92
- if(item.id == null && item.value !=null ){
93
- item = item.value;
94
- }
95
- if(item.id==self.initresid[0]){
96
- //默认加载如果已选中的和传入参数相等会取消选择,这种操作不应该被允许
97
- if(self.orgids==item.id){
98
- self.initdataone(item);
99
- return;
100
- }
101
- self.selectclick(item);
102
- return;
103
- }
104
- })
105
- }
106
- }
107
- //self.selectRes()
108
- }
109
- export default {
110
- title: '资源树',
111
- props: {
112
- searchText:'',
113
- strsign:'',
114
- source: {
115
- type: String,
116
- require: true,
117
- default:`tool.getFullTree(this.getRights().where(row.getType() == $organization$))`
118
- },
119
- //资源初始化数据
120
- initresid: {
121
- type: Array,
122
- default() { return [] },
123
- },
124
- resid: {
125
- },
126
- resobjprop:"",
127
- islist: {
128
- type: Boolean,
129
- default: false
130
- },
131
- //是否有查看上级的权限
132
- Url:{
133
- type: String,
134
- default:''
135
- },
136
- width:{
137
- type:String,
138
- default:'60%'
139
- }
140
- },
141
- data () {
142
- return {
143
- resobj:{res:this.$login.f.f_fengongsi, resids:this.$login.f.f_orgids.substring(0,this.$login.f.f_orgids.length-1)},
144
- userid: this.$login.f.id,
145
- resname:[this.$login.f.f_fengongsi],
146
- orgnames : "请选择",
147
- //单选点击 返回所有子
148
- orgids : null,
149
- orgobj:null,
150
- model: [
151
-
152
- ],
153
- childrenOptions: [],
154
- childrenregionOption:[],
155
- isselect: false
156
- }
157
- },
158
- methods: {
159
- selectRes () {
160
- let newobj={
161
- "res": [this.resname],
162
- "resids": [this.orgids],
163
- }
164
- this.$emit('re-res', newobj)
165
- },
166
- //树形结构变成list
167
- initTreetoList(val) {
168
- for (let value of val) {
169
- this.initErgodicList(value)
170
- }
171
- },
172
- //找到跟节点
173
- initErgodicList (val) {
174
- if(val.children.length > 0){
175
- this.childrenOptions.push(val)
176
- this.treetoList(val.children)
177
- }else{
178
- this.childrenOptions.push(val)
179
- }
180
- },
181
- initregion(val){
182
- if(val ==null ) return;
183
- val.forEach((item)=>{
184
- if(item.name != null){
185
- if(item.name.includes("公司")){
186
- return;
187
- }else{
188
- this.initregion(item.children)
189
- this.childrenregionOption.push({label:"",value:item})
190
- //return item;
191
- }
192
- }else{
193
- return;
194
- }
195
- })
196
-
197
- },
198
- async buluer (val) {
199
- this.strsign=val
200
- await new Promise(resolve => {
201
- this.$nextTick(() => {
202
- resolve()
203
- })
204
- })
205
- },
206
- //点击资源的方法
207
- selectclick (row) {
208
- if(this.orgids==row.id){
209
- //取消点击
210
- this.orgnames="请选择"
211
- this.orgids=null
212
- this.orgobj=null
213
- let newobj={
214
- "res": [],
215
- "resids": [],
216
- "orgobj": [],
217
- }
218
- this.$emit('re-res', newobj)
219
- }else{
220
- //点中点击
221
- this.orgnames=row.name
222
- this.orgids=row.id
223
- this.orgobj=row
224
- let objs=[]
225
- let objids=[]
226
- let objnames=[]
227
- this.addResChild(row,objs)
228
- objs.forEach((item) => {
229
- objids.push(item.id)
230
- objnames.push(item.name)
231
- })
232
- let newobj={
233
- "res": objnames,
234
- "resids": objids,
235
- "orgobj": objs,
236
- }
237
- this.$emit('re-res', newobj)
238
- }
239
- },
240
- initdataone(row){
241
- //点中点击
242
- this.orgnames=row.name
243
- this.orgids=row.id
244
- this.orgobj=row
245
- let objs=[]
246
- let objids=[]
247
- let objnames=[]
248
- this.addResChild(row,objs)
249
- objs.forEach((item) => {
250
- objids.push(item.id)
251
- objnames.push(item.name)
252
- })
253
- let newobj={
254
- "res": objnames,
255
- "resids": objids,
256
- "orgobj": objs,
257
- }
258
- this.$emit('re-res', newobj)
259
- },
260
- addResChild(val,objs){
261
- objs.push(val)
262
- if(val.children && val.children.length>0){
263
- Object.keys(val.children).forEach((key) => {
264
- this.addResChild(val.children[key],objs)
265
- })
266
- }
267
- return objs
268
- },
269
- //检查是否显示对勾
270
- isSelect(val) {
271
- if(this.orgids==val){
272
- return true
273
- }else{
274
- return false
275
- }
276
- },
277
- //树形结构变成list
278
- treetoList(val) {
279
- for (let value of val) {
280
- this.ergodicList(value)
281
- }
282
- },
283
- //找到跟节点
284
- ergodicList (val) {
285
- val.children.length > 0 ? this.treetoList(val.children) : this.childrenOptions.push({label: val.name, value: val})
286
- },
287
- //处理显示默认值
288
- dealResObj (val) {
289
- try{
290
- var arr=val.res.split(".")
291
- //截取最后一个分公司名字
292
- this.resname=arr[arr.length-1].toString()
293
- this.orgnames=arr[arr.length-1].toString()
294
- this.resid = val.resids
295
- this.orgids = val.resids
296
- }catch (e){
297
- this.resname='请选择组织'
298
- }
299
- },
300
- judgBoundary(){
301
- //判断是否超出边界,超出移动
302
- if(document.documentElement.offsetWidth< this.$els.dropdown.getBoundingClientRect().right){
303
- this.left = document.documentElement.offsetWidth - this.$els.dropdown.getBoundingClientRect().right - 25
304
- }
305
- }
306
- },
307
- events: {
308
-
309
- },
310
- ready () {
311
- this.dealResObj (this.resobj)
312
- let gen = saveGen(this)
313
- return co(gen)
314
- },
315
- watch: {
316
- 'resobjprop'(){
317
- //tag
318
- this.dealResObj (this.resobjprop)
319
- }
320
- }
321
- }
322
- </script>
323
- <style lang="less">
324
- #res-tree {
325
- .list-group-item {
326
- background-color: #FFF;
327
- color: #000;
328
- padding: 5px 10px;
329
- border:0px;
330
- white-space: nowrap;
331
- }
332
- }
333
- #res-tree .list-group {
334
- width: auto;
335
- min-width: 100%;
336
- }
337
- .hide-text-overflow{
338
- overflow: hidden;
339
- text-overflow: ellipsis
340
- }
341
- .select-style {
342
- border: 0px;
343
- /*border-bottom: 2px solid #C9CCCF;*/
344
- border: 1px solid #93B2D3;
345
- border-radius: 0px;
346
- color: #555;
347
- }
348
- </style>
1
+ <template>
2
+ <dropdown :model='model' class="auto" id="res-tree" v-if="!islist" v-el:dropdown :style="{width:width}">
3
+ <button type="button" class="btn btn-default dropdown-toggle select-style" data-toggle="dropdown" style="width: 100%">
4
+ <span class='btn-content' :style="{textOverflow:'ellipsis',overflow: 'hidden'}">{{ orgnames }}</span>
5
+ <span class="caret"></span>
6
+ </button>
7
+ <div class="dropdown-menu auto" style="width:auto;max-height: 500px;overflow: auto" >
8
+ <input type="text" placeholder="Search"
9
+ placeholder='请输入'
10
+ slot="dropdown-menu"
11
+ v-model="searchText"
12
+ class="form-control" autocomplete="off"
13
+ @keydown.enter="buluer(searchText)">
14
+ <tree :filter="strsign" :model='model' v-ref:tree :is-click="false" role="menu">
15
+ <span partial>
16
+ <span class="glyphicon glyphicon-chevron-down" v-show="row.open&&row.data.children.length>0" style="color:balck;"></span>
17
+ <span class="glyphicon glyphicon-chevron-right" v-show="!row.open&&row.data.children.length>0" style="color:balck;"></span>
18
+ <span class="RightTreeCanSelect" v-if="row.data.hasright" @click.stop="$parent.$parent.$parent.selectclick(row.data)">{{row.data.name}}</span>
19
+ <span class="RightTreeCanNotSelect" v-else>{{row.data.name}}</span>
20
+ <span class="glyphicon glyphicon-ok " v-if="$parent.$parent.$parent.isSelect(row.data.id)" style="color:balck;"></span>
21
+ </span>
22
+ </tree>
23
+ </div>
24
+
25
+ </dropdown>
26
+ <v-select v-if="islist"
27
+ placeholder='请选择'
28
+ :options='childrenOptions'
29
+ @change="selectclick"
30
+ :value-single="true"
31
+ close-on-select></v-select>
32
+ </template>
33
+ <script>
34
+ import Vue from 'vue';
35
+ import co from 'co'
36
+ import { PagedList, HttpResetClass } from 'vue-client'
37
+ import * as ldapHelper from '../../../utils/LdapHelper'
38
+ let saveGen = function * (self) {
39
+ //获取分公司树
40
+ let data = {
41
+ source: self.source,
42
+ userid: self.userid
43
+ }
44
+ // if(self.$treeorg==null || (self.$treeorg!=null&&self.$treeorg.length==0)){
45
+ let http = new HttpResetClass()
46
+ let ret = yield http.load('POST', `${self.Url}/rs/search`, data, {resolveMsg: null, rejectMsg: null})
47
+ // 去掉前面的两层节点
48
+ ret.data[0].children[0].children.forEach((item) => {
49
+ self.model.push(item)
50
+ })
51
+ Vue.$treeorg = Vue.prototype.$treeorg = self.model;
52
+ // }
53
+ //if(self.$treeorg!=null){
54
+ // self.model = self.$treeorg;
55
+ //}
56
+ // 给资源添加父关系
57
+ ldapHelper.procParent(self.model)
58
+ // 树转列
59
+ // if (self.islist) {
60
+ // self.treetoList(self.model)
61
+ // }
62
+ if(self.initresid.length>0){
63
+ if(self.initresid[0] == ''){
64
+ self.initresid[0] = self.$login.f.f_orgids.substring(0,this.$login.f.f_orgids.length-1);
65
+ }
66
+ }else{
67
+ self.initresid = [];
68
+ self.initresid[0] = self.$login.f.f_orgids.substring(0,this.$login.f.f_orgids.length-1);
69
+ }
70
+ if(self.initresid&&self.initresid.length>0){
71
+ self.isselect = false;
72
+ self.initTreetoList(self.model)
73
+ self.initregion(self.childrenOptions)
74
+ self.childrenOptions.forEach((item) => {
75
+ if(item.id == null && item.value !=null ){
76
+ item = item.value
77
+ }
78
+ if(item.id==self.initresid[0]){
79
+ //默认加载如果已选中的和传入参数相等会取消选择,这种操作不应该被允许
80
+ if(self.orgids==item.id){
81
+ self.initdataone(item);
82
+ return;
83
+ }
84
+ self.selectclick(item);
85
+ self.isselect = true;
86
+ return;
87
+ }
88
+ })
89
+ //如果没有找到公司,说明是选择的是大区
90
+ if(!self.isselect){
91
+ self.childrenregionOption.forEach((item) => {
92
+ if(item.id == null && item.value !=null ){
93
+ item = item.value;
94
+ }
95
+ if(item.id==self.initresid[0]){
96
+ //默认加载如果已选中的和传入参数相等会取消选择,这种操作不应该被允许
97
+ if(self.orgids==item.id){
98
+ self.initdataone(item);
99
+ return;
100
+ }
101
+ self.selectclick(item);
102
+ return;
103
+ }
104
+ })
105
+ }
106
+ }
107
+ //self.selectRes()
108
+ }
109
+ export default {
110
+ title: '资源树',
111
+ props: {
112
+ searchText:'',
113
+ strsign:'',
114
+ source: {
115
+ type: String,
116
+ require: true,
117
+ default:`tool.getFullTree(this.getRights().where(row.getType() == $organization$))`
118
+ },
119
+ //资源初始化数据
120
+ initresid: {
121
+ type: Array,
122
+ default() { return [] },
123
+ },
124
+ resid: {
125
+ },
126
+ resobjprop:"",
127
+ islist: {
128
+ type: Boolean,
129
+ default: false
130
+ },
131
+ //是否有查看上级的权限
132
+ Url:{
133
+ type: String,
134
+ default:''
135
+ },
136
+ width:{
137
+ type:String,
138
+ default:'60%'
139
+ }
140
+ },
141
+ data () {
142
+ return {
143
+ resobj:{res:this.$login.f.f_fengongsi, resids:this.$login.f.f_orgids.substring(0,this.$login.f.f_orgids.length-1)},
144
+ userid: this.$login.f.id,
145
+ resname:[this.$login.f.f_fengongsi],
146
+ orgnames : "请选择",
147
+ //单选点击 返回所有子
148
+ orgids : null,
149
+ orgobj:null,
150
+ model: [
151
+
152
+ ],
153
+ childrenOptions: [],
154
+ childrenregionOption:[],
155
+ isselect: false
156
+ }
157
+ },
158
+ methods: {
159
+ selectRes () {
160
+ let newobj={
161
+ "res": [this.resname],
162
+ "resids": [this.orgids],
163
+ }
164
+ this.$emit('re-res', newobj)
165
+ },
166
+ //树形结构变成list
167
+ initTreetoList(val) {
168
+ for (let value of val) {
169
+ this.initErgodicList(value)
170
+ }
171
+ },
172
+ //找到跟节点
173
+ initErgodicList (val) {
174
+ if(val.children.length > 0){
175
+ this.childrenOptions.push(val)
176
+ this.treetoList(val.children)
177
+ }else{
178
+ this.childrenOptions.push(val)
179
+ }
180
+ },
181
+ initregion(val){
182
+ if(val ==null ) return;
183
+ val.forEach((item)=>{
184
+ if(item.name != null){
185
+ if(item.name.includes("公司")){
186
+ return;
187
+ }else{
188
+ this.initregion(item.children)
189
+ this.childrenregionOption.push({label:"",value:item})
190
+ //return item;
191
+ }
192
+ }else{
193
+ return;
194
+ }
195
+ })
196
+
197
+ },
198
+ async buluer (val) {
199
+ this.strsign=val
200
+ await new Promise(resolve => {
201
+ this.$nextTick(() => {
202
+ resolve()
203
+ })
204
+ })
205
+ },
206
+ //点击资源的方法
207
+ selectclick (row) {
208
+ if(this.orgids==row.id){
209
+ //取消点击
210
+ this.orgnames="请选择"
211
+ this.orgids=null
212
+ this.orgobj=null
213
+ let newobj={
214
+ "res": [],
215
+ "resids": [],
216
+ "orgobj": [],
217
+ }
218
+ this.$emit('re-res', newobj)
219
+ }else{
220
+ //点中点击
221
+ this.orgnames=row.name
222
+ this.orgids=row.id
223
+ this.orgobj=row
224
+ let objs=[]
225
+ let objids=[]
226
+ let objnames=[]
227
+ this.addResChild(row,objs)
228
+ objs.forEach((item) => {
229
+ objids.push(item.id)
230
+ objnames.push(item.name)
231
+ })
232
+ let newobj={
233
+ "res": objnames,
234
+ "resids": objids,
235
+ "orgobj": objs,
236
+ }
237
+ this.$emit('re-res', newobj)
238
+ }
239
+ },
240
+ initdataone(row){
241
+ //点中点击
242
+ this.orgnames=row.name
243
+ this.orgids=row.id
244
+ this.orgobj=row
245
+ let objs=[]
246
+ let objids=[]
247
+ let objnames=[]
248
+ this.addResChild(row,objs)
249
+ objs.forEach((item) => {
250
+ objids.push(item.id)
251
+ objnames.push(item.name)
252
+ })
253
+ let newobj={
254
+ "res": objnames,
255
+ "resids": objids,
256
+ "orgobj": objs,
257
+ }
258
+ this.$emit('re-res', newobj)
259
+ },
260
+ addResChild(val,objs){
261
+ objs.push(val)
262
+ if(val.children && val.children.length>0){
263
+ Object.keys(val.children).forEach((key) => {
264
+ this.addResChild(val.children[key],objs)
265
+ })
266
+ }
267
+ return objs
268
+ },
269
+ //检查是否显示对勾
270
+ isSelect(val) {
271
+ if(this.orgids==val){
272
+ return true
273
+ }else{
274
+ return false
275
+ }
276
+ },
277
+ //树形结构变成list
278
+ treetoList(val) {
279
+ for (let value of val) {
280
+ this.ergodicList(value)
281
+ }
282
+ },
283
+ //找到跟节点
284
+ ergodicList (val) {
285
+ val.children.length > 0 ? this.treetoList(val.children) : this.childrenOptions.push({label: val.name, value: val})
286
+ },
287
+ //处理显示默认值
288
+ dealResObj (val) {
289
+ try{
290
+ var arr=val.res.split(".")
291
+ //截取最后一个分公司名字
292
+ this.resname=arr[arr.length-1].toString()
293
+ this.orgnames=arr[arr.length-1].toString()
294
+ this.resid = val.resids
295
+ this.orgids = val.resids
296
+ }catch (e){
297
+ this.resname='请选择组织'
298
+ }
299
+ },
300
+ judgBoundary(){
301
+ //判断是否超出边界,超出移动
302
+ if(document.documentElement.offsetWidth< this.$els.dropdown.getBoundingClientRect().right){
303
+ this.left = document.documentElement.offsetWidth - this.$els.dropdown.getBoundingClientRect().right - 25
304
+ }
305
+ }
306
+ },
307
+ events: {
308
+
309
+ },
310
+ ready () {
311
+ this.dealResObj (this.resobj)
312
+ let gen = saveGen(this)
313
+ return co(gen)
314
+ },
315
+ watch: {
316
+ 'resobjprop'(){
317
+ //tag
318
+ this.dealResObj (this.resobjprop)
319
+ }
320
+ }
321
+ }
322
+ </script>
323
+ <style lang="less">
324
+ #res-tree {
325
+ .list-group-item {
326
+ background-color: #FFF;
327
+ color: #000;
328
+ padding: 5px 10px;
329
+ border:0px;
330
+ white-space: nowrap;
331
+ }
332
+ }
333
+ #res-tree .list-group {
334
+ width: auto;
335
+ min-width: 100%;
336
+ }
337
+ .hide-text-overflow{
338
+ overflow: hidden;
339
+ text-overflow: ellipsis
340
+ }
341
+ .select-style {
342
+ border: 0px;
343
+ /*border-bottom: 2px solid #C9CCCF;*/
344
+ border: 1px solid #93B2D3;
345
+ border-radius: 0px;
346
+ color: #555;
347
+ }
348
+ </style>