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,501 @@
|
|
|
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.viewName" 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-header>
|
|
26
|
+
<el-main style="height: 100%;" ref="tableMain">
|
|
27
|
+
<el-table :data="crud.dataStore.records" :ref="crud.tableRef" stripe border height="100%"
|
|
28
|
+
header-row-class-name="list-default-row"
|
|
29
|
+
style="width: 100%;" @row-dblclick="beginRowEdit">
|
|
30
|
+
<el-table-column type="selection" width="40" align="center"></el-table-column>
|
|
31
|
+
<el-table-column type="index" label="序号" align="center" width="60"></el-table-column>
|
|
32
|
+
<el-table-column label="视图名称" prop="viewName" align="center">
|
|
33
|
+
<template slot-scope="scope">
|
|
34
|
+
<el-input v-model="scope.row.viewName" v-if="scope.row.editing"></el-input>
|
|
35
|
+
|
|
36
|
+
<div v-else>{{scope.row.viewName}}</div>
|
|
37
|
+
</template>
|
|
38
|
+
</el-table-column>
|
|
39
|
+
<el-table-column label="自动刷新" prop="viewName" align="center">
|
|
40
|
+
<template slot-scope="scope">
|
|
41
|
+
<el-radio-group v-model="scope.row.autoRefresh" v-if="scope.row.editing">
|
|
42
|
+
<el-radio :label="'1'">是</el-radio>
|
|
43
|
+
<el-radio :label="'0'">否</el-radio>
|
|
44
|
+
</el-radio-group>
|
|
45
|
+
<div v-else>
|
|
46
|
+
<div v-if="scope.row.autoRefresh == '1'">{{'是'}}</div>
|
|
47
|
+
<div v-else>{{'否'}}</div>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
</el-table-column>
|
|
51
|
+
<el-table-column label="说明" prop="remark" align="center">
|
|
52
|
+
<template slot-scope="scope">
|
|
53
|
+
<el-input v-model="scope.row.remark" v-if="scope.row.editing"></el-input>
|
|
54
|
+
<div v-else>{{scope.row.remark}}</div>
|
|
55
|
+
</template>
|
|
56
|
+
</el-table-column>
|
|
57
|
+
<el-table-column label="操作" align="center" width="300">
|
|
58
|
+
<template slot-scope="scope">
|
|
59
|
+
<div v-if="scope.row.editing">
|
|
60
|
+
<el-button type="primary" @click="save(scope.row)" size="mini"
|
|
61
|
+
icon="el-icon-success">保存
|
|
62
|
+
</el-button>
|
|
63
|
+
<el-button type="primary" @click="cancelAdd(scope.row)" size="mini"
|
|
64
|
+
icon="el-icon-error">取消
|
|
65
|
+
</el-button>
|
|
66
|
+
</div>
|
|
67
|
+
<div v-else>
|
|
68
|
+
<el-button type="primary" @click="setting(scope.row)" size="mini"
|
|
69
|
+
icon="el-icon-edit">配置
|
|
70
|
+
</el-button>
|
|
71
|
+
<el-button type="primary" @click="complexPreview(scope.row)" icon="el-icon-tickets"
|
|
72
|
+
size="mini">预览
|
|
73
|
+
</el-button>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
76
|
+
</el-table-column>
|
|
77
|
+
</el-table>
|
|
78
|
+
</el-main>
|
|
79
|
+
</el-container>
|
|
80
|
+
</el-main>
|
|
81
|
+
|
|
82
|
+
<el-footer>
|
|
83
|
+
<el-pagination
|
|
84
|
+
:ref="crud.pageRef"
|
|
85
|
+
:page-sizes="crud.pageSizes"
|
|
86
|
+
:page-size="crud.pageSize"
|
|
87
|
+
:current-page="crud.page"
|
|
88
|
+
:total="crud.dataStore.total"
|
|
89
|
+
@size-change="crud.sizeChange()"
|
|
90
|
+
@current-change="crud.currentPage()"
|
|
91
|
+
layout="total, sizes, prev, pager, next, jumper">
|
|
92
|
+
</el-pagination>
|
|
93
|
+
</el-footer>
|
|
94
|
+
<el-dialog :close-on-click-modal=false :title="'【' + currentRow.viewName + '】预览'" class="preview-complex"
|
|
95
|
+
:visible.sync="previewDialog" width="90%" height="80%" top="5vh">
|
|
96
|
+
<complex-view-rendering
|
|
97
|
+
v-if="previewDialog"
|
|
98
|
+
:resource-id="resourceId"
|
|
99
|
+
:data-permis="dataPermis"
|
|
100
|
+
:operate-permis="operatePermis">
|
|
101
|
+
|
|
102
|
+
</complex-view-rendering>
|
|
103
|
+
</el-dialog>
|
|
104
|
+
<el-dialog :close-on-click-modal=false :title="'【' + currentRow.viewName + '】配置'" class="preview-complex"
|
|
105
|
+
:visible.sync="settingDialog" width="90%" height="80%" top="5vh">
|
|
106
|
+
<complex-setting
|
|
107
|
+
@registeredResource="registeredResource"
|
|
108
|
+
:view-obj="currentRow"
|
|
109
|
+
:resource-id="resourceId"
|
|
110
|
+
:url-type-option-arr="urlTypeOptionArr"
|
|
111
|
+
:url-type-option-obj="urlTypeOptionObj"
|
|
112
|
+
:complex-preview="complexPreview"
|
|
113
|
+
v-if="settingDialog"></complex-setting>
|
|
114
|
+
</el-dialog>
|
|
115
|
+
</el-container>
|
|
116
|
+
</template>
|
|
117
|
+
|
|
118
|
+
<script>
|
|
119
|
+
import ComplexSetting from "./complexSetting";
|
|
120
|
+
import ComplexViewRendering from "../../../components/complexViewRendering";
|
|
121
|
+
|
|
122
|
+
export default {
|
|
123
|
+
name: "complex",
|
|
124
|
+
components: {ComplexViewRendering, ComplexSetting},
|
|
125
|
+
data() {
|
|
126
|
+
return {
|
|
127
|
+
crud: new this.CrudUtil({
|
|
128
|
+
vue: this,
|
|
129
|
+
entityName: "complex",
|
|
130
|
+
url: this.api.complex.url,
|
|
131
|
+
afterRemoveSuccess: this.afterRemoveSuccess,
|
|
132
|
+
searchForm:{order:"UPDATE_TIME DESC,CREATE_TIME DESC"},
|
|
133
|
+
noClearSearchColumns:['order']
|
|
134
|
+
}),
|
|
135
|
+
currentRow: {},
|
|
136
|
+
previewDialog: false,
|
|
137
|
+
settingDialog: false,
|
|
138
|
+
urlTypeOptionArr: [], //链接类型-从资源池中获取(可用对象)
|
|
139
|
+
urlTypeOptionObj: {},//链接类型对应对象(可用对象)
|
|
140
|
+
allResouceArr: [], //所有资源池对象
|
|
141
|
+
rSourceTypeObj: {
|
|
142
|
+
"singleForm": "单表表单",
|
|
143
|
+
"form": "智能建表",
|
|
144
|
+
"flow": "工作流",
|
|
145
|
+
"statRep": "统计报表",
|
|
146
|
+
"url": "url资源",
|
|
147
|
+
"sysFea": "自定义功能",
|
|
148
|
+
"sysFun": "系统功能"
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
resourceId: '', //预览资源id
|
|
152
|
+
operatePermis: "", //预览操作权限
|
|
153
|
+
dataPermis: "", //预览数据权限
|
|
154
|
+
deleteIdArr: [],//删除id
|
|
155
|
+
eidtRow: [],
|
|
156
|
+
editStatus: false
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
created() {
|
|
160
|
+
//从资源池中获取链接类型
|
|
161
|
+
this.initurlTypeOptionArr();
|
|
162
|
+
},
|
|
163
|
+
watch: {
|
|
164
|
+
previewDialog() { //监听配置弹窗,如果弹窗关闭则执行查询方法·
|
|
165
|
+
if (!this.previewDialog) {
|
|
166
|
+
this.crud.search();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
methods: {
|
|
172
|
+
/**
|
|
173
|
+
* 添加
|
|
174
|
+
*/
|
|
175
|
+
add() {
|
|
176
|
+
let vm = this;
|
|
177
|
+
let rows = vm.crud.dataStore.records;
|
|
178
|
+
if (rows.length > 0 && !rows[0].id) {
|
|
179
|
+
vm.$message('请先完成当前的数据添加!');
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
let newData = {
|
|
183
|
+
"viewName": "",
|
|
184
|
+
"remark": "",
|
|
185
|
+
autoRefresh:"0",
|
|
186
|
+
editing: true
|
|
187
|
+
};
|
|
188
|
+
rows.unshift(newData);
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* 删除
|
|
193
|
+
*/
|
|
194
|
+
remove() {
|
|
195
|
+
//删除事件
|
|
196
|
+
this.deleteIdArr = [];
|
|
197
|
+
let selection = this.$refs[this.crud.tableRef].selection || [];
|
|
198
|
+
selection.forEach(item => {
|
|
199
|
+
this.deleteIdArr.push(item.id);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
this.crud.remove();
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* 取消添加
|
|
207
|
+
*/
|
|
208
|
+
cancelAdd(row) {
|
|
209
|
+
let vm = this;
|
|
210
|
+
let rows = vm.crud.dataStore.records;
|
|
211
|
+
if (row["id"]) {
|
|
212
|
+
this.$set(row, "editing", false);
|
|
213
|
+
vm.crud.dataStore.records = JSON.parse(JSON.stringify(this.eidtRow));
|
|
214
|
+
} else {
|
|
215
|
+
rows.splice(rows.indexOf(row), 1);
|
|
216
|
+
}
|
|
217
|
+
this.editStatus = false;
|
|
218
|
+
},
|
|
219
|
+
/**
|
|
220
|
+
* 修改
|
|
221
|
+
* @param row
|
|
222
|
+
*/
|
|
223
|
+
beginRowEdit(row) {
|
|
224
|
+
if (this.editStatus) {
|
|
225
|
+
this.$message("请先结束当前编辑行!");
|
|
226
|
+
return;
|
|
227
|
+
} else {
|
|
228
|
+
this.editStatus = true;
|
|
229
|
+
}
|
|
230
|
+
this.eidtRow = JSON.parse(JSON.stringify(this.crud.dataStore.records));
|
|
231
|
+
this.$set(row, "editing", true);
|
|
232
|
+
},
|
|
233
|
+
/**
|
|
234
|
+
* 保存
|
|
235
|
+
* * @param row
|
|
236
|
+
*/
|
|
237
|
+
save(row) {
|
|
238
|
+
let vm = this;
|
|
239
|
+
if (!row["viewName"]) {
|
|
240
|
+
vm.$message({
|
|
241
|
+
message: "视图名称不能为空!",
|
|
242
|
+
duration: 1000
|
|
243
|
+
});
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
let submitObj = {
|
|
247
|
+
"viewName": row["viewName"],
|
|
248
|
+
"remark": row["remark"],
|
|
249
|
+
"autoRefresh": row["autoRefresh"],
|
|
250
|
+
"id": row["id"] || "",
|
|
251
|
+
};
|
|
252
|
+
let url = row["id"] ? this.api.complex.update : this.api.complex.add;
|
|
253
|
+
vm.axios.post(url, submitObj).then(res => {
|
|
254
|
+
vm.$message({
|
|
255
|
+
duration: 1500,
|
|
256
|
+
type: 'success',
|
|
257
|
+
message: res.data.operateMessage
|
|
258
|
+
});
|
|
259
|
+
if (res.data.operateSuccess) { // 保存 or 更新成功保存到资源池
|
|
260
|
+
//更新rName
|
|
261
|
+
this.updateResources(res.data.operateObj);
|
|
262
|
+
}
|
|
263
|
+
vm.editStatus = false;
|
|
264
|
+
vm.crud.search();
|
|
265
|
+
})
|
|
266
|
+
},
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* 注册or保存到资源池
|
|
271
|
+
*/
|
|
272
|
+
async registeredResource(obj, run) {
|
|
273
|
+
//根据资源类型
|
|
274
|
+
//根据当前资源查询 子复合视图 并获取所有 子页面的 数据权限和 操作权限
|
|
275
|
+
let resourceParam = {
|
|
276
|
+
rType: 'page', //url页面资源
|
|
277
|
+
rName: obj.viewName, //功能名称
|
|
278
|
+
rKey: obj.id, //唯一
|
|
279
|
+
externalAccess: '1',
|
|
280
|
+
noLoginRequired: '1',//默认不需要登录
|
|
281
|
+
passSwitch: '0',
|
|
282
|
+
rSource: 'cview', //资源类型 复合视图
|
|
283
|
+
rClass: '复合视图',
|
|
284
|
+
rClassId: '-1',
|
|
285
|
+
operatePermis: obj.optArr, //操作权限
|
|
286
|
+
dataPermis: obj.dataArr, //数据权限
|
|
287
|
+
rStatus: '1'
|
|
288
|
+
};
|
|
289
|
+
await this.axios.post(this.api.resources.saveResources, resourceParam); //注册or更新到资源池
|
|
290
|
+
},
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
*
|
|
294
|
+
*/
|
|
295
|
+
setting(row) {
|
|
296
|
+
this.currentRow = row;
|
|
297
|
+
|
|
298
|
+
this.resourceId = ''; //资源池id
|
|
299
|
+
this.operatePermis = []; //操作权限
|
|
300
|
+
this.dataPermis = []; //数据权限
|
|
301
|
+
let resourceArr = this.allResouceArr.filter(resource => {
|
|
302
|
+
return resource.rkey == row.id && resource.rsource == 'cview';
|
|
303
|
+
});
|
|
304
|
+
let resourceObj = resourceArr.length > 0 ? resourceArr[0] : {};
|
|
305
|
+
if (!this.isEmptyObject(resourceObj)) {
|
|
306
|
+
this.resourceId = resourceObj.id;
|
|
307
|
+
}
|
|
308
|
+
this.settingDialog = true;
|
|
309
|
+
},
|
|
310
|
+
/**
|
|
311
|
+
*
|
|
312
|
+
* @param row
|
|
313
|
+
*/
|
|
314
|
+
complexPreview(row) {
|
|
315
|
+
this.resourceId = ''; //资源池id
|
|
316
|
+
let resourceObj = {};
|
|
317
|
+
this.allResouceArr.some(item =>{
|
|
318
|
+
if(item.rkey == row.id && item.rsource == "cview"){
|
|
319
|
+
resourceObj = item;
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
this.currentRow = row;
|
|
324
|
+
if(!resourceObj.id){ // 不存在时刚添加没刷新数据
|
|
325
|
+
this.initurlTypeOptionArr().then(() => {
|
|
326
|
+
resourceObj = {};
|
|
327
|
+
this.allResouceArr.forEach(resource => {
|
|
328
|
+
if(resource.rkey == row.id && resource.rsource == 'cview'){
|
|
329
|
+
resourceObj = resource;
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
this.openPreviewDialog(resourceObj);
|
|
333
|
+
});
|
|
334
|
+
}else{
|
|
335
|
+
this.openPreviewDialog(resourceObj);
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
openPreviewDialog(resourceObj){
|
|
339
|
+
this.operatePermis = "";
|
|
340
|
+
this.dataPermis = "";
|
|
341
|
+
if (!this.isEmptyObject(resourceObj)) {
|
|
342
|
+
this.resourceId = resourceObj.id;
|
|
343
|
+
let optArr = [];
|
|
344
|
+
let dataArr = [];
|
|
345
|
+
(resourceObj.operatePermisList || []).forEach(item => {
|
|
346
|
+
optArr.push(item.id);
|
|
347
|
+
});
|
|
348
|
+
(resourceObj.dataPermisList || []).forEach(item => {
|
|
349
|
+
dataArr.push(item.id);
|
|
350
|
+
});
|
|
351
|
+
this.dataPermisList = dataArr.join(",");
|
|
352
|
+
this.operatePermis = optArr.join(",");
|
|
353
|
+
}
|
|
354
|
+
this.previewDialog = true;
|
|
355
|
+
|
|
356
|
+
},
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* 从资源池中获取资源类型
|
|
360
|
+
*/
|
|
361
|
+
initurlTypeOptionArr() {
|
|
362
|
+
let vm = this;
|
|
363
|
+
//查询资源来源是复合视图的
|
|
364
|
+
let allResourcesArr = [];
|
|
365
|
+
vm.urlTypeOptionArr = []; //绑定资源数据
|
|
366
|
+
vm.urlTypeOptionObj = {};
|
|
367
|
+
vm.allResouceArr = []; //所有资源池
|
|
368
|
+
return new Promise(resolve => {
|
|
369
|
+
vm.axios.post(this.api.resources.findResources, {rTypes: "page,menu,href", rStatus: '1'}).then(res => { //获取绑定资源数据
|
|
370
|
+
if (res.data && res.data.operateObj) {
|
|
371
|
+
(res.data.operateObj || []).forEach(item => {
|
|
372
|
+
if (item.rsource != 'cview' && item.rsource != 'singleForm') { //禁止套娃
|
|
373
|
+
// (复合视图类型和自定义单表表单资源不能使用)
|
|
374
|
+
allResourcesArr.push(item);
|
|
375
|
+
vm.urlTypeOptionObj[item.id] = item;
|
|
376
|
+
}
|
|
377
|
+
vm.allResouceArr.push(item);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
//对资源池总数据根据数据来源分组 rSource
|
|
382
|
+
let sourceData = this.getrSource(allResourcesArr);
|
|
383
|
+
sourceData.forEach(item => {
|
|
384
|
+
let childData = this.getrClass(item['children'] || []);
|
|
385
|
+
this.$set(item, 'children', childData || []);
|
|
386
|
+
});
|
|
387
|
+
sourceData = JSON.parse(JSON.stringify(sourceData).replace(/id/g, 'value').replace(/rname/g, 'label'));
|
|
388
|
+
|
|
389
|
+
//根据
|
|
390
|
+
vm.urlTypeOptionArr = sourceData;
|
|
391
|
+
resolve();
|
|
392
|
+
});
|
|
393
|
+
})
|
|
394
|
+
},
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* 根据 rSource 的分组
|
|
398
|
+
* @param dataArr
|
|
399
|
+
*/
|
|
400
|
+
getrSource(dataArr) {
|
|
401
|
+
let map = {},
|
|
402
|
+
dest = [];
|
|
403
|
+
dataArr.forEach(ai => {
|
|
404
|
+
if (!map[ai.rsource]) {
|
|
405
|
+
dest.push({
|
|
406
|
+
value: ai.rsource,
|
|
407
|
+
label: this.rSourceTypeObj[ai.rsource],
|
|
408
|
+
children: [ai]
|
|
409
|
+
});
|
|
410
|
+
map[ai.rsource] = ai;
|
|
411
|
+
} else {
|
|
412
|
+
dest.forEach(dj => {
|
|
413
|
+
if (dj.value == ai.rsource) {
|
|
414
|
+
dj.children.push(ai);
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
return dest;
|
|
420
|
+
},
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* 根据 rCalssId 分组
|
|
424
|
+
*/
|
|
425
|
+
getrClass(dataArr) {
|
|
426
|
+
let map = {},
|
|
427
|
+
dest = [];
|
|
428
|
+
dataArr.forEach(ai => {
|
|
429
|
+
if (!map[ai.rclassId]) {
|
|
430
|
+
dest.push({
|
|
431
|
+
value: ai.rclassId,
|
|
432
|
+
label: ai.rclass,
|
|
433
|
+
children: [ai]
|
|
434
|
+
});
|
|
435
|
+
map[ai.rclassId] = ai;
|
|
436
|
+
} else {
|
|
437
|
+
dest.forEach(dj => {
|
|
438
|
+
if (dj.value == ai.rclassId) {
|
|
439
|
+
dj.children.push(ai);
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
return dest;
|
|
445
|
+
},
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* 判断obj对象是否为空
|
|
449
|
+
* @param obj
|
|
450
|
+
* @returns {boolean}
|
|
451
|
+
*/
|
|
452
|
+
isEmptyObject(obj) {
|
|
453
|
+
for (let key in obj) {
|
|
454
|
+
if (obj.hasOwnProperty(key)) {
|
|
455
|
+
return false;//返回false,不为空对象
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return true;//返回true,为空对象
|
|
459
|
+
},
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* 删除对应的资源池
|
|
463
|
+
*/
|
|
464
|
+
afterRemoveSuccess() {
|
|
465
|
+
//同步删除资源池信息
|
|
466
|
+
this.axios.post(this.api.resources.deleteResources, {
|
|
467
|
+
'rkeys': this.deleteIdArr.join(","),
|
|
468
|
+
'rsouces': 'cview'
|
|
469
|
+
}).then(res => {
|
|
470
|
+
this.initurlTypeOptionArr(); //重新刷新资源池
|
|
471
|
+
});
|
|
472
|
+
},
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* 更新资源池
|
|
476
|
+
*/
|
|
477
|
+
updateResources(data){
|
|
478
|
+
let obj = {
|
|
479
|
+
rKey : data.id,
|
|
480
|
+
rSource : 'cview',
|
|
481
|
+
rName : data.viewName,
|
|
482
|
+
rType : "page",
|
|
483
|
+
externalAccess : "0",
|
|
484
|
+
noLoginRequired : "0",
|
|
485
|
+
passSwitch : "0",
|
|
486
|
+
rClass : "复合视图",
|
|
487
|
+
rClassId : "-1",
|
|
488
|
+
rStatus : "1"
|
|
489
|
+
}
|
|
490
|
+
this.axios.post(this.api.resources.updateResources, obj);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
</script>
|
|
495
|
+
|
|
496
|
+
<style scoped>
|
|
497
|
+
.preview-complex /deep/ .el-dialog__body {
|
|
498
|
+
height: calc(100% - 90px);
|
|
499
|
+
overflow-y: hidden !important;
|
|
500
|
+
}
|
|
501
|
+
</style>
|