sasp-admin 0.2.57

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 (141) hide show
  1. package/index.js +227 -0
  2. package/package.json +19 -0
  3. package/router.js +83 -0
  4. package/src/assets/font/iconfont.css +1346 -0
  5. package/src/assets/font/iconfont.eot +0 -0
  6. package/src/assets/font/iconfont.js +1 -0
  7. package/src/assets/font/iconfont.svg +827 -0
  8. package/src/assets/font/iconfont.ttf +0 -0
  9. package/src/assets/font/iconfont.woff +0 -0
  10. package/src/assets/images/loading-bar.gif +0 -0
  11. package/src/assets/js/adminInstall.js +36 -0
  12. package/src/assets/js/api/apiAdmin.js +613 -0
  13. package/src/assets/js/global/dataGlobal.js +260 -0
  14. package/src/assets/js/global/logGlobal.js +22 -0
  15. package/src/assets/js/global/paramGlobal.js +67 -0
  16. package/src/assets/js/global/resGlobal.js +91 -0
  17. package/src/assets/js/global/userGlobal.js +283 -0
  18. package/src/components/complexViewRendering.vue +601 -0
  19. package/src/components/ifmLink.vue +71 -0
  20. package/src/components/public/data/plDataCascader.vue +85 -0
  21. package/src/components/public/data/plDataRadio.vue +73 -0
  22. package/src/components/public/data/plDataRadioGroup.vue +70 -0
  23. package/src/components/public/data/plDataSelect.vue +856 -0
  24. package/src/components/public/data/plDatePicker.vue +159 -0
  25. package/src/components/public/org/bg.png +0 -0
  26. package/src/components/public/org/sysOrgPosUserSelect.vue +1237 -0
  27. package/src/components/public/org/sysOrgPosUserSelectDark.vue +1402 -0
  28. package/src/components/public/org/sysOrgPosUserSelectNew.vue +1527 -0
  29. package/src/components/public/upload/images/compress.png +0 -0
  30. package/src/components/public/upload/images/emipty.png +0 -0
  31. package/src/components/public/upload/images/excel.png +0 -0
  32. package/src/components/public/upload/images/file.png +0 -0
  33. package/src/components/public/upload/images/pdf.png +0 -0
  34. package/src/components/public/upload/images/powerpoint.png +0 -0
  35. package/src/components/public/upload/images/project.png +0 -0
  36. package/src/components/public/upload/images/sound.png +0 -0
  37. package/src/components/public/upload/images/txt.png +0 -0
  38. package/src/components/public/upload/images/video.png +0 -0
  39. package/src/components/public/upload/images/visio.png +0 -0
  40. package/src/components/public/upload/images/word.png +0 -0
  41. package/src/components/public/upload/plImage.vue +287 -0
  42. package/src/components/public/upload/plImgUpload.vue +137 -0
  43. package/src/components/public/upload/plUpload.vue +1124 -0
  44. package/src/components/public/upload/uploadImg.js +8 -0
  45. package/src/main.js +0 -0
  46. package/src/views/VueMenuView.vue +143 -0
  47. package/src/views/cloudMenuView.vue +125 -0
  48. package/src/views/complex/config/complex.vue +501 -0
  49. package/src/views/complex/config/complexSetting.vue +1250 -0
  50. package/src/views/complex/rendering/complexShow.vue +16 -0
  51. package/src/views/data/dataManage.vue +560 -0
  52. package/src/views/data/sysData.vue +292 -0
  53. package/src/views/event/eventManager/vueEventDiy.vue +1184 -0
  54. package/src/views/event/eventManager/vueEventMain.vue +108 -0
  55. package/src/views/event/eventManager/vueEventSys.vue +296 -0
  56. package/src/views/event/js/apiEvent.js +22 -0
  57. package/src/views/fileLog/fileDownloadLog.vue +437 -0
  58. package/src/views/initData/initData.vue +4316 -0
  59. package/src/views/log/dblog/logdbDevelop.vue +306 -0
  60. package/src/views/log/dblog/logdbEnt.vue +331 -0
  61. package/src/views/log/dblog/logdbGov.vue +395 -0
  62. package/src/views/log/error/logError.vue +553 -0
  63. package/src/views/log/loginlog/logManageDevOrSup.vue +357 -0
  64. package/src/views/log/loginlog/logManageEnt.vue +343 -0
  65. package/src/views/log/loginlog/logManageGov.vue +328 -0
  66. package/src/views/log/sms/logSms.vue +308 -0
  67. package/src/views/menu/component/menuManageComponent.vue +2402 -0
  68. package/src/views/menu/component/menuModule.vue +449 -0
  69. package/src/views/menu/menuLocal.vue +223 -0
  70. package/src/views/menu/menuManage.vue +1135 -0
  71. package/src/views/menu/tenantMenuManage.vue +1132 -0
  72. package/src/views/menuRouter/cview/cviewShow.vue +18 -0
  73. package/src/views/menuRouter/cviewMenuRouter.vue +183 -0
  74. package/src/views/menuRouter/menuView.vue +132 -0
  75. package/src/views/menuRouter/urlMenuRouter.vue +160 -0
  76. package/src/views/org/entOrgTree.vue +1050 -0
  77. package/src/views/org/ownerMenu/ownerMenuTree.vue +269 -0
  78. package/src/views/org/safeValidate/safeValidate.vue +469 -0
  79. package/src/views/org/sysEntOrgUserDetail.vue +3390 -0
  80. package/src/views/org/sysOrgDimension.vue +832 -0
  81. package/src/views/org/sysOrgPosUserDetail.vue +1648 -0
  82. package/src/views/org/sysOrgPosUserTree.vue +1101 -0
  83. package/src/views/org/sysOrgTree.vue +864 -0
  84. package/src/views/param/sysParam.vue +987 -0
  85. package/src/views/preview/pdfViewer.vue +82 -0
  86. package/src/views/resources/js/resourcesCommon.js +137 -0
  87. package/src/views/resources/resRouter/resView.vue +161 -0
  88. package/src/views/resources/resourcesTabs.vue +82 -0
  89. package/src/views/resources/tabs/comp/pageResPreview.vue +309 -0
  90. package/src/views/resources/tabs/comp/pageResRegister.vue +1120 -0
  91. package/src/views/resources/tabs/dataResources.vue +843 -0
  92. package/src/views/resources/tabs/pageResources.vue +970 -0
  93. package/src/views/role/allowMenu.vue +148 -0
  94. package/src/views/role/authRole/authRole.vue +427 -0
  95. package/src/views/role/authRole/component/allocateSetting.vue +1056 -0
  96. package/src/views/role/authRole/component/authSetting.vue +1196 -0
  97. package/src/views/role/commonRole/commonRole.vue +677 -0
  98. package/src/views/role/commonRole/compoment/allocateRoleMenuSetting.vue +335 -0
  99. package/src/views/role/commonRole/compoment/authLinkMenuTree.vue +55 -0
  100. package/src/views/role/commonRole/compoment/authSettingNew.vue +190 -0
  101. package/src/views/role/commonRole/compoment/commonSetting.vue +1576 -0
  102. package/src/views/role/commonRole/compoment/commonSettingAdjust.vue +584 -0
  103. package/src/views/role/commonRole/compoment/commonSettingNew.vue +572 -0
  104. package/src/views/role/commonRole/compoment/roleMenuPower.vue +226 -0
  105. package/src/views/role/commonRole/compoment/roleMenuPowerSetting.vue +69 -0
  106. package/src/views/role/commonRole/compoment/roleMenuSetting.vue +365 -0
  107. package/src/views/role/commonRole/compoment/roleSourceSetting.vue +229 -0
  108. package/src/views/role/commonRole/tenantCommonRole.vue +768 -0
  109. package/src/views/role/role.vue +135 -0
  110. package/src/views/role/roleMenuOption.vue +898 -0
  111. package/src/views/role/roleSynchroRemind.vue +399 -0
  112. package/src/views/role/sysRole.vue +1525 -0
  113. package/src/views/role/viewMenuOptDetail.vue +182 -0
  114. package/src/views/sms/sendSms.vue +164 -0
  115. package/src/views/station/orgStation.vue +561 -0
  116. package/src/views/tenant/appContentManager.vue +938 -0
  117. package/src/views/tenant/appManager.vue +642 -0
  118. package/src/views/tenant/tenantRoleManager.vue +670 -0
  119. package/src/views/tenant/tenantUserManager.vue +615 -0
  120. package/src/views/threeinone/compoment/safeCascadeSelect.vue +327 -0
  121. package/src/views/threeinone/init/safeInitRegion.vue +203 -0
  122. package/src/views/threeinone/safeManager.vue +927 -0
  123. package/src/views/threeinone/safeMenuManage.vue +565 -0
  124. package/src/views/threeinone/safeOrgSpv.vue +364 -0
  125. package/src/views/threeinone/safeSpv/safeSpvLeftTree.vue +109 -0
  126. package/src/views/threeinone/safeSpv/safeSpvMain.vue +335 -0
  127. package/src/views/threeinone/safeSpvEconView.vue +569 -0
  128. package/src/views/threeinone/safeValidateRegion.vue +328 -0
  129. package/src/views/urlResource/urlResource.vue +856 -0
  130. package/src/views/user/empowerUser/empowerEntUserManage.vue +415 -0
  131. package/src/views/user/empowerUser/empowerOrgTree.vue +167 -0
  132. package/src/views/user/empowerUser/empowerUserList.vue +633 -0
  133. package/src/views/user/empowerUser/empowerUserListMenuDeatil.vue +656 -0
  134. package/src/views/user/empowerUser/empowerUserListViewMenuTree.vue +257 -0
  135. package/src/views/user/empowerUser/empowerUserManage.vue +99 -0
  136. package/src/views/user/stationUserManage.vue +934 -0
  137. package/src/views/user/userManage.vue +737 -0
  138. package/src/views/user/userMangement.vue +938 -0
  139. package/src/views/user/viewMenu/viewMenu.vue +113 -0
  140. package/src/views/versionupdatetool/versionUpdateTool.vue +225 -0
  141. package/src/views/versionupdatetool/versioninfomation/verisonInfomationManagement.vue +68 -0
@@ -0,0 +1,1250 @@
1
+ <template>
2
+ <el-container style="height: 100%">
3
+ <el-header style="height: auto;">
4
+ <div class="search-form-parent el-card">
5
+ <el-form :inline="true" :model="crud.searchForm" size="small" class="demo-form-inline"
6
+ @submit.native.prevent="crud.doSearch()">
7
+ <el-form-item label="选项卡名称">
8
+ <el-input v-model="crud.searchForm.tabName" placeholder="选项卡名称"></el-input>
9
+ </el-form-item>
10
+ <el-form-item>
11
+ <el-button type="primary" icon="el-icon-search" @click="crud.doSearch()">查询</el-button>
12
+ <el-button icon="el-icon-close" @click="crud.resetSearch()">清空</el-button>
13
+ </el-form-item>
14
+ </el-form>
15
+ </div>
16
+ </el-header>
17
+
18
+ <el-main id="tableMain" style="height: 100%">
19
+ <el-container style="height:100%" class="table-list-container">
20
+ <el-header style="height: auto;" size="medium">
21
+ <el-button type="primary" size="small" round icon="el-icon-circle-plus" @click="add()">新增
22
+ </el-button>
23
+ <el-button type="danger" size="small" round icon="el-icon-delete" @click="remove()">删除
24
+ </el-button>
25
+ <el-button type="primary" size="small" round icon="el-icon-tickets" @click="complexPreviewFunc()">预览
26
+ </el-button>
27
+ </el-header>
28
+ <el-main style="height: 100%;" ref="tableMain">
29
+ <el-table :data="crud.dataStore.records" :ref="crud.tableRef" stripe border height="100%"
30
+ header-row-class-name="list-default-row"
31
+ style="width: 100%;">
32
+ <el-table-column type="selection" width="40" align="center"></el-table-column>
33
+ <el-table-column type="index" label="序号" align="center" width="60"></el-table-column>
34
+ <el-table-column label="选项卡名称" prop="tabName" align="center"></el-table-column>
35
+ <el-table-column label="链接类型" align="center">
36
+ <template slot-scope="scope">
37
+ <span>{{formatterUrlType(scope.row.urlType)}}</span>
38
+ </template>
39
+ </el-table-column>
40
+ <el-table-column label="图标" prop="tabIcon" align="center">
41
+ <template slot-scope="scope">
42
+ <i :class="scope.row.tabIcon"></i>
43
+ </template>
44
+ </el-table-column>
45
+ <el-table-column label="排列顺序" prop="sort" align="center"></el-table-column>
46
+ <el-table-column label="操作" align="center">
47
+ <template slot-scope="scope">
48
+ <el-button type="primary" @click="update(scope.row)">修改</el-button>
49
+ </template>
50
+ </el-table-column>
51
+ </el-table>
52
+ </el-main>
53
+ </el-container>
54
+ </el-main>
55
+ <el-footer>
56
+ <el-pagination
57
+ :ref="crud.pageRef"
58
+ :page-sizes="crud.pageSizes"
59
+ :page-size="crud.pageSize"
60
+ :current-page="crud.page"
61
+ :total="crud.dataStore.total"
62
+ @size-change="crud.sizeChange()"
63
+ @current-change="crud.currentPage()"
64
+ layout="total, sizes, prev, pager, next, jumper">
65
+ </el-pagination>
66
+ </el-footer>
67
+ <el-dialog :close-on-click-modal=false title="复合页面选项卡设置信息" top="15vh" :visible.sync="crud.dialogVisible"
68
+ append-to-body>
69
+ <el-form :model="crud.formData" :ref="crud.addFormRef">
70
+ <el-row>
71
+ <el-col :span="12">
72
+ <el-form-item label="选项卡名称" label-width="120px" prop="tabName" :rules="plValidate('required')">
73
+ <el-input v-model="crud.formData.tabName"></el-input>
74
+ </el-form-item>
75
+ </el-col>
76
+ <el-col :span="12">
77
+ <el-form-item label="选项卡图标" label-width="120px">
78
+ <el-input v-model="crud.formData.tabIcon" style="display: none"></el-input>
79
+ <el-button @click="iconDialog = true">
80
+ <i :class="(currentIcon || '').indexOf('saspiconfont') > -1 ? currentIcon : 'saspiconfont pl-icon-tuxiang'"
81
+ style="font-size:15px"></i></el-button>
82
+ <el-button @click="clearIcon()">清空</el-button>
83
+ </el-form-item>
84
+ </el-col>
85
+ </el-row>
86
+ <el-row>
87
+ <el-col :span="24">
88
+ <el-form-item label="链接类型" label-width="120px" prop="urlType" :rules="plValidate('required')">
89
+ <el-cascader style="width: 100%" @change="changeBindSource"
90
+ :options="urlTypeOptionArr"
91
+ filterable
92
+ clearable
93
+ v-model="crud.formData.urlType">
94
+ </el-cascader>
95
+ </el-form-item>
96
+ </el-col>
97
+ </el-row>
98
+ <el-form-item label="权限信息" label-width="120px">
99
+ <el-row>
100
+ <el-col :span="12">
101
+ <el-card class="box-card-class">
102
+ <div slot="header" class="clearfix">
103
+ <el-checkbox label="全选" @change="optChange"
104
+ v-model="crud.formData.allOptAuth"
105
+ style="margin-right: 0"></el-checkbox>
106
+ <span style="font-size: 15px;margin-left: 70px">操作权限</span>
107
+ </div>
108
+ <div class="tree">
109
+ <el-tree
110
+ :data="operationFormData"
111
+ show-checkbox
112
+ default-expand-all
113
+ node-key="id"
114
+ @check-change="checkeOptChangeFnc"
115
+ :render-content="renderOperateContent"
116
+ ref="operatePermisRef"
117
+ :props="defaultTreeProps">
118
+ </el-tree>
119
+ </div>
120
+ </el-card>
121
+ </el-col>
122
+ <el-col :span="12">
123
+ <el-card class="box-card-class">
124
+ <div slot="header" class="clearfix">
125
+ <el-checkbox label="全选" @change="dataChange"
126
+ v-model="crud.formData.allDataAuth"
127
+ style="margin-right: 0"></el-checkbox>
128
+ <span style="font-size: 15px;margin-left: 70px">数据权限</span>
129
+ </div>
130
+ <div class="tree">
131
+ <el-tree
132
+ :data="dataPermisFormData"
133
+ show-checkbox
134
+ default-expand-all
135
+ node-key="id"
136
+ @check-change="checkeDataChangeFnc"
137
+ ref="dataPermisRef"
138
+ :props="defaultTreeProps">
139
+ </el-tree>
140
+ </div>
141
+ </el-card>
142
+ </el-col>
143
+ </el-row>
144
+
145
+ </el-form-item>
146
+
147
+ <el-row>
148
+ <el-col :span="24">
149
+ <el-form-item label="排列顺序" label-width="120px" prop="sort"
150
+ :rules="plValidate('required','intNotZero')">
151
+ <el-input v-model="crud.formData.sort"></el-input>
152
+ </el-form-item>
153
+ </el-col>
154
+ </el-row>
155
+ </el-form>
156
+ <div slot="footer" class="dialog-footer">
157
+ <el-button type="primary" @click="submitForm()" size="small" icon="el-icon-success">确 定</el-button>
158
+ <el-button @click="crud.dialogVisible = false" size="small" icon="el-icon-error">取 消</el-button>
159
+ </div>
160
+ </el-dialog>
161
+ <el-dialog :close-on-click-modal=false :visible.sync="iconDialog" class="font-dialog" title="选择图标" width="70%"
162
+ height="80%" top="10vh" append-to-body>
163
+ <font-icon :callback="getmenuIcon"></font-icon>
164
+ </el-dialog>
165
+ </el-container>
166
+ </template>
167
+
168
+ <script>
169
+ import {FontIcon} from 'sasp-base';
170
+
171
+ const groupBy = (arr, func) =>
172
+ arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
173
+ acc[val] = (acc[val] || []).concat(arr[i]);
174
+ return acc;
175
+ }, {});
176
+ export default {
177
+ name: "complex-setting",
178
+ components: {FontIcon},
179
+ props: {
180
+ viewObj: {
181
+ type: Object,
182
+ default: function () {
183
+ return {}
184
+ }
185
+ },
186
+ urlTypeOptionArr: {
187
+ type: Array,
188
+ default: function () {
189
+ return []
190
+ }
191
+ },
192
+ urlTypeOptionObj: {
193
+ type: Object,
194
+ default: function () {
195
+ return {}
196
+ }
197
+ },
198
+ complexPreview: {
199
+ type: Function,
200
+ default() {
201
+ }
202
+ },
203
+ resourceId:{
204
+ type:String,
205
+ default:''
206
+ }
207
+ },
208
+ data() {
209
+ return {
210
+ crud: new this.CrudUtil({
211
+ vue: this,
212
+ entityName: "complextab",
213
+ url: this.api.complextab.url,
214
+ searchForm: {"order": "SORT ASC"},
215
+ noClearSearchColumns: ['viewId', "order"],
216
+ addDefaultData: {"formTreename": "", "formTreeid": "", "viewId": this.viewObj.id},
217
+ afterRemoveSuccess: this.afterRemoveSuccess,
218
+ updateLoadData: this.updateLoadData,
219
+ initNoSearch: true,
220
+ }),
221
+ optionObj: {
222
+ "form": "智能建表",
223
+ "singleForm": "单表表单",
224
+ "flow": "工作流",
225
+ "statRep": "统计报表",
226
+ "url": "url资源",
227
+ "sysFea": "自定义功能",
228
+ "sysFun": "系统功能"
229
+ },
230
+
231
+ options: [ // 链接类型
232
+ {label: '系统功能', value: 'sysFun'},
233
+ {label: '自定义功能', value: 'sysFea'},
234
+ {label: '智能建表', value: 'form'},
235
+ {label: '单表表单', value: 'singleForm'},
236
+ {label: '工作流', value: 'flow'},
237
+ {label: '统计报表', value: 'statRep'},
238
+ {label: 'url资源', value: 'url'},
239
+ ],
240
+ showTypeOption: [{ // 自定义表单展示方式
241
+ value: '列表视图',
242
+ label: '列表视图'
243
+ }, {
244
+ value: '列表&树视图',
245
+ label: '列表&树视图'
246
+ }],
247
+ sysFeatureMenuTypeOptions: [], // 系统功能菜单
248
+ sysFunctionMap: {}, // 系统功能菜单map键值对
249
+ customFunctionMenuOptions: [], // 自定义功能菜单
250
+ customFunctionMap: {}, // 自定义功能菜单map键值对
251
+ lastUrlType: "", // 上一次的链接类型
252
+ conditionOption: [], // 加载条件选项
253
+ currentIcon: "", // tab页图标
254
+ iconDialog: false, // tab页图片选择对话框
255
+ workFlowNodeOptions: [], // 工作流节点选项
256
+ chooseFormDialog: false, // 选择自定义表单
257
+ chooseFlowFormDialog: false, // 选择工作流
258
+ chooseTreeDialog: false, // 选择树
259
+ chooseStatisticalFormDialog: false, // 选则统计报表
260
+ flowTabDialog: false, // 工作流配置项
261
+ flowPreviewDialog: false, // 工作流tab页预览
262
+ defaultGzltabs: { // 工作流默认值配置
263
+ "tabs":
264
+ {
265
+ "draft": {
266
+ "sfqy": true,
267
+ "defaultShow": false,
268
+ "gzlswitch": true,
269
+ "icon": "saspiconfont pl-icon-cunrucaogaoxiang",
270
+ "tabName": "草稿"
271
+ },
272
+ "pending": {
273
+ "sfqy": true,
274
+ "defaultShow": true,
275
+ "gzlswitch": true,
276
+ "icon": "saspiconfont pl-icon-daichuli",
277
+ "tabName": "待处理"
278
+ },
279
+ "finished": {
280
+ "sfqy": true,
281
+ "defaultShow": false,
282
+ "gzlswitch": true,
283
+ "icon": "saspiconfont pl-icon-yichuli",
284
+ "tabName": "已处理"
285
+ },
286
+ "end": {
287
+ "sfqy": true,
288
+ "defaultShow": false,
289
+ "gzlswitch": true,
290
+ "icon": "saspiconfont pl-icon-jieshu",
291
+ "tabName": "已办结"
292
+ },
293
+ "cancel": {
294
+ "sfqy": true,
295
+ "defaultShow": false,
296
+ "gzlswitch": true,
297
+ "icon": "saspiconfont pl-icon-chexiao",
298
+ "tabName": "已撤销"
299
+ },
300
+ "stopped": {
301
+ "sfqy": true,
302
+ "defaultShow": false,
303
+ "gzlswitch": true,
304
+ "icon": "saspiconfont pl-icon-yizhongzhi",
305
+ "tabName": "已中止"
306
+ },
307
+ "query": {
308
+ "sfqy": true,
309
+ "defaultShow": false,
310
+ "gzlswitch": false,
311
+ "icon": "saspiconfont pl-icon-chaxun",
312
+ "tabName": "流程查询"
313
+ }
314
+ },
315
+ "tWidth": "", "tHeight": ""
316
+ },
317
+ operationFormData: [], //操作权限树数据
318
+ dataPermisFormData: [], //数据权限树数据
319
+ operationFormObj: {}, //操作权限节点数据key obj
320
+ dataPermisFormObj: {}, //数据节点权限obj
321
+ isHalfOperationKeyArr: [], //已经在半选中保存数据
322
+ isAllOperationKeyArr: [], //已经在全选中保存的数据
323
+ initCheckOperion: {},//默认选中操作权限
324
+ initCheckData: {}, //默认选中数据权限
325
+ defaultTreeProps: {
326
+ children: 'children',
327
+ label: 'powerName',
328
+ id: 'id'
329
+ },
330
+
331
+ refreshProper: '', //权限刷新
332
+
333
+ allCheckOperateKeyArr: [],
334
+ allCheckDataKeyArr: [],
335
+
336
+ defaultProps: {children: 'children', label: 'powerName', id: 'id', key: 'powerKey'}, // 树组件的配置信息
337
+
338
+ deleteIdArr: [], //删除id
339
+ updateResourceId: '', //当前修改的resoucedId
340
+ }
341
+ },
342
+ created() {
343
+ this.init();
344
+ },
345
+ watch: {
346
+ 'crud.formData.urlType'(val) { // 此处在select的change事件后触发,这里可以记住update时的初始值
347
+ this.lastUrlType = val;
348
+ },
349
+ resourceId() {
350
+ this.updateResourceId = this.resourceId;
351
+ }
352
+ },
353
+ methods: {
354
+
355
+ /**
356
+ * 预览方法
357
+ */
358
+ complexPreviewFunc() {
359
+ this.complexPreview(this.viewObj);
360
+ },
361
+
362
+ /**
363
+ * 初始化功能菜单等数据
364
+ */
365
+ initLinkData() {
366
+ let vm = this;
367
+ vm.sysFeatureMenuTypeOptions = [];
368
+ vm.customFunctionMenuOptions = [];
369
+ // vm.axios.post(vm.api.sysFunction.find,{"order":"GNLB ASC,SX ASC"}).then(res => {
370
+ // let [arrSys,arrCus] = [[],[]];
371
+ // (res.data || []).forEach(item => {
372
+ // if(item.ifcustomizemenu == "no"){
373
+ // vm.sysFunctionMap[item.id] = item;
374
+ // arrSys.push(item);
375
+ // }
376
+ // if(item.ifcustomizemenu == "yes"){
377
+ // vm.customFunctionMap[item.id] = item;
378
+ // arrCus.push(item);
379
+ // }
380
+ // });
381
+ // let SysData = groupBy(arrSys,'gnlb');
382
+ // let CusData = groupBy(arrCus,'gnlb');
383
+ // Object.keys(SysData).forEach(key => {
384
+ // let item = SysData[key];
385
+ // let options = [];
386
+ // for (let {id, gnmc} of item) {
387
+ // options.push({
388
+ // value: id,
389
+ // label: gnmc
390
+ // })
391
+ // }
392
+ // vm.sysFeatureMenuTypeOptions.push({
393
+ // label: key,
394
+ // options: options
395
+ // });
396
+ // });
397
+ // Object.keys(CusData).forEach(key => {
398
+ // let item = CusData[key];
399
+ // let options = [];
400
+ // for (let {id, gnmc} of item) {
401
+ // options.push({
402
+ // value: id,
403
+ // label: gnmc
404
+ // })
405
+ // }
406
+ // vm.customFunctionMenuOptions.push({
407
+ // label: key,
408
+ // options: options
409
+ // });
410
+ // });
411
+ // });
412
+ },
413
+ /**
414
+ * 初始化表单、搜索条件数据
415
+ */
416
+ init() {
417
+ let vm = this;
418
+ vm.updateResourceId = vm.resourceId;
419
+ vm.initLinkData();
420
+ let arr = ['viewId', 'tabName', 'tabIcon', 'urlType', 'urlId', 'urlName', 'formviewName', 'formviewId', 'formviewShowtype',
421
+ 'formTreeid', 'formTreename', 'url', 'parameter', 'sort', 'formCondition', 'menuGzljd', 'menuGzltabs'];
422
+ arr.forEach(key => {
423
+ vm.$set(vm.crud.formData, key, "");
424
+ });
425
+ this.crud.searchForm["viewId"] = this.viewObj.id;
426
+ this.crud.search();
427
+ },
428
+ /**
429
+ * 链接类型变化清除表单数据
430
+ */
431
+ changeBindSource(val) {
432
+ let vm = this;
433
+ let obj = { // 切换清除数据
434
+ "sysFunciton": ["urlId", "urlName"],
435
+ "diyFunction": ["urlId", "urlName"],
436
+ "form": ["urlId", "formviewId", "urlName", "formviewName", "formCondition", "formviewShowtype", "formTreeid", "formTreename"],
437
+ "flow": ["urlId", "urlName", "menuGzljd", "menuGzltabs"],
438
+ "statReport": ["urlId", "urlName"],
439
+ "url": ["urlId"],
440
+ };
441
+ if (this.lastUrlType && obj[this.lastUrlType]) {
442
+ obj[this.lastUrlType].forEach(key => {
443
+ vm.$set(vm.crud.formData, key, "");
444
+ })
445
+ }
446
+ vm.$set(vm.crud.formData, "allOptAuth", false);
447
+ vm.$set(vm.crud.formData, "allDataAuth", false);
448
+ let operatePermis = [];
449
+ let dataPermis = [];
450
+ this.operationFormData = [];
451
+ this.dataPermisFormData = [];
452
+ this.allCheckOperateKeyArr = [];
453
+ this.allCheckDataKeyArr = [];
454
+ this.operationFormObj = {};
455
+ this.dataPermisFormObj = {};
456
+ this.refreshProper = this.COMMON_FUNC.getUuidByParams(32);
457
+
458
+ if (val && val.length > 0) {
459
+ let length = val.length;
460
+ let resouceId = val[length - 1];
461
+ if (resouceId && this.urlTypeOptionObj[resouceId]) {
462
+ let obj = this.urlTypeOptionObj[resouceId];
463
+ operatePermis = obj.operatePermisList || []; //操作权限
464
+ dataPermis = obj.dataPermisList || []; //数据权限
465
+ let paramSetting = {};
466
+ paramSetting["id"] = "id";
467
+ paramSetting["pId"] = "parentId"; //上级数据
468
+ paramSetting["children"] = this.defaultProps["children"]; // 设置children可配置
469
+ this.operationFormData = this.COMMON_FUNC.buildElTree(operatePermis, paramSetting);
470
+ this.dataPermisFormData = this.COMMON_FUNC.buildElTree(dataPermis, paramSetting);
471
+ // //判断是否全选
472
+ //默认选中
473
+
474
+ if (this.$refs.operatePermisRef) {
475
+ this.$refs.operatePermisRef.setCheckedNodes([]);
476
+ }
477
+ if (this.$refs.dataPermisRef) {
478
+ this.$refs.dataPermisRef.setCheckedNodes([]);
479
+ }
480
+ }
481
+ }
482
+ //置空全选
483
+ vm.$nextTick(() => {
484
+ if (vm.$refs.operatePermisRef) {
485
+ vm.$refs.operatePermisRef.setCheckedNodes([]);
486
+ }
487
+ if (vm.$refs.dataPermisRef) {
488
+ vm.$refs.dataPermisRef.setCheckedNodes([]);
489
+ }
490
+ });
491
+ },
492
+ // 表单关联组件start
493
+ /**
494
+ * 设置tab页图标
495
+ * @param icon 图标
496
+ */
497
+ getmenuIcon(icon) {
498
+ let vm = this;
499
+ if(icon.startsWith("el-icon-")){
500
+ vm.crud.formData.tabIcon = icon;
501
+ vm.currentIcon = icon;
502
+ }else{
503
+ vm.crud.formData.tabIcon = 'saspiconfont ' + icon;
504
+ vm.currentIcon = 'saspiconfont ' + icon;
505
+ }
506
+
507
+ vm.iconDialog = false;
508
+ },
509
+ /**
510
+ * 清除tab页图标
511
+ */
512
+ clearIcon() {
513
+ let vm = this;
514
+ vm.crud.formData.tabIcon = '';
515
+ vm.currentIcon = '';
516
+ },
517
+ /**
518
+ * 保存工作流选项卡配置
519
+ * @param setting 配置字符串
520
+ */
521
+ saveFlowTabSetting(setting) {
522
+ let vm = this;
523
+ if (vm.crud.formData.id) { // 修改直接保存数据
524
+ vm.axios.post(vm.api.menu.update, {"id": vm.crud.formData.id, "menuGzltabs": setting});
525
+ }
526
+ vm.crud.formData.menuGzltabs = setting;
527
+ vm.flowTabDialog = false;
528
+ },
529
+ /**
530
+ * 工作流预览
531
+ */
532
+ flowPreview() {
533
+ if (!this.crud.formData.menuGzltabs || "{}" === this.crud.formData.menuGzltabs) { // 没有数据则设置为默认配置项
534
+ this.crud.formData.menuGzltabs = JSON.stringify(this.defaultGzltabs);
535
+ }
536
+ this.flowPreviewDialog = true;
537
+ },
538
+ /**
539
+ * 选择form
540
+ * @param data 表单数据
541
+ */
542
+ chooseForm(data) {
543
+ let {id, formId, formName, listTitle} = data;
544
+ let formData = this.crud.formData;
545
+ this.$set(formData, 'urlName', formName);
546
+ formData.formviewName = listTitle;
547
+ formData.formviewId = id;
548
+ formData.urlId = formId;
549
+ formData.formTreeid = "";
550
+ formData.formTreename = "";
551
+ this.$set(formData, 'formviewShowtype', "列表视图");
552
+ this.axios.post('/formConditionController/find', { //列表视图条件定义
553
+ 'viewId': id
554
+ }).then(res => {
555
+ this.conditionOption = [];
556
+ for (let {id, condintionName} of res.data) {
557
+ this.conditionOption.push({
558
+ value: id,
559
+ label: condintionName
560
+ })
561
+ }
562
+ });
563
+ this.chooseFormDialog = false;
564
+ },
565
+ /**
566
+ * 选择工作流
567
+ * @param data 工作流数据
568
+ */
569
+ selectWorkFlowForm(data) {
570
+ let formData = this.crud.formData;
571
+ let {id, flowName} = data;
572
+ formData.urlId = id;
573
+ this.$set(formData, 'urlName', flowName);
574
+ this.chooseFlowFormDialog = false;
575
+ this.axios.post('/flowDefineNodeController/find', {
576
+ 'sort': 'NODE_TYPE_EXTEND',
577
+ 'flowId': id
578
+ }).then(res => {
579
+ let workFlowNodeData = res.data;
580
+ this.workFlowNodeOptions = [];
581
+ for (let {id, nodeName} of workFlowNodeData) {
582
+ this.workFlowNodeOptions.push({
583
+ value: id,
584
+ label: nodeName
585
+ })
586
+ }
587
+ });
588
+ },
589
+ /**
590
+ * 开始选择树
591
+ */
592
+ chooseTree() {
593
+ if (!this.crud.formData.formviewId) {
594
+ this.$message("尚未选择表单,请先选择表单后再进行操作!");
595
+ return;
596
+ }
597
+ this.chooseTreeDialog = true;
598
+ },
599
+ /**
600
+ * 确定选择树
601
+ * @param data 树数据
602
+ * @param value 格式化后的名称
603
+ */
604
+ determinTree(data, value) {
605
+ let formData = this.crud.formData;
606
+ this.$set(formData, 'formTreeid', data.id);
607
+ this.$set(formData, 'formTreename', value);
608
+ this.chooseTreeDialog = false;
609
+ },
610
+ /**
611
+ * 选择统计报表
612
+ * @param data 报表数据
613
+ */
614
+ selectStatisticalForm(data) {
615
+ let {id, reportName} = data;
616
+ let formData = this.crud.formData;
617
+ this.$set(formData, 'urlId', id);
618
+ this.$set(formData, 'urlName', reportName);
619
+ this.chooseStatisticalFormDialog = false;
620
+ },
621
+ //表单关联组件end
622
+ /**
623
+ * crud修改方法后的回调
624
+ * @param formData
625
+ */
626
+ updateLoadData(formData) {
627
+ this.currentIcon = formData.tabIcon || "";
628
+ if (formData.urlType == 'flow') {
629
+ this.axios.post('/flowDefineNodeController/find', {
630
+ 'order': 'NODE_TYPE_EXTEND ASC',
631
+ 'flowId': formData.urlId
632
+ }).then(res => {
633
+ let workFlowNodeData = res.data;
634
+ this.workFlowNodeOptions = [];
635
+ for (let {id, nodeName} of workFlowNodeData) {
636
+ this.workFlowNodeOptions.push({
637
+ value: id,
638
+ label: nodeName
639
+ })
640
+ }
641
+ });
642
+ }
643
+ if (formData.menuGzljd) {
644
+ formData["menuGzljd"] = formData.split(","); // 工作流节点赋值为数组
645
+ }
646
+
647
+ if ((formData.urlType || "").indexOf('form') > -1 && formData["formviewId"]) { // 自定义表单加载条件
648
+ this.axios.post('/formConditionController/find', {
649
+ 'viewId': formData["formviewId"]
650
+ }).then(res => {
651
+ this.conditionOption = [];
652
+ for (let {id, condintionName} of res.data) {
653
+ this.conditionOption.push({
654
+ value: id,
655
+ label: condintionName
656
+ })
657
+ }
658
+ });
659
+ }
660
+ },
661
+ /**
662
+ * 删除成功后的操作,这里主要是为了更新menuOpts
663
+ */
664
+ afterRemoveSuccess() {
665
+ //根据 sourceId 删除 和 deleteId删除
666
+ this.axios.post(this.api.resourcesPower.deleteResourcesPower, {
667
+ rkeys: this.deleteIdArr.join(","),
668
+ resourceId: this.updateResourceId
669
+ })
670
+
671
+ },
672
+ /**
673
+ * 提交表单数据
674
+ */
675
+ submitForm() {
676
+ let vm = this;
677
+ vm.$refs[vm.crud.addFormRef].validate(async valid => {
678
+ if (!valid) {
679
+ return;
680
+ }
681
+ let loading = vm.$loading({
682
+ target: vm.$refs[vm.crud.addFormRef].$el,
683
+ lock: true,
684
+ text: '请稍候...',
685
+ spinner: 'el-icon-loading',
686
+ background: 'rgba(0, 0, 0, 0.6)'
687
+ });
688
+
689
+ let formData = JSON.parse(JSON.stringify(vm.crud.formData || {}));
690
+
691
+ let optType = "update";
692
+ if (!formData["id"]) {
693
+ optType = "add";
694
+ }
695
+ if (formData["urlType"] && typeof formData["urlType"] == "object") {
696
+ formData["urlType"] = JSON.stringify(formData["urlType"] || {});
697
+ }
698
+ //保存数据权限和操作权限
699
+ //计算所有选中的数据权限和操作权限
700
+ if (vm.$refs.operatePermisRef) {
701
+ //遍历所有选中节点,判断下级是否选中,如果下级选中了则判断下下级,如果找不到下级或者下级未被选中 则保存当前节点id
702
+ let checkeOpertionArr = vm.$refs.operatePermisRef.getCheckedKeys(); //全选的节点
703
+ //递归过滤 isHalfOperationKeyArr
704
+ let opertionKeyArr = [];
705
+ this.initSelectKey(this.operationFormData, checkeOpertionArr, opertionKeyArr);
706
+ formData["operatePermis"] = opertionKeyArr.join(","); //操作权限
707
+ }
708
+
709
+ if (vm.$refs.dataPermisRef) {
710
+ let checkDataArr = vm.$refs.dataPermisRef.getCheckedKeys(); //选中的数据权限
711
+ let dataKeyArr = [];
712
+ this.initSelectKey(this.dataPermisFormData, checkDataArr, dataKeyArr);
713
+ formData["dataPermis"] = dataKeyArr.join(","); //数据权限
714
+ }
715
+
716
+ // 设置viewId
717
+ formData["viewId"] = vm.viewObj.id;
718
+ //保存数据
719
+
720
+ delete formData["createTime"];
721
+ delete formData["updateTime"];
722
+ vm.axios.post(vm.api.complextab.url + "/" + optType, formData).then(res => {
723
+ vm.$message({
724
+ duration: 1500,
725
+ type: 'success',
726
+ message: res.data.operateMessage
727
+ });
728
+ if (res.data.operateSuccess) { // 操作成功,修改MenuOpts
729
+ let obj = res.data.operateObj;
730
+ // vm.updateMenuOpts();
731
+ //注册到资源池
732
+ // vm.registeredResource(res.data.operateObj);
733
+ //获取当前选中的操作权限
734
+ let optArr = []; //保存的操作权限
735
+ let dataArr = []; //保存的数据权限
736
+
737
+
738
+ //保存tab 标签
739
+ optArr.push({
740
+ "type": 'opt',
741
+ 'powerCode': obj.id,
742
+ 'powerKey': obj.id,
743
+ 'powerName': obj.tabName,
744
+ 'parentId': '-1',
745
+ 'parentTree': '-1',
746
+ });
747
+ dataArr.push({
748
+ "type": 'data',
749
+ 'powerCode': obj.id,
750
+ 'powerKey': obj.id,
751
+ 'powerName': obj.tabName,
752
+ 'parentId': '-1',
753
+ 'parentTree': '-1',
754
+ });
755
+ let resourceParam = {
756
+ rType: 'page', //url页面资源
757
+ rName: this.viewObj.viewName, //功能名称
758
+ rKey: this.viewObj.id, //唯一
759
+ externalAccess: '0',
760
+ noLoginRequired: '1',//默认不需要登录
761
+ passSwitch: '0',
762
+ rSource: 'cview', //资源类型 复合视图
763
+ rClass: '复合视图',
764
+ rClassId: '-1',
765
+ operatePermis: JSON.stringify(optArr), //操作权限
766
+ dataPermis: JSON.stringify(dataArr), //数据权限
767
+ rStatus: '1',
768
+ pPowerKey: obj.id,
769
+ operateKeys: formData["operatePermis"],
770
+ dataKeys: formData["dataPermis"]
771
+ };
772
+ this.axios.post(this.api.resources.saveOrUpdateRsources, resourceParam).then(res => {
773
+ //刷新资源池更新 sourceId
774
+ if (res.data && res.data.operateObj) {
775
+ this.updateResourceId = (res.data.operateObj || {}).id;
776
+ }
777
+ });
778
+ }
779
+ vm.$refs[vm.crud.addFormRef].clearValidate();
780
+ vm.crud.search();
781
+ loading && loading.close();
782
+ vm.crud.dialogVisible = false;
783
+ });
784
+ })
785
+ },
786
+ /**
787
+ * 修改menuOpts
788
+ */
789
+
790
+ /**
791
+ * 注册or保存到资源池
792
+ */
793
+
794
+
795
+ update(row) { //修改复合视图
796
+ let vm = this;
797
+ //修改 row,urlType
798
+ if (row.urlType && typeof row.urlType == 'string') {
799
+ this.$set(row, 'urlType', JSON.parse(row.urlType));
800
+ }
801
+ //初始化数据权限和操作权限
802
+ this.changeBindSource(row.urlType);
803
+ vm.crud.update(row);
804
+ this.$set(this.crud.formData, 'allOptAuth', true); //操作权限
805
+ this.$set(this.crud.formData, 'allDataAuth', true); //数据权限
806
+ //默认选中
807
+ vm.$nextTick(() => {
808
+ let opeateKeyArr = (row.operatePermis || '').split(","); //权限id用逗号拼接
809
+ let dataKeyArr = (row.dataPermis || '').split(","); //权限id用逗号拼接
810
+ if (this.$refs.operatePermisRef) { //选中操作权限
811
+ this.$refs.operatePermisRef.setCheckedKeys(opeateKeyArr);
812
+ //获取半选
813
+ if (this.operationFormData.length == 0) {
814
+ this.$set(vm.crud.formData, 'allOptAuth', false); //操作权限
815
+ }
816
+ this.operationFormData.some(item => {
817
+ if (opeateKeyArr.indexOf(item.id) == '-1') {
818
+ this.$set(vm.crud.formData, 'allOptAuth', false); //操作权限
819
+ return true;
820
+ }
821
+ });
822
+ }
823
+ if (this.$refs.dataPermisRef) { //选中数据权限
824
+ this.$refs.dataPermisRef.setCheckedKeys(dataKeyArr);
825
+ //获取半选
826
+ if (this.dataPermisFormData.length == 0) {
827
+ this.$set(vm.crud.formData, 'allDataAuth', false); //操作权限
828
+ }
829
+ this.dataPermisFormData.some(item => {
830
+ if (dataKeyArr.indexOf(item.id) == '-1') {
831
+ this.$set(vm.crud.formData, 'allDataAuth', false); //操作权限
832
+ return true;
833
+ }
834
+ });
835
+ }
836
+ //初始化树选中
837
+ // let checkOperateKeyArr = [];
838
+ // let checkDataKeyArr = [];
839
+ // this.initTreeCheck(row.operatePermis || [],checkOperateKeyArr); //操作权限
840
+ // this.initTreeCheck(row.dataPermis || [],checkDataKeyArr); //数据权限
841
+ // if(this.$refs.operatePermisRef){ //选中操作权限
842
+ // this.$refs.operatePermisRef.setCheckedKeys(checkOperateKeyArr);
843
+ // }
844
+ // if(this.$refs.dataPermisRef){//选中数据权限
845
+ // this.$refs.dataPermisRef.setCheckedKeys(checkDataKeyArr);
846
+ // }
847
+ // //判断是否全选 当前获取当前选中的数据 checkOperateKeyArr 和树数据比较 operationFormData
848
+ // let halfOperatArr = vm.$refs.operatePermisRef.getHalfCheckedNodes(); //获取操作半选
849
+ // let halfDataArr = vm.$refs.dataPermisRef.getHalfCheckedNodes(); //获取操作半选
850
+ // this.isAllOptCheck(this.operationFormData,halfOperatArr,this.allCheckOperateKeyArr);
851
+ // this.isAllDataCheck(this.dataPermisFormData,halfDataArr,this.allCheckDataKeyArr);
852
+ });
853
+ },
854
+
855
+ /**
856
+ * 操作权限判断全选
857
+ */
858
+ isAllOptCheck(formTreeArr, halfArr, allCheckArr) {
859
+ if (formTreeArr.length == 0 || halfArr.length > 0) {
860
+ this.$set(this.crud.formData, 'allOptAuth', false);
861
+ } else {
862
+ formTreeArr.some(item => { //判断是否选中
863
+ if (allCheckArr.indexOf(item.key) > -1) {
864
+ formTreeArr = item["childrens"];
865
+ if (formTreeArr) {
866
+ this.isAllOptCheck(formTreeArr, halfArr, allCheckArr);
867
+ }
868
+ } else {
869
+ this.$set(this.crud.formData, 'allOptAuth', false);
870
+ return true; //终止
871
+ }
872
+ });
873
+ }
874
+ },
875
+
876
+ /**
877
+ * 数据权限判断全选
878
+ */
879
+ isAllDataCheck(formTreeArr, halfArr, allCheckArr) {
880
+ if (formTreeArr.length == 0 || halfArr.length > 0) {
881
+ this.$set(this.crud.formData, 'allDataAuth', false);
882
+ } else {
883
+ formTreeArr.some(item => { //判断是否选中
884
+ if (allCheckArr.indexOf(item.key) > -1) {
885
+ formTreeArr = item["childrens"];
886
+ if (formTreeArr) {
887
+ this.isAllDataCheck(formTreeArr, halfArr, allCheckArr);
888
+ }
889
+ } else {
890
+ this.$set(this.crud.formData, 'allDataAuth', false);
891
+ return true; //终止
892
+ }
893
+ });
894
+ }
895
+ },
896
+
897
+ /**
898
+ * 新增复合视图
899
+ */
900
+ add() {
901
+ //清空数据权限和操作权限
902
+ this.operationFormData = [];
903
+ this.dataPermisFormData = [];
904
+ this.$set(this.crud.formData, 'allOptAuth', false); //操作权限
905
+ this.$set(this.crud.formData, 'allDataAuth', false); //数据权限
906
+ this.$set(this.crud.formData, 'tabIcon', '');
907
+ this.currentIcon = '';//清空图标
908
+ this.crud.add();
909
+ },
910
+
911
+ /**
912
+ * 删除复合视图
913
+ */
914
+ remove() {
915
+ //删除事件
916
+ this.deleteIdArr = [];
917
+ let selection = this.$refs[this.crud.tableRef].selection || [];
918
+ selection.forEach(item => {
919
+ this.deleteIdArr.push(item.id);
920
+ });
921
+ this.crud.remove();
922
+ },
923
+
924
+ /**
925
+ * 保存数据权限和操作权限树
926
+ */
927
+ saveOptAndData(submitObj) {
928
+ let vm = this;
929
+ //计算所有选中的数据权限和操作权限
930
+ let checkeOpertionArr = []; //全选操作权限
931
+ let halfOperatArr = []; //半选操作权限
932
+ let checkDataArr = [];
933
+ let halfCheckArr = [];//半选数据权限
934
+ if (vm.$refs.operatePermisRef) {
935
+ this.isHalfOperationKeyArr = [];
936
+ this.isAllOperationKeyArr = [];
937
+ checkeOpertionArr = vm.$refs.operatePermisRef.getCheckedNodes(); //全选
938
+ halfOperatArr = vm.$refs.operatePermisRef.getHalfCheckedNodes(); //获取半选
939
+ let keyOperateArr = vm.$refs.operatePermisRef.getCheckedKeys(); //获取当前完全勾选的节点
940
+
941
+ let copyCheckeOpertionArr = JSON.parse(JSON.stringify(checkeOpertionArr || []));
942
+ let copyHalfOperatArr = JSON.parse(JSON.stringify(halfOperatArr || []));
943
+ let copyKeyOperateArr = JSON.parse(JSON.stringify(keyOperateArr));
944
+
945
+ this.deleteAllCheckOpertion(copyCheckeOpertionArr, copyKeyOperateArr);
946
+ //循环半选的
947
+ this.disabelHalNoUseData(copyHalfOperatArr, copyKeyOperateArr);
948
+ let allOperateData = copyCheckeOpertionArr.concat(copyHalfOperatArr);
949
+ allOperateData = this.filterIsHalfOperation(allOperateData, this.isHalfOperationKeyArr, this.isAllOperationKeyArr);
950
+ submitObj["operatePermis"] = allOperateData;
951
+ //递归过滤 isHalfOperationKeyArr
952
+ }
953
+
954
+ if (vm.$refs.dataPermisRef) {
955
+ this.isHalfOperationKeyArr = []; //
956
+ this.isAllOperationKeyArr = [];
957
+ checkDataArr = vm.$refs.dataPermisRef.getCheckedNodes();
958
+ halfCheckArr = vm.$refs.dataPermisRef.getHalfCheckedNodes(); //获取半选
959
+ let keyDataArr = vm.$refs.operatePermisRef.getCheckedKeys(); //获取当前完全勾选的节点
960
+ let copyCheckDataArr = JSON.parse(JSON.stringify(checkDataArr || []));
961
+ let copyHalfCheckArr = JSON.parse(JSON.stringify(halfCheckArr || []));
962
+ let copyKeyDataArr = JSON.parse(JSON.stringify(keyDataArr));
963
+ this.deleteAllCheckOpertion(copyCheckDataArr, copyKeyDataArr);
964
+ this.disabelHalNoUseData(copyHalfCheckArr, copyKeyDataArr);
965
+ let allData = copyCheckDataArr.concat(copyHalfCheckArr);
966
+ allData = this.filterIsHalfOperation(allData, this.isHalfOperationKeyArr, this.isAllOperationKeyArr);
967
+ submitObj["dataPermis"] = allData;
968
+ }
969
+ //数据权限 和操作权限
970
+ if (submitObj['operatePermis'] && typeof submitObj["operatePermis"] == "object") {
971
+ submitObj["operatePermis"] = JSON.stringify(submitObj["operatePermis"]);
972
+ }
973
+ if (submitObj['dataPermis'] && typeof submitObj["dataPermis"] == "object") {
974
+ submitObj["dataPermis"] = JSON.stringify(submitObj["dataPermis"]);
975
+ }
976
+ },
977
+
978
+
979
+ /**
980
+ * 删除已经子数据
981
+ * @param allCheckArr
982
+ * @param keyArr
983
+ */
984
+ deleteAllCheckOpertion(allArr, keyArr) {
985
+ allArr.forEach(item => {
986
+ this.$set(item, 'enable', true); //默认节点可用
987
+ if (item["childrens"]) {
988
+ (item["childrens"] || []).forEach((child, index) => {
989
+ if (keyArr.indexOf(child.key) > -1) { //删除当前数据
990
+ this.isAllOperationKeyArr.push(child.key);
991
+ }
992
+ allArr = item["childrens"];
993
+ this.deleteAllCheckOpertion(allArr, keyArr);
994
+ })
995
+ }
996
+ });
997
+ },
998
+
999
+ /**
1000
+ * 递归半选中无用数据
1001
+ * @param halfOperatArr
1002
+ * @param keyArr
1003
+ */
1004
+ disabelHalNoUseData(halfOperatArr, keyArr) {
1005
+ halfOperatArr.forEach(item => {
1006
+ if (item["childrens"]) {
1007
+ (item["childrens"] || []).forEach((child, index) => {
1008
+ if (keyArr.indexOf(child.key) == -1) { //设置当前节点 isCheked:false
1009
+ // this.$set(child,'enable',false); //设置节点为不可用状态
1010
+ item["childrens"].splice(index, 1);
1011
+ keyArr.splice(index, 1);
1012
+ } else {
1013
+ this.$set(child, 'enable', true);
1014
+ ;//设置可编辑状态
1015
+ this.isHalfOperationKeyArr.push(child.key);
1016
+ }
1017
+ halfOperatArr = item["childrens"];
1018
+ this.disabelHalNoUseData(halfOperatArr, keyArr);
1019
+ })
1020
+ }
1021
+ });
1022
+ },
1023
+
1024
+ /**
1025
+ * 过滤全选数据
1026
+ */
1027
+ filterIsHalfOperation(checkeOpertionArr, isHalfOperationKeyArr, isAllOperationKey) {
1028
+ checkeOpertionArr = checkeOpertionArr.filter(item => {
1029
+ return isHalfOperationKeyArr.indexOf(item.key) == -1 && isAllOperationKey.indexOf(item.key) == -1;
1030
+ });
1031
+
1032
+ return checkeOpertionArr;
1033
+ },
1034
+
1035
+ /**
1036
+ * 操作权限全选
1037
+ */
1038
+ optChange(val) {
1039
+ //全选或取消全选
1040
+ if (val) {
1041
+ //全部勾选
1042
+ this.$refs.operatePermisRef.setCheckedNodes(this.operationFormData);
1043
+ } else {
1044
+ //取消全部勾选
1045
+ this.$refs.operatePermisRef.setCheckedNodes([]);
1046
+ }
1047
+ },
1048
+
1049
+ /**
1050
+ * 数据权限全选
1051
+ */
1052
+ dataChange(val) {
1053
+ //全选或取消全选
1054
+ if (val) {
1055
+ //全部勾选
1056
+ this.$refs.dataPermisRef.setCheckedNodes(this.dataPermisFormData);
1057
+ } else {
1058
+ //取消全部勾选
1059
+ this.$refs.dataPermisRef.setCheckedNodes([]);
1060
+ }
1061
+ },
1062
+
1063
+ /**
1064
+ * 获取parentId
1065
+ */
1066
+ setFormDataParentId(dataArr, parentId, allKeyArr) {
1067
+ dataArr.forEach(item => {
1068
+ this.$set(item, 'pId', parentId);
1069
+ this.$set(item, 'enable', true); //默认节点可用
1070
+ let parentTree = parentId;
1071
+ if (item.parentTree) {
1072
+ parentTree = item.parentTree + "," + parentId;
1073
+ }
1074
+ this.$set(item, 'parentTree', parentTree);
1075
+ allKeyArr.push(item['key']);
1076
+ if (item["childrens"]) { //
1077
+ dataArr = item["childrens"];
1078
+ parentId = item["key"];
1079
+ this.setFormDataParentId(dataArr, parentId, allKeyArr);
1080
+ }
1081
+ });
1082
+ },
1083
+
1084
+ /**
1085
+ * 初始化树选中
1086
+ */
1087
+ initTreeCheck(dataArr, keysArr) {
1088
+ (dataArr || []).forEach(item => {
1089
+ if (!item["childrens"]) { //因为下级全部选中上级自动选中,所以不用考虑上级
1090
+ // this.$refs.operatePermisRef.setCheckedKeys([item['key']]);
1091
+ if (item['enable']) { //当前已选择
1092
+ keysArr.push(item['key']);
1093
+ }
1094
+ }
1095
+ if (item["childrens"]) {
1096
+ this.initTreeCheck(item["childrens"], keysArr);
1097
+ }
1098
+ })
1099
+ },
1100
+
1101
+ /**
1102
+ * 格式化链接类型
1103
+ * @param urlType
1104
+ * @returns {string}
1105
+ */
1106
+ formatterUrlType(urlType) {
1107
+ let result = '';
1108
+ if (urlType) {
1109
+ if (typeof urlType == 'string') {
1110
+ let obj = JSON.parse(urlType);
1111
+ result = this.optionObj[obj[0]];
1112
+ } else {
1113
+ result = this.optionObj[urlType[0]];
1114
+ }
1115
+ }
1116
+ return result;
1117
+ },
1118
+
1119
+
1120
+ /**
1121
+ * 操作权限点击事件
1122
+ * @param data
1123
+ * @param checked
1124
+ */
1125
+ checkeOptChangeFnc(data, checked) {
1126
+ this.$set(this.crud.formData, 'allOptAuth', true); //操作权限
1127
+ let keysArr = [];
1128
+ if (this.$refs.operatePermisRef) {
1129
+ keysArr = this.$refs.operatePermisRef.getCheckedKeys();
1130
+ }
1131
+ this.operationFormData.some(item => {
1132
+ if (keysArr.indexOf(item.id) == '-1') {
1133
+ this.$set(this.crud.formData, 'allOptAuth', false); //操作权限
1134
+ return true;
1135
+ }
1136
+ });
1137
+ },
1138
+ /**
1139
+ * 数据全选点击全选判断
1140
+ * @param data
1141
+ * @param checked
1142
+ */
1143
+ checkeDataChangeFnc(data, checked) {
1144
+ this.$set(this.crud.formData, 'allDataAuth', true); //数据权限
1145
+ //获取半选
1146
+ let keysArr = [];
1147
+ if (this.$refs.dataPermisRef) {
1148
+ keysArr = this.$refs.dataPermisRef.getCheckedKeys();
1149
+ }
1150
+ this.dataPermisFormData.some(item => {
1151
+ if (keysArr.indexOf(item.id) == '-1') {
1152
+ this.$set(this.crud.formData, 'allDataAuth', false); //操作权限
1153
+ return true;
1154
+ }
1155
+ });
1156
+
1157
+ },
1158
+
1159
+ /**
1160
+ * 递归生成 树的 parentId 和 parentTree
1161
+ * @param treeArr
1162
+ */
1163
+ initParentIdAndParentTree(treeArr, pId) {
1164
+ (treeArr || []).forEach(item => {
1165
+ this.$set(item, 'parentId', pId);
1166
+ let parentTree = pId || "";
1167
+ if (item.parentTree) {
1168
+ parentTree = item.parentTree + "," + pId;
1169
+ }
1170
+ this.$set(item, 'parentTree', parentTree);
1171
+ if (item.children) {
1172
+ treeArr = item.children;
1173
+ pId = item.id;
1174
+ this.initParentIdAndParentTree(treeArr, pId);
1175
+
1176
+ }
1177
+ });
1178
+
1179
+ },
1180
+
1181
+ /**
1182
+ * 获取选中的
1183
+ */
1184
+ initSelectKey(treeArr, selectKeyArr, opertionKeyArr) {
1185
+ treeArr.forEach(item => {
1186
+ if (!item.children||item.children.length==0) {
1187
+ if (selectKeyArr.indexOf(item.id) > -1) {
1188
+ opertionKeyArr.push(item.id);
1189
+ }
1190
+ } else {
1191
+ treeArr = item["children"];
1192
+ this.initSelectKey(treeArr, selectKeyArr, opertionKeyArr);
1193
+ }
1194
+ });
1195
+
1196
+ },
1197
+
1198
+ /**
1199
+ * 操作权限
1200
+ * @param h
1201
+ * @param node
1202
+ * @param data
1203
+ * @param store
1204
+ * @returns {*}
1205
+ */
1206
+ renderOperateContent(h, { node, data, store }) {
1207
+ let type = "按钮";
1208
+ if(data.powerKey.indexOf("tree") > -1){
1209
+ type = "树"
1210
+ }
1211
+ return (
1212
+ <span >
1213
+ <span>{node.label}</span>
1214
+ <span class="custom-operate-tree-node">
1215
+ ({type})
1216
+ </span>
1217
+ </span>);
1218
+ },
1219
+ }
1220
+ }
1221
+ </script>
1222
+
1223
+ <style scoped lang="scss">
1224
+ .box-card-class {
1225
+ width: 350px;
1226
+ height: 350px;
1227
+ overflow-y: auto;
1228
+ padding-bottom: 10px;
1229
+ }
1230
+
1231
+ .tree {
1232
+ overflow-y: auto;
1233
+ height: 220px;
1234
+ }
1235
+
1236
+ .tree /deep/ .el-tree {
1237
+   .el-tree-node__content {
1238
+     display: block !important;
1239
+ }
1240
+
1241
+   .el-tree-node__children {
1242
+     overflow: visible !important;
1243
+ }
1244
+ }
1245
+ .tree /deep/.custom-operate-tree-node {
1246
+ margin-left: 10px;
1247
+ font-size: 11px;
1248
+ color: #409EFF;
1249
+ }
1250
+ </style>