safecheck-client 4.0.1-81 → 4.0.1-82

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 (251) hide show
  1. package/package.json +1 -1
  2. package/src/App.vue +31 -31
  3. package/src/components/CheckerCount/CheckCountUserList.vue +144 -144
  4. package/src/components/DefectDealMain/DefectListNew.vue +642 -642
  5. package/src/components/NewDefectList/DefectListNew.vue +682 -682
  6. package/src/components/Util/RightTreeSafeDep.vue +362 -362
  7. package/src/components/Util/SafecheckUpload.vue +280 -280
  8. package/src/components/android/AddPlanItem.vue +447 -447
  9. package/src/components/android/AddPlanItemYy.vue +451 -451
  10. package/src/components/android/AddSpecialPlanItem.vue +426 -426
  11. package/src/components/android/AndroidDefectDeal.vue +700 -700
  12. package/src/components/android/CurrentCreateYy.vue +1051 -1051
  13. package/src/components/android/DailyworkloadQuery.vue +473 -473
  14. package/src/components/android/Devices.vue +327 -327
  15. package/src/components/android/Devicesm.vue +327 -327
  16. package/src/components/android/NewCheckpaperAndroid.vue +1343 -1343
  17. package/src/components/android/PaperFeedbackm.vue +1026 -1026
  18. package/src/components/android/PhoneRecordInfo.vue +113 -113
  19. package/src/components/android/PhoneSellInfo.vue +113 -113
  20. package/src/components/android/PhoneUpDetail.vue +1040 -1040
  21. package/src/components/android/QRCode/QRCodeBinding.vue +300 -300
  22. package/src/components/android/QRCode/QRCodePage.vue +212 -212
  23. package/src/components/android/SafePlanItem.vue +509 -509
  24. package/src/components/android/examples/SafeListExamples.vue +296 -296
  25. package/src/components/android/old/PaperFeedback.vue +1015 -1015
  26. package/src/components/android/recheck/Recheck.vue +402 -402
  27. package/src/components/android/userinfo/SafecheckUserInfo.vue +776 -776
  28. package/src/components/checkplan/checkmsg.vue +459 -459
  29. package/src/components/defect/DefectList.vue +507 -507
  30. package/src/components/defect/DefectListWeixiu.vue +484 -484
  31. package/src/components/filialCircle/CircleList.vue +139 -139
  32. package/src/components/inspections/AddInspectPlanItem.vue +325 -325
  33. package/src/components/inspections/AddInspectPlanItems.vue +325 -325
  34. package/src/components/inspections/AddInspectPlanItemss.vue +317 -317
  35. package/src/components/inspections/DisplayInspectionList.vue +1224 -1224
  36. package/src/components/inspections/inspectionOrderV.vue +1853 -1853
  37. package/src/components/inspections/inspectionOrderVs.vue +1853 -1853
  38. package/src/components/inspections/inspectionOrderVss.vue +1856 -1856
  39. package/src/components/inspections/inspectionUserInfo.vue +398 -398
  40. package/src/components/map/PersonTrack.vue +226 -226
  41. package/src/components/paper/PaperList.vue +802 -802
  42. package/src/components/paper/RegionalList.vue +220 -220
  43. package/src/components/pc/AnnouncementPC.vue +524 -524
  44. package/src/components/pc/DefectList.vue +742 -742
  45. package/src/components/pc/DefectMaterialLook.vue +98 -98
  46. package/src/components/pc/DeviceChange.vue +1068 -1068
  47. package/src/components/pc/PaperDefectMain.vue +905 -905
  48. package/src/components/pc/RoleSelectorDep.vue +166 -166
  49. package/src/components/pc/SafeVisitInfo.vue +261 -261
  50. package/src/components/report/HiddenSituation.vue +165 -165
  51. package/src/components/rongcheng/AspiratedOrderV.vue +2377 -2377
  52. package/src/components/rongcheng/CurrentCreateOnline.vue +906 -906
  53. package/src/components/rongcheng/DefectList.vue +560 -560
  54. package/src/components/rongcheng/SafecheckOrderVCli.vue +2641 -2641
  55. package/src/components/safecheckNew/android/AddPlanItem.vue +419 -419
  56. package/src/components/safecheckNew/android/CurrentCreate.vue +1050 -1050
  57. package/src/components/safecheckNew/android/Recheck.vue +379 -379
  58. package/src/components/sendsingle/EquipmentManagement.vue +727 -727
  59. package/src/components/shaoguan/DefectList.vue +473 -473
  60. package/src/components/shaoguan/SafecheckOrderV.vue +2140 -2140
  61. package/src/components/tongcheng/PaperFeedback.vue +1061 -1061
  62. package/src/components/userfile/SecurityAudit.vue +243 -243
  63. package/src/filiale/ALshan/pc/DefectListWeixiu.vue +476 -476
  64. package/src/filiale/ancheng/android/SafecheckOrderV.vue +2703 -2703
  65. package/src/filiale/ancheng/android/SafecheckUserInfo.vue +737 -737
  66. package/src/filiale/ancheng/pc/checkScreen.vue +923 -923
  67. package/src/filiale/ankangyihua/android/AddPlanItem.vue +446 -446
  68. package/src/filiale/ankangyihua/android/SafecheckOrderV.vue +2908 -2908
  69. package/src/filiale/ankangyihua/pc/DefectListWeixiu.vue +491 -491
  70. package/src/filiale/baiyin/android/SafecheckOrderV.vue +2785 -2785
  71. package/src/filiale/baiyin/pc/DefectListNew.vue +597 -597
  72. package/src/filiale/bayan/android/Edit.vue +132 -132
  73. package/src/filiale/bayan/pc/DefectListNew.vue +597 -597
  74. package/src/filiale/bayan/pc/DeviceChange.vue +1838 -1838
  75. package/src/filiale/bayan/pc/HiddenSituation.vue +295 -295
  76. package/src/filiale/dexin/android/CasualSave.vue +1050 -1050
  77. package/src/filiale/dexin/android/SafecheckOrderV.vue +2950 -2950
  78. package/src/filiale/fugou/android/AddPlanItem.vue +413 -413
  79. package/src/filiale/fugou/android/SafecheckOrderV.vue +2796 -2796
  80. package/src/filiale/fugou/pc/CheckBookSearchUser.vue +830 -830
  81. package/src/filiale/fugu/android/SafecheckOrderV.vue +2484 -2484
  82. package/src/filiale/fugu/pc/NewCheckpaper.vue +1287 -1287
  83. package/src/filiale/ganquan/android/AddPlanItem.vue +444 -444
  84. package/src/filiale/ganquan/android/SafecheckOrderV.vue +2485 -2485
  85. package/src/filiale/ganquan/pc/NewCheckpaper.vue +1354 -1354
  86. package/src/filiale/guangxi/pc/DefectListNew.vue +518 -518
  87. package/src/filiale/hanzhong/android/SafecheckOrderV.vue +2683 -2683
  88. package/src/filiale/hanzhong/android/SafecheckUserInfo.vue +786 -786
  89. package/src/filiale/huaran/android/SafecheckOrderV.vue +2803 -2803
  90. package/src/filiale/huatong/android/SafecheckOrderV.vue +2426 -2426
  91. package/src/filiale/huatong/android/SafecheckUserInfo.vue +749 -749
  92. package/src/filiale/huayin/pc/NewCheckpaper.vue +1307 -1307
  93. package/src/filiale/jiaocheng/android/AddPlanItem.vue +435 -435
  94. package/src/filiale/jiaocheng/android/SafecheckUserInfo.vue +737 -737
  95. package/src/filiale/jiaocheng/pc/DefectListNew.vue +576 -576
  96. package/src/filiale/jiaxian/android/AddPlanItem.vue +447 -447
  97. package/src/filiale/jiaxian/android/SafecheckOrderV.vue +2807 -2807
  98. package/src/filiale/jiaxian/android/SafecheckUserInfo.vue +784 -784
  99. package/src/filiale/jinbin/pc/DefectListWeixiu.vue +478 -478
  100. package/src/filiale/jingyang/android/AddPlanItem.vue +458 -458
  101. package/src/filiale/jingyang/android/SafecheckOrderV.vue +2734 -2734
  102. package/src/filiale/jingyang/android/SafecheckUserInfo.vue +781 -781
  103. package/src/filiale/jinhong/pc/CheckBookList.vue +393 -393
  104. package/src/filiale/jinhong/pc/PaperList.vue +853 -853
  105. package/src/filiale/jinhong/pc/PlanManage.vue +927 -927
  106. package/src/filiale/jinhong/pc/checkPlanList.vue +420 -420
  107. package/src/filiale/kelai/android/AddPlanItem.vue +488 -488
  108. package/src/filiale/kelai/android/SafecheckUserInfo.vue +774 -774
  109. package/src/filiale/kelai/android/SafecheckUserInfo1.vue +618 -618
  110. package/src/filiale/kelai/pc/DefectListNew.vue +688 -688
  111. package/src/filiale/kelai/pc/FaultLimitGas/FaultLimitGasList.vue +518 -518
  112. package/src/filiale/kelai/pc/NewCheckpaper.vue +1454 -1454
  113. package/src/filiale/liaoyuan/android/AddPlanItem.vue +412 -412
  114. package/src/filiale/liaoyuan/android/CurrentCreate.vue +1066 -1066
  115. package/src/filiale/liaoyuan/android/SafecheckOrderV.vue +2388 -2388
  116. package/src/filiale/liaoyuan/android/SafecheckUserInfo.vue +557 -557
  117. package/src/filiale/liaoyuan/pc/DefectListWeixiu.vue +489 -489
  118. package/src/filiale/liaoyuan/pc/NewCheckpaper.vue +1020 -1020
  119. package/src/filiale/lixian/android/SafecheckOrderV.vue +2404 -2404
  120. package/src/filiale/lixian/android/SafecheckUserInfo.vue +578 -578
  121. package/src/filiale/lixian/pc/NewCheckpaper.vue +1211 -1211
  122. package/src/filiale/meihekou/android/AreaPlan.vue +577 -577
  123. package/src/filiale/meihekou/android/MeterReading.vue +110 -110
  124. package/src/filiale/meihekou/android/PhoneUpUserinfo.vue +1307 -1307
  125. package/src/filiale/meihekou/android/SafecheckUserInfo.vue +785 -785
  126. package/src/filiale/meihekou/pc/NewCheckpaperTemp.vue +1288 -1288
  127. package/src/filiale/minsheng/android/SafecheckUserInfo.vue +754 -754
  128. package/src/filiale/minsheng/pc/DefectListNew.vue +535 -535
  129. package/src/filiale/pingxiang/android/SafecheckOrderV.vue +2424 -2424
  130. package/src/filiale/pingxiang/android/SafecheckUserInfo.vue +600 -600
  131. package/src/filiale/pingxiang/pc/DefectListNew.vue +519 -519
  132. package/src/filiale/pingxiang/pc/NewCheckpaper.vue +1294 -1294
  133. package/src/filiale/qianneng/android/AddPlanItem.vue +482 -482
  134. package/src/filiale/qianneng/android/SafecheckOrderV.vue +2785 -2785
  135. package/src/filiale/qianneng/android/SafecheckUserInfo.vue +775 -775
  136. package/src/filiale/qianneng/pc/DefectListNew.vue +576 -576
  137. package/src/filiale/qianneng/pc/NewCheckpaper.vue +1546 -1546
  138. package/src/filiale/qingjian/android/SafecheckOrderV.vue +2844 -2844
  139. package/src/filiale/qingjian/android/SafecheckUserInfo.vue +800 -800
  140. package/src/filiale/qingjian/pc/NewCheckpaper.vue +1871 -1871
  141. package/src/filiale/qingjian/pc/SecurityCheckCoordinates.vue +359 -359
  142. package/src/filiale/qingjian/pc.js +15 -15
  143. package/src/filiale/qingtongxia/android/AddPlanItem.vue +450 -450
  144. package/src/filiale/qingtongxia/android/SafecheckOrderV.vue +2726 -2726
  145. package/src/filiale/qingtongxia/android/SafecheckUserInfo.vue +782 -782
  146. package/src/filiale/qingtongxia/pc/DefectListNew.vue +594 -594
  147. package/src/filiale/rizhao/android/AddPlanItem.vue +446 -446
  148. package/src/filiale/rizhao/android/SafecheckOrderV.vue +2430 -2430
  149. package/src/filiale/rizhao/android/SafecheckUserInfo.vue +640 -640
  150. package/src/filiale/rizhao/pc/DefectList.vue +489 -489
  151. package/src/filiale/rongchuang/android/SafecheckOrderV.vue +2696 -2696
  152. package/src/filiale/rongchuang/android/checkpapermsg.vue +209 -209
  153. package/src/filiale/ruihua/android/SafecheckOrderV.vue +2747 -2747
  154. package/src/filiale/ruihua/android/SafecheckUserInfo.vue +804 -804
  155. package/src/filiale/shanggao/android/SafecheckOrderV.vue +2426 -2426
  156. package/src/filiale/shanxian/android/SafecheckUserInfo.vue +749 -749
  157. package/src/filiale/shanxian/pc/HiddenSituation.vue +121 -121
  158. package/src/filiale/shanxian/pc/NewCheckpaper.vue +1526 -1526
  159. package/src/filiale/shexian/android/AddPlanItem.vue +444 -444
  160. package/src/filiale/shexian/android/SafecheckOrderV.vue +2879 -2879
  161. package/src/filiale/shexian/pc/DefectListNew.vue +593 -593
  162. package/src/filiale/shexian/pc/NewCheckpaper.vue +1469 -1469
  163. package/src/filiale/shimen/android/SafecheckUserInfo.vue +547 -547
  164. package/src/filiale/shimen/pc/DefectList.vue +473 -473
  165. package/src/filiale/shimen/pc/NewCheckpaper.vue +1275 -1275
  166. package/src/filiale/siyang/android/AddPlanItem.vue +450 -450
  167. package/src/filiale/siyang/android/CurrentCreate.vue +1051 -1051
  168. package/src/filiale/siyang/android/PhoneRecordInfo.vue +214 -214
  169. package/src/filiale/siyang/android/SafecheckOrderV.vue +2796 -2796
  170. package/src/filiale/siyang/android/SafecheckUserInfo.vue +789 -789
  171. package/src/filiale/siyang/pc/HiddenSituation.vue +167 -167
  172. package/src/filiale/taiyuan/android/AddPlanItem.vue +456 -456
  173. package/src/filiale/taiyuan/android/AreaPlan.vue +565 -565
  174. package/src/filiale/taiyuan/android/PhoneUpUserinfo.vue +1253 -1253
  175. package/src/filiale/taiyuan/android.js +15 -15
  176. package/src/filiale/taiyuan/pc/NewCheckpaper.vue +1976 -1976
  177. package/src/filiale/taiyuan/pc/PlanManage.vue +891 -891
  178. package/src/filiale/taiyuan/pc/checkUserList.vue +798 -798
  179. package/src/filiale/tianke/android/AddPlanItem.vue +455 -455
  180. package/src/filiale/tianke/android/CurrentCreate.vue +988 -988
  181. package/src/filiale/tianke/android/SafecheckOrderV.vue +2431 -2431
  182. package/src/filiale/tianke/android/SafecheckUserInfo.vue +744 -744
  183. package/src/filiale/tongchuan/android/AddPlanItem.vue +483 -483
  184. package/src/filiale/tongchuan/android/PhoneRecordInfo.vue +191 -191
  185. package/src/filiale/tongchuan/android/PhoneSellInfo.vue +113 -113
  186. package/src/filiale/tongchuan/android/SafecheckUserInfo.vue +720 -720
  187. package/src/filiale/tongchuan/pc/CheckBookDetails.vue +209 -209
  188. package/src/filiale/tongchuan/pc/DefectListWeixiu.vue +484 -484
  189. package/src/filiale/tongchuan/pc/HiddenSituation.vue +166 -166
  190. package/src/filiale/weinan/android/AddPlanItem.vue +438 -438
  191. package/src/filiale/weinan/android/CurrentCreate.vue +1171 -1171
  192. package/src/filiale/weinan/android/CurrentCreateOnline.vue +911 -911
  193. package/src/filiale/weinan/android/SafePlanItem.vue +440 -440
  194. package/src/filiale/weinan/android/SafecheckUserInfo.vue +778 -778
  195. package/src/filiale/weinan/pc/DefectListNew.vue +617 -617
  196. package/src/filiale/weinan/pc/DeviceChange.vue +1088 -1088
  197. package/src/filiale/weinan/pc/HiddenSituation.vue +167 -167
  198. package/src/filiale/weinan/pc/checkScreen.vue +1094 -1094
  199. package/src/filiale/weinanct/android/SafecheckOrderV.vue +2730 -2730
  200. package/src/filiale/weinanct/pc/NewCheckpaper.vue +1315 -1315
  201. package/src/filiale/wensu/android/AddPlanItem.vue +495 -495
  202. package/src/filiale/wensu/android/AndroidDefectDeal.vue +464 -464
  203. package/src/filiale/wensu/android/PaperFeedback.vue +1358 -1358
  204. package/src/filiale/wensu/android/SafecheckOrderV.vue +2430 -2430
  205. package/src/filiale/wensu/android/SafecheckUserInfo.vue +627 -627
  206. package/src/filiale/wensu/pc/DefectListNew.vue +735 -735
  207. package/src/filiale/wenxi/android/AddPlanItem.vue +431 -431
  208. package/src/filiale/wenxi/android/SafecheckOrderV.vue +2671 -2671
  209. package/src/filiale/wenxi/android/SafecheckUserInfo.vue +673 -673
  210. package/src/filiale/wenxi/pc/DefectList.vue +653 -653
  211. package/src/filiale/wenxi/pc/NewCheckpaper.vue +1358 -1358
  212. package/src/filiale/wuan/android/SafecheckOrderV.vue +2241 -2241
  213. package/src/filiale/wuan/android/SafecheckUserInfo.vue +596 -596
  214. package/src/filiale/wuan/pc/DefectListWeixiu.vue +506 -506
  215. package/src/filiale/wuan/pc/NewCheckpaper.vue +1169 -1169
  216. package/src/filiale/wuhai/android/SafecheckOrderV.vue +2456 -2456
  217. package/src/filiale/wuhai/android/SafecheckUserInfo.vue +573 -573
  218. package/src/filiale/wuhai/pc/NewCheckpaper.vue +1281 -1281
  219. package/src/filiale/xiangyuanzhongai/android/PhoneUpUserinfo.vue +1251 -1251
  220. package/src/filiale/xinkang/pc/CheckSearchUser.vue +1026 -1026
  221. package/src/filiale/xinkang/pc/DefectListWeixiu.vue +475 -475
  222. package/src/filiale/yangchunboneng/android/AddPlanItem.vue +496 -496
  223. package/src/filiale/yangchunboneng/android/SafecheckOrderV.vue +2865 -2865
  224. package/src/filiale/yangchunboneng/android/SafecheckUserInfo.vue +887 -887
  225. package/src/filiale/yangchunboneng/pc/DefectListNew.vue +576 -576
  226. package/src/filiale/yongzhou/android/SafecheckOrderV.vue +2774 -2774
  227. package/src/filiale/yongzhou/android/SafecheckUserInfo.vue +776 -776
  228. package/src/filiale/yuansheng/android/SafecheckOrderV.vue +2758 -2758
  229. package/src/filiale/yuansheng/android/SafecheckUserInfo.vue +797 -797
  230. package/src/filiale/yuansheng/pc/DefectListNew.vue +524 -524
  231. package/src/filiale/yuansheng/pc/NewCheckpaper.vue +1371 -1371
  232. package/src/filiale/yuansheng/pc/checkmsg.vue +464 -464
  233. package/src/filiale/yunchengminsheng/android/DailyworkloadQuery.vue +491 -491
  234. package/src/filiale/yunchengminsheng/android/PaperFeedback.vue +1509 -1509
  235. package/src/filiale/yunchengminsheng/android/PhoneSellInfo.vue +113 -113
  236. package/src/filiale/yunchengminsheng/android/SafecheckDevices.vue +1270 -1270
  237. package/src/filiale/yunchengminsheng/android/SafecheckUserInfo.vue +785 -785
  238. package/src/filiale/yunchengminsheng/android.js +15 -15
  239. package/src/filiale/yunchengminsheng/pc/PaperList.vue +811 -811
  240. package/src/filiale/yunchengminsheng/pc.js +15 -15
  241. package/src/filiale/zhongsheng/android/BuyRecords.vue +122 -122
  242. package/src/filiale/zhongsheng/android/SafecheckOrderV.vue +2461 -2461
  243. package/src/filiale/zhongsheng/android/SafecheckUserInfo.vue +690 -690
  244. package/src/filiale/zhongsheng/pc/DefectListWeixiu.vue +514 -514
  245. package/src/filiale/zhongsheng/pc/NewCheckpaper.vue +1322 -1322
  246. package/src/filiale/zhongyi/android/SafecheckOrderV.vue +2431 -2431
  247. package/src/filiale/zhongyi/pc/DefectListNew.vue +514 -514
  248. package/src/filiale/zhoukou/android/SafecheckOrderV.vue +2502 -2502
  249. package/src/filiale/zhoukou/android/SafecheckUserInfo.vue +588 -588
  250. package/src/main.js +33 -32
  251. package/src/safecheck.js +924 -924
@@ -1,1838 +1,1838 @@
1
- <template>
2
- <div id="unit" class="flex-row">
3
- <!-- <work-busy :is-busy="seaching"></work-busy>-->
4
- <div class="flex basic-main" style="flex:1">
5
- <div novalidate="" class="row form-horizontal select-overspread container-fluid auto" partial="">
6
- <div novalidate="" class="form-inline auto" partial="">
7
- <div class="form-group col-sm-2">
8
- <label class="font_normal_body">组织机构</label>
9
- <res-select
10
- :initresid='curorgid'
11
- @res-select="getorg"
12
- is-mul="false"
13
- restype='organization'
14
- >
15
- </res-select>
16
- </div>
17
- <div class="form-group col-sm-2">
18
- <label class="font_normal_body">配置名称</label>
19
- <v-select
20
- v-model="dispositioName"
21
- :options='disposition'
22
- @change="dispselect"
23
- close-on-select
24
- :value-single="true"
25
- clear-button>
26
- ></v-select>
27
- </div>
28
- </div>
29
- </div>
30
- <div class="list-group list_area table_sy" isedit="true" style="overflow: auto" v-if="firstShow">
31
- <table class="table table-bordered">
32
- <thead a-partial="head" class="text-left">
33
- <tr>
34
- <th>安检配置项</th>
35
- </tr>
36
- </thead>
37
- <tbody>
38
- <tr a-partial="body" :id="'vc-datagrid-tree-grid-'+$index" v-for="item in safeArray">
39
- <td><a herf="#" @click="selectedshow($index)" class="list-group-item expand-transition"
40
- style="border: none;background-color: transparent;cursor: pointer" :id="'vc-tree-tree-grid-'+$index">
41
- <span style="color: black" v-for="n in item.safeindex-1 ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
42
- <span style="color: black" :id="'vc-tree-tree-grid-'+$index">
43
- <span style="color: black" v-if="item.safeshow&&(item.safetype=='selector'||item.safetype=='radio'||item.safetype=='')"
44
- @click.stop="pushArray(item,$index)" class="glyphicon glyphicon-minus-sign"
45
- style="font-size: 18px;">
46
- </span>
47
- <span style="color: black" v-if="!item.safeshow&&(item.safetype=='selector'||item.safetype=='radio'||item.safetype=='')"
48
- @click.stop="pushArray(item,$index)" class="glyphicon glyphicon-plus-sign"
49
- style="font-size: 18px;">
50
- </span>
51
- <span style="color: black" v-if="item.safetype!='selector'&&item.safetype!='radio'&&item.safetype!=''" style="font-size: 18px;">
52
- &nbsp;&nbsp;&nbsp;</span>
53
- </span> <span style="color: black" partial=""> <span>{{ item.safename }}</span>
54
- <span style="color: black" v-if="item.safevalue!=0">【{{ item.safevalue }}】</span>
55
- <span style="color: black" v-show="item.selectedshow">
56
- <button v-show="isadd(item)" class="button_spacing button_export" @click.stop="addsafeConfig(item)">添加</button><!--v-if-->
57
- <button v-show="isdelete(item)" class="button_spacing button_export" @click.stop="updatesafeConfigName(item)">修改名称</button><!--v-if-->
58
- <button v-show="isdelete(item)" class="button_spacing button_export" @click.stop="updatesafeConfig(item)">修改属性</button><!--v-if-->
59
-
60
- <button v-show="isdelete(item)" class="button_spacing button_export" @click.stop="deletesafeConfig(item)">删除</button><!--v-if-->
61
- </span>
62
- </span> </a></td>
63
- </tr>
64
- </tbody>
65
- <tbody>
66
- <tr a-partial="foot"></tr>
67
- </tbody>
68
- </table>
69
- </div>
70
- <div class="list-group list_area table_sy" isedit="true" style="overflow: auto" v-if="!firstShow">
71
- <table class="table table-bordered">
72
- <thead a-partial="head" class="text-left">
73
- <tr>
74
- <th>工单配置项</th>
75
- </tr>
76
- </thead>
77
- <tbody>
78
- <tr a-partial="body" :id="'vc-datagrid-tree-grid-'+$index" v-for="item in telArray">
79
- <td>
80
- <a herf="#" @click="selecttelshow($index)" class="list-group-item expand-transition" style="border: none;background-color: transparent;cursor: pointer" :id="'vc-tree-tree-grid-'+$index">
81
- <span style="color: black" v-for="n in item.telindex-1 ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
82
- <span style="color: black" :id="'vc-tree-tree-grid-'+$index">
83
- <span style="color: black" v-if="item.telshow&&(item.teltype=='selector'||item.teltype=='radio'||item.teltype=='')"
84
- @click.stop="tlepushArray(item,$index)" class="glyphicon glyphicon-minus-sign"
85
- style="font-size: 18px;">
86
- </span>
87
- <span style="color: black" v-if="!item.telshow&&(item.teltype=='selector'||item.teltype=='radio'||item.teltype=='')"
88
- @click.stop="tlepushArray(item,$index)" class="glyphicon glyphicon-plus-sign"
89
- style="font-size: 18px;">
90
- </span>
91
- <span style="color: black" v-if="item.telshow!='selector'&&item.teltype!='radio'&&item.teltype!=''" style="font-size: 18px;">
92
- &nbsp;&nbsp;&nbsp;</span>
93
- </span> <span style="color: black" partial=""><span>{{ item.telname }}</span>
94
- <span style="color: black" v-if="item.telvalue!=0">【{{ item.telvalue }}】</span>
95
- <span style="color: black" v-show="item.selectedshow">
96
- <button v-show="isteladd(item)" class="button_spacing button_export" @click.stop="addsafeConfig(item)">添加</button><!--v-if-->
97
- <button v-show="isteldelete(item)" class="button_spacing button_export" @click.stop="updatetelConfigName(item)">修改名称</button><!--v-if-->
98
- <button v-show="isteldelete(item)" class="button_spacing button_export" @click.stop="updatetelConfig(item)">修改属性</button><!--v-if-->
99
- <button v-show="isteldelete(item)" class="button_spacing button_export" @click.stop="deletetelConfig(item)">删除</button><!--v-if-->
100
- </span>
101
- </span> </a></td>
102
- </tr>
103
- </tbody>
104
- <tbody>
105
- <tr a-partial="foot"></tr>
106
- </tbody>
107
- </table>
108
- </div>
109
- </div>
110
- <div class="binary-right" style="width: 40%" v-if="rightshow"> <!--fragment-start-->
111
- <div class="auto select-overspread" style="overflow-y: hidden"> <!--fragment-start-->
112
- <ul class="nav nav-tabs"><p class="bg-info text-center" style="padding: 8px">功能信息</p> <!--v-if--> <h3
113
- class="txtline">上一级【{{ getlastname() }}】</h3><!--v-if--> </ul>
114
- <div class="form-horizontal" style="margin-top:20px;flex: 1">
115
- <div class="row">
116
- <div class="col-sm-6" v-for="(key,value) in rightdata">
117
- <label class="font_normal_body">{{getrightdataname(key)}}</label>
118
- <input type="text" style="width:60%" class="input_search full-with" :placeholder="getrightdatavalue(key,value)"
119
- disabled=""></div>
120
- </div>
121
-
122
- <button @click="closeright()" class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px"><span
123
- class="glyphicon glyphicon-log-out" style="color: black"></span>返回
124
- </button>
125
- </div><!--fragment-end--><!--vue-validator--> </div><!--v-component--><!--fragment-end--><!--v-if--> </div>
126
- <div class="binary-right" style="width: 40%" v-if="righttelshow">
127
- <div class="auto select-overspread" style="overflow-y: hidden">
128
- <ul class="nav nav-tabs"><p class="bg-info text-center" style="padding: 8px">功能信息</p> <h3
129
- class="txtline">上一级【{{ getlastname() }}】</h3></ul>
130
- <div class="form-horizontal" style="margin-top:20px;flex: 1">
131
- <div class="row">
132
- <div class="col-sm-6" v-for="(key,value) in rightteldata">
133
- <label class="font_normal_body">{{getrightdataname(key)}}</label>
134
- <input type="text" style="width:60%" class="input_search full-with" :placeholder="getrightdatavalue(key,value)"
135
- disabled=""></div>
136
- </div>
137
- <button @click="closeright()" class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px"><span
138
- class="glyphicon glyphicon-log-out" style="color: black"></span>返回
139
- </button>
140
- </div> </div> </div>
141
- <modal :show.sync="modelshow" v-ref:modal large backdrop="false">
142
- <header slot="modal-header" class="modal-header">
143
- <button type="button" class="close" @click="cancel"><span style="color: black">&times;</span></button>
144
- </header>
145
- <article slot="modal-body" class="modal-body">
146
- <div class="auto select-overspread" style="overflow-y: hidden">
147
- <validator name='v'>
148
- <ul class="nav nav-tabs">
149
- <p class="bg-info text-center" style="padding: 8px;">配置添加</p>
150
- </ul>
151
- <div class="form-horizontal" style="margin-top:20px;flex: 1;">
152
- <div class="row">
153
- <div class="col-sm-6">
154
- <label class="font_normal_body" >配置名称</label>
155
- <input type="text"
156
- v-model="model.name" style="width:60%"
157
- class="input_search full-with" placeholder="配置名称">
158
- </div>
159
- </div>
160
-
161
-
162
- <button @click="confirm()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
163
- <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
164
- </button>
165
- <button @click='cancel()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
166
- <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
167
- </button>
168
- </div>
169
- </validator>
170
- </div>
171
- </article>
172
- <footer slot="modal-footer" class="modal-footer">
173
- </footer>
174
- </modal>
175
- <modal :show.sync="modelshow1" v-ref:modal large backdrop="false">
176
- <header slot="modal-header" class="modal-header">
177
- <button type="button" class="close" @click="cancel1"><span style="color: black">&times;</span></button>
178
- </header>
179
- <article slot="modal-body" class="modal-body">
180
- <div class="auto select-overspread" style="overflow-y: hidden">
181
- <validator name='v'>
182
- <ul class="nav nav-tabs">
183
- <p class="bg-info text-center" style="padding: 8px;">名称修改</p>
184
- </ul>
185
- <div class="form-horizontal" style="margin-top:20px;flex: 1;">
186
- <div class="row">
187
- <div class="col-sm-6">
188
- <label class="font_normal_body" >配置名称</label>
189
- <input type="text"
190
- v-model="model.name" style="width:60%"
191
- class="input_search full-with" placeholder="配置名称">
192
- </div>
193
- </div>
194
-
195
-
196
- <button @click="confirm1()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
197
- <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
198
- </button>
199
- <button @click='cancel1()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
200
- <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
201
- </button>
202
- </div>
203
- </validator>
204
- </div>
205
- </article>
206
- <footer slot="modal-footer" class="modal-footer">
207
- </footer>
208
- </modal>
209
- <modal :show.sync="modelshow2" v-ref:modal large backdrop="false">
210
- <header slot="modal-header" class="modal-header">
211
- <button type="button" class="close" @click="cancel2"><span style="color: black">&times;</span></button>
212
- </header>
213
- <article slot="modal-body" class="modal-body">
214
- <div class="auto select-overspread" >
215
- <validator name='v'>
216
- <ul class="nav nav-tabs">
217
- <p class="bg-info text-center" style="padding: 8px;">属性修改</p>
218
- </ul>
219
- <div class="form-horizontal" style="margin-top:20px;margin-bottom:20px;flex: 1;">
220
- <div class="row">
221
- <div class="col-sm-6" v-for="objs in updateArray">
222
- <label class="font_normal_body" >{{objs.label}}</label>
223
- <input v-if="objs.type=='input'" type="text"
224
- v-model="objs.value" style="width:60%"
225
- class="input_search full-with" :placeholder="objs.label">
226
- <v-select v-if="objs.type=='selector'"
227
- :value.sync="objs.value"
228
- v-model="objs.value" style="width:60%"
229
- close-on-select
230
- :value-single="true"
231
- :options="objs.options"
232
- class=" full-with" :placeholder="objs.label"></v-select>
233
- </div>
234
- </div>
235
-
236
-
237
- <button @click="confirm2()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
238
- <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
239
- </button>
240
- <button @click='cancel2()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
241
- <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
242
- </button>
243
- </div>
244
- </validator>
245
- </div>
246
- </article>
247
- <footer slot="modal-footer" class="modal-footer">
248
- </footer>
249
- </modal>
250
- <modal :show.sync="modeltelshow" v-ref:modal large backdrop="false">
251
- <header slot="modal-header" class="modal-header">
252
- <button type="button" class="close" @click="cancel"><span style="color: black">&times;</span></button>
253
- </header>
254
- <article slot="modal-body" class="modal-body">
255
- <div class="auto select-overspread" style="overflow-y: hidden">
256
- <validator name='v'>
257
- <ul class="nav nav-tabs">
258
- <p class="bg-info text-center" style="padding: 8px;">配置添加</p>
259
- </ul>
260
- <div class="form-horizontal" style="margin-top:20px;margin-bottom: 100px;maflex: 1;">
261
- <div class="row">
262
- <div class="col-sm-6">
263
- <label class="font_normal_body" >配置名称</label>
264
- <input type="text"
265
- v-model="model.name" style="width:60%"
266
- class="input_search full-with" placeholder="配置名称">
267
- </div>
268
- <div class="col-sm-6" v-if="modeldata.telindex===2">
269
- <label class="font_normal_body" >配置类型</label>
270
- <v-select
271
- v-model="model.type"
272
- :value.sync="model.type"
273
- :options='distype'
274
- close-on-select
275
- :value-single="true"
276
- clear-button>
277
- ></v-select>
278
- </div>
279
- <div class="col-sm-6" v-if="modeldata.telindex===2">
280
- <label class="font_normal_body" >配置数量</label>
281
- <input type="text"
282
- v-model="model.num" style="width:60%"
283
- class="input_search full-with" placeholder="配置数量">
284
- </div>
285
- <div class="row"></div>
286
- <button @click="telconfirm()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
287
- <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
288
- </button>
289
- <button @click='cancel()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
290
- <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
291
- </button>
292
- </div>
293
- </div>
294
- </validator>
295
- </div>
296
- </article>
297
- <footer slot="modal-footer" class="modal-footer">
298
- </footer>
299
- </modal>
300
- <modal :show.sync="modeltelshow1" v-ref:modal large backdrop="false">
301
- <header slot="modal-header" class="modal-header">
302
- <button type="button" class="close" @click="cancel1"><span style="color: black">&times;</span></button>
303
- </header>
304
- <article slot="modal-body" class="modal-body">
305
- <div class="auto select-overspread" style="overflow-y: hidden">
306
- <validator name='v'>
307
- <ul class="nav nav-tabs">
308
- <p class="bg-info text-center" style="padding: 8px;">名称修改</p>
309
- </ul>
310
- <div class="form-horizontal" style="margin-top:20px;flex: 1;">
311
- <div class="row">
312
- <div class="col-sm-6">
313
- <label class="font_normal_body" >配置名称</label>
314
- <input type="text"
315
- v-model="model.name" style="width:60%"
316
- class="input_search full-with" placeholder="配置名称">
317
- </div>
318
- </div>
319
- <button @click="contelfirm1()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
320
- <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
321
- </button>
322
- <button @click='cancel1()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
323
- <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
324
- </button>
325
- </div>
326
- </validator>
327
- </div>
328
- </article>
329
- <footer slot="modal-footer" class="modal-footer">
330
- </footer>
331
- </modal>
332
- <modal :show.sync="modeltelshow2" v-ref:modal large backdrop="false">
333
- <header slot="modal-header" class="modal-header">
334
- <button type="button" class="close" @click="cancel2"><span style="color: black">&times;</span></button>
335
- </header>
336
- <article slot="modal-body" class="modal-body">
337
- <div class="auto select-overspread" >
338
- <validator name='v'>
339
- <ul class="nav nav-tabs">
340
- <p class="bg-info text-center" style="padding: 8px;">属性修改</p>
341
- </ul>
342
- <div class="form-horizontal" style="margin-top:20px;margin-bottom:20px;flex: 1;">
343
- <div class="row">
344
- <div class="col-sm-6" v-for="objs in updateArray">
345
- <label class="font_normal_body" >{{objs.label}}</label>
346
- <input v-if="objs.type=='input'" type="text"
347
- v-model="objs.value" style="width:60%"
348
- class="input_search full-with" :placeholder="objs.label">
349
- <v-select v-if="objs.type=='selector'"
350
- :value.sync="objs.value"
351
- v-model="objs.value" style="width:60%"
352
- close-on-select
353
- :value-single="true"
354
- :options="objs.options"
355
- class=" full-with" :placeholder="objs.label"></v-select>
356
- </div>
357
- </div>
358
- <button @click="telconfirm2()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
359
- <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
360
- </button>
361
- <button @click='cancel2()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
362
- <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
363
- </button>
364
- </div>
365
- </validator>
366
- </div>
367
- </article>
368
- <footer slot="modal-footer" class="modal-footer">
369
- </footer>
370
- </modal>
371
- </div>
372
- </template>
373
-
374
- <script>
375
- import { HttpResetClass } from 'vue-client'
376
- export default {
377
- title: '配置修改',
378
- ready() {
379
-
380
- },
381
- data() {
382
- return {
383
- firstShow: true,
384
- dispositioName:'',
385
- curorgid: [this.$login.f.orgid],
386
- seaching:false,
387
- modelshow:false,
388
- modelshow1:false,
389
- modelshow2:false,
390
- modeltelshow:false,
391
- modeltelshow1:false,
392
- modeltelshow2:false,
393
- upmodel:{},
394
- f_dir:'',
395
- model:{},
396
- modeldata:{},
397
- rightshow:false,
398
- righttelshow:false,
399
- rightrow:{},
400
- rightelrow:{},
401
- rightdata:{},
402
- rightteldata:{},
403
- telArray: [],
404
- safeArray: [],
405
- updateArray:[],
406
- distype:[{label:"输入框",value:"string"},{label:"选择框",value:"selector"}],
407
- disposition:this.$appdata.getParam('配置名称'),
408
- safeConfig: {
409
- "民用配置项": {},
410
- "非民用配置项": {}
411
- },
412
- telConfig: {
413
- "民用配置项": {},
414
- "非民用配置项": {}
415
- }
416
- }
417
- },
418
- methods: {
419
- dispselect(val){
420
- if(val=='安检配置项' || val==""){
421
- this.firstShow=true
422
- }else{
423
- this.firstShow=false
424
- }
425
- },
426
- getorg(val) {
427
- this.f_filialeid = val[0]
428
- if (val[0]){
429
- new HttpResetClass().load('post','api/af-safecheck/sql/safe_singleTable_OrderBy',{data: {
430
- items: 'f_dir',
431
- tablename: 't_organization',
432
- condition: `id = '${val[0]}'`,
433
- orderitem: 'id'
434
- }}).then(res=>{
435
- if (!res.data[0].f_dir){
436
- this.$showMessage("该公司无组织目录,无法获取配置文件,请联系管理员确认")
437
- }else{
438
- this.f_dir=res.data[0].f_dir
439
- try {
440
- new HttpResetClass().load('GET',`/safecheck/rs/vue/DevicesConfig.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {},{resolveMsg: '获取居民配置项成功!', rejectMsg: '获取居民配置项出错!'}).then(res=>{
441
- //tag
442
- this.safeConfig["民用配置项"]=Object.assign({},res.data)
443
- })
444
- new HttpResetClass().load('GET',`/safecheck/rs/vue/DevicesSetConfig.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {},{resolveMsg: '获取非居民配置项成功!', rejectMsg: '获取非居民配置项出错!'}).then(res=>{
445
- //tag
446
- this.safeConfig["非民用配置项"]=Object.assign({},res.data)
447
- }).then(res=> {
448
- this.safeArray = []
449
- this.initArray()
450
- this.model = {}
451
- this.modeldata = {}
452
- })
453
- new HttpResetClass().load('GET',`/telephone/rs/vue/SubstitConfigBusiness.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {},{resolveMsg: '获取居民配置项成功!', rejectMsg: '获取居民配置项出错!'}).then(res=>{
454
- this.telConfig["非民用配置项"]=Object.assign({},res.data)
455
- })
456
- new HttpResetClass().load('GET',`/telephone/rs/vue/SubstitConfigCivil.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {},{resolveMsg: '获取非居民配置项成功!', rejectMsg: '获取非居民配置项出错!'}).then(res=>{
457
- this.telConfig["民用配置项"]=Object.assign({},res.data)
458
- }).then(res=> {
459
- this.telArray = []
460
- this.initTelArray()
461
- })
462
- }catch (e) {
463
- this.$showMessage("获取配置文件失败"+e)
464
- }
465
- }
466
- })
467
- }
468
- },
469
- isteldelete(item){
470
-
471
- if (item.telindex!=1){
472
- return true
473
- }
474
- },
475
- isdelete(item){
476
- if (item.safename=='燃气表'&&item.safeindex){
477
- return false
478
- }
479
- if (item.safeindex!='1'){
480
- return true
481
- }
482
- },
483
- isteladd(item){
484
- if (item.telindex===4){
485
- return false
486
- }if (item.telindex===3){
487
- return item.teltype==='selector'||item.teltype==='radio'
488
- }
489
- return true
490
- },
491
- isadd(item){
492
- if (item.safeindex=='4' ){
493
- return false
494
- }if (item.safeindex=='3'){
495
- return item.safetype=='selector'||item.safetype=='radio'
496
- }
497
- return true
498
- },
499
- telconfirm(){
500
- if (this.modeldata.telindex==1){
501
- for(var i=0;i<this.telConfig[this.modeldata.telname].data.length;i++){
502
- if (this.telConfig[this.modeldata.telname].data[i].f_type===this.model.name){
503
- this.$showMessage('已有配置名'+this.model.name+',修改失败')
504
- return
505
- }
506
- }
507
- }
508
- if (this.modeldata.telindex==2){
509
- for(var i=0;i<this.telConfig[this.modeldata.last].data.length;i++){
510
- for (var j = 0; j <this.telConfig[this.modeldata.last].data[i].details.length; j++) {
511
- if (this.telConfig[this.modeldata.last].data[i].details[j].f_project===this.model.name){
512
- this.$showMessage('已有配置名'+this.model.name+',修改失败')
513
- return
514
- }
515
- }
516
- }
517
- }
518
- if (this.modeldata.telindex==3){
519
- for(var i=0;i<this.telConfig[this.modeldata.lastlast].data.length;i++){
520
- for (var j = 0; j <this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
521
- if(!!this.telConfig[this.modeldata.lastlast].data[i].details[j].options){
522
- for (var k = 0; k < this.telConfig[this.modeldata.lastlast].data[i].details[j].options.length; k++) {
523
- if (this.telConfig[this.modeldata.lastlast].data[i].details[j].options[k].data===this.model.name){
524
- this.$showMessage('已有配置名'+this.model.name+',修改失败')
525
- return
526
- }
527
- }
528
- }
529
- }
530
- }
531
- }
532
- if (this.modeldata.telindex==1){
533
- this.telConfig[this.modeldata.telname].data.push({
534
- f_type:this.model.name,
535
- details:[]
536
- })
537
- }
538
- if (this.modeldata.telindex==2){
539
- for(var i=0;i<this.telConfig[this.modeldata.last].data.length;i++){
540
- if(this.telConfig[this.modeldata.last].data[i].f_type==this.modeldata.telname){
541
- if(this.model.type==""){
542
- this.$showMessage("请输入类型")
543
- return
544
- }
545
- if(this.model.type=="string"){
546
- this.telConfig[this.modeldata.last].data[i].details.push({
547
- f_project:this.model.name,
548
- level:"",
549
- type:this.model.type
550
- })
551
- }
552
- if(this.model.type=="selector"){
553
- let options=[]
554
- if(this.model.num>0){
555
- for (let j = 0; j <this.model.num; j++) {
556
- options.push({
557
- data:"请修改"+j,
558
- isdefect:false,
559
- f_status:false,
560
- isdefault: false
561
- })
562
- }
563
- }else{
564
- this.$showMessage("请输入选项数量")
565
- return
566
- }
567
- this.telConfig[this.modeldata.last].data[i].details.push({
568
- f_project:this.model.name,
569
- level:"",
570
- type:this.model.type,
571
- options:options
572
- })
573
- }
574
- }
575
- }
576
- }
577
- if (this.modeldata.telindex==3){
578
- for(var i=0;i<this.telConfig[this.modeldata.lastlast].data.length;i++){
579
- for (var j = 0; j <this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
580
- if(!!this.telConfig[this.modeldata.lastlast].data[i].details[j].options){
581
- if(this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project===this.modeldata.telname){
582
- this.telConfig[this.modeldata.lastlast].data[i].details[j].options.push({
583
- data:this.model.name,
584
- f_status:false,
585
- isdefect:false,
586
- isdefault:false
587
- })
588
- }
589
-
590
- }
591
- }
592
- }
593
- }
594
- let path
595
- let value
596
- if (this.modeldata.last=='民用配置项'||this.modeldata.lastlast=='民用配置项'||this.modeldata.lastlastlast=='民用配置项'){
597
- path= this.f_dir + `/phonevues/SubstitConfigCivil.json`
598
- value=this.telConfig["民用配置项"]
599
- }else{
600
- path= this.f_dir + `/phonevues/SubstitConfigBusiness.json`
601
- value=this.telConfig["非民用配置项"]
602
- }
603
- /*发送求情*/
604
- this.$resetpost('rs/vue/telSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=>{
605
- this.$showMessage("修改成功")
606
- /*刷新页面*/
607
- this.telArray = []
608
- this.initTelArray()
609
- this.cancel1()
610
- })
611
- },
612
- confirm() {
613
- ////tag
614
- if (this.modeldata.safeindex==1){
615
- //tag
616
- for(let name in this.safeConfig[this.modeldata.safename]){
617
- if(typeof name=='function'){
618
- continue
619
- }
620
- if (name==this.model.name){
621
- this.$showMessage('已有配置名'+name+',添加失败')
622
- return
623
- }
624
- }
625
- }
626
- if (this.modeldata.safeindex==2){
627
- for(let name in this.safeConfig[this.modeldata.safelast][this.modeldata.safename].items){
628
- if(typeof name=='function'){
629
- continue
630
- }
631
- if (name==this.model.name){
632
- this.$showMessage('已有配置名'+name+',添加失败')
633
- return
634
- }
635
- }
636
- //tag
637
- }
638
- if (this.modeldata.safeindex==3){
639
- for (let i = 0; i < this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].options.length; i++) {
640
- if (this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].options[i].data==this.model.name){
641
- this.$showMessage('已有配置名'+this.model.name+',添加失败')
642
- return
643
- }
644
- }
645
- //tag
646
- }
647
- ////tag
648
- ////tag)
649
- if (this.modeldata.safeindex=='1'){
650
- let index
651
- ////tag
652
- ////tag
653
- if (Object.keys(this.safeConfig[this.modeldata.safename]).length==0){
654
- index=0
655
- }else{
656
- for (let obj in this.safeConfig[this.modeldata.safename]) {
657
- if(typeof obj=='function'){
658
- continue
659
- }
660
- ////tag
661
- ////tag
662
- ////tag
663
- index = this.safeConfig[this.modeldata.safename][obj].index
664
- }
665
- }
666
- ////tag
667
- this.safeConfig[this.modeldata.safename][this.model.name] = {
668
- checkmust: true,
669
- index: index + 1,
670
- items:{}
671
- }
672
- ////tag)
673
- }
674
- if (this.modeldata.safeindex=='2'){
675
- let index
676
- ////tag
677
- ////tag
678
- if (Object.keys(this.safeConfig[this.modeldata.safelast][this.modeldata.safename].items).length==0){
679
- index=0
680
- }else{
681
- for (let obj in this.safeConfig[this.modeldata.safelast][this.modeldata.safename].items) {
682
- if(typeof obj=='function'){
683
- continue
684
- }
685
- ////tag
686
- ////tag
687
- ////tag
688
- index = this.safeConfig[this.modeldata.safelast][this.modeldata.safename].items[obj].index
689
- }
690
- }
691
-
692
- ////tag
693
- this.safeConfig[this.modeldata.safelast][this.modeldata.safename].items[this.model.name] = {
694
- index: index + 1,
695
- multiple: false,
696
- options:[],
697
- isshow:true,
698
- checkmust:false,
699
- type: "selector"
700
- }
701
- ////tag)
702
- }
703
- if (this.modeldata.safeindex=='3'){
704
- let index
705
- ////tag
706
- ////tag
707
- ////tag
708
- this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].options.push({
709
- data:this.model.name,
710
- isdefect:false,
711
- level:'A',
712
- isdefault:false
713
- })
714
-
715
- ////tag)
716
- }
717
- let path
718
- let value
719
- if (this.modeldata.safelast=='民用配置项'||this.modeldata.safelastlast=='民用配置项'||this.modeldata.safelastlastlast=='民用配置项'){
720
- path= this.f_dir + `/phonevues/DevicesConfig.json`
721
- value=this.safeConfig["民用配置项"]
722
- }else{
723
- path= this.f_dir + `/phonevues/DevicesSetConfig.json`
724
- value=this.safeConfig["非民用配置项"]
725
- }
726
-
727
- this.$resetpost('rs/vue/safeSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=> {
728
-
729
- this.$showMessage("保存成功")
730
- this.safeArray = []
731
- this.initArray()
732
- this.model = {}
733
- this.modeldata = {}
734
- this.rightshow = false
735
- this.modelshow = false
736
- })
737
-
738
- },
739
- cancel() {
740
- this.model={}
741
- this.modeldata={}
742
- this.modelshow = false
743
- this.modeltelshow = false
744
- },
745
- confirm1() {
746
- if (this.modeldata.safeindex==2){
747
- //tag
748
- for(let name in this.safeConfig[this.modeldata.safelast]){
749
- if(typeof name=='function'){
750
- continue
751
- }
752
- if (name==this.model.name){
753
- this.$showMessage('已有配置名'+name+',修改失败')
754
- return
755
- }
756
- }
757
- }
758
- if (this.modeldata.safeindex==3){
759
- for(let name in this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items){
760
- if(typeof name=='function'){
761
- continue
762
- }
763
- if (name==this.model.name){
764
- this.$showMessage('已有配置名'+name+',修改失败')
765
- return
766
- }
767
- }
768
- //tag
769
- }
770
- if (this.modeldata.safeindex==4){
771
- for (let i = 0; i < this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options.length; i++) {
772
- if (this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options[i].data==this.model.name){
773
- this.$showMessage('已有配置名'+this.model.name+',修改失败')
774
- return
775
- }
776
- }
777
- //tag
778
- }
779
- this.seaching=true
780
- ////tag
781
- ////tag)
782
-
783
- if (this.modeldata.safeindex=='2'){
784
- this.safeConfig[this.modeldata.safelast][this.model.name]=Object.assign({},this.safeConfig[this.modeldata.safelast][this.modeldata.safename])
785
- delete this.safeConfig[this.modeldata.safelast][this.modeldata.safename]
786
- }
787
- if (this.modeldata.safeindex=='3'){
788
- this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.model.name]=Object.assign({},this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename])
789
- delete this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename]
790
- }
791
- if (this.modeldata.safeindex=='4'){
792
- ////tag
793
- ////tag)
794
- for (let i = 0; i < this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options.length; i++) {
795
- if(this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options[i].data==this.modeldata.safename){
796
- this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options[i].data=this.model.name
797
- }
798
- }
799
- }
800
- let path
801
- let value
802
- if (this.modeldata.safelast=='民用配置项'||this.modeldata.safelastlast=='民用配置项'||this.modeldata.safelastlastlast=='民用配置项'){
803
- path= this.f_dir + `/phonevues/DevicesConfig.json`
804
- value=this.safeConfig["民用配置项"]
805
- }else{
806
- path= this.f_dir + `/phonevues/DevicesSetConfig.json`
807
- value=this.safeConfig["非民用配置项"]
808
- }
809
-
810
- this.$resetpost('rs/vue/safeSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=>{
811
- this.$showMessage("修改成功")
812
- this.safeArray = []
813
- this.initArray()
814
- this.model={}
815
- this.modeldata={}
816
- this.rightshow=false
817
- this.modelshow1 = false
818
- this.seaching=false
819
- })
820
-
821
-
822
- },
823
- contelfirm1() {
824
- if (this.modeldata.telindex===2){
825
- for( var i=0;i<this.telConfig[this.modeldata.last].data.length;i++){
826
- if (this.telConfig[this.modeldata.last].data[i].f_type===this.model.name){
827
- this.$showMessage('已有配置名'+this.model.name+',修改失败')
828
- return
829
- }
830
- }
831
- }
832
- if (this.modeldata.telindex===3){
833
- for(var i=0;i<this.telConfig[this.modeldata.lastlast].data.length;i++){
834
- for (let j = 0; j <this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
835
- if (this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project===this.model.name){
836
- this.$showMessage('已有配置名'+this.model.name+',修改失败')
837
- return
838
- }
839
- }
840
- }
841
- }
842
- if (this.modeldata.telindex===4){
843
- for(var i=0;i<this.telConfig[this.modeldata.lastlastlast].data.length;i++){
844
- for (var j = 0; j <this.telConfig[this.modeldata.lastlastlast].data[i].details.length; j++) {
845
- if(!!this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options){
846
- for (var k = 0; k < this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options.length; k++) {
847
- if (this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].data===this.model.name){
848
- this.$showMessage('已有配置名'+this.model.name+',修改失败')
849
- return
850
- }
851
- }
852
- }
853
- }
854
- }
855
- }
856
- this.seaching=true
857
- if (this.modeldata.telindex==2){
858
- for( var i=0;i<this.telConfig[this.modeldata.last].data.length;i++){
859
- if (this.telConfig[this.modeldata.last].data[i].f_type===this.modeldata.telname){
860
- this.telConfig[this.modeldata.last].data[i].f_type=this.model.name
861
- }
862
- }
863
- }
864
-
865
- if (this.modeldata.telindex==3){
866
- for(var i=0;i<this.telConfig[this.modeldata.lastlast].data.length;i++){
867
- for (let j = 0; j <this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
868
- if (this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project===this.modeldata.telname){
869
- this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project=this.model.name
870
- }
871
- }
872
- }
873
- }
874
- if (this.modeldata.telindex==4){
875
- for(var i=0;i<this.telConfig[this.modeldata.lastlastlast].data.length;i++){
876
- for (var j = 0; j <this.telConfig[this.modeldata.lastlastlast].data[i].details.length; j++) {
877
- if(!!this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options){
878
- for (var k = 0; k < this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options.length; k++) {
879
- if (this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].data===this.modeldata.telname){
880
- this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].data=this.model.name
881
- }
882
- }
883
- }
884
- }
885
- }
886
- }
887
- let path
888
- let value
889
- if (this.modeldata.last=='民用配置项'||this.modeldata.lastlast=='民用配置项'||this.modeldata.lastlastlast=='民用配置项'){
890
- path= this.f_dir + `/phonevues/SubstitConfigCivil.json`
891
- value=this.telConfig["民用配置项"]
892
- }else{
893
- path= this.f_dir + `/phonevues/SubstitConfigBusiness.json`
894
- value=this.telConfig["非民用配置项"]
895
- }
896
- /*发送求情*/
897
- this.$resetpost('rs/vue/telSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=>{
898
- this.$showMessage("修改成功")
899
- /*刷新页面*/
900
- this.telArray = []
901
- this.initTelArray()
902
- this.cancel1()
903
- })
904
- },
905
- cancel1() {
906
- this.model={}
907
- this.modeldata={}
908
- this.modelshow1 = false
909
- this.modeltelshow1 = false
910
- },
911
- addsafeConfig(item) {
912
- this.modeldata = item
913
- this.modeltelshow= true
914
- },
915
- deletetelConfig(item){
916
- this.$showMessage('删除后无法恢复,确认删除吗?',['confirm','cancel']).then(res=>{
917
- if (res=='confirm'){
918
- if (item.telindex==2){
919
- for(var i=0;i<this.telConfig[item.last].data.length;i++){
920
- if(this.telConfig[item.last].data[i].f_type===item.telname){
921
- this.telConfig[item.last].data.splice(i, 1);
922
- i--;
923
-
924
- }
925
- }
926
- }else if (item.telindex==3){
927
- for(var i=0;i<this.telConfig[item.lastlast].data.length;i++){
928
- for (var j = 0; j <this.telConfig[item.lastlast].data[i].details.length; j++) {
929
- console.log(this.telConfig[item.lastlast].data[i].details[j].f_project)
930
- if (this.telConfig[item.lastlast].data[i].details[j].f_project===item.telname){
931
- //移除这个对象
932
- // 移除这个对象
933
- this.telConfig[item.lastlast].data[i].details.splice(j, 1);
934
- // 移除后需要调整 j 的值,因为数组长度减少了
935
- j--;
936
- }
937
- }
938
- }
939
- }else if (item.telindex==4){
940
- for(var i=0;i<this.telConfig[item.lastlastlast].data.length;i++){
941
- for (var j = 0; j <this.telConfig[item.lastlastlast].data[i].details.length; j++) {
942
- if(!!this.telConfig[item.lastlastlast].data[i].details[j].options){
943
- for(var k = 0; k < this.telConfig[item.lastlastlast].data[i].details[j].options.length; k++){
944
- if(this.telConfig[item.lastlastlast].data[i].details[j].options[k].data===item.telname &&this.telConfig[item.lastlastlast].data[i].details[j].f_project===item.last){
945
- //除这个对象
946
- this.telConfig[item.lastlastlast].data[i].details[j].options.splice(k, 1);
947
- // 移除后需要调整 k 的值,因为数组长度减少了
948
- k--;
949
-
950
- }
951
- }
952
- }
953
- }
954
- }
955
- }
956
- let path
957
- let value
958
- if (this.modeldata.last==='民用配置项'||this.modeldata.lastlast==='民用配置项'||this.modeldata.lastlastlast==='民用配置项'){
959
- path= this.f_dir + `/phonevues/SubstitConfigCivil.json`
960
- value=this.telConfig["民用配置项"]
961
- }else{
962
- path= this.f_dir + `/phonevues/SubstitConfigBusiness.json`
963
- value=this.telConfig["非民用配置项"]
964
- }
965
- /*发送求情*/
966
- this.$resetpost('rs/vue/telSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=>{
967
- this.$showMessage("修改成功")
968
- this.telArray = []
969
- this.initTelArray()
970
- this.cancel2()
971
- })
972
- }
973
- })
974
- },
975
- deletesafeConfig(item){
976
- this.$showMessage('删除后无法恢复,确认删除吗?',['confirm','cancel']).then(res=>{
977
- if (res=='confirm'){
978
- this.seaching=true
979
- if (item.safeindex=='2'){
980
- ////tag
981
- if (item.safename=='燃气表'){
982
- this.$showMessage("燃气表不允许删除!!!")
983
- return
984
- }else{
985
- ////tag
986
- delete this.safeConfig[item.safelast][item.safename]
987
-
988
- for(let name in this.safeConfig[item.safelast]){
989
- if(typeof name=='function'){
990
- continue
991
- }
992
- if (this.safeConfig[item.safelast][name].index>item.safesort){
993
- this.safeConfig[item.safelast][name].index=this.safeConfig[item.safelast][name].index-1
994
- }
995
- }
996
- }
997
- }else if (item.safeindex=='3'){
998
- delete this.safeConfig[item.safelastlast][item.safelast].items[item.safename]
999
- for(let name in this.safeConfig[item.safelastlast][item.safelast].items){
1000
- if(typeof name=='function'){
1001
- continue
1002
- }
1003
- if (this.safeConfig[item.safelastlast][item.safelast].items[name].index>item.safesort){
1004
- this.safeConfig[item.safelastlast][item.safelast].items[name].index=this.safeConfig[item.safelastlast][item.safelast].items[name].index-1
1005
- }
1006
- }
1007
- }else if (item.safeindex=='4'){
1008
- for (let i = 0; i < this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options.length; i++) {
1009
- if (this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i].data==item.safename){
1010
- this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options.splice(i,1)
1011
- }
1012
- }
1013
- }
1014
- let path
1015
- let value
1016
- if (item.safelast=='民用配置项'||item.safelastlast=='民用配置项'||item.safelastlastlast=='民用配置项'){
1017
- path= this.f_dir + `/phonevues/DevicesConfig.json`
1018
- value=this.safeConfig["民用配置项"]
1019
- }else{
1020
- path= this.f_dir + `/phonevues/DevicesSetConfig.json`
1021
- value=this.safeConfig["非民用配置项"]
1022
- }
1023
-
1024
- this.$resetpost('rs/vue/safeSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=> {
1025
-
1026
- this.$showMessage("删除成功")
1027
- this.safeArray = []
1028
- this.initArray()
1029
- this.model = {}
1030
- this.modeldata = {}
1031
- this.rightshow = false
1032
- this.modelshow2 = false
1033
- // this.sleep(2000);
1034
- this.seaching = false
1035
- })
1036
- }
1037
- })
1038
-
1039
- },
1040
- updatesafeConfig(item){
1041
- this.modeldata=item
1042
- //tag
1043
- let array=[]
1044
- if (item.safeindex=='2') {
1045
- //tag)
1046
- let aa = {"checkmust": false, "index": 1}
1047
- if (this.safeConfig[item.safelast][item.safename].checkmust) {
1048
- array.push({
1049
- label: '是否必填',
1050
- value: true,
1051
- type: 'selector',
1052
- name:'checkmust',
1053
- options: [{label: '是', value: true}, {label: '否', value: false}]
1054
- })
1055
- } else {
1056
- array.push({
1057
- label: '是否必填',
1058
- value: false,
1059
- type: 'selector',
1060
- name:'checkmust',
1061
- options: [{label: '是', value: true}, {label: '否', value: false}]
1062
- })
1063
- }
1064
- }
1065
- if (item.safeindex=='3'){
1066
- let aa={"index":1,"multiple":false,"isshow":true,"checkmust":false,"type":"selector"}
1067
- for (let key in this.safeConfig[item.safelastlast][item.safelast].items[item.safename]){
1068
- if(typeof key=='function'){
1069
- continue
1070
- }
1071
- if (key=='index'){
1072
-
1073
- }else if(key=='multiple'){
1074
- array.push({
1075
- label: '是否多选',
1076
- value: this.safeConfig[item.safelastlast][item.safelast].items[item.safename][key],
1077
- name:key,
1078
- type: 'selector',
1079
- options: [{label: '是', value: true}, {label: '否', value: false}]
1080
- })
1081
- }else if(key=='options'){
1082
-
1083
- }else if(key=='isshow'){
1084
- array.push({
1085
- label: '是否展示',
1086
- value: this.safeConfig[item.safelastlast][item.safelast].items[item.safename][key],
1087
- name:key,
1088
- type: 'selector',
1089
- options: [{label: '是', value: true}, {label: '否', value: false}]
1090
- })
1091
- }else if(key=='checkmust'){
1092
- array.push({
1093
- label: '是否必填',
1094
- value: this.safeConfig[item.safelastlast][item.safelast].items[item.safename][key],
1095
- name:key,
1096
- type: 'selector',
1097
- options: [{label: '是', value: true}, {label: '否', value: false}]
1098
- })
1099
- }else if(key=='type'){
1100
- array.push({
1101
- label: '配置类型',
1102
- value: this.safeConfig[item.safelastlast][item.safelast].items[item.safename][key],
1103
- name:key,
1104
- type: 'selector',
1105
- options: [{label: '输入框', value: 'string'}, {label: '选择框', value: 'selector'}, {label: '勾选框', value: 'radio'},{label: '图片框', value: 'picture'}]
1106
- })
1107
- }
1108
- }
1109
- //tag)
1110
- }
1111
- if (item.safeindex=='4'){
1112
- let aa={"data":"333333333","isdefect":"否","level":"A","isdefault":"否"}
1113
- for (let i = 0; i < this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options.length; i++) {
1114
- if (this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i].data==item.safename){
1115
- //tag)
1116
- for(let key in this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i]){
1117
- if(typeof key=='function'){
1118
- continue
1119
- }
1120
- if(key=='data'){
1121
-
1122
- }else if(key=='isdefect'){
1123
- array.push({
1124
- label: '是否隐患',
1125
- value: this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i][key],
1126
- name:key,
1127
- type: 'selector',
1128
- options: [{label: '是', value: true}, {label: '否', value: false}]
1129
- })
1130
- }else if(key=='isdefault'){
1131
- array.push({
1132
- label: '是否默认',
1133
- value: this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i][key],
1134
- name:key,
1135
- type: 'selector',
1136
- options: [{label: '是否默认', value: ''},{label: '是', value: true}, {label: '否', value: false}]
1137
- })
1138
-
1139
- }else if(key=='level'){
1140
- array.push({
1141
- label: '隐患级别',
1142
- value: this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i][key],
1143
- name:key,
1144
- type: 'input',
1145
- })
1146
-
1147
- }
1148
- }
1149
- }
1150
- }
1151
- }
1152
- //tag
1153
- //tag
1154
- this.updateArray=Object.assign([],array)
1155
- this.modelshow2=true
1156
- },
1157
- updatetelConfig(item){
1158
- this.modeldata=item
1159
- let array=[]
1160
- if (item.telindex==2) {
1161
- }
1162
- if (item.telindex==3){
1163
- for(var i=0;i<this.telConfig[this.modeldata.lastlast].data.length;i++){
1164
- for (var j = 0; j <this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
1165
- if (this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project===this.modeldata.telname){
1166
- for(let key in this.telConfig[this.modeldata.lastlast].data[i].details[j]){
1167
- if(typeof key=='function'){
1168
- continue
1169
- }
1170
- if(key==='level'){
1171
- array.push({
1172
- label: '隐患级别',
1173
- value: this.telConfig[this.modeldata.lastlast].data[i].details[j].level,
1174
- name:key,
1175
- type: 'input',
1176
- })
1177
- }
1178
- }
1179
- }
1180
- }
1181
- }
1182
- }
1183
- if (item.telindex===4){
1184
- for(var i=0;i<this.telConfig[this.modeldata.lastlastlast].data.length;i++){
1185
- for (var j = 0; j <this.telConfig[this.modeldata.lastlastlast].data[i].details.length; j++) {
1186
- if(!!this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options){
1187
- for(var k = 0; k < this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options.length; k++){
1188
- if(this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].data===this.modeldata.telname &&this.telConfig[this.modeldata.lastlastlast].data[i].details[j].f_project===this.modeldata.last){
1189
- for(var key in this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k]){
1190
- if(typeof key=='function'){
1191
- continue
1192
- }
1193
- if(key==='isdefect'){
1194
- array.push({
1195
- label: '隐患',
1196
- value: this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].isdefect,
1197
- name:key,
1198
- type: 'input',
1199
- })
1200
- }
1201
- if(key==='isdefault'){
1202
- array.push({
1203
- label: '是否默认',
1204
- value: this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].isdefault,
1205
- name:key,
1206
- type: 'input',
1207
- })
1208
- }
1209
- if(key==='f_status'){
1210
- array.push({
1211
- label: '是否异常',
1212
- value: this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].f_status,
1213
- name:key,
1214
- type: 'input',
1215
- })
1216
- }
1217
- }
1218
- }
1219
- }
1220
- }
1221
- }
1222
- }
1223
- }
1224
- this.updateArray=Object.assign([],array)
1225
- this.modeltelshow2=true
1226
- },
1227
- confirm2(){
1228
- this.seaching=true
1229
- if (this.modeldata.safeindex=='2'){
1230
- for (let i = 0; i < this.updateArray.length; i++) {
1231
- this.safeConfig[this.modeldata.safelast][this.modeldata.safename][this.updateArray[i].name]=this.updateArray[i].value
1232
- }
1233
- }
1234
- if (this.modeldata.safeindex=='3'){
1235
- for (let i = 0; i < this.updateArray.length; i++) {
1236
- this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename][this.updateArray[i].name]=this.updateArray[i].value
1237
- if (this.updateArray[i].name=='type'&&this.updateArray[i].value!='selector'&&this.updateArray[i].value!='radio'){
1238
-
1239
- if (this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].hasOwnProperty('options')){
1240
- delete this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].options
1241
- }
1242
- }
1243
- if (this.updateArray[i].name=='type'&&(this.updateArray[i].value=='selector'||this.updateArray[i].value!='radio')){
1244
- if (!this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].hasOwnProperty('options')){
1245
- this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].options=[]
1246
- }
1247
- }
1248
- }
1249
-
1250
- }
1251
- if (this.modeldata.safeindex=='4'){
1252
-
1253
- for (let i = 0; i < this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options.length; i++) {
1254
- if(this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options[i].data==this.modeldata.safename){
1255
- for (let j = 0; j < this.updateArray.length; j++) {
1256
-
1257
-
1258
- this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options[i][this.updateArray[j].name]=this.updateArray[j].value
1259
- }
1260
- }
1261
- }
1262
- }
1263
- let path
1264
- let value
1265
- if (this.modeldata.safelast=='民用配置项'||this.modeldata.safelastlast=='民用配置项'||this.modeldata.safelastlastlast=='民用配置项'){
1266
- path= this.f_dir + `/phonevues/DevicesConfig.json`
1267
- value=this.safeConfig["民用配置项"]
1268
- }else{
1269
- path= this.f_dir + `/phonevues/DevicesSetConfig.json`
1270
- value=this.safeConfig["非民用配置项"]
1271
- }
1272
-
1273
- this.$resetpost('rs/vue/safeSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=> {
1274
-
1275
- this.$showMessage("修改成功")
1276
- this.safeArray = []
1277
- this.initArray()
1278
- this.model = {}
1279
- this.modeldata = {}
1280
- this.rightshow = false
1281
- this.modelshow2 = false
1282
- this.seaching = false
1283
- })
1284
- },
1285
- telconfirm2(){
1286
- this.seaching=true
1287
- if (this.modeldata.telindex==3) {
1288
- for (var i = 0; i< this.telConfig[this.modeldata.lastlast].data.length; i++) {
1289
- for (var j = 0; j < this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
1290
- if (this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project === this.modeldata.telname) {
1291
- for (let key in this.telConfig[this.modeldata.lastlast].data[i].details[j]) {
1292
- for (let K = 0; K< this.updateArray.length; K++) {
1293
- if(this.updateArray[K].name===key){
1294
- this.telConfig[this.modeldata.lastlast].data[i].details[j][key]=this.updateArray[K].value
1295
- }
1296
- }
1297
- }
1298
- }
1299
- }
1300
- }
1301
- }
1302
- if (this.modeldata.telindex==4){
1303
- for(var i=0;i<this.telConfig[this.modeldata.lastlastlast].data.length;i++){
1304
- for (var j = 0; j <this.telConfig[this.modeldata.lastlastlast].data[i].details.length; j++) {
1305
- if(!!this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options){
1306
- for(var k = 0; k < this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options.length; k++){
1307
- if(this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].data===this.modeldata.telname &&this.telConfig[this.modeldata.lastlastlast].data[i].details[j].f_project===this.modeldata.last){
1308
- for(var key in this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k]){
1309
- for (var l = 0; l< this.updateArray.length; l++) {
1310
- if(this.updateArray[l].name===key){
1311
- this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k][key]=this.updateArray[l].value
1312
- }
1313
- }
1314
- }
1315
- }
1316
- }
1317
- }
1318
- }
1319
- }
1320
- }
1321
- let path
1322
- let value
1323
- if (this.modeldata.last==='民用配置项'||this.modeldata.lastlast==='民用配置项'||this.modeldata.lastlastlast==='民用配置项'){
1324
- path= this.f_dir + `/phonevues/SubstitConfigCivil.json`
1325
- value=this.telConfig["民用配置项"]
1326
- }else{
1327
- path= this.f_dir + `/phonevues/SubstitConfigBusiness.json`
1328
- value=this.telConfig["非民用配置项"]
1329
- }
1330
- /*发送求情*/
1331
- this.$resetpost('rs/vue/telSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=>{
1332
- this.$showMessage("修改成功")
1333
- this.telArray = []
1334
- this.initTelArray()
1335
- this.cancel2()
1336
- })
1337
- },
1338
- cancel2(){
1339
- this.modelshow2=false
1340
- this.modeltelshow2=false
1341
- },
1342
- updatesafeConfigName(item){
1343
-
1344
- this.$set('model.name',item.safename)
1345
- this.modeldata=Object.assign({},item)
1346
- this.modelshow1=true
1347
- },
1348
- updatetelConfigName(item){
1349
- this.$set('model.name',item.telname)
1350
- this.modeldata=Object.assign({},item)
1351
- this.modeltelshow1=true
1352
- },
1353
- initArray() {
1354
- for (let bigsafe in this.safeConfig) {
1355
- if(typeof bigsafe=='function'){
1356
- continue
1357
- }
1358
- ////tag
1359
- ////tag)
1360
- this.safeArray.push({
1361
- selectedshow: false,
1362
- safetype: '',
1363
- safeshow: false,
1364
- safename: bigsafe,
1365
- safevalue: this.safeConfig[bigsafe] ? Object.keys(this.safeConfig[bigsafe]).length : 0,
1366
- safeindex: 1
1367
- })
1368
- }
1369
- this.seaching=false
1370
- },
1371
- initTelArray(){
1372
- //延时0.5s,后执行
1373
- setTimeout(()=>{
1374
- for (let bigsafe in this.telConfig) {
1375
- if (typeof bigsafe == 'function') {
1376
- continue
1377
- }
1378
- this.telArray.push({
1379
- selectedshow: false,
1380
- teltype:'',
1381
- telshow: false,
1382
- telname: bigsafe,
1383
- telvalue: this.telConfig[bigsafe] ? this.telConfig[bigsafe].data.length : 0,
1384
- telindex: 1,
1385
- type:bigsafe
1386
- })
1387
- }
1388
- },1000)
1389
- },
1390
- tlepushArray(val, arrayindex) {
1391
- let spliceindex = arrayindex + 1
1392
- if(this.telArray[arrayindex].telshow == false){
1393
- this.telArray[arrayindex].telshow = true
1394
- if(val.telindex==1){
1395
- let linshiarray = []
1396
- for (let two in this.telConfig[val.telname].data){
1397
- linshiarray.push({
1398
- selectedshow:false,
1399
- telsort:two+1 ,
1400
- teltype:'',
1401
- type: val.type,
1402
- telshow: false,
1403
- telname: this.telConfig[val.telname].data[two].f_type,
1404
- telvalue: this.telConfig[val.telname].data[two].details.length,
1405
- telindex: 2,
1406
- last:val.telname //fei
1407
- })
1408
- }
1409
- linshiarray=this.jsonSort(linshiarray, "telsort",true)
1410
- for (let i = 0; i < linshiarray.length; i++) {
1411
- this.telArray.splice(spliceindex, 0,linshiarray[i])
1412
- }
1413
- }
1414
- if(val.telindex==2){
1415
- let linshiarray = [];
1416
- for (var i = 0; i < this.telConfig[val.type].data.length; i++) {
1417
- if (this.telConfig[val.type].data[i].f_type === val.telname) {
1418
- for (var j = 0; j < this.telConfig[val.type].data[i].details.length; j++) {
1419
- linshiarray.push({
1420
- type:val.type,
1421
- selectedshow: false,
1422
- telsort: j+1,
1423
- teltype: this.telConfig[val.type].data[i].details[j].type,
1424
- telshow: false,
1425
- telname: this.telConfig[val.type].data[i].details[j].f_project,
1426
- telvalue: this.telConfig[val.type].data[i].details[j].options?this.telConfig[val.type].data[i].details[j].options.length:0,
1427
- telindex: 3,
1428
- last: val.telname,
1429
- lastlast:val.last,
1430
- });
1431
- }
1432
- }
1433
- }
1434
- linshiarray=this.jsonSort(linshiarray, "telsort",true)
1435
- for (let i = 0; i < linshiarray.length; i++) {
1436
- this.telArray.splice(spliceindex, 0,linshiarray[i])
1437
- }
1438
- }
1439
- if(val.telindex==3){
1440
- let linshiarray = [];
1441
- for (var m = 0; m < this.telConfig[val.type].data.length; m++) {
1442
- for (var n = 0; n < this.telConfig[val.type].data[m].details.length; n++){
1443
- if(this.telConfig[val.type].data[m].details[n].f_project==val.telname){
1444
- for (var p = 0; p < this.telConfig[val.type].data[m].details[n].options.length; p++){
1445
- linshiarray.push({
1446
- telindex: 4,
1447
- type:val.type,
1448
- selectedshow: false,
1449
- telsort: p+1,
1450
- teltype: this.telConfig[val.type].data[m].details[n].options[p].type,
1451
- telshow: false,
1452
- telname: this.telConfig[val.type].data[m].details[n].options[p].data,
1453
- telvalue: this.telConfig[val.type].data[m].details[n].options[p].options?this.telConfig[val.type].data[m].details[n].options[p].options.length:0,
1454
- last:val.telname,
1455
- lastlast:val.last,
1456
- lastlastlast:val.lastlast
1457
-
1458
- })
1459
- }
1460
- }
1461
- }
1462
- }
1463
- linshiarray=this.jsonSort(linshiarray, "telsort",true)
1464
- for (let i = 0; i < linshiarray.length; i++) {
1465
- this.telArray.splice(spliceindex, 0,linshiarray[i])
1466
- }
1467
- }
1468
- }else if(this.telArray[arrayindex].telshow ===true){
1469
- this.telArray[arrayindex].telshow = false
1470
- for (let i = 0; i < this.telArray.length; i++) {
1471
- if (this.telArray[i].last === this.telArray[arrayindex].telname
1472
- || this.telArray[i].lastlast === this.telArray[arrayindex].telname
1473
- || this.telArray[i].lastlastlast === this.telArray[arrayindex].telname) {
1474
- if(this.telArray[arrayindex].type===this.telArray[i].type){
1475
- //从数组中移除
1476
- this.telArray.splice(i, 1);
1477
- i--; // 由于删除了元素,索引需要减1
1478
- }
1479
-
1480
- }
1481
- }
1482
- }
1483
- },
1484
- closeright() {
1485
- this.rightshow = false
1486
- this.righttelshow = false
1487
- },
1488
- getlastname() {
1489
- if (this.rightrow.safelast) {
1490
- return this.rightrow.safelast
1491
- }
1492
- return '无'
1493
- },
1494
- pushArray(val, arrayindex) {
1495
- ////tag
1496
- ////tag)
1497
- ////tag)
1498
- if (this.safeArray[arrayindex].safeshow == false) {
1499
- let spliceindex = arrayindex + 1
1500
- this.safeArray[arrayindex].safeshow = true
1501
- if (val.safeindex == '1') {
1502
- let linshiarray = []
1503
- for (let two in this.safeConfig[val.safename]) {
1504
- if(typeof two=='function'){
1505
- continue
1506
- }
1507
- ////tag
1508
- ////tag)
1509
-
1510
- linshiarray.push({
1511
- selectedshow: false,
1512
- safesort: this.safeConfig[val.safename][two].index,
1513
- safetype: '',
1514
- safeshow: false,
1515
- safename: two,
1516
- safevalue: this.safeConfig[val.safename][two].items ? Object.keys(this.safeConfig[val.safename][two].items).length : 0,
1517
- safeindex: 2,
1518
- safelast: val.safename
1519
- })
1520
-
1521
- }
1522
- linshiarray=this.jsonSort(linshiarray, "safesort",true)
1523
- ////tag
1524
- ////tag)
1525
- for (let i = 0; i < linshiarray.length; i++) {
1526
- this.safeArray.splice(spliceindex, 0,linshiarray[i])
1527
- }
1528
- }
1529
- if (val.safeindex == '2') {
1530
- let linshiarray = []
1531
- let aa = {"safename": "燃气表", "safevalue": 3, "safeindex": 2, "safelast": "民用配置项"}
1532
- for (let isthree in this.safeConfig[val.safelast][val.safename]) {
1533
- if(typeof isthree=='function'){
1534
- continue
1535
- }
1536
- if (isthree == 'items') {
1537
- for (let three in this.safeConfig[val.safelast][val.safename].items) {
1538
- if(typeof three=='function'){
1539
- continue
1540
- }
1541
- ////tag
1542
- ////tag
1543
- ////tag
1544
- ////tag)
1545
- ////tag)
1546
- linshiarray.push({
1547
- safesort:this.safeConfig[val.safelast][val.safename].items[three].index,
1548
- selectedshow: false,
1549
- safetype: this.safeConfig[val.safelast][val.safename].items[three].type,
1550
- safeshow: false,
1551
- safename: three,
1552
- safevalue: this.safeConfig[val.safelast][val.safename].items[three].options ? Object.keys(this.safeConfig[val.safelast][val.safename].items[three].options).length : 0,
1553
- safeindex: 3,
1554
- safelast: val.safename,
1555
- safelastlast: val.safelast
1556
- })
1557
- }
1558
- linshiarray=this.jsonSort(linshiarray, "safesort",true)
1559
- ////tag
1560
- ////tag)
1561
- for (let i = 0; i < linshiarray.length; i++) {
1562
- this.safeArray.splice(spliceindex, 0,linshiarray[i])
1563
- }
1564
- }
1565
- }
1566
-
1567
- }
1568
- if (val.safeindex == '3') {
1569
- let linshiarray = []
1570
- let aa = {
1571
- "safename": "燃气表有无改装在卧室、卫生间、客厅",
1572
- "safevalue": 4,
1573
- "safeindex": 3,
1574
- "safelast": "燃气表",
1575
- "safelastlast": "民用配置项"
1576
- }
1577
- for (let isfour in this.safeConfig[val.safelastlast][val.safelast].items[val.safename]) {
1578
- if(typeof isfour=='function'){
1579
- continue
1580
- }
1581
- if (isfour == 'options') {
1582
- for (let four in this.safeConfig[val.safelastlast][val.safelast].items[val.safename].options) {
1583
- if(typeof four=='function'){
1584
- continue
1585
- }
1586
- ////tag
1587
- ////tag
1588
- ////tag)
1589
- ////tag)
1590
- ////tag)
1591
- linshiarray.push({
1592
- safesort:four,
1593
- selectedshow: false,
1594
- safetype: 'no',
1595
- safeshow: false,
1596
- safename: this.safeConfig[val.safelastlast][val.safelast].items[val.safename].options[four].data,
1597
- safevalue: 0,
1598
- safeindex: 4,
1599
- safelast: val.safename,
1600
- safelastlast: val.safelast,
1601
- safelastlastlast: val.safelastlast,
1602
- })
1603
- }
1604
- linshiarray=this.jsonSort(linshiarray, "safesort",true)
1605
- ////tag
1606
- ////tag)
1607
- for (let i = 0; i < linshiarray.length; i++) {
1608
- this.safeArray.splice(spliceindex, 0,linshiarray[i])
1609
- }
1610
-
1611
- }
1612
- }
1613
- }
1614
- } else {
1615
- let deleteindex = {begin: 999999, end: 99999}
1616
- this.safeArray[arrayindex].safeshow = false
1617
- for (let i = 0; i < this.safeArray.length; i++) {
1618
- if (this.safeArray[i].safelast == this.safeArray[arrayindex].safename
1619
- || this.safeArray[i].safelastlast == this.safeArray[arrayindex].safename
1620
- || this.safeArray[i].safelastlastlast == this.safeArray[arrayindex].safename) {
1621
- if (deleteindex.begin == 999999) {
1622
- deleteindex.begin = i
1623
- } else {
1624
- deleteindex.end = i
1625
- }
1626
- }
1627
- }
1628
- ////tag)
1629
- this.safeArray.splice(deleteindex.begin, deleteindex.end + 1 - deleteindex.begin)
1630
-
1631
- }
1632
- ////tag)
1633
- },
1634
- selectedshow(index) {
1635
- this.rightdata={}
1636
- ////tag
1637
- for (let i = 0; i < this.safeArray.length; i++) {
1638
- this.safeArray[i].selectedshow = false
1639
- }
1640
- this.safeArray[index].selectedshow = true
1641
- this.rightrow = Object.assign({}, this.safeArray[index])
1642
- //传入参数到右侧
1643
- //开始取对应参数
1644
- ////tag
1645
- ////tag
1646
- this.setRightRow(this.rightrow)
1647
-
1648
- this.rightshow = true
1649
-
1650
- },
1651
- selecttelshow(index) {
1652
- this.rightteldata={}
1653
- for (let i = 0; i < this.telArray.length; i++) {
1654
- this.telArray[i].selectedshow = false
1655
- }
1656
- this.telArray[index].selectedshow = true
1657
- this.righttelrow = Object.assign({}, this.telArray[index])
1658
- this.setRighttelRow(this.righttelrow)
1659
- this.righttelshow = true
1660
- },
1661
- setRighttelRow(row) {
1662
- if (row.lastlastlast) {
1663
- for (var i = 0; i < this.telConfig[row.lastlastlast].data.length; i++) {
1664
- if(this.telConfig[row.lastlastlast].data[i].f_type===row.lastlast){
1665
- for (var j = 0; j < this.telConfig[row.lastlastlast].data[i].details.length; j++) {
1666
- if (this.telConfig[row.lastlastlast].data[i].details[j].f_project === row.last) {
1667
- if (this.telConfig[row.lastlastlast].data[i].details[j].options) {
1668
- for (var k = 0; k < this.telConfig[row.lastlastlast].data[i].details[j].options.length; k++) {
1669
- if (this.telConfig[row.lastlastlast].data[i].details[j].options[k].data === row.telname) {
1670
- this.rightteldata = Object.assign({}, this.telConfig[row.lastlastlast].data[i].details[j].options[k])
1671
- }
1672
- }
1673
- }
1674
- }
1675
- }
1676
- }
1677
- }
1678
- } else if (row.lastlast) {
1679
- for (var i = 0; i < this.telConfig[row.lastlast].data.length; i++) {
1680
- if(this.telConfig[row.lastlast].data[i].f_type===row.last){
1681
- for (var j = 0; j < this.telConfig[row.lastlast].data[i].details.length; j++) {
1682
- if (this.telConfig[row.lastlast].data[i].details[j].f_project === row.telname) {
1683
- this.rightteldata = Object.assign({}, this.telConfig[row.lastlast].data[i].details[j])
1684
- }
1685
- }
1686
- }
1687
- }
1688
- } else if (row.last) {
1689
- for (var i = 0; i < this.telConfig[row.last].data.length; i++) {
1690
- if(this.telConfig[row.last].data[i].f_type===row.telname
1691
- ){
1692
- this.rightteldata = Object.assign({}, this.telConfig[row.last].data[i])
1693
- }
1694
- }
1695
- }
1696
- },
1697
- getrightdataname(name) {
1698
- ////tag
1699
- ////tag
1700
- debugger
1701
- if (name == 'checkmust') {
1702
- return '是否必填'
1703
- }
1704
- if (name == 'isdefault') {
1705
- return '是否默认'
1706
- }
1707
- if (name == 'index') {
1708
- return '配置下标'
1709
- }
1710
- if (name == 'items') {
1711
- return '配置数量'
1712
- }
1713
- if (name == 'items' ||name== 'details') {
1714
- return '配置数量'
1715
- }
1716
- if (name == 'options') {
1717
- return '选项数量'
1718
- }
1719
- if (name == 'type') {
1720
- return '配置类型'
1721
- }
1722
- if (name == 'isdefect') {
1723
- return '是否隐患'
1724
- }
1725
- if (name == 'isshow') {
1726
- return '是否展示'
1727
- }
1728
- if (name == 'multiple') {
1729
- return '是否多选'
1730
- }
1731
- if (name == 'level') {
1732
- return '隐患级别'
1733
- }
1734
- if (name == 'data') {
1735
- return '选项名称'
1736
- }
1737
- if (name == 'f_status') {
1738
- return '是否异常'
1739
- }
1740
- if (name == 'f_project') {
1741
- return '名称'
1742
- }
1743
- if (name == 'f_type') {
1744
- return '名称'
1745
- }
1746
- },
1747
- getrightdatavalue(key, value) {
1748
- if (key == 'items' ||key == 'details'){
1749
- return Object.keys(value).length
1750
- }
1751
- if (key == 'options') {
1752
- return value.length
1753
- }
1754
- if (value == 'string') {
1755
- return '文本框'
1756
- }
1757
- if (value == 'selector') {
1758
- return '选择框'
1759
- }
1760
- if (value == 'picture') {
1761
- return '照片框'
1762
- }
1763
- if (value == 'radio') {
1764
- return '勾选框'
1765
- }
1766
- if (value === true) {
1767
- return '是'
1768
- }
1769
- if (value === false) {
1770
- return '否'
1771
- }
1772
- return value
1773
- },
1774
- setRightRow(row) {
1775
- ////tag
1776
- if (row.safelastlastlast) {
1777
- ////tag
1778
- ////tag)
1779
- for (let i = 0; i < this.safeConfig[row.safelastlastlast][row.safelastlast].items[row.safelast].options.length; i++) {
1780
- if (this.safeConfig[row.safelastlastlast][row.safelastlast].items[row.safelast].options[i].data == row.safename) {
1781
- this.rightdata = Object.assign({}, this.safeConfig[row.safelastlastlast][row.safelastlast].items[row.safelast].options[i])
1782
- }
1783
- }
1784
- } else if (row.safelastlast) {
1785
-
1786
- ////tag)
1787
- this.rightdata = Object.assign(this.safeConfig[row.safelastlast][row.safelast].items[row.safename])
1788
- } else if (row.safelast) {
1789
- ////tag)
1790
- this.rightdata = Object.assign(this.safeConfig[row.safelast][row.safename])
1791
- }
1792
- },
1793
- getJsonLength(val) {
1794
- return Object.keys(val).length
1795
- },
1796
- jsonSort(array, field, reverse) {
1797
- ////tag
1798
- //数组长度小于2 或 没有指定排序字段 或 不是json格式数据
1799
- if (array.length < 2 || !field || typeof array[0] !== "object") return array;
1800
- //数字类型排序
1801
- if (typeof array[0][field] === "number") {
1802
- array.sort(function (x, y) {
1803
- return x[field] - y[field]
1804
- });
1805
- }
1806
- //字符串类型排序
1807
- if (typeof array[0][field] === "string") {
1808
- array.sort(function (x, y) {
1809
- return parseInt(x[field]) - parseInt(y[field])
1810
- });
1811
- }
1812
- //倒序
1813
- if (reverse) {
1814
- array.reverse();
1815
- }
1816
- return array;
1817
- },
1818
- sleep(n) {
1819
- var start = new Date().getTime();
1820
- // //tag;
1821
- while (true) {
1822
- if (new Date().getTime() - start > n) {
1823
- break;
1824
- }
1825
- }
1826
- // //tag.getTime());
1827
- }
1828
-
1829
-
1830
- },
1831
- events: {}
1832
- }
1833
- </script>
1834
- <style>
1835
- /*span {*/
1836
- /* color: black;*/
1837
- /*}*/
1838
- </style>
1
+ <template>
2
+ <div id="unit" class="flex-row">
3
+ <!-- <work-busy :is-busy="seaching"></work-busy>-->
4
+ <div class="flex basic-main" style="flex:1">
5
+ <div novalidate="" class="row form-horizontal select-overspread container-fluid auto" partial="">
6
+ <div novalidate="" class="form-inline auto" partial="">
7
+ <div class="form-group col-sm-2">
8
+ <label class="font_normal_body">组织机构</label>
9
+ <res-select
10
+ :initresid='curorgid'
11
+ @res-select="getorg"
12
+ is-mul="false"
13
+ restype='organization'
14
+ >
15
+ </res-select>
16
+ </div>
17
+ <div class="form-group col-sm-2">
18
+ <label class="font_normal_body">配置名称</label>
19
+ <v-select
20
+ v-model="dispositioName"
21
+ :options='disposition'
22
+ @change="dispselect"
23
+ close-on-select
24
+ :value-single="true"
25
+ clear-button>
26
+ ></v-select>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ <div class="list-group list_area table_sy" isedit="true" style="overflow: auto" v-if="firstShow">
31
+ <table class="table table-bordered">
32
+ <thead a-partial="head" class="text-left">
33
+ <tr>
34
+ <th>安检配置项</th>
35
+ </tr>
36
+ </thead>
37
+ <tbody>
38
+ <tr a-partial="body" :id="'vc-datagrid-tree-grid-'+$index" v-for="item in safeArray">
39
+ <td><a herf="#" @click="selectedshow($index)" class="list-group-item expand-transition"
40
+ style="border: none;background-color: transparent;cursor: pointer" :id="'vc-tree-tree-grid-'+$index">
41
+ <span style="color: black" v-for="n in item.safeindex-1 ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
42
+ <span style="color: black" :id="'vc-tree-tree-grid-'+$index">
43
+ <span style="color: black" v-if="item.safeshow&&(item.safetype=='selector'||item.safetype=='radio'||item.safetype=='')"
44
+ @click.stop="pushArray(item,$index)" class="glyphicon glyphicon-minus-sign"
45
+ style="font-size: 18px;">
46
+ </span>
47
+ <span style="color: black" v-if="!item.safeshow&&(item.safetype=='selector'||item.safetype=='radio'||item.safetype=='')"
48
+ @click.stop="pushArray(item,$index)" class="glyphicon glyphicon-plus-sign"
49
+ style="font-size: 18px;">
50
+ </span>
51
+ <span style="color: black" v-if="item.safetype!='selector'&&item.safetype!='radio'&&item.safetype!=''" style="font-size: 18px;">
52
+ &nbsp;&nbsp;&nbsp;</span>
53
+ </span> <span style="color: black" partial=""> <span>{{ item.safename }}</span>
54
+ <span style="color: black" v-if="item.safevalue!=0">【{{ item.safevalue }}】</span>
55
+ <span style="color: black" v-show="item.selectedshow">
56
+ <button v-show="isadd(item)" class="button_spacing button_export" @click.stop="addsafeConfig(item)">添加</button><!--v-if-->
57
+ <button v-show="isdelete(item)" class="button_spacing button_export" @click.stop="updatesafeConfigName(item)">修改名称</button><!--v-if-->
58
+ <button v-show="isdelete(item)" class="button_spacing button_export" @click.stop="updatesafeConfig(item)">修改属性</button><!--v-if-->
59
+
60
+ <button v-show="isdelete(item)" class="button_spacing button_export" @click.stop="deletesafeConfig(item)">删除</button><!--v-if-->
61
+ </span>
62
+ </span> </a></td>
63
+ </tr>
64
+ </tbody>
65
+ <tbody>
66
+ <tr a-partial="foot"></tr>
67
+ </tbody>
68
+ </table>
69
+ </div>
70
+ <div class="list-group list_area table_sy" isedit="true" style="overflow: auto" v-if="!firstShow">
71
+ <table class="table table-bordered">
72
+ <thead a-partial="head" class="text-left">
73
+ <tr>
74
+ <th>工单配置项</th>
75
+ </tr>
76
+ </thead>
77
+ <tbody>
78
+ <tr a-partial="body" :id="'vc-datagrid-tree-grid-'+$index" v-for="item in telArray">
79
+ <td>
80
+ <a herf="#" @click="selecttelshow($index)" class="list-group-item expand-transition" style="border: none;background-color: transparent;cursor: pointer" :id="'vc-tree-tree-grid-'+$index">
81
+ <span style="color: black" v-for="n in item.telindex-1 ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
82
+ <span style="color: black" :id="'vc-tree-tree-grid-'+$index">
83
+ <span style="color: black" v-if="item.telshow&&(item.teltype=='selector'||item.teltype=='radio'||item.teltype=='')"
84
+ @click.stop="tlepushArray(item,$index)" class="glyphicon glyphicon-minus-sign"
85
+ style="font-size: 18px;">
86
+ </span>
87
+ <span style="color: black" v-if="!item.telshow&&(item.teltype=='selector'||item.teltype=='radio'||item.teltype=='')"
88
+ @click.stop="tlepushArray(item,$index)" class="glyphicon glyphicon-plus-sign"
89
+ style="font-size: 18px;">
90
+ </span>
91
+ <span style="color: black" v-if="item.telshow!='selector'&&item.teltype!='radio'&&item.teltype!=''" style="font-size: 18px;">
92
+ &nbsp;&nbsp;&nbsp;</span>
93
+ </span> <span style="color: black" partial=""><span>{{ item.telname }}</span>
94
+ <span style="color: black" v-if="item.telvalue!=0">【{{ item.telvalue }}】</span>
95
+ <span style="color: black" v-show="item.selectedshow">
96
+ <button v-show="isteladd(item)" class="button_spacing button_export" @click.stop="addsafeConfig(item)">添加</button><!--v-if-->
97
+ <button v-show="isteldelete(item)" class="button_spacing button_export" @click.stop="updatetelConfigName(item)">修改名称</button><!--v-if-->
98
+ <button v-show="isteldelete(item)" class="button_spacing button_export" @click.stop="updatetelConfig(item)">修改属性</button><!--v-if-->
99
+ <button v-show="isteldelete(item)" class="button_spacing button_export" @click.stop="deletetelConfig(item)">删除</button><!--v-if-->
100
+ </span>
101
+ </span> </a></td>
102
+ </tr>
103
+ </tbody>
104
+ <tbody>
105
+ <tr a-partial="foot"></tr>
106
+ </tbody>
107
+ </table>
108
+ </div>
109
+ </div>
110
+ <div class="binary-right" style="width: 40%" v-if="rightshow"> <!--fragment-start-->
111
+ <div class="auto select-overspread" style="overflow-y: hidden"> <!--fragment-start-->
112
+ <ul class="nav nav-tabs"><p class="bg-info text-center" style="padding: 8px">功能信息</p> <!--v-if--> <h3
113
+ class="txtline">上一级【{{ getlastname() }}】</h3><!--v-if--> </ul>
114
+ <div class="form-horizontal" style="margin-top:20px;flex: 1">
115
+ <div class="row">
116
+ <div class="col-sm-6" v-for="(key,value) in rightdata">
117
+ <label class="font_normal_body">{{getrightdataname(key)}}</label>
118
+ <input type="text" style="width:60%" class="input_search full-with" :placeholder="getrightdatavalue(key,value)"
119
+ disabled=""></div>
120
+ </div>
121
+
122
+ <button @click="closeright()" class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px"><span
123
+ class="glyphicon glyphicon-log-out" style="color: black"></span>返回
124
+ </button>
125
+ </div><!--fragment-end--><!--vue-validator--> </div><!--v-component--><!--fragment-end--><!--v-if--> </div>
126
+ <div class="binary-right" style="width: 40%" v-if="righttelshow">
127
+ <div class="auto select-overspread" style="overflow-y: hidden">
128
+ <ul class="nav nav-tabs"><p class="bg-info text-center" style="padding: 8px">功能信息</p> <h3
129
+ class="txtline">上一级【{{ getlastname() }}】</h3></ul>
130
+ <div class="form-horizontal" style="margin-top:20px;flex: 1">
131
+ <div class="row">
132
+ <div class="col-sm-6" v-for="(key,value) in rightteldata">
133
+ <label class="font_normal_body">{{getrightdataname(key)}}</label>
134
+ <input type="text" style="width:60%" class="input_search full-with" :placeholder="getrightdatavalue(key,value)"
135
+ disabled=""></div>
136
+ </div>
137
+ <button @click="closeright()" class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px"><span
138
+ class="glyphicon glyphicon-log-out" style="color: black"></span>返回
139
+ </button>
140
+ </div> </div> </div>
141
+ <modal :show.sync="modelshow" v-ref:modal large backdrop="false">
142
+ <header slot="modal-header" class="modal-header">
143
+ <button type="button" class="close" @click="cancel"><span style="color: black">&times;</span></button>
144
+ </header>
145
+ <article slot="modal-body" class="modal-body">
146
+ <div class="auto select-overspread" style="overflow-y: hidden">
147
+ <validator name='v'>
148
+ <ul class="nav nav-tabs">
149
+ <p class="bg-info text-center" style="padding: 8px;">配置添加</p>
150
+ </ul>
151
+ <div class="form-horizontal" style="margin-top:20px;flex: 1;">
152
+ <div class="row">
153
+ <div class="col-sm-6">
154
+ <label class="font_normal_body" >配置名称</label>
155
+ <input type="text"
156
+ v-model="model.name" style="width:60%"
157
+ class="input_search full-with" placeholder="配置名称">
158
+ </div>
159
+ </div>
160
+
161
+
162
+ <button @click="confirm()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
163
+ <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
164
+ </button>
165
+ <button @click='cancel()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
166
+ <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
167
+ </button>
168
+ </div>
169
+ </validator>
170
+ </div>
171
+ </article>
172
+ <footer slot="modal-footer" class="modal-footer">
173
+ </footer>
174
+ </modal>
175
+ <modal :show.sync="modelshow1" v-ref:modal large backdrop="false">
176
+ <header slot="modal-header" class="modal-header">
177
+ <button type="button" class="close" @click="cancel1"><span style="color: black">&times;</span></button>
178
+ </header>
179
+ <article slot="modal-body" class="modal-body">
180
+ <div class="auto select-overspread" style="overflow-y: hidden">
181
+ <validator name='v'>
182
+ <ul class="nav nav-tabs">
183
+ <p class="bg-info text-center" style="padding: 8px;">名称修改</p>
184
+ </ul>
185
+ <div class="form-horizontal" style="margin-top:20px;flex: 1;">
186
+ <div class="row">
187
+ <div class="col-sm-6">
188
+ <label class="font_normal_body" >配置名称</label>
189
+ <input type="text"
190
+ v-model="model.name" style="width:60%"
191
+ class="input_search full-with" placeholder="配置名称">
192
+ </div>
193
+ </div>
194
+
195
+
196
+ <button @click="confirm1()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
197
+ <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
198
+ </button>
199
+ <button @click='cancel1()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
200
+ <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
201
+ </button>
202
+ </div>
203
+ </validator>
204
+ </div>
205
+ </article>
206
+ <footer slot="modal-footer" class="modal-footer">
207
+ </footer>
208
+ </modal>
209
+ <modal :show.sync="modelshow2" v-ref:modal large backdrop="false">
210
+ <header slot="modal-header" class="modal-header">
211
+ <button type="button" class="close" @click="cancel2"><span style="color: black">&times;</span></button>
212
+ </header>
213
+ <article slot="modal-body" class="modal-body">
214
+ <div class="auto select-overspread" >
215
+ <validator name='v'>
216
+ <ul class="nav nav-tabs">
217
+ <p class="bg-info text-center" style="padding: 8px;">属性修改</p>
218
+ </ul>
219
+ <div class="form-horizontal" style="margin-top:20px;margin-bottom:20px;flex: 1;">
220
+ <div class="row">
221
+ <div class="col-sm-6" v-for="objs in updateArray">
222
+ <label class="font_normal_body" >{{objs.label}}</label>
223
+ <input v-if="objs.type=='input'" type="text"
224
+ v-model="objs.value" style="width:60%"
225
+ class="input_search full-with" :placeholder="objs.label">
226
+ <v-select v-if="objs.type=='selector'"
227
+ :value.sync="objs.value"
228
+ v-model="objs.value" style="width:60%"
229
+ close-on-select
230
+ :value-single="true"
231
+ :options="objs.options"
232
+ class=" full-with" :placeholder="objs.label"></v-select>
233
+ </div>
234
+ </div>
235
+
236
+
237
+ <button @click="confirm2()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
238
+ <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
239
+ </button>
240
+ <button @click='cancel2()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
241
+ <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
242
+ </button>
243
+ </div>
244
+ </validator>
245
+ </div>
246
+ </article>
247
+ <footer slot="modal-footer" class="modal-footer">
248
+ </footer>
249
+ </modal>
250
+ <modal :show.sync="modeltelshow" v-ref:modal large backdrop="false">
251
+ <header slot="modal-header" class="modal-header">
252
+ <button type="button" class="close" @click="cancel"><span style="color: black">&times;</span></button>
253
+ </header>
254
+ <article slot="modal-body" class="modal-body">
255
+ <div class="auto select-overspread" style="overflow-y: hidden">
256
+ <validator name='v'>
257
+ <ul class="nav nav-tabs">
258
+ <p class="bg-info text-center" style="padding: 8px;">配置添加</p>
259
+ </ul>
260
+ <div class="form-horizontal" style="margin-top:20px;margin-bottom: 100px;maflex: 1;">
261
+ <div class="row">
262
+ <div class="col-sm-6">
263
+ <label class="font_normal_body" >配置名称</label>
264
+ <input type="text"
265
+ v-model="model.name" style="width:60%"
266
+ class="input_search full-with" placeholder="配置名称">
267
+ </div>
268
+ <div class="col-sm-6" v-if="modeldata.telindex===2">
269
+ <label class="font_normal_body" >配置类型</label>
270
+ <v-select
271
+ v-model="model.type"
272
+ :value.sync="model.type"
273
+ :options='distype'
274
+ close-on-select
275
+ :value-single="true"
276
+ clear-button>
277
+ ></v-select>
278
+ </div>
279
+ <div class="col-sm-6" v-if="modeldata.telindex===2">
280
+ <label class="font_normal_body" >配置数量</label>
281
+ <input type="text"
282
+ v-model="model.num" style="width:60%"
283
+ class="input_search full-with" placeholder="配置数量">
284
+ </div>
285
+ <div class="row"></div>
286
+ <button @click="telconfirm()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
287
+ <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
288
+ </button>
289
+ <button @click='cancel()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
290
+ <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
291
+ </button>
292
+ </div>
293
+ </div>
294
+ </validator>
295
+ </div>
296
+ </article>
297
+ <footer slot="modal-footer" class="modal-footer">
298
+ </footer>
299
+ </modal>
300
+ <modal :show.sync="modeltelshow1" v-ref:modal large backdrop="false">
301
+ <header slot="modal-header" class="modal-header">
302
+ <button type="button" class="close" @click="cancel1"><span style="color: black">&times;</span></button>
303
+ </header>
304
+ <article slot="modal-body" class="modal-body">
305
+ <div class="auto select-overspread" style="overflow-y: hidden">
306
+ <validator name='v'>
307
+ <ul class="nav nav-tabs">
308
+ <p class="bg-info text-center" style="padding: 8px;">名称修改</p>
309
+ </ul>
310
+ <div class="form-horizontal" style="margin-top:20px;flex: 1;">
311
+ <div class="row">
312
+ <div class="col-sm-6">
313
+ <label class="font_normal_body" >配置名称</label>
314
+ <input type="text"
315
+ v-model="model.name" style="width:60%"
316
+ class="input_search full-with" placeholder="配置名称">
317
+ </div>
318
+ </div>
319
+ <button @click="contelfirm1()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
320
+ <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
321
+ </button>
322
+ <button @click='cancel1()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
323
+ <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
324
+ </button>
325
+ </div>
326
+ </validator>
327
+ </div>
328
+ </article>
329
+ <footer slot="modal-footer" class="modal-footer">
330
+ </footer>
331
+ </modal>
332
+ <modal :show.sync="modeltelshow2" v-ref:modal large backdrop="false">
333
+ <header slot="modal-header" class="modal-header">
334
+ <button type="button" class="close" @click="cancel2"><span style="color: black">&times;</span></button>
335
+ </header>
336
+ <article slot="modal-body" class="modal-body">
337
+ <div class="auto select-overspread" >
338
+ <validator name='v'>
339
+ <ul class="nav nav-tabs">
340
+ <p class="bg-info text-center" style="padding: 8px;">属性修改</p>
341
+ </ul>
342
+ <div class="form-horizontal" style="margin-top:20px;margin-bottom:20px;flex: 1;">
343
+ <div class="row">
344
+ <div class="col-sm-6" v-for="objs in updateArray">
345
+ <label class="font_normal_body" >{{objs.label}}</label>
346
+ <input v-if="objs.type=='input'" type="text"
347
+ v-model="objs.value" style="width:60%"
348
+ class="input_search full-with" :placeholder="objs.label">
349
+ <v-select v-if="objs.type=='selector'"
350
+ :value.sync="objs.value"
351
+ v-model="objs.value" style="width:60%"
352
+ close-on-select
353
+ :value-single="true"
354
+ :options="objs.options"
355
+ class=" full-with" :placeholder="objs.label"></v-select>
356
+ </div>
357
+ </div>
358
+ <button @click="telconfirm2()" class="btn button_search col-sm-1 col-sm-offset-5" style="width: 70px" :disabled="!$v.valid">
359
+ <span style="color: black" class="glyphicon glyphicon-floppy-disk"></span>保存
360
+ </button>
361
+ <button @click='cancel2()' class="btn button_clear col-sm-1 col-sm-offset-1" style="width: 70px">
362
+ <span style="color: black" class=" glyphicon glyphicon-log-out"></span>返回
363
+ </button>
364
+ </div>
365
+ </validator>
366
+ </div>
367
+ </article>
368
+ <footer slot="modal-footer" class="modal-footer">
369
+ </footer>
370
+ </modal>
371
+ </div>
372
+ </template>
373
+
374
+ <script>
375
+ import { HttpResetClass } from 'vue-client'
376
+ export default {
377
+ title: '配置修改',
378
+ ready() {
379
+
380
+ },
381
+ data() {
382
+ return {
383
+ firstShow: true,
384
+ dispositioName:'',
385
+ curorgid: [this.$login.f.orgid],
386
+ seaching:false,
387
+ modelshow:false,
388
+ modelshow1:false,
389
+ modelshow2:false,
390
+ modeltelshow:false,
391
+ modeltelshow1:false,
392
+ modeltelshow2:false,
393
+ upmodel:{},
394
+ f_dir:'',
395
+ model:{},
396
+ modeldata:{},
397
+ rightshow:false,
398
+ righttelshow:false,
399
+ rightrow:{},
400
+ rightelrow:{},
401
+ rightdata:{},
402
+ rightteldata:{},
403
+ telArray: [],
404
+ safeArray: [],
405
+ updateArray:[],
406
+ distype:[{label:"输入框",value:"string"},{label:"选择框",value:"selector"}],
407
+ disposition:this.$appdata.getParam('配置名称'),
408
+ safeConfig: {
409
+ "民用配置项": {},
410
+ "非民用配置项": {}
411
+ },
412
+ telConfig: {
413
+ "民用配置项": {},
414
+ "非民用配置项": {}
415
+ }
416
+ }
417
+ },
418
+ methods: {
419
+ dispselect(val){
420
+ if(val=='安检配置项' || val==""){
421
+ this.firstShow=true
422
+ }else{
423
+ this.firstShow=false
424
+ }
425
+ },
426
+ getorg(val) {
427
+ this.f_filialeid = val[0]
428
+ if (val[0]){
429
+ new HttpResetClass().load('post','api/af-safecheck/sql/safe_singleTable_OrderBy',{data: {
430
+ items: 'f_dir',
431
+ tablename: 't_organization',
432
+ condition: `id = '${val[0]}'`,
433
+ orderitem: 'id'
434
+ }}).then(res=>{
435
+ if (!res.data[0].f_dir){
436
+ this.$showMessage("该公司无组织目录,无法获取配置文件,请联系管理员确认")
437
+ }else{
438
+ this.f_dir=res.data[0].f_dir
439
+ try {
440
+ new HttpResetClass().load('GET',`/safecheck/rs/vue/DevicesConfig.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {},{resolveMsg: '获取居民配置项成功!', rejectMsg: '获取居民配置项出错!'}).then(res=>{
441
+ //tag
442
+ this.safeConfig["民用配置项"]=Object.assign({},res.data)
443
+ })
444
+ new HttpResetClass().load('GET',`/safecheck/rs/vue/DevicesSetConfig.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {},{resolveMsg: '获取非居民配置项成功!', rejectMsg: '获取非居民配置项出错!'}).then(res=>{
445
+ //tag
446
+ this.safeConfig["非民用配置项"]=Object.assign({},res.data)
447
+ }).then(res=> {
448
+ this.safeArray = []
449
+ this.initArray()
450
+ this.model = {}
451
+ this.modeldata = {}
452
+ })
453
+ new HttpResetClass().load('GET',`/telephone/rs/vue/SubstitConfigBusiness.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {},{resolveMsg: '获取居民配置项成功!', rejectMsg: '获取居民配置项出错!'}).then(res=>{
454
+ this.telConfig["非民用配置项"]=Object.assign({},res.data)
455
+ })
456
+ new HttpResetClass().load('GET',`/telephone/rs/vue/SubstitConfigCivil.json?folderName=phonevues&orgDir=${res.data[0].f_dir}`, {},{resolveMsg: '获取非居民配置项成功!', rejectMsg: '获取非居民配置项出错!'}).then(res=>{
457
+ this.telConfig["民用配置项"]=Object.assign({},res.data)
458
+ }).then(res=> {
459
+ this.telArray = []
460
+ this.initTelArray()
461
+ })
462
+ }catch (e) {
463
+ this.$showMessage("获取配置文件失败"+e)
464
+ }
465
+ }
466
+ })
467
+ }
468
+ },
469
+ isteldelete(item){
470
+
471
+ if (item.telindex!=1){
472
+ return true
473
+ }
474
+ },
475
+ isdelete(item){
476
+ if (item.safename=='燃气表'&&item.safeindex){
477
+ return false
478
+ }
479
+ if (item.safeindex!='1'){
480
+ return true
481
+ }
482
+ },
483
+ isteladd(item){
484
+ if (item.telindex===4){
485
+ return false
486
+ }if (item.telindex===3){
487
+ return item.teltype==='selector'||item.teltype==='radio'
488
+ }
489
+ return true
490
+ },
491
+ isadd(item){
492
+ if (item.safeindex=='4' ){
493
+ return false
494
+ }if (item.safeindex=='3'){
495
+ return item.safetype=='selector'||item.safetype=='radio'
496
+ }
497
+ return true
498
+ },
499
+ telconfirm(){
500
+ if (this.modeldata.telindex==1){
501
+ for(var i=0;i<this.telConfig[this.modeldata.telname].data.length;i++){
502
+ if (this.telConfig[this.modeldata.telname].data[i].f_type===this.model.name){
503
+ this.$showMessage('已有配置名'+this.model.name+',修改失败')
504
+ return
505
+ }
506
+ }
507
+ }
508
+ if (this.modeldata.telindex==2){
509
+ for(var i=0;i<this.telConfig[this.modeldata.last].data.length;i++){
510
+ for (var j = 0; j <this.telConfig[this.modeldata.last].data[i].details.length; j++) {
511
+ if (this.telConfig[this.modeldata.last].data[i].details[j].f_project===this.model.name){
512
+ this.$showMessage('已有配置名'+this.model.name+',修改失败')
513
+ return
514
+ }
515
+ }
516
+ }
517
+ }
518
+ if (this.modeldata.telindex==3){
519
+ for(var i=0;i<this.telConfig[this.modeldata.lastlast].data.length;i++){
520
+ for (var j = 0; j <this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
521
+ if(!!this.telConfig[this.modeldata.lastlast].data[i].details[j].options){
522
+ for (var k = 0; k < this.telConfig[this.modeldata.lastlast].data[i].details[j].options.length; k++) {
523
+ if (this.telConfig[this.modeldata.lastlast].data[i].details[j].options[k].data===this.model.name){
524
+ this.$showMessage('已有配置名'+this.model.name+',修改失败')
525
+ return
526
+ }
527
+ }
528
+ }
529
+ }
530
+ }
531
+ }
532
+ if (this.modeldata.telindex==1){
533
+ this.telConfig[this.modeldata.telname].data.push({
534
+ f_type:this.model.name,
535
+ details:[]
536
+ })
537
+ }
538
+ if (this.modeldata.telindex==2){
539
+ for(var i=0;i<this.telConfig[this.modeldata.last].data.length;i++){
540
+ if(this.telConfig[this.modeldata.last].data[i].f_type==this.modeldata.telname){
541
+ if(this.model.type==""){
542
+ this.$showMessage("请输入类型")
543
+ return
544
+ }
545
+ if(this.model.type=="string"){
546
+ this.telConfig[this.modeldata.last].data[i].details.push({
547
+ f_project:this.model.name,
548
+ level:"",
549
+ type:this.model.type
550
+ })
551
+ }
552
+ if(this.model.type=="selector"){
553
+ let options=[]
554
+ if(this.model.num>0){
555
+ for (let j = 0; j <this.model.num; j++) {
556
+ options.push({
557
+ data:"请修改"+j,
558
+ isdefect:false,
559
+ f_status:false,
560
+ isdefault: false
561
+ })
562
+ }
563
+ }else{
564
+ this.$showMessage("请输入选项数量")
565
+ return
566
+ }
567
+ this.telConfig[this.modeldata.last].data[i].details.push({
568
+ f_project:this.model.name,
569
+ level:"",
570
+ type:this.model.type,
571
+ options:options
572
+ })
573
+ }
574
+ }
575
+ }
576
+ }
577
+ if (this.modeldata.telindex==3){
578
+ for(var i=0;i<this.telConfig[this.modeldata.lastlast].data.length;i++){
579
+ for (var j = 0; j <this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
580
+ if(!!this.telConfig[this.modeldata.lastlast].data[i].details[j].options){
581
+ if(this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project===this.modeldata.telname){
582
+ this.telConfig[this.modeldata.lastlast].data[i].details[j].options.push({
583
+ data:this.model.name,
584
+ f_status:false,
585
+ isdefect:false,
586
+ isdefault:false
587
+ })
588
+ }
589
+
590
+ }
591
+ }
592
+ }
593
+ }
594
+ let path
595
+ let value
596
+ if (this.modeldata.last=='民用配置项'||this.modeldata.lastlast=='民用配置项'||this.modeldata.lastlastlast=='民用配置项'){
597
+ path= this.f_dir + `/phonevues/SubstitConfigCivil.json`
598
+ value=this.telConfig["民用配置项"]
599
+ }else{
600
+ path= this.f_dir + `/phonevues/SubstitConfigBusiness.json`
601
+ value=this.telConfig["非民用配置项"]
602
+ }
603
+ /*发送求情*/
604
+ this.$resetpost('rs/vue/telSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=>{
605
+ this.$showMessage("修改成功")
606
+ /*刷新页面*/
607
+ this.telArray = []
608
+ this.initTelArray()
609
+ this.cancel1()
610
+ })
611
+ },
612
+ confirm() {
613
+ ////tag
614
+ if (this.modeldata.safeindex==1){
615
+ //tag
616
+ for(let name in this.safeConfig[this.modeldata.safename]){
617
+ if(typeof name=='function'){
618
+ continue
619
+ }
620
+ if (name==this.model.name){
621
+ this.$showMessage('已有配置名'+name+',添加失败')
622
+ return
623
+ }
624
+ }
625
+ }
626
+ if (this.modeldata.safeindex==2){
627
+ for(let name in this.safeConfig[this.modeldata.safelast][this.modeldata.safename].items){
628
+ if(typeof name=='function'){
629
+ continue
630
+ }
631
+ if (name==this.model.name){
632
+ this.$showMessage('已有配置名'+name+',添加失败')
633
+ return
634
+ }
635
+ }
636
+ //tag
637
+ }
638
+ if (this.modeldata.safeindex==3){
639
+ for (let i = 0; i < this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].options.length; i++) {
640
+ if (this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].options[i].data==this.model.name){
641
+ this.$showMessage('已有配置名'+this.model.name+',添加失败')
642
+ return
643
+ }
644
+ }
645
+ //tag
646
+ }
647
+ ////tag
648
+ ////tag)
649
+ if (this.modeldata.safeindex=='1'){
650
+ let index
651
+ ////tag
652
+ ////tag
653
+ if (Object.keys(this.safeConfig[this.modeldata.safename]).length==0){
654
+ index=0
655
+ }else{
656
+ for (let obj in this.safeConfig[this.modeldata.safename]) {
657
+ if(typeof obj=='function'){
658
+ continue
659
+ }
660
+ ////tag
661
+ ////tag
662
+ ////tag
663
+ index = this.safeConfig[this.modeldata.safename][obj].index
664
+ }
665
+ }
666
+ ////tag
667
+ this.safeConfig[this.modeldata.safename][this.model.name] = {
668
+ checkmust: true,
669
+ index: index + 1,
670
+ items:{}
671
+ }
672
+ ////tag)
673
+ }
674
+ if (this.modeldata.safeindex=='2'){
675
+ let index
676
+ ////tag
677
+ ////tag
678
+ if (Object.keys(this.safeConfig[this.modeldata.safelast][this.modeldata.safename].items).length==0){
679
+ index=0
680
+ }else{
681
+ for (let obj in this.safeConfig[this.modeldata.safelast][this.modeldata.safename].items) {
682
+ if(typeof obj=='function'){
683
+ continue
684
+ }
685
+ ////tag
686
+ ////tag
687
+ ////tag
688
+ index = this.safeConfig[this.modeldata.safelast][this.modeldata.safename].items[obj].index
689
+ }
690
+ }
691
+
692
+ ////tag
693
+ this.safeConfig[this.modeldata.safelast][this.modeldata.safename].items[this.model.name] = {
694
+ index: index + 1,
695
+ multiple: false,
696
+ options:[],
697
+ isshow:true,
698
+ checkmust:false,
699
+ type: "selector"
700
+ }
701
+ ////tag)
702
+ }
703
+ if (this.modeldata.safeindex=='3'){
704
+ let index
705
+ ////tag
706
+ ////tag
707
+ ////tag
708
+ this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].options.push({
709
+ data:this.model.name,
710
+ isdefect:false,
711
+ level:'A',
712
+ isdefault:false
713
+ })
714
+
715
+ ////tag)
716
+ }
717
+ let path
718
+ let value
719
+ if (this.modeldata.safelast=='民用配置项'||this.modeldata.safelastlast=='民用配置项'||this.modeldata.safelastlastlast=='民用配置项'){
720
+ path= this.f_dir + `/phonevues/DevicesConfig.json`
721
+ value=this.safeConfig["民用配置项"]
722
+ }else{
723
+ path= this.f_dir + `/phonevues/DevicesSetConfig.json`
724
+ value=this.safeConfig["非民用配置项"]
725
+ }
726
+
727
+ this.$resetpost('rs/vue/safeSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=> {
728
+
729
+ this.$showMessage("保存成功")
730
+ this.safeArray = []
731
+ this.initArray()
732
+ this.model = {}
733
+ this.modeldata = {}
734
+ this.rightshow = false
735
+ this.modelshow = false
736
+ })
737
+
738
+ },
739
+ cancel() {
740
+ this.model={}
741
+ this.modeldata={}
742
+ this.modelshow = false
743
+ this.modeltelshow = false
744
+ },
745
+ confirm1() {
746
+ if (this.modeldata.safeindex==2){
747
+ //tag
748
+ for(let name in this.safeConfig[this.modeldata.safelast]){
749
+ if(typeof name=='function'){
750
+ continue
751
+ }
752
+ if (name==this.model.name){
753
+ this.$showMessage('已有配置名'+name+',修改失败')
754
+ return
755
+ }
756
+ }
757
+ }
758
+ if (this.modeldata.safeindex==3){
759
+ for(let name in this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items){
760
+ if(typeof name=='function'){
761
+ continue
762
+ }
763
+ if (name==this.model.name){
764
+ this.$showMessage('已有配置名'+name+',修改失败')
765
+ return
766
+ }
767
+ }
768
+ //tag
769
+ }
770
+ if (this.modeldata.safeindex==4){
771
+ for (let i = 0; i < this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options.length; i++) {
772
+ if (this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options[i].data==this.model.name){
773
+ this.$showMessage('已有配置名'+this.model.name+',修改失败')
774
+ return
775
+ }
776
+ }
777
+ //tag
778
+ }
779
+ this.seaching=true
780
+ ////tag
781
+ ////tag)
782
+
783
+ if (this.modeldata.safeindex=='2'){
784
+ this.safeConfig[this.modeldata.safelast][this.model.name]=Object.assign({},this.safeConfig[this.modeldata.safelast][this.modeldata.safename])
785
+ delete this.safeConfig[this.modeldata.safelast][this.modeldata.safename]
786
+ }
787
+ if (this.modeldata.safeindex=='3'){
788
+ this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.model.name]=Object.assign({},this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename])
789
+ delete this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename]
790
+ }
791
+ if (this.modeldata.safeindex=='4'){
792
+ ////tag
793
+ ////tag)
794
+ for (let i = 0; i < this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options.length; i++) {
795
+ if(this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options[i].data==this.modeldata.safename){
796
+ this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options[i].data=this.model.name
797
+ }
798
+ }
799
+ }
800
+ let path
801
+ let value
802
+ if (this.modeldata.safelast=='民用配置项'||this.modeldata.safelastlast=='民用配置项'||this.modeldata.safelastlastlast=='民用配置项'){
803
+ path= this.f_dir + `/phonevues/DevicesConfig.json`
804
+ value=this.safeConfig["民用配置项"]
805
+ }else{
806
+ path= this.f_dir + `/phonevues/DevicesSetConfig.json`
807
+ value=this.safeConfig["非民用配置项"]
808
+ }
809
+
810
+ this.$resetpost('rs/vue/safeSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=>{
811
+ this.$showMessage("修改成功")
812
+ this.safeArray = []
813
+ this.initArray()
814
+ this.model={}
815
+ this.modeldata={}
816
+ this.rightshow=false
817
+ this.modelshow1 = false
818
+ this.seaching=false
819
+ })
820
+
821
+
822
+ },
823
+ contelfirm1() {
824
+ if (this.modeldata.telindex===2){
825
+ for( var i=0;i<this.telConfig[this.modeldata.last].data.length;i++){
826
+ if (this.telConfig[this.modeldata.last].data[i].f_type===this.model.name){
827
+ this.$showMessage('已有配置名'+this.model.name+',修改失败')
828
+ return
829
+ }
830
+ }
831
+ }
832
+ if (this.modeldata.telindex===3){
833
+ for(var i=0;i<this.telConfig[this.modeldata.lastlast].data.length;i++){
834
+ for (let j = 0; j <this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
835
+ if (this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project===this.model.name){
836
+ this.$showMessage('已有配置名'+this.model.name+',修改失败')
837
+ return
838
+ }
839
+ }
840
+ }
841
+ }
842
+ if (this.modeldata.telindex===4){
843
+ for(var i=0;i<this.telConfig[this.modeldata.lastlastlast].data.length;i++){
844
+ for (var j = 0; j <this.telConfig[this.modeldata.lastlastlast].data[i].details.length; j++) {
845
+ if(!!this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options){
846
+ for (var k = 0; k < this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options.length; k++) {
847
+ if (this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].data===this.model.name){
848
+ this.$showMessage('已有配置名'+this.model.name+',修改失败')
849
+ return
850
+ }
851
+ }
852
+ }
853
+ }
854
+ }
855
+ }
856
+ this.seaching=true
857
+ if (this.modeldata.telindex==2){
858
+ for( var i=0;i<this.telConfig[this.modeldata.last].data.length;i++){
859
+ if (this.telConfig[this.modeldata.last].data[i].f_type===this.modeldata.telname){
860
+ this.telConfig[this.modeldata.last].data[i].f_type=this.model.name
861
+ }
862
+ }
863
+ }
864
+
865
+ if (this.modeldata.telindex==3){
866
+ for(var i=0;i<this.telConfig[this.modeldata.lastlast].data.length;i++){
867
+ for (let j = 0; j <this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
868
+ if (this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project===this.modeldata.telname){
869
+ this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project=this.model.name
870
+ }
871
+ }
872
+ }
873
+ }
874
+ if (this.modeldata.telindex==4){
875
+ for(var i=0;i<this.telConfig[this.modeldata.lastlastlast].data.length;i++){
876
+ for (var j = 0; j <this.telConfig[this.modeldata.lastlastlast].data[i].details.length; j++) {
877
+ if(!!this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options){
878
+ for (var k = 0; k < this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options.length; k++) {
879
+ if (this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].data===this.modeldata.telname){
880
+ this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].data=this.model.name
881
+ }
882
+ }
883
+ }
884
+ }
885
+ }
886
+ }
887
+ let path
888
+ let value
889
+ if (this.modeldata.last=='民用配置项'||this.modeldata.lastlast=='民用配置项'||this.modeldata.lastlastlast=='民用配置项'){
890
+ path= this.f_dir + `/phonevues/SubstitConfigCivil.json`
891
+ value=this.telConfig["民用配置项"]
892
+ }else{
893
+ path= this.f_dir + `/phonevues/SubstitConfigBusiness.json`
894
+ value=this.telConfig["非民用配置项"]
895
+ }
896
+ /*发送求情*/
897
+ this.$resetpost('rs/vue/telSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=>{
898
+ this.$showMessage("修改成功")
899
+ /*刷新页面*/
900
+ this.telArray = []
901
+ this.initTelArray()
902
+ this.cancel1()
903
+ })
904
+ },
905
+ cancel1() {
906
+ this.model={}
907
+ this.modeldata={}
908
+ this.modelshow1 = false
909
+ this.modeltelshow1 = false
910
+ },
911
+ addsafeConfig(item) {
912
+ this.modeldata = item
913
+ this.modeltelshow= true
914
+ },
915
+ deletetelConfig(item){
916
+ this.$showMessage('删除后无法恢复,确认删除吗?',['confirm','cancel']).then(res=>{
917
+ if (res=='confirm'){
918
+ if (item.telindex==2){
919
+ for(var i=0;i<this.telConfig[item.last].data.length;i++){
920
+ if(this.telConfig[item.last].data[i].f_type===item.telname){
921
+ this.telConfig[item.last].data.splice(i, 1);
922
+ i--;
923
+
924
+ }
925
+ }
926
+ }else if (item.telindex==3){
927
+ for(var i=0;i<this.telConfig[item.lastlast].data.length;i++){
928
+ for (var j = 0; j <this.telConfig[item.lastlast].data[i].details.length; j++) {
929
+ console.log(this.telConfig[item.lastlast].data[i].details[j].f_project)
930
+ if (this.telConfig[item.lastlast].data[i].details[j].f_project===item.telname){
931
+ //移除这个对象
932
+ // 移除这个对象
933
+ this.telConfig[item.lastlast].data[i].details.splice(j, 1);
934
+ // 移除后需要调整 j 的值,因为数组长度减少了
935
+ j--;
936
+ }
937
+ }
938
+ }
939
+ }else if (item.telindex==4){
940
+ for(var i=0;i<this.telConfig[item.lastlastlast].data.length;i++){
941
+ for (var j = 0; j <this.telConfig[item.lastlastlast].data[i].details.length; j++) {
942
+ if(!!this.telConfig[item.lastlastlast].data[i].details[j].options){
943
+ for(var k = 0; k < this.telConfig[item.lastlastlast].data[i].details[j].options.length; k++){
944
+ if(this.telConfig[item.lastlastlast].data[i].details[j].options[k].data===item.telname &&this.telConfig[item.lastlastlast].data[i].details[j].f_project===item.last){
945
+ //除这个对象
946
+ this.telConfig[item.lastlastlast].data[i].details[j].options.splice(k, 1);
947
+ // 移除后需要调整 k 的值,因为数组长度减少了
948
+ k--;
949
+
950
+ }
951
+ }
952
+ }
953
+ }
954
+ }
955
+ }
956
+ let path
957
+ let value
958
+ if (this.modeldata.last==='民用配置项'||this.modeldata.lastlast==='民用配置项'||this.modeldata.lastlastlast==='民用配置项'){
959
+ path= this.f_dir + `/phonevues/SubstitConfigCivil.json`
960
+ value=this.telConfig["民用配置项"]
961
+ }else{
962
+ path= this.f_dir + `/phonevues/SubstitConfigBusiness.json`
963
+ value=this.telConfig["非民用配置项"]
964
+ }
965
+ /*发送求情*/
966
+ this.$resetpost('rs/vue/telSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=>{
967
+ this.$showMessage("修改成功")
968
+ this.telArray = []
969
+ this.initTelArray()
970
+ this.cancel2()
971
+ })
972
+ }
973
+ })
974
+ },
975
+ deletesafeConfig(item){
976
+ this.$showMessage('删除后无法恢复,确认删除吗?',['confirm','cancel']).then(res=>{
977
+ if (res=='confirm'){
978
+ this.seaching=true
979
+ if (item.safeindex=='2'){
980
+ ////tag
981
+ if (item.safename=='燃气表'){
982
+ this.$showMessage("燃气表不允许删除!!!")
983
+ return
984
+ }else{
985
+ ////tag
986
+ delete this.safeConfig[item.safelast][item.safename]
987
+
988
+ for(let name in this.safeConfig[item.safelast]){
989
+ if(typeof name=='function'){
990
+ continue
991
+ }
992
+ if (this.safeConfig[item.safelast][name].index>item.safesort){
993
+ this.safeConfig[item.safelast][name].index=this.safeConfig[item.safelast][name].index-1
994
+ }
995
+ }
996
+ }
997
+ }else if (item.safeindex=='3'){
998
+ delete this.safeConfig[item.safelastlast][item.safelast].items[item.safename]
999
+ for(let name in this.safeConfig[item.safelastlast][item.safelast].items){
1000
+ if(typeof name=='function'){
1001
+ continue
1002
+ }
1003
+ if (this.safeConfig[item.safelastlast][item.safelast].items[name].index>item.safesort){
1004
+ this.safeConfig[item.safelastlast][item.safelast].items[name].index=this.safeConfig[item.safelastlast][item.safelast].items[name].index-1
1005
+ }
1006
+ }
1007
+ }else if (item.safeindex=='4'){
1008
+ for (let i = 0; i < this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options.length; i++) {
1009
+ if (this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i].data==item.safename){
1010
+ this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options.splice(i,1)
1011
+ }
1012
+ }
1013
+ }
1014
+ let path
1015
+ let value
1016
+ if (item.safelast=='民用配置项'||item.safelastlast=='民用配置项'||item.safelastlastlast=='民用配置项'){
1017
+ path= this.f_dir + `/phonevues/DevicesConfig.json`
1018
+ value=this.safeConfig["民用配置项"]
1019
+ }else{
1020
+ path= this.f_dir + `/phonevues/DevicesSetConfig.json`
1021
+ value=this.safeConfig["非民用配置项"]
1022
+ }
1023
+
1024
+ this.$resetpost('rs/vue/safeSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=> {
1025
+
1026
+ this.$showMessage("删除成功")
1027
+ this.safeArray = []
1028
+ this.initArray()
1029
+ this.model = {}
1030
+ this.modeldata = {}
1031
+ this.rightshow = false
1032
+ this.modelshow2 = false
1033
+ // this.sleep(2000);
1034
+ this.seaching = false
1035
+ })
1036
+ }
1037
+ })
1038
+
1039
+ },
1040
+ updatesafeConfig(item){
1041
+ this.modeldata=item
1042
+ //tag
1043
+ let array=[]
1044
+ if (item.safeindex=='2') {
1045
+ //tag)
1046
+ let aa = {"checkmust": false, "index": 1}
1047
+ if (this.safeConfig[item.safelast][item.safename].checkmust) {
1048
+ array.push({
1049
+ label: '是否必填',
1050
+ value: true,
1051
+ type: 'selector',
1052
+ name:'checkmust',
1053
+ options: [{label: '是', value: true}, {label: '否', value: false}]
1054
+ })
1055
+ } else {
1056
+ array.push({
1057
+ label: '是否必填',
1058
+ value: false,
1059
+ type: 'selector',
1060
+ name:'checkmust',
1061
+ options: [{label: '是', value: true}, {label: '否', value: false}]
1062
+ })
1063
+ }
1064
+ }
1065
+ if (item.safeindex=='3'){
1066
+ let aa={"index":1,"multiple":false,"isshow":true,"checkmust":false,"type":"selector"}
1067
+ for (let key in this.safeConfig[item.safelastlast][item.safelast].items[item.safename]){
1068
+ if(typeof key=='function'){
1069
+ continue
1070
+ }
1071
+ if (key=='index'){
1072
+
1073
+ }else if(key=='multiple'){
1074
+ array.push({
1075
+ label: '是否多选',
1076
+ value: this.safeConfig[item.safelastlast][item.safelast].items[item.safename][key],
1077
+ name:key,
1078
+ type: 'selector',
1079
+ options: [{label: '是', value: true}, {label: '否', value: false}]
1080
+ })
1081
+ }else if(key=='options'){
1082
+
1083
+ }else if(key=='isshow'){
1084
+ array.push({
1085
+ label: '是否展示',
1086
+ value: this.safeConfig[item.safelastlast][item.safelast].items[item.safename][key],
1087
+ name:key,
1088
+ type: 'selector',
1089
+ options: [{label: '是', value: true}, {label: '否', value: false}]
1090
+ })
1091
+ }else if(key=='checkmust'){
1092
+ array.push({
1093
+ label: '是否必填',
1094
+ value: this.safeConfig[item.safelastlast][item.safelast].items[item.safename][key],
1095
+ name:key,
1096
+ type: 'selector',
1097
+ options: [{label: '是', value: true}, {label: '否', value: false}]
1098
+ })
1099
+ }else if(key=='type'){
1100
+ array.push({
1101
+ label: '配置类型',
1102
+ value: this.safeConfig[item.safelastlast][item.safelast].items[item.safename][key],
1103
+ name:key,
1104
+ type: 'selector',
1105
+ options: [{label: '输入框', value: 'string'}, {label: '选择框', value: 'selector'}, {label: '勾选框', value: 'radio'},{label: '图片框', value: 'picture'}]
1106
+ })
1107
+ }
1108
+ }
1109
+ //tag)
1110
+ }
1111
+ if (item.safeindex=='4'){
1112
+ let aa={"data":"333333333","isdefect":"否","level":"A","isdefault":"否"}
1113
+ for (let i = 0; i < this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options.length; i++) {
1114
+ if (this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i].data==item.safename){
1115
+ //tag)
1116
+ for(let key in this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i]){
1117
+ if(typeof key=='function'){
1118
+ continue
1119
+ }
1120
+ if(key=='data'){
1121
+
1122
+ }else if(key=='isdefect'){
1123
+ array.push({
1124
+ label: '是否隐患',
1125
+ value: this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i][key],
1126
+ name:key,
1127
+ type: 'selector',
1128
+ options: [{label: '是', value: true}, {label: '否', value: false}]
1129
+ })
1130
+ }else if(key=='isdefault'){
1131
+ array.push({
1132
+ label: '是否默认',
1133
+ value: this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i][key],
1134
+ name:key,
1135
+ type: 'selector',
1136
+ options: [{label: '是否默认', value: ''},{label: '是', value: true}, {label: '否', value: false}]
1137
+ })
1138
+
1139
+ }else if(key=='level'){
1140
+ array.push({
1141
+ label: '隐患级别',
1142
+ value: this.safeConfig[item.safelastlastlast][item.safelastlast].items[item.safelast].options[i][key],
1143
+ name:key,
1144
+ type: 'input',
1145
+ })
1146
+
1147
+ }
1148
+ }
1149
+ }
1150
+ }
1151
+ }
1152
+ //tag
1153
+ //tag
1154
+ this.updateArray=Object.assign([],array)
1155
+ this.modelshow2=true
1156
+ },
1157
+ updatetelConfig(item){
1158
+ this.modeldata=item
1159
+ let array=[]
1160
+ if (item.telindex==2) {
1161
+ }
1162
+ if (item.telindex==3){
1163
+ for(var i=0;i<this.telConfig[this.modeldata.lastlast].data.length;i++){
1164
+ for (var j = 0; j <this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
1165
+ if (this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project===this.modeldata.telname){
1166
+ for(let key in this.telConfig[this.modeldata.lastlast].data[i].details[j]){
1167
+ if(typeof key=='function'){
1168
+ continue
1169
+ }
1170
+ if(key==='level'){
1171
+ array.push({
1172
+ label: '隐患级别',
1173
+ value: this.telConfig[this.modeldata.lastlast].data[i].details[j].level,
1174
+ name:key,
1175
+ type: 'input',
1176
+ })
1177
+ }
1178
+ }
1179
+ }
1180
+ }
1181
+ }
1182
+ }
1183
+ if (item.telindex===4){
1184
+ for(var i=0;i<this.telConfig[this.modeldata.lastlastlast].data.length;i++){
1185
+ for (var j = 0; j <this.telConfig[this.modeldata.lastlastlast].data[i].details.length; j++) {
1186
+ if(!!this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options){
1187
+ for(var k = 0; k < this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options.length; k++){
1188
+ if(this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].data===this.modeldata.telname &&this.telConfig[this.modeldata.lastlastlast].data[i].details[j].f_project===this.modeldata.last){
1189
+ for(var key in this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k]){
1190
+ if(typeof key=='function'){
1191
+ continue
1192
+ }
1193
+ if(key==='isdefect'){
1194
+ array.push({
1195
+ label: '隐患',
1196
+ value: this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].isdefect,
1197
+ name:key,
1198
+ type: 'input',
1199
+ })
1200
+ }
1201
+ if(key==='isdefault'){
1202
+ array.push({
1203
+ label: '是否默认',
1204
+ value: this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].isdefault,
1205
+ name:key,
1206
+ type: 'input',
1207
+ })
1208
+ }
1209
+ if(key==='f_status'){
1210
+ array.push({
1211
+ label: '是否异常',
1212
+ value: this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].f_status,
1213
+ name:key,
1214
+ type: 'input',
1215
+ })
1216
+ }
1217
+ }
1218
+ }
1219
+ }
1220
+ }
1221
+ }
1222
+ }
1223
+ }
1224
+ this.updateArray=Object.assign([],array)
1225
+ this.modeltelshow2=true
1226
+ },
1227
+ confirm2(){
1228
+ this.seaching=true
1229
+ if (this.modeldata.safeindex=='2'){
1230
+ for (let i = 0; i < this.updateArray.length; i++) {
1231
+ this.safeConfig[this.modeldata.safelast][this.modeldata.safename][this.updateArray[i].name]=this.updateArray[i].value
1232
+ }
1233
+ }
1234
+ if (this.modeldata.safeindex=='3'){
1235
+ for (let i = 0; i < this.updateArray.length; i++) {
1236
+ this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename][this.updateArray[i].name]=this.updateArray[i].value
1237
+ if (this.updateArray[i].name=='type'&&this.updateArray[i].value!='selector'&&this.updateArray[i].value!='radio'){
1238
+
1239
+ if (this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].hasOwnProperty('options')){
1240
+ delete this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].options
1241
+ }
1242
+ }
1243
+ if (this.updateArray[i].name=='type'&&(this.updateArray[i].value=='selector'||this.updateArray[i].value!='radio')){
1244
+ if (!this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].hasOwnProperty('options')){
1245
+ this.safeConfig[this.modeldata.safelastlast][this.modeldata.safelast].items[this.modeldata.safename].options=[]
1246
+ }
1247
+ }
1248
+ }
1249
+
1250
+ }
1251
+ if (this.modeldata.safeindex=='4'){
1252
+
1253
+ for (let i = 0; i < this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options.length; i++) {
1254
+ if(this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options[i].data==this.modeldata.safename){
1255
+ for (let j = 0; j < this.updateArray.length; j++) {
1256
+
1257
+
1258
+ this.safeConfig[this.modeldata.safelastlastlast][this.modeldata.safelastlast].items[this.modeldata.safelast].options[i][this.updateArray[j].name]=this.updateArray[j].value
1259
+ }
1260
+ }
1261
+ }
1262
+ }
1263
+ let path
1264
+ let value
1265
+ if (this.modeldata.safelast=='民用配置项'||this.modeldata.safelastlast=='民用配置项'||this.modeldata.safelastlastlast=='民用配置项'){
1266
+ path= this.f_dir + `/phonevues/DevicesConfig.json`
1267
+ value=this.safeConfig["民用配置项"]
1268
+ }else{
1269
+ path= this.f_dir + `/phonevues/DevicesSetConfig.json`
1270
+ value=this.safeConfig["非民用配置项"]
1271
+ }
1272
+
1273
+ this.$resetpost('rs/vue/safeSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=> {
1274
+
1275
+ this.$showMessage("修改成功")
1276
+ this.safeArray = []
1277
+ this.initArray()
1278
+ this.model = {}
1279
+ this.modeldata = {}
1280
+ this.rightshow = false
1281
+ this.modelshow2 = false
1282
+ this.seaching = false
1283
+ })
1284
+ },
1285
+ telconfirm2(){
1286
+ this.seaching=true
1287
+ if (this.modeldata.telindex==3) {
1288
+ for (var i = 0; i< this.telConfig[this.modeldata.lastlast].data.length; i++) {
1289
+ for (var j = 0; j < this.telConfig[this.modeldata.lastlast].data[i].details.length; j++) {
1290
+ if (this.telConfig[this.modeldata.lastlast].data[i].details[j].f_project === this.modeldata.telname) {
1291
+ for (let key in this.telConfig[this.modeldata.lastlast].data[i].details[j]) {
1292
+ for (let K = 0; K< this.updateArray.length; K++) {
1293
+ if(this.updateArray[K].name===key){
1294
+ this.telConfig[this.modeldata.lastlast].data[i].details[j][key]=this.updateArray[K].value
1295
+ }
1296
+ }
1297
+ }
1298
+ }
1299
+ }
1300
+ }
1301
+ }
1302
+ if (this.modeldata.telindex==4){
1303
+ for(var i=0;i<this.telConfig[this.modeldata.lastlastlast].data.length;i++){
1304
+ for (var j = 0; j <this.telConfig[this.modeldata.lastlastlast].data[i].details.length; j++) {
1305
+ if(!!this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options){
1306
+ for(var k = 0; k < this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options.length; k++){
1307
+ if(this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k].data===this.modeldata.telname &&this.telConfig[this.modeldata.lastlastlast].data[i].details[j].f_project===this.modeldata.last){
1308
+ for(var key in this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k]){
1309
+ for (var l = 0; l< this.updateArray.length; l++) {
1310
+ if(this.updateArray[l].name===key){
1311
+ this.telConfig[this.modeldata.lastlastlast].data[i].details[j].options[k][key]=this.updateArray[l].value
1312
+ }
1313
+ }
1314
+ }
1315
+ }
1316
+ }
1317
+ }
1318
+ }
1319
+ }
1320
+ }
1321
+ let path
1322
+ let value
1323
+ if (this.modeldata.last==='民用配置项'||this.modeldata.lastlast==='民用配置项'||this.modeldata.lastlastlast==='民用配置项'){
1324
+ path= this.f_dir + `/phonevues/SubstitConfigCivil.json`
1325
+ value=this.telConfig["民用配置项"]
1326
+ }else{
1327
+ path= this.f_dir + `/phonevues/SubstitConfigBusiness.json`
1328
+ value=this.telConfig["非民用配置项"]
1329
+ }
1330
+ /*发送求情*/
1331
+ this.$resetpost('rs/vue/telSaveConfig', {path: path, data: JSON.stringify(value)} ).then(res=>{
1332
+ this.$showMessage("修改成功")
1333
+ this.telArray = []
1334
+ this.initTelArray()
1335
+ this.cancel2()
1336
+ })
1337
+ },
1338
+ cancel2(){
1339
+ this.modelshow2=false
1340
+ this.modeltelshow2=false
1341
+ },
1342
+ updatesafeConfigName(item){
1343
+
1344
+ this.$set('model.name',item.safename)
1345
+ this.modeldata=Object.assign({},item)
1346
+ this.modelshow1=true
1347
+ },
1348
+ updatetelConfigName(item){
1349
+ this.$set('model.name',item.telname)
1350
+ this.modeldata=Object.assign({},item)
1351
+ this.modeltelshow1=true
1352
+ },
1353
+ initArray() {
1354
+ for (let bigsafe in this.safeConfig) {
1355
+ if(typeof bigsafe=='function'){
1356
+ continue
1357
+ }
1358
+ ////tag
1359
+ ////tag)
1360
+ this.safeArray.push({
1361
+ selectedshow: false,
1362
+ safetype: '',
1363
+ safeshow: false,
1364
+ safename: bigsafe,
1365
+ safevalue: this.safeConfig[bigsafe] ? Object.keys(this.safeConfig[bigsafe]).length : 0,
1366
+ safeindex: 1
1367
+ })
1368
+ }
1369
+ this.seaching=false
1370
+ },
1371
+ initTelArray(){
1372
+ //延时0.5s,后执行
1373
+ setTimeout(()=>{
1374
+ for (let bigsafe in this.telConfig) {
1375
+ if (typeof bigsafe == 'function') {
1376
+ continue
1377
+ }
1378
+ this.telArray.push({
1379
+ selectedshow: false,
1380
+ teltype:'',
1381
+ telshow: false,
1382
+ telname: bigsafe,
1383
+ telvalue: this.telConfig[bigsafe] ? this.telConfig[bigsafe].data.length : 0,
1384
+ telindex: 1,
1385
+ type:bigsafe
1386
+ })
1387
+ }
1388
+ },1000)
1389
+ },
1390
+ tlepushArray(val, arrayindex) {
1391
+ let spliceindex = arrayindex + 1
1392
+ if(this.telArray[arrayindex].telshow == false){
1393
+ this.telArray[arrayindex].telshow = true
1394
+ if(val.telindex==1){
1395
+ let linshiarray = []
1396
+ for (let two in this.telConfig[val.telname].data){
1397
+ linshiarray.push({
1398
+ selectedshow:false,
1399
+ telsort:two+1 ,
1400
+ teltype:'',
1401
+ type: val.type,
1402
+ telshow: false,
1403
+ telname: this.telConfig[val.telname].data[two].f_type,
1404
+ telvalue: this.telConfig[val.telname].data[two].details.length,
1405
+ telindex: 2,
1406
+ last:val.telname //fei
1407
+ })
1408
+ }
1409
+ linshiarray=this.jsonSort(linshiarray, "telsort",true)
1410
+ for (let i = 0; i < linshiarray.length; i++) {
1411
+ this.telArray.splice(spliceindex, 0,linshiarray[i])
1412
+ }
1413
+ }
1414
+ if(val.telindex==2){
1415
+ let linshiarray = [];
1416
+ for (var i = 0; i < this.telConfig[val.type].data.length; i++) {
1417
+ if (this.telConfig[val.type].data[i].f_type === val.telname) {
1418
+ for (var j = 0; j < this.telConfig[val.type].data[i].details.length; j++) {
1419
+ linshiarray.push({
1420
+ type:val.type,
1421
+ selectedshow: false,
1422
+ telsort: j+1,
1423
+ teltype: this.telConfig[val.type].data[i].details[j].type,
1424
+ telshow: false,
1425
+ telname: this.telConfig[val.type].data[i].details[j].f_project,
1426
+ telvalue: this.telConfig[val.type].data[i].details[j].options?this.telConfig[val.type].data[i].details[j].options.length:0,
1427
+ telindex: 3,
1428
+ last: val.telname,
1429
+ lastlast:val.last,
1430
+ });
1431
+ }
1432
+ }
1433
+ }
1434
+ linshiarray=this.jsonSort(linshiarray, "telsort",true)
1435
+ for (let i = 0; i < linshiarray.length; i++) {
1436
+ this.telArray.splice(spliceindex, 0,linshiarray[i])
1437
+ }
1438
+ }
1439
+ if(val.telindex==3){
1440
+ let linshiarray = [];
1441
+ for (var m = 0; m < this.telConfig[val.type].data.length; m++) {
1442
+ for (var n = 0; n < this.telConfig[val.type].data[m].details.length; n++){
1443
+ if(this.telConfig[val.type].data[m].details[n].f_project==val.telname){
1444
+ for (var p = 0; p < this.telConfig[val.type].data[m].details[n].options.length; p++){
1445
+ linshiarray.push({
1446
+ telindex: 4,
1447
+ type:val.type,
1448
+ selectedshow: false,
1449
+ telsort: p+1,
1450
+ teltype: this.telConfig[val.type].data[m].details[n].options[p].type,
1451
+ telshow: false,
1452
+ telname: this.telConfig[val.type].data[m].details[n].options[p].data,
1453
+ telvalue: this.telConfig[val.type].data[m].details[n].options[p].options?this.telConfig[val.type].data[m].details[n].options[p].options.length:0,
1454
+ last:val.telname,
1455
+ lastlast:val.last,
1456
+ lastlastlast:val.lastlast
1457
+
1458
+ })
1459
+ }
1460
+ }
1461
+ }
1462
+ }
1463
+ linshiarray=this.jsonSort(linshiarray, "telsort",true)
1464
+ for (let i = 0; i < linshiarray.length; i++) {
1465
+ this.telArray.splice(spliceindex, 0,linshiarray[i])
1466
+ }
1467
+ }
1468
+ }else if(this.telArray[arrayindex].telshow ===true){
1469
+ this.telArray[arrayindex].telshow = false
1470
+ for (let i = 0; i < this.telArray.length; i++) {
1471
+ if (this.telArray[i].last === this.telArray[arrayindex].telname
1472
+ || this.telArray[i].lastlast === this.telArray[arrayindex].telname
1473
+ || this.telArray[i].lastlastlast === this.telArray[arrayindex].telname) {
1474
+ if(this.telArray[arrayindex].type===this.telArray[i].type){
1475
+ //从数组中移除
1476
+ this.telArray.splice(i, 1);
1477
+ i--; // 由于删除了元素,索引需要减1
1478
+ }
1479
+
1480
+ }
1481
+ }
1482
+ }
1483
+ },
1484
+ closeright() {
1485
+ this.rightshow = false
1486
+ this.righttelshow = false
1487
+ },
1488
+ getlastname() {
1489
+ if (this.rightrow.safelast) {
1490
+ return this.rightrow.safelast
1491
+ }
1492
+ return '无'
1493
+ },
1494
+ pushArray(val, arrayindex) {
1495
+ ////tag
1496
+ ////tag)
1497
+ ////tag)
1498
+ if (this.safeArray[arrayindex].safeshow == false) {
1499
+ let spliceindex = arrayindex + 1
1500
+ this.safeArray[arrayindex].safeshow = true
1501
+ if (val.safeindex == '1') {
1502
+ let linshiarray = []
1503
+ for (let two in this.safeConfig[val.safename]) {
1504
+ if(typeof two=='function'){
1505
+ continue
1506
+ }
1507
+ ////tag
1508
+ ////tag)
1509
+
1510
+ linshiarray.push({
1511
+ selectedshow: false,
1512
+ safesort: this.safeConfig[val.safename][two].index,
1513
+ safetype: '',
1514
+ safeshow: false,
1515
+ safename: two,
1516
+ safevalue: this.safeConfig[val.safename][two].items ? Object.keys(this.safeConfig[val.safename][two].items).length : 0,
1517
+ safeindex: 2,
1518
+ safelast: val.safename
1519
+ })
1520
+
1521
+ }
1522
+ linshiarray=this.jsonSort(linshiarray, "safesort",true)
1523
+ ////tag
1524
+ ////tag)
1525
+ for (let i = 0; i < linshiarray.length; i++) {
1526
+ this.safeArray.splice(spliceindex, 0,linshiarray[i])
1527
+ }
1528
+ }
1529
+ if (val.safeindex == '2') {
1530
+ let linshiarray = []
1531
+ let aa = {"safename": "燃气表", "safevalue": 3, "safeindex": 2, "safelast": "民用配置项"}
1532
+ for (let isthree in this.safeConfig[val.safelast][val.safename]) {
1533
+ if(typeof isthree=='function'){
1534
+ continue
1535
+ }
1536
+ if (isthree == 'items') {
1537
+ for (let three in this.safeConfig[val.safelast][val.safename].items) {
1538
+ if(typeof three=='function'){
1539
+ continue
1540
+ }
1541
+ ////tag
1542
+ ////tag
1543
+ ////tag
1544
+ ////tag)
1545
+ ////tag)
1546
+ linshiarray.push({
1547
+ safesort:this.safeConfig[val.safelast][val.safename].items[three].index,
1548
+ selectedshow: false,
1549
+ safetype: this.safeConfig[val.safelast][val.safename].items[three].type,
1550
+ safeshow: false,
1551
+ safename: three,
1552
+ safevalue: this.safeConfig[val.safelast][val.safename].items[three].options ? Object.keys(this.safeConfig[val.safelast][val.safename].items[three].options).length : 0,
1553
+ safeindex: 3,
1554
+ safelast: val.safename,
1555
+ safelastlast: val.safelast
1556
+ })
1557
+ }
1558
+ linshiarray=this.jsonSort(linshiarray, "safesort",true)
1559
+ ////tag
1560
+ ////tag)
1561
+ for (let i = 0; i < linshiarray.length; i++) {
1562
+ this.safeArray.splice(spliceindex, 0,linshiarray[i])
1563
+ }
1564
+ }
1565
+ }
1566
+
1567
+ }
1568
+ if (val.safeindex == '3') {
1569
+ let linshiarray = []
1570
+ let aa = {
1571
+ "safename": "燃气表有无改装在卧室、卫生间、客厅",
1572
+ "safevalue": 4,
1573
+ "safeindex": 3,
1574
+ "safelast": "燃气表",
1575
+ "safelastlast": "民用配置项"
1576
+ }
1577
+ for (let isfour in this.safeConfig[val.safelastlast][val.safelast].items[val.safename]) {
1578
+ if(typeof isfour=='function'){
1579
+ continue
1580
+ }
1581
+ if (isfour == 'options') {
1582
+ for (let four in this.safeConfig[val.safelastlast][val.safelast].items[val.safename].options) {
1583
+ if(typeof four=='function'){
1584
+ continue
1585
+ }
1586
+ ////tag
1587
+ ////tag
1588
+ ////tag)
1589
+ ////tag)
1590
+ ////tag)
1591
+ linshiarray.push({
1592
+ safesort:four,
1593
+ selectedshow: false,
1594
+ safetype: 'no',
1595
+ safeshow: false,
1596
+ safename: this.safeConfig[val.safelastlast][val.safelast].items[val.safename].options[four].data,
1597
+ safevalue: 0,
1598
+ safeindex: 4,
1599
+ safelast: val.safename,
1600
+ safelastlast: val.safelast,
1601
+ safelastlastlast: val.safelastlast,
1602
+ })
1603
+ }
1604
+ linshiarray=this.jsonSort(linshiarray, "safesort",true)
1605
+ ////tag
1606
+ ////tag)
1607
+ for (let i = 0; i < linshiarray.length; i++) {
1608
+ this.safeArray.splice(spliceindex, 0,linshiarray[i])
1609
+ }
1610
+
1611
+ }
1612
+ }
1613
+ }
1614
+ } else {
1615
+ let deleteindex = {begin: 999999, end: 99999}
1616
+ this.safeArray[arrayindex].safeshow = false
1617
+ for (let i = 0; i < this.safeArray.length; i++) {
1618
+ if (this.safeArray[i].safelast == this.safeArray[arrayindex].safename
1619
+ || this.safeArray[i].safelastlast == this.safeArray[arrayindex].safename
1620
+ || this.safeArray[i].safelastlastlast == this.safeArray[arrayindex].safename) {
1621
+ if (deleteindex.begin == 999999) {
1622
+ deleteindex.begin = i
1623
+ } else {
1624
+ deleteindex.end = i
1625
+ }
1626
+ }
1627
+ }
1628
+ ////tag)
1629
+ this.safeArray.splice(deleteindex.begin, deleteindex.end + 1 - deleteindex.begin)
1630
+
1631
+ }
1632
+ ////tag)
1633
+ },
1634
+ selectedshow(index) {
1635
+ this.rightdata={}
1636
+ ////tag
1637
+ for (let i = 0; i < this.safeArray.length; i++) {
1638
+ this.safeArray[i].selectedshow = false
1639
+ }
1640
+ this.safeArray[index].selectedshow = true
1641
+ this.rightrow = Object.assign({}, this.safeArray[index])
1642
+ //传入参数到右侧
1643
+ //开始取对应参数
1644
+ ////tag
1645
+ ////tag
1646
+ this.setRightRow(this.rightrow)
1647
+
1648
+ this.rightshow = true
1649
+
1650
+ },
1651
+ selecttelshow(index) {
1652
+ this.rightteldata={}
1653
+ for (let i = 0; i < this.telArray.length; i++) {
1654
+ this.telArray[i].selectedshow = false
1655
+ }
1656
+ this.telArray[index].selectedshow = true
1657
+ this.righttelrow = Object.assign({}, this.telArray[index])
1658
+ this.setRighttelRow(this.righttelrow)
1659
+ this.righttelshow = true
1660
+ },
1661
+ setRighttelRow(row) {
1662
+ if (row.lastlastlast) {
1663
+ for (var i = 0; i < this.telConfig[row.lastlastlast].data.length; i++) {
1664
+ if(this.telConfig[row.lastlastlast].data[i].f_type===row.lastlast){
1665
+ for (var j = 0; j < this.telConfig[row.lastlastlast].data[i].details.length; j++) {
1666
+ if (this.telConfig[row.lastlastlast].data[i].details[j].f_project === row.last) {
1667
+ if (this.telConfig[row.lastlastlast].data[i].details[j].options) {
1668
+ for (var k = 0; k < this.telConfig[row.lastlastlast].data[i].details[j].options.length; k++) {
1669
+ if (this.telConfig[row.lastlastlast].data[i].details[j].options[k].data === row.telname) {
1670
+ this.rightteldata = Object.assign({}, this.telConfig[row.lastlastlast].data[i].details[j].options[k])
1671
+ }
1672
+ }
1673
+ }
1674
+ }
1675
+ }
1676
+ }
1677
+ }
1678
+ } else if (row.lastlast) {
1679
+ for (var i = 0; i < this.telConfig[row.lastlast].data.length; i++) {
1680
+ if(this.telConfig[row.lastlast].data[i].f_type===row.last){
1681
+ for (var j = 0; j < this.telConfig[row.lastlast].data[i].details.length; j++) {
1682
+ if (this.telConfig[row.lastlast].data[i].details[j].f_project === row.telname) {
1683
+ this.rightteldata = Object.assign({}, this.telConfig[row.lastlast].data[i].details[j])
1684
+ }
1685
+ }
1686
+ }
1687
+ }
1688
+ } else if (row.last) {
1689
+ for (var i = 0; i < this.telConfig[row.last].data.length; i++) {
1690
+ if(this.telConfig[row.last].data[i].f_type===row.telname
1691
+ ){
1692
+ this.rightteldata = Object.assign({}, this.telConfig[row.last].data[i])
1693
+ }
1694
+ }
1695
+ }
1696
+ },
1697
+ getrightdataname(name) {
1698
+ ////tag
1699
+ ////tag
1700
+ debugger
1701
+ if (name == 'checkmust') {
1702
+ return '是否必填'
1703
+ }
1704
+ if (name == 'isdefault') {
1705
+ return '是否默认'
1706
+ }
1707
+ if (name == 'index') {
1708
+ return '配置下标'
1709
+ }
1710
+ if (name == 'items') {
1711
+ return '配置数量'
1712
+ }
1713
+ if (name == 'items' ||name== 'details') {
1714
+ return '配置数量'
1715
+ }
1716
+ if (name == 'options') {
1717
+ return '选项数量'
1718
+ }
1719
+ if (name == 'type') {
1720
+ return '配置类型'
1721
+ }
1722
+ if (name == 'isdefect') {
1723
+ return '是否隐患'
1724
+ }
1725
+ if (name == 'isshow') {
1726
+ return '是否展示'
1727
+ }
1728
+ if (name == 'multiple') {
1729
+ return '是否多选'
1730
+ }
1731
+ if (name == 'level') {
1732
+ return '隐患级别'
1733
+ }
1734
+ if (name == 'data') {
1735
+ return '选项名称'
1736
+ }
1737
+ if (name == 'f_status') {
1738
+ return '是否异常'
1739
+ }
1740
+ if (name == 'f_project') {
1741
+ return '名称'
1742
+ }
1743
+ if (name == 'f_type') {
1744
+ return '名称'
1745
+ }
1746
+ },
1747
+ getrightdatavalue(key, value) {
1748
+ if (key == 'items' ||key == 'details'){
1749
+ return Object.keys(value).length
1750
+ }
1751
+ if (key == 'options') {
1752
+ return value.length
1753
+ }
1754
+ if (value == 'string') {
1755
+ return '文本框'
1756
+ }
1757
+ if (value == 'selector') {
1758
+ return '选择框'
1759
+ }
1760
+ if (value == 'picture') {
1761
+ return '照片框'
1762
+ }
1763
+ if (value == 'radio') {
1764
+ return '勾选框'
1765
+ }
1766
+ if (value === true) {
1767
+ return '是'
1768
+ }
1769
+ if (value === false) {
1770
+ return '否'
1771
+ }
1772
+ return value
1773
+ },
1774
+ setRightRow(row) {
1775
+ ////tag
1776
+ if (row.safelastlastlast) {
1777
+ ////tag
1778
+ ////tag)
1779
+ for (let i = 0; i < this.safeConfig[row.safelastlastlast][row.safelastlast].items[row.safelast].options.length; i++) {
1780
+ if (this.safeConfig[row.safelastlastlast][row.safelastlast].items[row.safelast].options[i].data == row.safename) {
1781
+ this.rightdata = Object.assign({}, this.safeConfig[row.safelastlastlast][row.safelastlast].items[row.safelast].options[i])
1782
+ }
1783
+ }
1784
+ } else if (row.safelastlast) {
1785
+
1786
+ ////tag)
1787
+ this.rightdata = Object.assign(this.safeConfig[row.safelastlast][row.safelast].items[row.safename])
1788
+ } else if (row.safelast) {
1789
+ ////tag)
1790
+ this.rightdata = Object.assign(this.safeConfig[row.safelast][row.safename])
1791
+ }
1792
+ },
1793
+ getJsonLength(val) {
1794
+ return Object.keys(val).length
1795
+ },
1796
+ jsonSort(array, field, reverse) {
1797
+ ////tag
1798
+ //数组长度小于2 或 没有指定排序字段 或 不是json格式数据
1799
+ if (array.length < 2 || !field || typeof array[0] !== "object") return array;
1800
+ //数字类型排序
1801
+ if (typeof array[0][field] === "number") {
1802
+ array.sort(function (x, y) {
1803
+ return x[field] - y[field]
1804
+ });
1805
+ }
1806
+ //字符串类型排序
1807
+ if (typeof array[0][field] === "string") {
1808
+ array.sort(function (x, y) {
1809
+ return parseInt(x[field]) - parseInt(y[field])
1810
+ });
1811
+ }
1812
+ //倒序
1813
+ if (reverse) {
1814
+ array.reverse();
1815
+ }
1816
+ return array;
1817
+ },
1818
+ sleep(n) {
1819
+ var start = new Date().getTime();
1820
+ // //tag;
1821
+ while (true) {
1822
+ if (new Date().getTime() - start > n) {
1823
+ break;
1824
+ }
1825
+ }
1826
+ // //tag.getTime());
1827
+ }
1828
+
1829
+
1830
+ },
1831
+ events: {}
1832
+ }
1833
+ </script>
1834
+ <style>
1835
+ /*span {*/
1836
+ /* color: black;*/
1837
+ /*}*/
1838
+ </style>