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.
- package/index.js +227 -0
- package/package.json +19 -0
- package/router.js +83 -0
- package/src/assets/font/iconfont.css +1346 -0
- package/src/assets/font/iconfont.eot +0 -0
- package/src/assets/font/iconfont.js +1 -0
- package/src/assets/font/iconfont.svg +827 -0
- package/src/assets/font/iconfont.ttf +0 -0
- package/src/assets/font/iconfont.woff +0 -0
- package/src/assets/images/loading-bar.gif +0 -0
- package/src/assets/js/adminInstall.js +36 -0
- package/src/assets/js/api/apiAdmin.js +613 -0
- package/src/assets/js/global/dataGlobal.js +260 -0
- package/src/assets/js/global/logGlobal.js +22 -0
- package/src/assets/js/global/paramGlobal.js +67 -0
- package/src/assets/js/global/resGlobal.js +91 -0
- package/src/assets/js/global/userGlobal.js +283 -0
- package/src/components/complexViewRendering.vue +601 -0
- package/src/components/ifmLink.vue +71 -0
- package/src/components/public/data/plDataCascader.vue +85 -0
- package/src/components/public/data/plDataRadio.vue +73 -0
- package/src/components/public/data/plDataRadioGroup.vue +70 -0
- package/src/components/public/data/plDataSelect.vue +856 -0
- package/src/components/public/data/plDatePicker.vue +159 -0
- package/src/components/public/org/bg.png +0 -0
- package/src/components/public/org/sysOrgPosUserSelect.vue +1237 -0
- package/src/components/public/org/sysOrgPosUserSelectDark.vue +1402 -0
- package/src/components/public/org/sysOrgPosUserSelectNew.vue +1527 -0
- package/src/components/public/upload/images/compress.png +0 -0
- package/src/components/public/upload/images/emipty.png +0 -0
- package/src/components/public/upload/images/excel.png +0 -0
- package/src/components/public/upload/images/file.png +0 -0
- package/src/components/public/upload/images/pdf.png +0 -0
- package/src/components/public/upload/images/powerpoint.png +0 -0
- package/src/components/public/upload/images/project.png +0 -0
- package/src/components/public/upload/images/sound.png +0 -0
- package/src/components/public/upload/images/txt.png +0 -0
- package/src/components/public/upload/images/video.png +0 -0
- package/src/components/public/upload/images/visio.png +0 -0
- package/src/components/public/upload/images/word.png +0 -0
- package/src/components/public/upload/plImage.vue +287 -0
- package/src/components/public/upload/plImgUpload.vue +137 -0
- package/src/components/public/upload/plUpload.vue +1124 -0
- package/src/components/public/upload/uploadImg.js +8 -0
- package/src/main.js +0 -0
- package/src/views/VueMenuView.vue +143 -0
- package/src/views/cloudMenuView.vue +125 -0
- package/src/views/complex/config/complex.vue +501 -0
- package/src/views/complex/config/complexSetting.vue +1250 -0
- package/src/views/complex/rendering/complexShow.vue +16 -0
- package/src/views/data/dataManage.vue +560 -0
- package/src/views/data/sysData.vue +292 -0
- package/src/views/event/eventManager/vueEventDiy.vue +1184 -0
- package/src/views/event/eventManager/vueEventMain.vue +108 -0
- package/src/views/event/eventManager/vueEventSys.vue +296 -0
- package/src/views/event/js/apiEvent.js +22 -0
- package/src/views/fileLog/fileDownloadLog.vue +437 -0
- package/src/views/initData/initData.vue +4316 -0
- package/src/views/log/dblog/logdbDevelop.vue +306 -0
- package/src/views/log/dblog/logdbEnt.vue +331 -0
- package/src/views/log/dblog/logdbGov.vue +395 -0
- package/src/views/log/error/logError.vue +553 -0
- package/src/views/log/loginlog/logManageDevOrSup.vue +357 -0
- package/src/views/log/loginlog/logManageEnt.vue +343 -0
- package/src/views/log/loginlog/logManageGov.vue +328 -0
- package/src/views/log/sms/logSms.vue +308 -0
- package/src/views/menu/component/menuManageComponent.vue +2402 -0
- package/src/views/menu/component/menuModule.vue +449 -0
- package/src/views/menu/menuLocal.vue +223 -0
- package/src/views/menu/menuManage.vue +1135 -0
- package/src/views/menu/tenantMenuManage.vue +1132 -0
- package/src/views/menuRouter/cview/cviewShow.vue +18 -0
- package/src/views/menuRouter/cviewMenuRouter.vue +183 -0
- package/src/views/menuRouter/menuView.vue +132 -0
- package/src/views/menuRouter/urlMenuRouter.vue +160 -0
- package/src/views/org/entOrgTree.vue +1050 -0
- package/src/views/org/ownerMenu/ownerMenuTree.vue +269 -0
- package/src/views/org/safeValidate/safeValidate.vue +469 -0
- package/src/views/org/sysEntOrgUserDetail.vue +3390 -0
- package/src/views/org/sysOrgDimension.vue +832 -0
- package/src/views/org/sysOrgPosUserDetail.vue +1648 -0
- package/src/views/org/sysOrgPosUserTree.vue +1101 -0
- package/src/views/org/sysOrgTree.vue +864 -0
- package/src/views/param/sysParam.vue +987 -0
- package/src/views/preview/pdfViewer.vue +82 -0
- package/src/views/resources/js/resourcesCommon.js +137 -0
- package/src/views/resources/resRouter/resView.vue +161 -0
- package/src/views/resources/resourcesTabs.vue +82 -0
- package/src/views/resources/tabs/comp/pageResPreview.vue +309 -0
- package/src/views/resources/tabs/comp/pageResRegister.vue +1120 -0
- package/src/views/resources/tabs/dataResources.vue +843 -0
- package/src/views/resources/tabs/pageResources.vue +970 -0
- package/src/views/role/allowMenu.vue +148 -0
- package/src/views/role/authRole/authRole.vue +427 -0
- package/src/views/role/authRole/component/allocateSetting.vue +1056 -0
- package/src/views/role/authRole/component/authSetting.vue +1196 -0
- package/src/views/role/commonRole/commonRole.vue +677 -0
- package/src/views/role/commonRole/compoment/allocateRoleMenuSetting.vue +335 -0
- package/src/views/role/commonRole/compoment/authLinkMenuTree.vue +55 -0
- package/src/views/role/commonRole/compoment/authSettingNew.vue +190 -0
- package/src/views/role/commonRole/compoment/commonSetting.vue +1576 -0
- package/src/views/role/commonRole/compoment/commonSettingAdjust.vue +584 -0
- package/src/views/role/commonRole/compoment/commonSettingNew.vue +572 -0
- package/src/views/role/commonRole/compoment/roleMenuPower.vue +226 -0
- package/src/views/role/commonRole/compoment/roleMenuPowerSetting.vue +69 -0
- package/src/views/role/commonRole/compoment/roleMenuSetting.vue +365 -0
- package/src/views/role/commonRole/compoment/roleSourceSetting.vue +229 -0
- package/src/views/role/commonRole/tenantCommonRole.vue +768 -0
- package/src/views/role/role.vue +135 -0
- package/src/views/role/roleMenuOption.vue +898 -0
- package/src/views/role/roleSynchroRemind.vue +399 -0
- package/src/views/role/sysRole.vue +1525 -0
- package/src/views/role/viewMenuOptDetail.vue +182 -0
- package/src/views/sms/sendSms.vue +164 -0
- package/src/views/station/orgStation.vue +561 -0
- package/src/views/tenant/appContentManager.vue +938 -0
- package/src/views/tenant/appManager.vue +642 -0
- package/src/views/tenant/tenantRoleManager.vue +670 -0
- package/src/views/tenant/tenantUserManager.vue +615 -0
- package/src/views/threeinone/compoment/safeCascadeSelect.vue +327 -0
- package/src/views/threeinone/init/safeInitRegion.vue +203 -0
- package/src/views/threeinone/safeManager.vue +927 -0
- package/src/views/threeinone/safeMenuManage.vue +565 -0
- package/src/views/threeinone/safeOrgSpv.vue +364 -0
- package/src/views/threeinone/safeSpv/safeSpvLeftTree.vue +109 -0
- package/src/views/threeinone/safeSpv/safeSpvMain.vue +335 -0
- package/src/views/threeinone/safeSpvEconView.vue +569 -0
- package/src/views/threeinone/safeValidateRegion.vue +328 -0
- package/src/views/urlResource/urlResource.vue +856 -0
- package/src/views/user/empowerUser/empowerEntUserManage.vue +415 -0
- package/src/views/user/empowerUser/empowerOrgTree.vue +167 -0
- package/src/views/user/empowerUser/empowerUserList.vue +633 -0
- package/src/views/user/empowerUser/empowerUserListMenuDeatil.vue +656 -0
- package/src/views/user/empowerUser/empowerUserListViewMenuTree.vue +257 -0
- package/src/views/user/empowerUser/empowerUserManage.vue +99 -0
- package/src/views/user/stationUserManage.vue +934 -0
- package/src/views/user/userManage.vue +737 -0
- package/src/views/user/userMangement.vue +938 -0
- package/src/views/user/viewMenu/viewMenu.vue +113 -0
- package/src/views/versionupdatetool/versionUpdateTool.vue +225 -0
- package/src/views/versionupdatetool/versioninfomation/verisonInfomationManagement.vue +68 -0
|
@@ -0,0 +1,1120 @@
|
|
|
1
|
+
<!--注册到资源池页面-->
|
|
2
|
+
<template>
|
|
3
|
+
<el-container style="height: 100%;overflow-y: hidden" v-loading="loading" element-loading-text="加载中">
|
|
4
|
+
<el-container style="box-sizing: border-box;height: 100%" class="resouceConfigClass">
|
|
5
|
+
<el-aside style="width: 300px;padding-top: 10px" class="p-asideTree">
|
|
6
|
+
<el-header style="height: 40px;">
|
|
7
|
+
<el-input size="small" style=""
|
|
8
|
+
prefix-icon="el-icon-search"
|
|
9
|
+
placeholder="输入视图名称进行过滤"
|
|
10
|
+
clearable
|
|
11
|
+
v-model="filterText">
|
|
12
|
+
</el-input>
|
|
13
|
+
</el-header>
|
|
14
|
+
<el-tree
|
|
15
|
+
v-if="showTreeDialog"
|
|
16
|
+
class="asideTree"
|
|
17
|
+
:data="viewData"
|
|
18
|
+
node-key="id"
|
|
19
|
+
ref="viewRef"
|
|
20
|
+
:filter-node-method="filterNode"
|
|
21
|
+
@node-click="nodeClick"
|
|
22
|
+
default-expand-all
|
|
23
|
+
:expand-on-click-node="false"
|
|
24
|
+
:render-content="renderContent">
|
|
25
|
+
</el-tree>
|
|
26
|
+
</el-aside>
|
|
27
|
+
<el-main style="padding: 0;box-sizing: border-box;width: 100%;height: 100%;overflow:auto">
|
|
28
|
+
<el-form :model="form" label-width="120px" ref="resourceConfigRef" size="small">
|
|
29
|
+
<el-row>
|
|
30
|
+
<el-col :span="24">
|
|
31
|
+
<el-form-item label="视图名称" >
|
|
32
|
+
{{form.rname}}
|
|
33
|
+
</el-form-item>
|
|
34
|
+
</el-col>
|
|
35
|
+
</el-row>
|
|
36
|
+
<el-tabs :tab-position="'top'" v-model="activeName" @tab-click="tabClick"
|
|
37
|
+
style="height: 100%;margin-left:50px">
|
|
38
|
+
<el-tab-pane v-for="(item,index) in tabArr" v-if="form[item.showCode]"
|
|
39
|
+
:label="item.name" :name="item.tabName" :key="index">
|
|
40
|
+
<span slot="label">{{item.name}}
|
|
41
|
+
<i class="el-icon-check" v-if="sourcesObj[form[item.showCode]]"></i>
|
|
42
|
+
</span>
|
|
43
|
+
<el-row>·
|
|
44
|
+
<el-col :span="12">
|
|
45
|
+
<el-form-item label="注册状态" v-if="form.rname && form.name != ''">
|
|
46
|
+
{{form.id?"已注册":"未注册"}}
|
|
47
|
+
</el-form-item>
|
|
48
|
+
</el-col>
|
|
49
|
+
</el-row>
|
|
50
|
+
<el-row>
|
|
51
|
+
<el-col :span="24">
|
|
52
|
+
<el-form-item label="权限信息" >
|
|
53
|
+
<el-row>
|
|
54
|
+
<el-col :span="12">
|
|
55
|
+
<el-card class="box-card-class">
|
|
56
|
+
<div slot="header" class="clearfix">
|
|
57
|
+
<el-checkbox label="全选" @change="optChange"
|
|
58
|
+
v-model="form.allOptAuth" style="margin-right: 0"></el-checkbox>
|
|
59
|
+
<span style="font-size: 15px;margin-left: 70px">操作权限</span>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="tree">
|
|
62
|
+
<el-tree
|
|
63
|
+
class="filter-tree"
|
|
64
|
+
:data="operationFormData"
|
|
65
|
+
:show-checkbox="true"
|
|
66
|
+
default-expand-all
|
|
67
|
+
@check-change="checkeOptChangeFnc"
|
|
68
|
+
node-key="key"
|
|
69
|
+
:props="defaultTreeProps"
|
|
70
|
+
:render-content="renderOperateContent"
|
|
71
|
+
:ref="'operatePermisRef_' + item.tabName">
|
|
72
|
+
</el-tree>
|
|
73
|
+
</div>
|
|
74
|
+
</el-card>
|
|
75
|
+
</el-col>
|
|
76
|
+
<el-col :span="12">
|
|
77
|
+
<el-card class="box-card-class">
|
|
78
|
+
<div slot="header" class="clearfix">
|
|
79
|
+
<el-checkbox label="全选" @change="dataChange"
|
|
80
|
+
v-model="form.allDataAuth" style="margin-right: 0"></el-checkbox>
|
|
81
|
+
<span style="font-size: 15px;margin-left: 70px">数据权限</span>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="tree">
|
|
84
|
+
<el-tree
|
|
85
|
+
class="filter-tree"
|
|
86
|
+
:data="dataPermisFormData"
|
|
87
|
+
:show-checkbox="true"
|
|
88
|
+
default-expand-all
|
|
89
|
+
@check-change="checkeDataChangeFnc"
|
|
90
|
+
node-key="key"
|
|
91
|
+
:props="defaultTreeProps"
|
|
92
|
+
:ref="'dataPermisRef_' + item.tabName">
|
|
93
|
+
</el-tree>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
</el-card>
|
|
97
|
+
</el-col>
|
|
98
|
+
</el-row>
|
|
99
|
+
</el-form-item>
|
|
100
|
+
</el-col>
|
|
101
|
+
</el-row>
|
|
102
|
+
<!-- <el-row >-->
|
|
103
|
+
<!-- <el-col :span="12">-->
|
|
104
|
+
<!-- <el-form-item label="是否外部访问" size="small" prop="externalAccess">-->
|
|
105
|
+
<!-- <el-radio-group v-model="form.externalAccess" @change="changeExternal">-->
|
|
106
|
+
<!-- <el-radio-button label="1">是</el-radio-button>-->
|
|
107
|
+
<!-- <el-radio-button label="0">否</el-radio-button>-->
|
|
108
|
+
<!-- </el-radio-group>-->
|
|
109
|
+
<!-- </el-form-item>-->
|
|
110
|
+
<!-- </el-col>-->
|
|
111
|
+
<!-- <el-col :span="12">-->
|
|
112
|
+
<!-- <el-form-item label="代理地址" size="small" prop="rAgentUrl" v-if="form.externalAccess == '1'" :rules="rAgentUrlPageEq">-->
|
|
113
|
+
<!-- <el-input v-model="form.rAgentUrl" style="width: 300px;">-->
|
|
114
|
+
<!-- </el-input>-->
|
|
115
|
+
<!-- </el-form-item>-->
|
|
116
|
+
<!-- </el-col>-->
|
|
117
|
+
<!-- </el-row>-->
|
|
118
|
+
</el-tab-pane>
|
|
119
|
+
</el-tabs>
|
|
120
|
+
<el-row >
|
|
121
|
+
<el-col style="text-align: center">
|
|
122
|
+
<el-button type="primary"
|
|
123
|
+
:disabled="!form.rname || form.rname == ''"
|
|
124
|
+
icon="el-icon-check" size="small" @click="saveOrUpdate()">注册</el-button>
|
|
125
|
+
|
|
126
|
+
</el-col>
|
|
127
|
+
</el-row>
|
|
128
|
+
</el-form>
|
|
129
|
+
</el-main>
|
|
130
|
+
|
|
131
|
+
</el-container>
|
|
132
|
+
</el-container>
|
|
133
|
+
</template>
|
|
134
|
+
|
|
135
|
+
<script>
|
|
136
|
+
export default {
|
|
137
|
+
name: "page-res-register",
|
|
138
|
+
props:{
|
|
139
|
+
},
|
|
140
|
+
data(){
|
|
141
|
+
//表单视图名称唯一性验证
|
|
142
|
+
let rAgentUrlEqValidate =(type,rule,value,callback) => {
|
|
143
|
+
if(!value){
|
|
144
|
+
callback();
|
|
145
|
+
}
|
|
146
|
+
this.axios.post(this.api.resources.find,{rType:type,rAgentUrlEq:value}).then(res =>{
|
|
147
|
+
if((res.data ||[]).length == 0){
|
|
148
|
+
callback();
|
|
149
|
+
}else if(this.form.id){
|
|
150
|
+
let temple = res.data.filter(item =>{
|
|
151
|
+
return item.id == this.form.id;
|
|
152
|
+
});
|
|
153
|
+
if(temple.length > 0){
|
|
154
|
+
callback();
|
|
155
|
+
}else {
|
|
156
|
+
return callback(new Error('该代理地址已存在!'));
|
|
157
|
+
}
|
|
158
|
+
}else{
|
|
159
|
+
return callback(new Error('该代理地址已存在!'));
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
let rDataAgentUrlEqValidate =(type,rule,value,callback) => {
|
|
165
|
+
if(!value){
|
|
166
|
+
callback();
|
|
167
|
+
}
|
|
168
|
+
this.axios.post(this.api.resources.find,{rType:type,rAgentUrlEq:value}).then(res =>{
|
|
169
|
+
if((res.data ||[]).length == 0 ){
|
|
170
|
+
callback();
|
|
171
|
+
}else if(this.sourceDataIdArr.length > 0){
|
|
172
|
+
let temple = res.data.filter(item =>{
|
|
173
|
+
return this.sourceDataIdArr.indexOf(item.id) == -1;
|
|
174
|
+
});
|
|
175
|
+
if(temple.length == 0){
|
|
176
|
+
callback();
|
|
177
|
+
}else {
|
|
178
|
+
return callback(new Error('该代理地址已存在!'));
|
|
179
|
+
}
|
|
180
|
+
}else{
|
|
181
|
+
return callback(new Error('该代理地址已存在!'));
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
return{
|
|
188
|
+
form:{ //页面资源
|
|
189
|
+
allOptAuth:false ,//操作权限全选
|
|
190
|
+
allDataAuth:false ,//数据权限权限
|
|
191
|
+
} ,//正在编辑的表单or列表实体
|
|
192
|
+
|
|
193
|
+
dataForm:{ //数据资源
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
operationFormData:[], //操作权限
|
|
197
|
+
dataPermisFormData:[], //数据权限
|
|
198
|
+
|
|
199
|
+
addOrUpdateButtonText:'注册',
|
|
200
|
+
allCheckOperateKeyArr:[],
|
|
201
|
+
allCheckDataKeyArr:[],
|
|
202
|
+
sourcesObj:{}, //资源池页面资源对象
|
|
203
|
+
sourcesDataObj:{}, //数据资源对象
|
|
204
|
+
filterText: '', // 需要过滤节点的关键字
|
|
205
|
+
|
|
206
|
+
isHalfOperationKeyArr:[], //已经在半选中保存数据
|
|
207
|
+
isAllOperationKeyArr:[], //已经在全选中保存的数据
|
|
208
|
+
defaultTreeProps:{
|
|
209
|
+
children: 'childrens',
|
|
210
|
+
label: 'name',
|
|
211
|
+
id:'key'
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
rAgentUrlPageEq:[
|
|
215
|
+
{required: true, message: '该输入项为必输项'},
|
|
216
|
+
{validator:rAgentUrlEqValidate.bind(null,'page'),trigger:'blur'}
|
|
217
|
+
],
|
|
218
|
+
rAgentDataPageEq:[
|
|
219
|
+
{required: true, message: '该输入项为必输项'},
|
|
220
|
+
{validator:rDataAgentUrlEqValidate.bind(null,'data'),trigger:'blur'}
|
|
221
|
+
],
|
|
222
|
+
|
|
223
|
+
oldrAgentUrl:'',
|
|
224
|
+
oldDatarAgentUrl:'',//数据资源地址
|
|
225
|
+
activeName:"singleForm", //page 页面资源 data 数据资源
|
|
226
|
+
tabArr:[{
|
|
227
|
+
name:'单表资源',
|
|
228
|
+
tabName:'singleForm',
|
|
229
|
+
showCode:'tableViewDefineKey'
|
|
230
|
+
},{
|
|
231
|
+
name:'列表资源',
|
|
232
|
+
tabName:'form',
|
|
233
|
+
showCode:'listViewDefineKey'
|
|
234
|
+
},{
|
|
235
|
+
name:'流程资源',
|
|
236
|
+
tabName:'flow',
|
|
237
|
+
showCode:'flowId'
|
|
238
|
+
}],
|
|
239
|
+
methodNameArr:[
|
|
240
|
+
{label:"添加",value:"add"},
|
|
241
|
+
{label:"删除",value:"delete"},
|
|
242
|
+
{label:"修改",value:"update"},
|
|
243
|
+
{label:"查看",value:"query"}
|
|
244
|
+
],
|
|
245
|
+
|
|
246
|
+
methodName:["add","delete","update","query"],
|
|
247
|
+
methodNameObj:{"add":"添加","delete":"删除","update":"修改","query":"查看"},
|
|
248
|
+
rRequestTypeArr:[
|
|
249
|
+
{label:"get请求",value:"get"},
|
|
250
|
+
{label:"post请求",value:"post"}
|
|
251
|
+
],
|
|
252
|
+
|
|
253
|
+
fieldTypeObj:{
|
|
254
|
+
"1": "字符串",
|
|
255
|
+
"6": "字符串",
|
|
256
|
+
"2": "字符串",
|
|
257
|
+
"3": "字符串",
|
|
258
|
+
"4": "字符串",
|
|
259
|
+
"10": "字符串",
|
|
260
|
+
"7": "字符串",
|
|
261
|
+
"5":"字符串",
|
|
262
|
+
"9":"整数"
|
|
263
|
+
},
|
|
264
|
+
|
|
265
|
+
oldMethodObj:{},
|
|
266
|
+
sourceDataIdArr:[],
|
|
267
|
+
viewData: [],
|
|
268
|
+
showTreeDialog:false,
|
|
269
|
+
loading: true,
|
|
270
|
+
clickData:{},
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
watch:{
|
|
274
|
+
'form.id'() {
|
|
275
|
+
this.addOrUpdateButtonText = '注册';
|
|
276
|
+
},
|
|
277
|
+
filterText(val){
|
|
278
|
+
this.$refs.viewRef.filter(val.trim())
|
|
279
|
+
},
|
|
280
|
+
rClassId(){
|
|
281
|
+
this.initSysRources().then(() =>{
|
|
282
|
+
//初始化参数列表
|
|
283
|
+
this.initFormFields();
|
|
284
|
+
});
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
created(){
|
|
288
|
+
this.initSysRources().then(() =>{
|
|
289
|
+
this.nodeClick(this.viewData[0]);
|
|
290
|
+
});
|
|
291
|
+
},
|
|
292
|
+
|
|
293
|
+
methods:{
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* 查询系统资源池
|
|
297
|
+
*/
|
|
298
|
+
initSysRources(){
|
|
299
|
+
let vm = this;
|
|
300
|
+
let allResourcesArr = [];
|
|
301
|
+
vm.showTreeDialog = false;
|
|
302
|
+
vm.loading = true;
|
|
303
|
+
vm.sourcesObj = {};
|
|
304
|
+
vm.sourcesDataObj = {};
|
|
305
|
+
return new Promise(resolve => {
|
|
306
|
+
vm.axios.post(this.api.resources.findResources).then(res => { //获取绑定资源数据
|
|
307
|
+
if(res.data && res.data.operateObj){
|
|
308
|
+
allResourcesArr = res.data.operateObj || [];
|
|
309
|
+
allResourcesArr.forEach(item =>{
|
|
310
|
+
if(item.rtype == 'data'){ //数据资源
|
|
311
|
+
vm.sourcesDataObj[item.rkey] = item; //数据资源一个方法保存一条 resouces 为保证 rkey一致, rkey 为 表单id +"_"+方法名
|
|
312
|
+
}else{ //页面资源
|
|
313
|
+
vm.sourcesObj[item.rkey] = item;
|
|
314
|
+
vm.sourcesObj[item.ragentUrl] = item; // pageId存储在这里
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
vm.axios.post(vm.api.param.getSysParams,{"key":"formUrl"}).then(paramRes => {
|
|
319
|
+
let formUrl = paramRes.data || "";
|
|
320
|
+
vm.axios.post(formUrl + "/plFormBaseController/getResourceOperations").then(optsRes => {
|
|
321
|
+
vm.viewData = optsRes.data || [];
|
|
322
|
+
vm.viewData.forEach(item => {
|
|
323
|
+
(item.listOpts || []).forEach(optData => {
|
|
324
|
+
if(optData.key.indexOf("_tree") > -1){
|
|
325
|
+
optData.name = this.formatterTreeName(optData);
|
|
326
|
+
}
|
|
327
|
+
})
|
|
328
|
+
})
|
|
329
|
+
vm.showTreeDialog = true;
|
|
330
|
+
this.$nextTick(() => {
|
|
331
|
+
if(this.filterText){
|
|
332
|
+
this.$refs.viewRef && this.$refs.viewRef.filter(this.filterText);
|
|
333
|
+
}
|
|
334
|
+
})
|
|
335
|
+
vm.loading = false;
|
|
336
|
+
this.$forceUpdate();
|
|
337
|
+
resolve();
|
|
338
|
+
})
|
|
339
|
+
})
|
|
340
|
+
});
|
|
341
|
+
})
|
|
342
|
+
},
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* 节点筛选
|
|
346
|
+
*/
|
|
347
|
+
filterNode(val,data){
|
|
348
|
+
if(!val){
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
return data.label.indexOf(val) !== -1;
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
clearForm(){
|
|
355
|
+
this.oldrAgentUrl = '';
|
|
356
|
+
this.$set(this.form,'rMethodName',[]); //资源方法
|
|
357
|
+
this.$set(this.form,'dataExternalAccess','1');
|
|
358
|
+
this.$set(this.form,'dataRAgentUrl','');
|
|
359
|
+
this.$set(this.form,'dataRstatus','1');
|
|
360
|
+
this.$set(this.form,'rRequestType','get'); //默认get请求
|
|
361
|
+
this.$set(this.form,'rIfRestrictedParams','0'); //限制入参
|
|
362
|
+
this.$set(this.form,'rParamLists',[]); //参数列表
|
|
363
|
+
this.$set(this.form,'dataRAgentUrl',''); //置空数据资源代理地址
|
|
364
|
+
//查询节点的权限信息(按钮信息 ) 和数据权限(条件定义)
|
|
365
|
+
this.operationFormData = [];
|
|
366
|
+
this.dataPermisFormData = [];
|
|
367
|
+
this.$set(this.form,'allOptAuth',false); //操作权限
|
|
368
|
+
this.$set(this.form,'allDataAuth',false); //操作权限
|
|
369
|
+
|
|
370
|
+
this.sourceDataIdArr = [];
|
|
371
|
+
},
|
|
372
|
+
|
|
373
|
+
//选择表单视图
|
|
374
|
+
async nodeClick(data,node,tabName){
|
|
375
|
+
//获取最新资源池
|
|
376
|
+
// await this.initSysRources();
|
|
377
|
+
if(tabName != 'form' && tabName != 'flow'){
|
|
378
|
+
this.activeName = 'singleForm';
|
|
379
|
+
}
|
|
380
|
+
this.$set(this.form,'rname',data.realName);
|
|
381
|
+
this.$set(this.form,'tableViewDefineKey',data.tableViewDefineKey);
|
|
382
|
+
this.$set(this.form,'listViewDefineKey',data.listViewDefineKey);
|
|
383
|
+
this.$set(this.form,'flowId',data.flowId);
|
|
384
|
+
this.$set(this.form,'rAgentUrl',data.pageDefineKey);
|
|
385
|
+
this.clearForm(); //清空
|
|
386
|
+
|
|
387
|
+
this.$set(this.form,'rclass',data.formName);
|
|
388
|
+
this.$set(this.form,'rclassId',data.formDefineKey);
|
|
389
|
+
this.$set(this.form,'id','');
|
|
390
|
+
|
|
391
|
+
if(tabName == "form"){
|
|
392
|
+
this.$set(this.form,'rkey',data.listViewDefineKey);
|
|
393
|
+
this.operationFormData = data.listOpts;
|
|
394
|
+
this.dataPermisFormData = data.listDatas;
|
|
395
|
+
}else if(tabName == "flow"){
|
|
396
|
+
this.$set(this.form,'rkey',data.flowId);
|
|
397
|
+
this.operationFormData = data.flowOpts;
|
|
398
|
+
this.dataPermisFormData = data.flowDatas;
|
|
399
|
+
}else{
|
|
400
|
+
this.$set(this.form,'rkey',data.tableViewDefineKey);
|
|
401
|
+
this.operationFormData = data.singleFormOpts;
|
|
402
|
+
this.dataPermisFormData = data.singleFormDatas;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
if(this.sourcesObj[this.form.rkey]){
|
|
406
|
+
this.$set(this.form,'id',this.sourcesObj[this.form.rkey].id); //赋值id
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
this.operateData(data);
|
|
410
|
+
|
|
411
|
+
this.clickData = data;
|
|
412
|
+
},
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* 节点数据处理
|
|
417
|
+
*/
|
|
418
|
+
operateData(data){
|
|
419
|
+
//默认不注册数据资源
|
|
420
|
+
this.$set(this.form,'isNeedDataSource','0'); //是否注册相关数据资源
|
|
421
|
+
//判断资源池中是否存在,如果存在初始化选
|
|
422
|
+
let defineKey;
|
|
423
|
+
if(this.activeName == "singleForm"){
|
|
424
|
+
defineKey = data.tableViewDefineKey;
|
|
425
|
+
}else if(this.activeName == "form"){
|
|
426
|
+
defineKey = data.listViewDefineKey;
|
|
427
|
+
}else{ // flow
|
|
428
|
+
defineKey = data.flowId;
|
|
429
|
+
}
|
|
430
|
+
if(this.sourcesObj[defineKey]){
|
|
431
|
+
//初始化选中操作权限和数据权限
|
|
432
|
+
//获取止于草拟
|
|
433
|
+
let operatePermisList; //操作权限
|
|
434
|
+
let dataPermisList; //数据权限
|
|
435
|
+
operatePermisList = this.sourcesObj[defineKey].operatePermisList || []; //操作权限
|
|
436
|
+
dataPermisList = this.sourcesObj[defineKey].dataPermisList || []; //数据权限
|
|
437
|
+
this.$nextTick(() =>{
|
|
438
|
+
//是否启用
|
|
439
|
+
let rstatus = "1"; //默认启用状态
|
|
440
|
+
if(this.sourcesObj[defineKey].rstatus){
|
|
441
|
+
rstatus = this.sourcesObj[defineKey].rstatus;
|
|
442
|
+
}
|
|
443
|
+
this.$set(this.form,'rstatus',rstatus);
|
|
444
|
+
let externalAccess = "0"; //默认开启外部访问
|
|
445
|
+
if(this.sourcesObj[defineKey].externalAccess){
|
|
446
|
+
externalAccess = this.sourcesObj[defineKey].externalAccess;
|
|
447
|
+
}
|
|
448
|
+
//默认代理地址
|
|
449
|
+
// let agentUrl = "";
|
|
450
|
+
// if(this.sourcesObj[defineKey].ragentUrl){
|
|
451
|
+
// agentUrl = this.sourcesObj[defineKey].ragentUrl;
|
|
452
|
+
// }
|
|
453
|
+
this.$set(this.form,'rAgentUrl',data.pageDefineKey); //代理地址这里设置为表单资源的pageId
|
|
454
|
+
|
|
455
|
+
this.$set(this.form,'externalAccess',externalAccess);
|
|
456
|
+
this.oldrAgentUrl = this.form.rAgentUrl;
|
|
457
|
+
let checkOperateKeys = []; //操作权限
|
|
458
|
+
let checkDataKeys = []; //数据权限
|
|
459
|
+
operatePermisList.forEach(item =>{
|
|
460
|
+
checkOperateKeys.push(item.powerKey);
|
|
461
|
+
});
|
|
462
|
+
dataPermisList.forEach(item =>{
|
|
463
|
+
checkDataKeys.push(item.powerKey);
|
|
464
|
+
});
|
|
465
|
+
this.$set(this.form,'allOptAuth',true); //操作权限
|
|
466
|
+
this.$set(this.form,'allDataAuth',true); //数据权限
|
|
467
|
+
//判断是否全选 当前获取当前选中的数据 checkOperateKeyArr 和树数据比较 operationFormData
|
|
468
|
+
if(this.$refs["operatePermisRef_" + this.activeName]){ //选中操作权限
|
|
469
|
+
this.$refs["operatePermisRef_" + this.activeName][0].setCheckedKeys(checkOperateKeys);
|
|
470
|
+
//判断是否选中全选
|
|
471
|
+
if(this.operationFormData.length == 0){
|
|
472
|
+
this.$set(this.form,'allOptAuth',false); //操作权限
|
|
473
|
+
}
|
|
474
|
+
this.operationFormData.some(item =>{
|
|
475
|
+
if(checkOperateKeys.indexOf(item.key) == '-1' ){
|
|
476
|
+
this.$set(this.form,'allOptAuth',false); //操作权限
|
|
477
|
+
return true;
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
if(this.$refs["dataPermisRef_" + this.activeName]){//选中数据权限
|
|
482
|
+
this.$refs["dataPermisRef_" + this.activeName][0].setCheckedKeys(checkDataKeys);
|
|
483
|
+
//判断是否全选
|
|
484
|
+
if(this.dataPermisFormData.length == 0){
|
|
485
|
+
this.$set(this.form,'allDataAuth',false); //操作权限
|
|
486
|
+
}
|
|
487
|
+
this.dataPermisFormData.some(item =>{
|
|
488
|
+
if(checkDataKeys.indexOf(item.key) == '-1' ){
|
|
489
|
+
this.$set(this.form,'allDataAuth',false); //操作权限
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
}else{
|
|
497
|
+
//初始化默认值
|
|
498
|
+
//是否启用
|
|
499
|
+
this.$set(this.form,'rstatus',"1");
|
|
500
|
+
this.$set(this.form,'externalAccess',"0");
|
|
501
|
+
// this.$set(this.form,'rAgentUrl','');
|
|
502
|
+
this.oldrAgentUrl = "";
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* 初始化树选中
|
|
508
|
+
*/
|
|
509
|
+
initTreeCheck(dataArr,keysArr){
|
|
510
|
+
(dataArr || []).forEach(item =>{
|
|
511
|
+
if(!item["childrens"]){ //因为下级全部选中上级自动选中,所以不用考虑上级
|
|
512
|
+
// this.$refs["operatePermisRef_" + this.activeName][0].setCheckedKeys([item['key']]);
|
|
513
|
+
if(item['enable']){ //当前已选择
|
|
514
|
+
keysArr.push(item['key']);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
if(item["childrens"]){
|
|
518
|
+
this.initTreeCheck(item["childrens"],keysArr);
|
|
519
|
+
}
|
|
520
|
+
})
|
|
521
|
+
},
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
handleCheckChange(data, checked, indeterminate) {
|
|
525
|
+
|
|
526
|
+
},
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
renderContent(h, { node, data, store }) {
|
|
530
|
+
let showText = node.label;
|
|
531
|
+
if(showText.length > 16){
|
|
532
|
+
showText = showText.substr(0,16) + "...";
|
|
533
|
+
}
|
|
534
|
+
if(!this.isEmptyObject(this.sourcesObj) && this.sourcesObj[data.pageDefineKey] ){
|
|
535
|
+
return (
|
|
536
|
+
<span class="custom-tree-node">
|
|
537
|
+
<span title={node.label}>{showText}</span>
|
|
538
|
+
<span class="custom-tree-node-icon">
|
|
539
|
+
<i class="el-icon-check"></i>
|
|
540
|
+
</span>
|
|
541
|
+
</span>);
|
|
542
|
+
|
|
543
|
+
}else{
|
|
544
|
+
return (
|
|
545
|
+
<span class="custom-tree-node">
|
|
546
|
+
<span title={node.label}>{showText}</span>
|
|
547
|
+
</span>);
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* 操作权限全选
|
|
553
|
+
*/
|
|
554
|
+
optChange(val){
|
|
555
|
+
//全选或取消全选
|
|
556
|
+
if(val){
|
|
557
|
+
//全部勾选
|
|
558
|
+
this.$refs["operatePermisRef_" + this.activeName][0].setCheckedNodes(this.operationFormData);
|
|
559
|
+
}else{
|
|
560
|
+
//取消全部勾选
|
|
561
|
+
this.$refs["operatePermisRef_" + this.activeName][0].setCheckedNodes([]);
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* 数据权限全选
|
|
567
|
+
*/
|
|
568
|
+
dataChange(val){
|
|
569
|
+
//全选或取消全选
|
|
570
|
+
if(val){
|
|
571
|
+
//全部勾选
|
|
572
|
+
this.$refs["dataPermisRef_" + this.activeName][0].setCheckedNodes(this.dataPermisFormData);
|
|
573
|
+
}else{
|
|
574
|
+
//取消全部勾选
|
|
575
|
+
this.$refs["dataPermisRef_" + this.activeName][0].setCheckedNodes([]);
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* 操作权限点击事件
|
|
581
|
+
* @param data
|
|
582
|
+
* @param checked
|
|
583
|
+
*/
|
|
584
|
+
checkeOptChangeFnc(data,checked){
|
|
585
|
+
this.$set(this.form,'allOptAuth',true); //操作权限
|
|
586
|
+
let keysArr = this.$refs["operatePermisRef_" + this.activeName][0].getCheckedKeys();
|
|
587
|
+
this.operationFormData.some(item =>{
|
|
588
|
+
if(keysArr.indexOf(item.key) == '-1' ){
|
|
589
|
+
this.$set(this.form,'allOptAuth',false); //操作权限
|
|
590
|
+
return true;
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
},
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* 数据全选点击全选判断
|
|
598
|
+
* @param data
|
|
599
|
+
* @param checked
|
|
600
|
+
*/
|
|
601
|
+
checkeDataChangeFnc(data,checked){
|
|
602
|
+
this.$set(this.form,'allDataAuth',true); //数据权限
|
|
603
|
+
//获取半选
|
|
604
|
+
let keysArr = this.$refs["dataPermisRef_" + this.activeName][0].getCheckedKeys();
|
|
605
|
+
this.dataPermisFormData.some(item =>{
|
|
606
|
+
if(keysArr.indexOf(item.key) == '-1' ){
|
|
607
|
+
this.$set(this.form,'allDataAuth',false); //操作权限
|
|
608
|
+
return true;
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
},
|
|
612
|
+
|
|
613
|
+
//注册或更新到资源池
|
|
614
|
+
saveOrUpdate(){
|
|
615
|
+
let vm = this;
|
|
616
|
+
let resourceConfigRef = this.$refs.resourceConfigRef;
|
|
617
|
+
//校验资源权限
|
|
618
|
+
// let dataSourcesFormRef = this.$refs.dataSourcesFormRef;
|
|
619
|
+
//更新当前 oldAgntUrl
|
|
620
|
+
this.oldrAgentUrl = this.form.rAgentUrl || '';
|
|
621
|
+
this.oldDatarAgentUrl = this.form.dataRAgentUrl || '';
|
|
622
|
+
|
|
623
|
+
resourceConfigRef.validate(valid =>{
|
|
624
|
+
if(!valid){
|
|
625
|
+
this.$message({
|
|
626
|
+
type: 'warning',
|
|
627
|
+
message: "当前页面资源信息未完善"
|
|
628
|
+
});
|
|
629
|
+
return;
|
|
630
|
+
}else {
|
|
631
|
+
// if(dataSourcesFormRef && this.form.isNeedDataSource == '1'){
|
|
632
|
+
// dataSourcesFormRef.validate(valid2 =>{ //数据资源验证
|
|
633
|
+
// if(!valid2){
|
|
634
|
+
// this.$message({
|
|
635
|
+
// type: 'warning',
|
|
636
|
+
// message: "当前数据资源信息未完善"
|
|
637
|
+
// });
|
|
638
|
+
// }else {
|
|
639
|
+
// this.executeSaveResouce();
|
|
640
|
+
// }
|
|
641
|
+
// });
|
|
642
|
+
// }else {
|
|
643
|
+
// this.executeSaveResouce();
|
|
644
|
+
// }
|
|
645
|
+
this.executeSaveResouce();
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
},
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* 执行保存
|
|
653
|
+
*/
|
|
654
|
+
async executeSaveResouce(){
|
|
655
|
+
let vm = this;
|
|
656
|
+
let rSource = this.activeName; //单表表单、列表、工作流
|
|
657
|
+
//操作权限
|
|
658
|
+
//数据权限
|
|
659
|
+
let optArr = []; //保存的操作权限
|
|
660
|
+
let dataArr = []; //保存的数据权限
|
|
661
|
+
this.sourceDataIdArr = []; //清空
|
|
662
|
+
|
|
663
|
+
//计算保存的数据权限和操作权限
|
|
664
|
+
//获取选中的操作权限
|
|
665
|
+
let checkOperateNodesArr = this.$refs["operatePermisRef_" + this.activeName][0].getCheckedNodes();
|
|
666
|
+
let checkDataNodesArr = this.$refs["dataPermisRef_" + this.activeName][0].getCheckedNodes();
|
|
667
|
+
//获取选中的数据权限
|
|
668
|
+
checkOperateNodesArr.forEach(item =>{
|
|
669
|
+
optArr.push({
|
|
670
|
+
'type':'opt',
|
|
671
|
+
'powerCode':item.key,
|
|
672
|
+
'powerName':item.name,
|
|
673
|
+
'powerKey':item.key,
|
|
674
|
+
'parentId':'-1',
|
|
675
|
+
'parentTree':'-1',
|
|
676
|
+
})
|
|
677
|
+
});
|
|
678
|
+
checkDataNodesArr.forEach(item =>{
|
|
679
|
+
dataArr.push({
|
|
680
|
+
'type':'data',
|
|
681
|
+
'powerCode':item.key,
|
|
682
|
+
'powerName':item.name,
|
|
683
|
+
'powerKey':item.key,
|
|
684
|
+
'parentId':'-1',
|
|
685
|
+
'parentTree':'-1',
|
|
686
|
+
})
|
|
687
|
+
});
|
|
688
|
+
let resourceParam = {
|
|
689
|
+
rType: this.form.externalAccess == '1'? 'page': 'menu', //url页面资源
|
|
690
|
+
rName : this.form.rname, //功能名称
|
|
691
|
+
rKey : this.form.rkey, //唯一
|
|
692
|
+
externalAccess:this.form.externalAccess,
|
|
693
|
+
rAgentUrl:this.form.rAgentUrl,
|
|
694
|
+
noLoginRequired:'0',//默认不需要登录
|
|
695
|
+
passSwitch: '0',
|
|
696
|
+
rSource: rSource, //资源类型 复合视图
|
|
697
|
+
rClass: this.form.rclass,
|
|
698
|
+
rClassId: this.form.rclassId,
|
|
699
|
+
operatePermis: JSON.stringify(optArr || []), //操作权限
|
|
700
|
+
dataPermis: JSON.stringify(dataArr || []), //数据权限
|
|
701
|
+
rStatus:this.form.rstatus
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
//保存后重新刷新资源池
|
|
705
|
+
let res = await this.axios.post(this.api.resources.saveResources, resourceParam);
|
|
706
|
+
vm.$message({
|
|
707
|
+
duration: 1000,
|
|
708
|
+
type: 'success',
|
|
709
|
+
message: this.addOrUpdateButtonText+'成功!'
|
|
710
|
+
}
|
|
711
|
+
);
|
|
712
|
+
if(res.data.operateObj){
|
|
713
|
+
this.$nextTick(()=>{
|
|
714
|
+
this.form.id = res.data.operateObj.id; //更新当前formId
|
|
715
|
+
});
|
|
716
|
+
// //如果存在数据资源,保存数据资源
|
|
717
|
+
//
|
|
718
|
+
// let keysArr = Object.keys(this.oldMethodObj );
|
|
719
|
+
// //注册or更新到资源池
|
|
720
|
+
// if(this.form.isNeedDataSource == '0'){
|
|
721
|
+
// this.form.rMethodName = []
|
|
722
|
+
// }
|
|
723
|
+
// let updateResouce = keysArr.filter(val=> { return (this.form.rMethodName || []).indexOf(val) > -1 }); //需要更新的
|
|
724
|
+
// // 差集 数组arr1相对于arr2所没有的
|
|
725
|
+
// let addResouce = (this.form.rMethodName || []).filter(val => { return keysArr.indexOf(val) === -1 }); //需要新增的
|
|
726
|
+
// let deleteResouce = (keysArr || []).filter(val => { return (this.form.rMethodName || []).indexOf(val) === -1 }); //需要删除的
|
|
727
|
+
//
|
|
728
|
+
// //保存更新 oldMethodObj this.oldMethodObj[key] = this.sourcesDataObj[data.id+"_"+key].id;
|
|
729
|
+
// // this.oldMethodObj = {};
|
|
730
|
+
// let newObjMethodObj = {};
|
|
731
|
+
// for(let addKey of (addResouce || [])){ //需要新增的
|
|
732
|
+
// let addResouceData = {
|
|
733
|
+
// rType: 'data', //url页面资源
|
|
734
|
+
// rName : this.form.rname + "(" +this.methodNameObj[addKey]+")", //功能名称
|
|
735
|
+
// rKey : this.form.rkey + "_" +addKey, //唯一key
|
|
736
|
+
// externalAccess:this.form.dataExternalAccess || '1',
|
|
737
|
+
// rMethodName:this.methodNameObj[addKey], //资源名
|
|
738
|
+
// rAgentUrl:this.form.dataRAgentUrl || '',
|
|
739
|
+
// noLoginRequired:'0',//默认不需要登录
|
|
740
|
+
// rIfRestrictedParams:this.form.rIfRestrictedParams || '0', //限制入参
|
|
741
|
+
// passSwitch: '0',
|
|
742
|
+
// rSource: rSource, //资源类型 复合视图
|
|
743
|
+
// rClass: this.form.rclass,
|
|
744
|
+
// rClassId: this.form.rclassId,
|
|
745
|
+
// rDataReqType:addKey, //请求方式
|
|
746
|
+
// rRequestType:this.form.rRequestType, //请求方式
|
|
747
|
+
// rParamLists:JSON.stringify(this.form.rParamLists || []), //参数列表
|
|
748
|
+
// rStatus:this.form.dataRstatus || '1',
|
|
749
|
+
// }
|
|
750
|
+
// let res = await this.axios.post(this.api.resources.add,addResouceData);
|
|
751
|
+
// if(res.data.operateObj){
|
|
752
|
+
// this.$set(this.form,'dataId',res.data.operateObj.id);
|
|
753
|
+
// this.sourceDataIdArr.push(res.data.operateObj.id);
|
|
754
|
+
// // this.oldMethodObj[addKey] = res.data.operateObj.id;
|
|
755
|
+
// newObjMethodObj[addKey] = res.data.operateObj.id;
|
|
756
|
+
// }
|
|
757
|
+
// }
|
|
758
|
+
// for(let addKey of (updateResouce || [])){ //需要更新的
|
|
759
|
+
// let updateResouceData = {
|
|
760
|
+
// id: this.oldMethodObj[addKey],
|
|
761
|
+
// rType: 'data', //url页面资源
|
|
762
|
+
// rName : this.form.rname + "(" +this.methodNameObj[addKey]+")", //功能名称
|
|
763
|
+
// rKey : this.form.rkey + "_" +addKey, //唯一key
|
|
764
|
+
// externalAccess:this.form.dataExternalAccess || '1',
|
|
765
|
+
// rMethodName:this.methodNameObj[addKey], //资源名
|
|
766
|
+
// rAgentUrl:this.form.dataRAgentUrl || '',
|
|
767
|
+
// noLoginRequired:'0',//默认不需要登录
|
|
768
|
+
// rIfRestrictedParams:this.form.rIfRestrictedParams || '0', //限制入参
|
|
769
|
+
// passSwitch: '0',
|
|
770
|
+
// rSource: rSource, //资源类型 复合视图
|
|
771
|
+
// rClass: this.form.rclass,
|
|
772
|
+
// rClassId: this.form.rclassId,
|
|
773
|
+
// rDataReqType:addKey, //请求方式
|
|
774
|
+
// rRequestType:this.form.rRequestType, //请求方式
|
|
775
|
+
// rParamLists:JSON.stringify(this.form.rParamLists || []), //参数列表
|
|
776
|
+
// rStatus:this.form.dataRstatus || '1',
|
|
777
|
+
// }
|
|
778
|
+
// let res = await this.axios.post(this.api.resources.update,updateResouceData);
|
|
779
|
+
// if(res.data.operateObj){
|
|
780
|
+
// this.$set(this.form,'dataId',res.data.operateObj.id);
|
|
781
|
+
// // this.oldMethodObj[addKey] = res.data.operateObj.id; //更新 oldMethodObj
|
|
782
|
+
// newObjMethodObj[addKey] = res.data.operateObj.id;
|
|
783
|
+
//
|
|
784
|
+
// this.sourceDataIdArr.push(res.data.operateObj.id);
|
|
785
|
+
// }
|
|
786
|
+
// }
|
|
787
|
+
//
|
|
788
|
+
// let deletIds = [];
|
|
789
|
+
// (deleteResouce || []).forEach(item =>{
|
|
790
|
+
// deletIds.push(this.oldMethodObj[item]);
|
|
791
|
+
// });
|
|
792
|
+
// if(deletIds.length > 0){
|
|
793
|
+
// await this.axios.post(this.api.resources.delete,{ids:deletIds.join(",")}); //删除
|
|
794
|
+
// }
|
|
795
|
+
// this.oldMethodObj = JSON.parse(JSON.stringify(newObjMethodObj)); //赋值上次选中
|
|
796
|
+
// //重新加载资源池
|
|
797
|
+
this.$emit('initResourceData'); // 重新加载资源池左侧树
|
|
798
|
+
this.initSysRources();
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
},
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* 保存数据权限和操作权限树
|
|
806
|
+
*/
|
|
807
|
+
saveOptAndData(submitObj){
|
|
808
|
+
let vm = this;
|
|
809
|
+
//计算所有选中的数据权限和操作权限
|
|
810
|
+
let checkeOpertionArr = []; //全选操作权限
|
|
811
|
+
let halfOperatArr = []; //半选操作权限
|
|
812
|
+
let checkDataArr = [];
|
|
813
|
+
let halfCheckArr = [];//半选数据权限
|
|
814
|
+
if(vm.$refs["operatePermisRef_" + this.activeName]){
|
|
815
|
+
this.isHalfOperationKeyArr = [];
|
|
816
|
+
this.isAllOperationKeyArr = [];
|
|
817
|
+
checkeOpertionArr = vm.$refs["operatePermisRef_" + this.activeName][0].getCheckedNodes(); //全选
|
|
818
|
+
halfOperatArr = vm.$refs["operatePermisRef_" + this.activeName][0].getHalfCheckedNodes(); //获取半选
|
|
819
|
+
let keyOperateArr = vm.$refs["operatePermisRef_" + this.activeName][0].getCheckedKeys(); //获取当前完全勾选的节点
|
|
820
|
+
|
|
821
|
+
let copyCheckeOpertionArr = JSON.parse(JSON.stringify(checkeOpertionArr || []));
|
|
822
|
+
let copyHalfOperatArr = JSON.parse(JSON.stringify(halfOperatArr || []));
|
|
823
|
+
let copyKeyOperateArr = JSON.parse(JSON.stringify(keyOperateArr));
|
|
824
|
+
|
|
825
|
+
this.deleteAllCheckOpertion(copyCheckeOpertionArr,copyKeyOperateArr);
|
|
826
|
+
//循环半选的
|
|
827
|
+
this.disabelHalNoUseData(copyHalfOperatArr,copyKeyOperateArr);
|
|
828
|
+
let allOperateData = copyCheckeOpertionArr.concat(copyHalfOperatArr);
|
|
829
|
+
allOperateData = this.filterIsHalfOperation(allOperateData,this.isHalfOperationKeyArr,this.isAllOperationKeyArr);
|
|
830
|
+
submitObj["operatePermis"] = allOperateData;
|
|
831
|
+
//递归过滤 isHalfOperationKeyArr
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
if(vm.$refs["dataPermisRef_" + this.activeName]){
|
|
835
|
+
this.isHalfOperationKeyArr = []; //
|
|
836
|
+
this.isAllOperationKeyArr = [];
|
|
837
|
+
checkDataArr = vm.$refs["dataPermisRef_" + this.activeName][0].getCheckedNodes();
|
|
838
|
+
halfCheckArr = vm.$refs["dataPermisRef_" + this.activeName][0].getHalfCheckedNodes(); //获取半选
|
|
839
|
+
let keyDataArr = vm.$refs["operatePermisRef_" + this.activeName][0].getCheckedKeys(); //获取当前完全勾选的节点
|
|
840
|
+
let copyCheckDataArr = JSON.parse(JSON.stringify(checkDataArr || []));
|
|
841
|
+
let copyHalfCheckArr = JSON.parse(JSON.stringify(halfCheckArr || []));
|
|
842
|
+
let copyKeyDataArr = JSON.parse(JSON.stringify(keyDataArr));
|
|
843
|
+
this.deleteAllCheckOpertion(copyCheckDataArr,copyKeyDataArr);
|
|
844
|
+
this.disabelHalNoUseData(copyHalfCheckArr,copyKeyDataArr);
|
|
845
|
+
let allData = copyCheckDataArr.concat(copyHalfCheckArr);
|
|
846
|
+
allData = this.filterIsHalfOperation(allData,this.isHalfOperationKeyArr,this.isAllOperationKeyArr);
|
|
847
|
+
submitObj["dataPermis"] = allData;
|
|
848
|
+
}
|
|
849
|
+
//数据权限 和操作权限
|
|
850
|
+
if(submitObj['operatePermis'] && typeof submitObj["operatePermis"] == "object"){
|
|
851
|
+
submitObj["operatePermis"] = JSON.stringify(submitObj["operatePermis"]);
|
|
852
|
+
}
|
|
853
|
+
if(submitObj['dataPermis'] && typeof submitObj["dataPermis"] == "object"){
|
|
854
|
+
submitObj["dataPermis"] = JSON.stringify(submitObj["dataPermis"]);
|
|
855
|
+
}
|
|
856
|
+
},
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* 删除已经子数据
|
|
861
|
+
* @param allCheckArr
|
|
862
|
+
* @param keyArr
|
|
863
|
+
*/
|
|
864
|
+
deleteAllCheckOpertion(allArr,keyArr){
|
|
865
|
+
allArr.forEach(item =>{
|
|
866
|
+
this.$set(item,'enable',true); //默认节点可用
|
|
867
|
+
if(item["childrens"]){
|
|
868
|
+
(item["childrens"] || []).forEach((child,index) =>{
|
|
869
|
+
if(keyArr.indexOf(child.key) > -1){ //删除当前数据
|
|
870
|
+
this.isAllOperationKeyArr.push(child.key);
|
|
871
|
+
}
|
|
872
|
+
allArr = item["childrens"];
|
|
873
|
+
this.deleteAllCheckOpertion(allArr,keyArr);
|
|
874
|
+
})
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
},
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* 递归半选中无用数据
|
|
881
|
+
* @param halfOperatArr
|
|
882
|
+
* @param keyArr
|
|
883
|
+
*/
|
|
884
|
+
disabelHalNoUseData(halfOperatArr,keyArr){
|
|
885
|
+
halfOperatArr.forEach(item =>{
|
|
886
|
+
if(item["childrens"]){
|
|
887
|
+
(item["childrens"] || []).forEach((child,index) =>{
|
|
888
|
+
if(keyArr.indexOf(child.key) == -1){ //设置当前节点 isCheked:false
|
|
889
|
+
// this.$set(child,'enable',false); //设置节点为不可用状态
|
|
890
|
+
item["childrens"].splice(index,1);
|
|
891
|
+
keyArr.splice(index,1);
|
|
892
|
+
}else{
|
|
893
|
+
this.$set(child,'enable',true); ;//设置可编辑状态
|
|
894
|
+
this.isHalfOperationKeyArr.push(child.key);
|
|
895
|
+
}
|
|
896
|
+
halfOperatArr = item["childrens"];
|
|
897
|
+
this.disabelHalNoUseData(halfOperatArr,keyArr);
|
|
898
|
+
})
|
|
899
|
+
}
|
|
900
|
+
});
|
|
901
|
+
},
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* 过滤全选数据
|
|
905
|
+
*/
|
|
906
|
+
filterIsHalfOperation(checkeOpertionArr,isHalfOperationKeyArr,isAllOperationKey){
|
|
907
|
+
checkeOpertionArr = checkeOpertionArr.filter(item =>{
|
|
908
|
+
return isHalfOperationKeyArr.indexOf(item.key) == -1 && isAllOperationKey.indexOf(item.key) == -1;
|
|
909
|
+
});
|
|
910
|
+
|
|
911
|
+
return checkeOpertionArr;
|
|
912
|
+
},
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* 切换是否外部启用
|
|
917
|
+
* @param val
|
|
918
|
+
*/
|
|
919
|
+
changeExternal(val){
|
|
920
|
+
if(val == '0'){
|
|
921
|
+
this.$set(this.form,'rAgentUrl','');
|
|
922
|
+
}
|
|
923
|
+
},
|
|
924
|
+
|
|
925
|
+
changeDataExternal(val){
|
|
926
|
+
this.$set(this.form,'dataRAgentUrl','');
|
|
927
|
+
},
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* 切换数据资源开关
|
|
931
|
+
*/
|
|
932
|
+
chanegDataSource(val){
|
|
933
|
+
if(val == '0'){
|
|
934
|
+
this.activeName = 'page'; //强制跳转到页面资源
|
|
935
|
+
}
|
|
936
|
+
},
|
|
937
|
+
|
|
938
|
+
handleClick(tab, event){
|
|
939
|
+
|
|
940
|
+
},
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* 新增参数列表
|
|
945
|
+
*/
|
|
946
|
+
addRParamLists(){
|
|
947
|
+
this.$refs.dataSourcesFormRef.validate(valid => {
|
|
948
|
+
if (!valid) {
|
|
949
|
+
return;
|
|
950
|
+
}
|
|
951
|
+
//新增
|
|
952
|
+
this.form.rParamLists.push({
|
|
953
|
+
id: '',
|
|
954
|
+
chfieldName: '',
|
|
955
|
+
fieldName:'',
|
|
956
|
+
fieldType:'',
|
|
957
|
+
key:this.COMMON_FUNC.getUuidByParams(16)
|
|
958
|
+
})
|
|
959
|
+
});
|
|
960
|
+
},
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* 删除参数列表
|
|
964
|
+
*/
|
|
965
|
+
removeRParamLists(){
|
|
966
|
+
//获取选中
|
|
967
|
+
let selection = this.$refs.rParamListsRef.selection;
|
|
968
|
+
if((selection|| []).length == 0){
|
|
969
|
+
vm.$message({
|
|
970
|
+
duration: 1500,
|
|
971
|
+
type: 'info',
|
|
972
|
+
message: '请至少选择一条需要删除的数据!'
|
|
973
|
+
});
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
let deletKeyArr = [];
|
|
977
|
+
selection .forEach(item =>{
|
|
978
|
+
deletKeyArr.push(item.key);
|
|
979
|
+
});
|
|
980
|
+
this.form.rParamLists = this.form.rParamLists.filter(item =>{
|
|
981
|
+
return deletKeyArr.indexOf(item.key) == -1;
|
|
982
|
+
});
|
|
983
|
+
},
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* 判断obj对象是否为空
|
|
987
|
+
* @param obj
|
|
988
|
+
* @returns {boolean}
|
|
989
|
+
*/
|
|
990
|
+
isEmptyObject(obj) {
|
|
991
|
+
for (let key in obj){
|
|
992
|
+
if (obj.hasOwnProperty(key)) {
|
|
993
|
+
return false;//返回false,不为空对象
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
return true;//返回true,为空对象
|
|
997
|
+
},
|
|
998
|
+
|
|
999
|
+
renderOperateContent(h, { node, data, store }) {
|
|
1000
|
+
let type = "按钮";
|
|
1001
|
+
if(node.key.indexOf("tree") > -1){
|
|
1002
|
+
type = "树"
|
|
1003
|
+
}
|
|
1004
|
+
return (
|
|
1005
|
+
<span >
|
|
1006
|
+
<span>{node.label}</span>
|
|
1007
|
+
<span class="custom-operate-tree-node">
|
|
1008
|
+
({type})
|
|
1009
|
+
</span>
|
|
1010
|
+
</span>);
|
|
1011
|
+
},
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* 格式化树视图名称
|
|
1015
|
+
* @param row
|
|
1016
|
+
* @returns {string}
|
|
1017
|
+
*/
|
|
1018
|
+
formatterTreeName(row){
|
|
1019
|
+
let name = "";
|
|
1020
|
+
if(row.treeName){
|
|
1021
|
+
let treeSort = row.treeSort || [];
|
|
1022
|
+
let maxIndex = treeSort.length - 1;
|
|
1023
|
+
treeSort.forEach((item,index) =>{
|
|
1024
|
+
if(index < maxIndex){
|
|
1025
|
+
name += item.chfieldName + "-->";
|
|
1026
|
+
}else{
|
|
1027
|
+
name += item.chfieldName;
|
|
1028
|
+
}
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
return name;
|
|
1032
|
+
},
|
|
1033
|
+
|
|
1034
|
+
tabClick(tab){
|
|
1035
|
+
if(tab.name == "form"){
|
|
1036
|
+
this.nodeClick(this.clickData,{},'form');
|
|
1037
|
+
}else if(tab.name == "flow"){
|
|
1038
|
+
this.nodeClick(this.clickData,{},'flow');
|
|
1039
|
+
}else{
|
|
1040
|
+
this.nodeClick(this.clickData,{});
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
</script>
|
|
1046
|
+
|
|
1047
|
+
<style scoped lang="scss">
|
|
1048
|
+
.asideTree {
|
|
1049
|
+
overflow-y: auto;
|
|
1050
|
+
width: 100% !important;
|
|
1051
|
+
height: calc(100% - 90px);
|
|
1052
|
+
position: relative;
|
|
1053
|
+
-webkit-user-select: none;
|
|
1054
|
+
-moz-user-select: none;
|
|
1055
|
+
-ms-user-select: none;
|
|
1056
|
+
user-select: none;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
.p-asideTree{
|
|
1060
|
+
border: 1px solid #cccccc;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
.p-asideTree /deep/ .el-tree-node.is-current > .el-tree-node__content {
|
|
1064
|
+
background-color: #75cafb !important;
|
|
1065
|
+
color: white;
|
|
1066
|
+
}
|
|
1067
|
+
.p-asideTree /deep/ .el-checkbox__input.is-checked+.el-checkbox__label {
|
|
1068
|
+
color: black;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
.asideTree /deep/ .el-tree > .el-tree-node > .el-tree-node__content { /* 选中第一级菜单 */
|
|
1072
|
+
background-color: #1A598A;
|
|
1073
|
+
text-decoration: none;
|
|
1074
|
+
border: 1px silver solid;
|
|
1075
|
+
color: #fff;
|
|
1076
|
+
text-align: center;
|
|
1077
|
+
height: 35px;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
.asideTree /deep/ .custom-tree-node-icon{
|
|
1081
|
+
margin-left: 5px;
|
|
1082
|
+
font-weight: bold;
|
|
1083
|
+
color: #4c8bff;
|
|
1084
|
+
font-size: 16px;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
.box-card-class{
|
|
1088
|
+
width: 350px;
|
|
1089
|
+
height: 250px;
|
|
1090
|
+
overflow-y: auto;
|
|
1091
|
+
padding-bottom: 10px;
|
|
1092
|
+
}
|
|
1093
|
+
.clearfix{
|
|
1094
|
+
width: 280px;
|
|
1095
|
+
}
|
|
1096
|
+
.tree {
|
|
1097
|
+
overflow-y:auto;
|
|
1098
|
+
height: 150px;
|
|
1099
|
+
}
|
|
1100
|
+
.tree /deep/ .el-tree {
|
|
1101
|
+
.el-tree-node__content {
|
|
1102
|
+
display: block !important;
|
|
1103
|
+
}
|
|
1104
|
+
.el-tree-node__children {
|
|
1105
|
+
overflow: visible !important;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
.resouceConfigClass /deep/ .el-card__header{
|
|
1111
|
+
padding: 10px 20px;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
/deep/.custom-operate-tree-node {
|
|
1115
|
+
margin-left: 10px;
|
|
1116
|
+
font-size: 11px;
|
|
1117
|
+
color: #409EFF;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
</style>
|