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,856 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-container style="height: 100%">
|
|
3
|
+
<el-header style="height: auto">
|
|
4
|
+
<div class="search-form-parent el-card" style="padding-left:10px;padding-right:10px">
|
|
5
|
+
<el-form size="small" :inline="true"
|
|
6
|
+
@keyup.enter.native="crud.doSearch()" onSubmit="return false;">
|
|
7
|
+
<el-form-item label="功能名称" label-width="80px">
|
|
8
|
+
<el-input placeholder="请输入" v-model="crud.searchForm.functionName"></el-input>
|
|
9
|
+
</el-form-item>
|
|
10
|
+
<el-form-item label="功能地址" label-width="80px">
|
|
11
|
+
<el-input placeholder="请输入" v-model="crud.searchForm.functionUrl"></el-input>
|
|
12
|
+
</el-form-item>
|
|
13
|
+
<el-form-item label="功能类别" label-width="80px">
|
|
14
|
+
<el-select placeholder="请选择" v-model="crud.searchForm.functionType" clearable>
|
|
15
|
+
<el-option
|
|
16
|
+
v-for="item in functionTypeArr"
|
|
17
|
+
:key="item"
|
|
18
|
+
:label="item"
|
|
19
|
+
:value="item">
|
|
20
|
+
</el-option>
|
|
21
|
+
</el-select>
|
|
22
|
+
</el-form-item>
|
|
23
|
+
<el-button type="primary" icon="el-icon-search" size="small" style="margin-top: 5px" @click="crud.doSearch()">查询</el-button>
|
|
24
|
+
<el-button icon="el-icon-close" size="small" style="margin-top: 5px" @click="crud.resetSearch()">清空</el-button>
|
|
25
|
+
</el-form>
|
|
26
|
+
</div>
|
|
27
|
+
</el-header>
|
|
28
|
+
<el-main id="tableMain" style="height: 100%">
|
|
29
|
+
<el-container style="height:100%" class="table-list-container">
|
|
30
|
+
<el-header style="height: auto;" size="small">
|
|
31
|
+
<el-button type="primary" @click="addUrlResource()" round size="small" icon="el-icon-circle-plus">新增</el-button>
|
|
32
|
+
<el-button type="danger" @click="removeResource()" round size="small" icon="el-icon-delete">删除</el-button>
|
|
33
|
+
<el-button type="warning" @click="resreshResource()" round size="small" icon="el-icon-refresh-right">刷新资源池</el-button>
|
|
34
|
+
</el-header>
|
|
35
|
+
<el-main style="height:100%">
|
|
36
|
+
<el-table :data="crud.dataStore.records" :ref="crud.tableRef" stripe border height="100%" style="width: 100%;"
|
|
37
|
+
header-row-class-name="list-default-row">
|
|
38
|
+
<el-table-column type="selection" width="40" align="center"></el-table-column>
|
|
39
|
+
<el-table-column type="index" label="序号" align="center" width="60"></el-table-column>
|
|
40
|
+
<el-table-column label="功能名称" prop="functionName" width="200"></el-table-column>
|
|
41
|
+
<el-table-column label="功能地址" prop="functionUrl" width="400"></el-table-column>
|
|
42
|
+
<el-table-column label="功能类别" align="center" prop="functionType" width="100"></el-table-column>
|
|
43
|
+
<el-table-column label="操作权限" prop="permissionsAction" ></el-table-column>
|
|
44
|
+
<el-table-column label="数据权限" prop="permissionsData" ></el-table-column>
|
|
45
|
+
<el-table-column label="功能顺序" align="center" prop="functionOrder" width="80"></el-table-column>
|
|
46
|
+
<el-table-column label="操作" align="center" width="150">
|
|
47
|
+
<template slot-scope="scope">
|
|
48
|
+
<el-button size="small" icon="el-icon-edit" type="primary" @click="updateData(scope.row,scope.$index)">
|
|
49
|
+
修改
|
|
50
|
+
</el-button>
|
|
51
|
+
</template>
|
|
52
|
+
</el-table-column>
|
|
53
|
+
</el-table>
|
|
54
|
+
</el-main>
|
|
55
|
+
</el-container>
|
|
56
|
+
</el-main>
|
|
57
|
+
<el-footer>
|
|
58
|
+
<el-pagination
|
|
59
|
+
:ref="crud.pageRef"
|
|
60
|
+
:page-sizes="crud.pageSizes"
|
|
61
|
+
:page-size="crud.pageSize"
|
|
62
|
+
:current-page="crud.page"
|
|
63
|
+
:total="crud.dataStore.total"
|
|
64
|
+
@size-change="crud.sizeChange()"
|
|
65
|
+
@current-change="crud.currentPage()"
|
|
66
|
+
layout="total, sizes, prev, pager, next, jumper">
|
|
67
|
+
</el-pagination>
|
|
68
|
+
</el-footer>
|
|
69
|
+
<el-dialog :close-on-click-modal=false :visible.sync="dialogVisible" height="96%" width="70%" :title="urlTitle" top="20px" :before-close="closeDialog">
|
|
70
|
+
<el-container>
|
|
71
|
+
<!--基础信息块-->
|
|
72
|
+
<el-header style="height: 340px;margin-top: -5px;">
|
|
73
|
+
<h1 style="text-align: center;margin-bottom: 10px;padding-bottom: 10px;font-size:18px;">基础信息</h1>
|
|
74
|
+
<el-form label-width="80px" :model="baseInfoObj" :rules="baseInfoRules" ref="baseInfoObj">
|
|
75
|
+
<el-row>
|
|
76
|
+
<el-col :span="11">
|
|
77
|
+
<el-form-item label="功能名称" prop="functionName">
|
|
78
|
+
<el-input v-model="baseInfoObj.functionName"></el-input>
|
|
79
|
+
</el-form-item>
|
|
80
|
+
</el-col>
|
|
81
|
+
<el-col :span="12" :offset="1">
|
|
82
|
+
<el-form-item label="功能分类" prop="functionType">
|
|
83
|
+
<el-select style="width: 100%" v-model="baseInfoObj.functionType" filterable remote :remote-method="remoteFunctionType">
|
|
84
|
+
<el-option
|
|
85
|
+
v-for="item in functionTypeArr"
|
|
86
|
+
:key="item"
|
|
87
|
+
:label="item"
|
|
88
|
+
:value="item">
|
|
89
|
+
</el-option>
|
|
90
|
+
</el-select>
|
|
91
|
+
</el-form-item>
|
|
92
|
+
</el-col>
|
|
93
|
+
</el-row>
|
|
94
|
+
<el-row>
|
|
95
|
+
<el-col :span="11">
|
|
96
|
+
<el-form-item label="链接地址" prop="functionUrl">
|
|
97
|
+
<el-input v-model="baseInfoObj.functionUrl" placeholder="外部链接请加上https://或http://"></el-input>
|
|
98
|
+
</el-form-item>
|
|
99
|
+
</el-col>
|
|
100
|
+
<el-col :span="12" :offset="1">
|
|
101
|
+
<el-form-item label="功能顺序" prop="functionOrder">
|
|
102
|
+
<el-input v-model="baseInfoObj.functionOrder"></el-input>
|
|
103
|
+
</el-form-item>
|
|
104
|
+
</el-col>
|
|
105
|
+
</el-row>
|
|
106
|
+
<el-form-item label="备注信息" style="margin-bottom: 0px">
|
|
107
|
+
<el-input type="textarea" :rows="6" v-model="baseInfoObj.notes"></el-input>
|
|
108
|
+
</el-form-item>
|
|
109
|
+
</el-form>
|
|
110
|
+
</el-header>
|
|
111
|
+
<!--权限信息块-->
|
|
112
|
+
<el-main style="margin-top:-30px;width: 100%;padding-bottom: 0px;">
|
|
113
|
+
<h1 style="text-align: center;margin-bottom: 10px;padding-bottom: 10px;font-size:18px;">权限信息</h1>
|
|
114
|
+
<el-row>
|
|
115
|
+
<!--操作权限块-->
|
|
116
|
+
<el-col :span="11">
|
|
117
|
+
<div class="el-card is-always-shadow" style="width:100%;padding: 0px;height: 340px;margin-left: 30px">
|
|
118
|
+
<el-container>
|
|
119
|
+
<el-header
|
|
120
|
+
style="height: auto;border-bottom: solid #f2f2f2;border-bottom-width: 1px;padding-top: 10px;padding-bottom: 10px;">
|
|
121
|
+
<el-form :inline="true">
|
|
122
|
+
<el-form-item label="操作权限" size="mini" style="margin-bottom: 0px"></el-form-item>
|
|
123
|
+
<el-button type="danger" size="mini" round @click="delActionMethod"
|
|
124
|
+
style="float: right;margin-right: 5px">删除
|
|
125
|
+
</el-button>
|
|
126
|
+
<el-popover placement="bottom" width="300" v-model="addActionFastMethodShow">
|
|
127
|
+
<el-select v-model="addActionFastIndex" placeholder="请选择" multiple style="width: 300px;padding-top: 15px;padding-bottom: 20px"
|
|
128
|
+
size="small">
|
|
129
|
+
<el-option
|
|
130
|
+
v-for="(item,index) in addActionFastMethodDefault"
|
|
131
|
+
:label="item.code+'-'+item.name"
|
|
132
|
+
:value="index"
|
|
133
|
+
:key="index"
|
|
134
|
+
:disabled="item.tag">
|
|
135
|
+
</el-option>
|
|
136
|
+
</el-select>
|
|
137
|
+
<div style="text-align: center; margin: 0">
|
|
138
|
+
<el-button type="primary" size="mini" @click="addFastActionMethod()">确定</el-button>
|
|
139
|
+
<el-button size="mini" @click="addActionFastMethodShow = false">取消</el-button>
|
|
140
|
+
</div>
|
|
141
|
+
<el-button type="primary" size="mini" round
|
|
142
|
+
style="float: right;margin-right: 10px"
|
|
143
|
+
slot="reference">快速引入
|
|
144
|
+
</el-button>
|
|
145
|
+
</el-popover>
|
|
146
|
+
<el-popover placement="bottom" width="300" v-model="addActionMethodShow">
|
|
147
|
+
<el-form :inline="true" size="small" :model="actionObj" :rules="addActionRules" ref="addActionRules">
|
|
148
|
+
<el-form-item style="width: 30% " prop="code">
|
|
149
|
+
<el-input placeholder="权限码" v-model="actionObj.code"></el-input>
|
|
150
|
+
</el-form-item>
|
|
151
|
+
<el-form-item style="width: 30%" prop="name">
|
|
152
|
+
<el-input placeholder="权限名称" v-model="actionObj.name"></el-input>
|
|
153
|
+
</el-form-item>
|
|
154
|
+
<el-form-item style="width: 30%" prop="order" :validate-event="false">
|
|
155
|
+
<el-input placeholder="顺序号" v-model="actionObj.order" :validate-event="false"></el-input>
|
|
156
|
+
</el-form-item>
|
|
157
|
+
<div style="text-align: center; margin: 0">
|
|
158
|
+
<el-button type="primary" size="mini" @click="addActionMethod('addActionRules')">确定</el-button>
|
|
159
|
+
<el-button size="mini" @click="addActionMethodShow = false">取消</el-button>
|
|
160
|
+
</div>
|
|
161
|
+
</el-form>
|
|
162
|
+
<el-button type="primary" size="mini" round
|
|
163
|
+
style="float: right;margin-right: 10px"
|
|
164
|
+
slot="reference" @click="openActionPopver()">添加
|
|
165
|
+
</el-button>
|
|
166
|
+
</el-popover>
|
|
167
|
+
</el-form>
|
|
168
|
+
</el-header>
|
|
169
|
+
<el-main style="padding-top: 10px;padding-bottom: 0px;">
|
|
170
|
+
<el-table border size="mini" height="260px" :data="actionObjArr" ref="actionObjArrTbale" stripe border style="width: 100%"
|
|
171
|
+
header-row-class-name="list-default-row ">
|
|
172
|
+
<el-table-column type="selection" align="center"></el-table-column>
|
|
173
|
+
<el-table-column type="index" label="序号" align="center"></el-table-column>
|
|
174
|
+
<el-table-column label="权限码" prop="code" align="center">
|
|
175
|
+
<template slot-scope="scope">
|
|
176
|
+
<span v-if="isActionNotEdit(scope.row,scope.$index)" style="text-align: center">{{scope.row.code}}</span>
|
|
177
|
+
<el-input v-if="isActionEdit(scope.row,scope.$index)" v-model="scope.row.code" size="mini"></el-input>
|
|
178
|
+
</template>
|
|
179
|
+
</el-table-column>
|
|
180
|
+
<el-table-column label="权限名称" prop="name" align="center">
|
|
181
|
+
<template slot-scope="scope">
|
|
182
|
+
<span v-if="isActionNotEdit(scope.row,scope.$index)" style="text-align: center">{{scope.row.name}}</span>
|
|
183
|
+
<el-input v-if="isActionEdit(scope.row,scope.$index)" v-model="scope.row.name" size="mini"></el-input>
|
|
184
|
+
</template>
|
|
185
|
+
</el-table-column>
|
|
186
|
+
<el-table-column label="顺序" prop="order" align="center">
|
|
187
|
+
<template slot-scope="scope">
|
|
188
|
+
<span v-if="isActionNotEdit(scope.row,scope.$index)" style="text-align: center">{{scope.row.order}}</span>
|
|
189
|
+
<el-input v-if="isActionEdit(scope.row,scope.$index)" v-model="scope.row.order" size="mini"></el-input>
|
|
190
|
+
</template>
|
|
191
|
+
</el-table-column>
|
|
192
|
+
<el-table-column label="操作" align="center" >
|
|
193
|
+
<template slot-scope="scope">
|
|
194
|
+
<el-button icon="el-icon-edit" v-if="isActionNotEdit(scope.row,scope.$index)" type="primary" size="mini" @click="clickActionEdit(scope.$index)" style="font-size: 8px;margin-right: 5px"> 修改</el-button>
|
|
195
|
+
<i class="el-icon-circle-check" title="保存" style="font-size:25px;margin-right: 10px;cursor: pointer;color:#409eff;"
|
|
196
|
+
v-if="isActionEdit(scope.row,scope.$index)" @click="clickActionEditSave(scope.row,scope.$index)"></i>
|
|
197
|
+
<i class="el-icon-circle-close" title="取消" style="font-size:25px;margin-left: 10px;cursor: pointer"
|
|
198
|
+
v-if="isActionEdit(scope.row,scope.$index)" @click="clickActionEditClose()"></i>
|
|
199
|
+
</template>
|
|
200
|
+
</el-table-column>
|
|
201
|
+
</el-table>
|
|
202
|
+
</el-main>
|
|
203
|
+
</el-container>
|
|
204
|
+
</div>
|
|
205
|
+
</el-col>
|
|
206
|
+
<!--数据权限块-->
|
|
207
|
+
<el-col :span="11">
|
|
208
|
+
<div class="el-card is-always-shadow" style="width:100%;height: 340px;padding: 0px;margin-right: 30px;margin-left: 80px">
|
|
209
|
+
<el-container>
|
|
210
|
+
<el-header
|
|
211
|
+
style="height: auto;border-bottom: solid #f2f2f2;border-bottom-width: 1px;padding-top: 10px;padding-bottom: 10px">
|
|
212
|
+
<el-form :inline="true">
|
|
213
|
+
<el-form-item label="数据权限" size="mini" style="margin-bottom: 0px"></el-form-item>
|
|
214
|
+
<el-button type="danger" size="mini" round @click="delDataMethod"
|
|
215
|
+
style="float: right;margin-right: 5px">删除
|
|
216
|
+
</el-button>
|
|
217
|
+
<el-popover placement="bottom" width="300" v-model="addDataMethodShow">
|
|
218
|
+
<el-form :inline="true" size="small" :model="dataObj" :rules="addDataRules" ref="addDataRules">
|
|
219
|
+
<el-form-item style="width: 30% " prop="code">
|
|
220
|
+
<el-input placeholder="权限码" v-model="dataObj.code"></el-input>
|
|
221
|
+
</el-form-item>
|
|
222
|
+
<el-form-item style="width: 30%" prop="name">
|
|
223
|
+
<el-input placeholder="权限名称" v-model="dataObj.name"></el-input>
|
|
224
|
+
</el-form-item>
|
|
225
|
+
<el-form-item style="width: 30%" prop="order">
|
|
226
|
+
<el-input placeholder="顺序号" v-model="dataObj.order"></el-input>
|
|
227
|
+
</el-form-item>
|
|
228
|
+
</el-form>
|
|
229
|
+
<div style="text-align: center; margin: 0">
|
|
230
|
+
<el-button type="primary" size="mini" @click="addDataMethod('addDataRules')">确定</el-button>
|
|
231
|
+
<el-button size="mini" @click="addDataMethodShow = false">取消</el-button>
|
|
232
|
+
</div>
|
|
233
|
+
<el-button type="primary" size="mini" round
|
|
234
|
+
style="float: right;margin-right: 10px"
|
|
235
|
+
slot="reference" @click="openDataPopver">添加
|
|
236
|
+
</el-button>
|
|
237
|
+
</el-popover>
|
|
238
|
+
</el-form>
|
|
239
|
+
</el-header>
|
|
240
|
+
<el-main style="padding-top: 10px;padding-bottom: 0px">
|
|
241
|
+
<el-table border size="mini" height="260px" :data="dataObjArr" ref="dataObjArrTbale" stripe border style="width: 100%;"
|
|
242
|
+
header-row-class-name="list-default-row">
|
|
243
|
+
<el-table-column type="selection" width="40" align="center"></el-table-column>
|
|
244
|
+
<el-table-column type="index" label="序号" align="center" width="60"></el-table-column>
|
|
245
|
+
<el-table-column label="权限码" prop="code" align="center">
|
|
246
|
+
<template slot-scope="scope">
|
|
247
|
+
<span v-if="isDataNotEdit(scope.row,scope.$index)" style="text-align: center">{{scope.row.code}}</span>
|
|
248
|
+
<el-input v-if="isDataEdit(scope.row,scope.$index)" v-model="scope.row.code" size="mini"></el-input>
|
|
249
|
+
</template>
|
|
250
|
+
</el-table-column>
|
|
251
|
+
<el-table-column label="权限名称" prop="name" align="center">
|
|
252
|
+
<template slot-scope="scope">
|
|
253
|
+
<span v-if="isDataNotEdit(scope.row,scope.$index)" style="text-align: center">{{scope.row.name}}</span>
|
|
254
|
+
<el-input v-if="isDataEdit(scope.row,scope.$index)" v-model="scope.row.name" size="mini"></el-input>
|
|
255
|
+
</template>
|
|
256
|
+
</el-table-column>
|
|
257
|
+
<el-table-column label="顺序" prop="order" align="center">
|
|
258
|
+
<template slot-scope="scope">
|
|
259
|
+
<span v-if="isDataNotEdit(scope.row,scope.$index)" style="text-align: center">{{scope.row.order}}</span>
|
|
260
|
+
<el-input v-if="isDataEdit(scope.row,scope.$index)" v-model="scope.row.order" size="mini"></el-input>
|
|
261
|
+
</template>
|
|
262
|
+
</el-table-column>
|
|
263
|
+
<el-table-column label="操作" align="center">
|
|
264
|
+
<template slot-scope="scope">
|
|
265
|
+
<el-button icon="el-icon-edit" v-if="isDataNotEdit(scope.row,scope.$index)" type="primary" size="mini" @click="clickDataEdit(scope.$index)" style="font-size: 8px;margin-right: 5px"> 修改</el-button>
|
|
266
|
+
<i class="el-icon-circle-check" style="font-size:25px;margin-right: 10px;cursor: pointer" v-if="isDataEdit(scope.row,scope.$index)" @click="clickDataEditSave(scope.row,scope.$index)"></i>
|
|
267
|
+
<i class="el-icon-circle-close" style="font-size:25px;margin-left: 10px;cursor: pointer" v-if="isDataEdit(scope.row,scope.$index)" @click="clickDataEditClose"></i>
|
|
268
|
+
</template>
|
|
269
|
+
</el-table-column>
|
|
270
|
+
</el-table>
|
|
271
|
+
</el-main>
|
|
272
|
+
</el-container>
|
|
273
|
+
</div>
|
|
274
|
+
</el-col>
|
|
275
|
+
</el-row>
|
|
276
|
+
</el-main>
|
|
277
|
+
</el-container>
|
|
278
|
+
<div slot="footer" class="dialog-footer" style="text-align: center">
|
|
279
|
+
<el-button type="primary" @click="submitAdd('baseInfoObj')" size="small">保 存</el-button>
|
|
280
|
+
<el-button @click="closeDialog" size="small">取 消</el-button>
|
|
281
|
+
</div>
|
|
282
|
+
</el-dialog>
|
|
283
|
+
</el-container>
|
|
284
|
+
</template>
|
|
285
|
+
<script>
|
|
286
|
+
export default {
|
|
287
|
+
name: "url-resource",
|
|
288
|
+
data() {
|
|
289
|
+
let numberRules=(rule,value,callback) =>{
|
|
290
|
+
const reg = /^\+?([1-9][0-9]*)$/;
|
|
291
|
+
if(!reg.test(value)){
|
|
292
|
+
callback(new Error('顺序必须为正整数!'));
|
|
293
|
+
}
|
|
294
|
+
callback();
|
|
295
|
+
};
|
|
296
|
+
let actionRules=(rule,value,callback) =>{
|
|
297
|
+
const reg = /^\+?([1-9][0-9]*)$/;
|
|
298
|
+
if(!reg.test(value)){
|
|
299
|
+
callback(new Error('顺序必须为正整数!'));
|
|
300
|
+
}
|
|
301
|
+
// 判断 是否重复添加数据
|
|
302
|
+
let index=this.checkActionArr(this.actionObj);
|
|
303
|
+
if(index >= 0){
|
|
304
|
+
callback(new Error('操作权限已存在'));
|
|
305
|
+
}
|
|
306
|
+
callback();
|
|
307
|
+
};
|
|
308
|
+
let dataRules=(rule,value,callback) =>{
|
|
309
|
+
const reg = /^\+?([1-9][0-9]*)$/;
|
|
310
|
+
if(!reg.test(value)){
|
|
311
|
+
callback(new Error('顺序必须为正整数!'));
|
|
312
|
+
}
|
|
313
|
+
// 判断 是否重复添加数据
|
|
314
|
+
let index=this.checkDataArr(this.dataObj);
|
|
315
|
+
if(index >= 0){
|
|
316
|
+
callback(new Error('数据权限已存在'));
|
|
317
|
+
}
|
|
318
|
+
callback();
|
|
319
|
+
};
|
|
320
|
+
return {
|
|
321
|
+
crud: new this.CrudUtil({
|
|
322
|
+
vue: this,
|
|
323
|
+
entityName: "urlResource",
|
|
324
|
+
url: this.api.urlResource.url,
|
|
325
|
+
searchForm: {
|
|
326
|
+
order: 'FUNCTION_ORDER ASC',
|
|
327
|
+
},
|
|
328
|
+
afterRemoveSuccess:this.afterRemoveSuccess,
|
|
329
|
+
}),
|
|
330
|
+
dialogVisible: false,
|
|
331
|
+
functionTypeArr: [],
|
|
332
|
+
baseInfoObj: {
|
|
333
|
+
"functionName":"",
|
|
334
|
+
"functionUrl":"",
|
|
335
|
+
"functionType":"",
|
|
336
|
+
"functionOrder":"",
|
|
337
|
+
"notes":"",
|
|
338
|
+
},
|
|
339
|
+
baseInfoRules:{
|
|
340
|
+
functionName:[
|
|
341
|
+
{ required: true, message: '请输入功能名称', trigger: 'blur' },
|
|
342
|
+
],
|
|
343
|
+
functionUrl:[
|
|
344
|
+
{ required: true, message: '请输入链接地址', trigger: 'blur' },
|
|
345
|
+
],
|
|
346
|
+
functionType:[
|
|
347
|
+
{ required: true, message: '请选择功能分类', trigger: 'blur' },
|
|
348
|
+
],
|
|
349
|
+
functionOrder:[
|
|
350
|
+
{ required: true, message: '请输入功能顺序', trigger: 'blur' },
|
|
351
|
+
{ validator: numberRules,trigger: 'blur'}
|
|
352
|
+
],
|
|
353
|
+
},
|
|
354
|
+
urlTitle:"添加URL资源",
|
|
355
|
+
// 操作权限相关数据
|
|
356
|
+
actionObj: {},
|
|
357
|
+
actionObjArr: [],
|
|
358
|
+
actionObjArrBak: [],
|
|
359
|
+
addActionFastMethodDefaultBak:[],
|
|
360
|
+
addActionMethodShow: false,
|
|
361
|
+
addActionFastMethodShow: false,
|
|
362
|
+
addActionFastMethodDefault: [{"name":"增加","code":"add","order":"1","tag":false,'uuId':this.COMMON_FUNC.getUuidByParams(16)},
|
|
363
|
+
{"name":"修改","code":"update","order":"2","tag":false,'uuId':this.COMMON_FUNC.getUuidByParams(16)},
|
|
364
|
+
{"name":"删除","code":"delete","order":"3","tag":false,'uuId':this.COMMON_FUNC.getUuidByParams(16)},
|
|
365
|
+
{"name":"查询","code":"query","order":"4","tag":false,'uuId':this.COMMON_FUNC.getUuidByParams(16)}],
|
|
366
|
+
addActionFastIndex:[],
|
|
367
|
+
lasActionRowIndex: -1,
|
|
368
|
+
addActionRules:{
|
|
369
|
+
name: [
|
|
370
|
+
{ required: true, message: '请输入权限名称', trigger: 'blur' },
|
|
371
|
+
],
|
|
372
|
+
code: [
|
|
373
|
+
{ required: true, message: '请输入权限码', trigger: 'blur' },
|
|
374
|
+
],
|
|
375
|
+
order: [
|
|
376
|
+
{ required: true, message: '请输入顺序', trigger: 'blur' },
|
|
377
|
+
{ validator: actionRules,trigger: 'blur'}
|
|
378
|
+
]
|
|
379
|
+
},
|
|
380
|
+
// 数据权限相关数据
|
|
381
|
+
dataObj: {},
|
|
382
|
+
dataObjArr: [],
|
|
383
|
+
dataObjArrBak: [],
|
|
384
|
+
addDataMethodShow: false,
|
|
385
|
+
lasDataRowIndex: -1,
|
|
386
|
+
addDataRules:{
|
|
387
|
+
name: [
|
|
388
|
+
{ required: true, message: '请输入权限名称', trigger: 'blur' },
|
|
389
|
+
],
|
|
390
|
+
code: [
|
|
391
|
+
{ required: true, message: '请输入权限码', trigger: 'blur' },
|
|
392
|
+
],
|
|
393
|
+
order: [
|
|
394
|
+
{ required: true, message: '请输入顺序', trigger: 'blur' },
|
|
395
|
+
{ validator: dataRules,trigger: 'blur'}
|
|
396
|
+
]
|
|
397
|
+
},
|
|
398
|
+
addOrUpdata: "",
|
|
399
|
+
deleteIdArr:[],
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
created() {
|
|
403
|
+
this.init();
|
|
404
|
+
},
|
|
405
|
+
methods: {
|
|
406
|
+
init(){
|
|
407
|
+
// 初始化功能类别
|
|
408
|
+
this.axios.post(this.api.urlResource.findFunctionType).then(res => {
|
|
409
|
+
this.functionTypeArr=[];
|
|
410
|
+
if(res.data.operateMessage){
|
|
411
|
+
res.data.operateObj.forEach(res => {
|
|
412
|
+
this.functionTypeArr.push(res.functionType);
|
|
413
|
+
})
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
this.sortByKey(this.actionObjArr,'order');
|
|
417
|
+
this.sortByKey(this.dataObjArr,'order');
|
|
418
|
+
},
|
|
419
|
+
// 对话框显示
|
|
420
|
+
addUrlResource() {
|
|
421
|
+
this.urlTitle="添加URL资源";
|
|
422
|
+
this.dialogVisible = true;
|
|
423
|
+
this.addOrUpdata="add";
|
|
424
|
+
// 功能顺序默认为当前数据中最大顺序+1,如果没有数据则为1。
|
|
425
|
+
this.axios.post(this.api.urlResource.findMaxOrder).then(res => {
|
|
426
|
+
this.$set(this.baseInfoObj,"functionOrder",res.data.operateObj + 1);
|
|
427
|
+
});
|
|
428
|
+
this.$set(this.baseInfoObj,"functionType",this.functionTypeArr[0]);
|
|
429
|
+
},
|
|
430
|
+
|
|
431
|
+
// 刷新资源池
|
|
432
|
+
resreshResource(){
|
|
433
|
+
this.axios.post(this.api.urlResource.updateResouce).then(res =>{
|
|
434
|
+
let message = "刷新资源池失败!";
|
|
435
|
+
let type = "error";
|
|
436
|
+
if(res.data && res.data.operateSuccess){
|
|
437
|
+
message = "刷新资源池成功!";
|
|
438
|
+
type = "success";
|
|
439
|
+
}
|
|
440
|
+
this.$message({
|
|
441
|
+
type:type,
|
|
442
|
+
message:message
|
|
443
|
+
})
|
|
444
|
+
})
|
|
445
|
+
|
|
446
|
+
},
|
|
447
|
+
//数组对象排序
|
|
448
|
+
sortByKey(array,key){
|
|
449
|
+
return array.sort(function(a,b){
|
|
450
|
+
var x = parseInt(a[key]);
|
|
451
|
+
var y = parseInt(b[key]);
|
|
452
|
+
return((x<y)?-1:((x>y)?1:0));
|
|
453
|
+
})
|
|
454
|
+
},
|
|
455
|
+
// 功能分类可输入
|
|
456
|
+
remoteFunctionType(data){
|
|
457
|
+
this.$set(this.baseInfoObj,"functionType",data);
|
|
458
|
+
},
|
|
459
|
+
// 打开气泡框
|
|
460
|
+
openActionPopver(){
|
|
461
|
+
this.actionObj= {};
|
|
462
|
+
this.$set(this.actionObj,'uuId',this.COMMON_FUNC.getUuidByParams(16)); //唯一标志
|
|
463
|
+
this.$refs['addActionRules'].clearValidate();
|
|
464
|
+
},
|
|
465
|
+
// 打开气泡框
|
|
466
|
+
openDataPopver(){
|
|
467
|
+
this.dataObj= {};
|
|
468
|
+
this.$set(this.dataObj,'uuId',this.COMMON_FUNC.getUuidByParams(16)); //唯一标志
|
|
469
|
+
this.$refs['addDataRules'].clearValidate();
|
|
470
|
+
},
|
|
471
|
+
// 判断当前操作权限数组有无目标对象 有则返回在数组中的索引
|
|
472
|
+
checkActionArr(obj){
|
|
473
|
+
let index=this.actionObjArr.findIndex(data => {
|
|
474
|
+
if(obj.code == data.code || obj.name == data.name || obj.order == data.order){
|
|
475
|
+
return true;
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
return index;
|
|
479
|
+
},
|
|
480
|
+
// 判断传入对象 是否在快速引入数组中存在
|
|
481
|
+
checkActionDefaultArr(obj){
|
|
482
|
+
let index=this.addActionFastMethodDefault.findIndex(data => {
|
|
483
|
+
if(obj.code == data.code || obj.name == data.name){
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
return index;
|
|
488
|
+
},
|
|
489
|
+
// 增加操作权限
|
|
490
|
+
addActionMethod(addActionRules){
|
|
491
|
+
this.$refs[addActionRules].validate((valid) => {
|
|
492
|
+
if (valid) {
|
|
493
|
+
this.actionObjArr.push(this.actionObj);
|
|
494
|
+
// 快速引入判断
|
|
495
|
+
let index2=this.checkActionDefaultArr(this.actionObj);
|
|
496
|
+
if(index2>=0){
|
|
497
|
+
this.$set(this.addActionFastMethodDefault[index2],"tag",true);
|
|
498
|
+
}
|
|
499
|
+
this.addActionMethodShow=false;
|
|
500
|
+
this.actionObj={};
|
|
501
|
+
} else {
|
|
502
|
+
//this.$message.error("增加失败!");
|
|
503
|
+
return false;
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
this.sortByKey(this.actionObjArr,'order');
|
|
507
|
+
},
|
|
508
|
+
// 快速增加操作权限
|
|
509
|
+
addFastActionMethod(){
|
|
510
|
+
this.addActionFastMethodShow = false;
|
|
511
|
+
this.addActionFastIndex.forEach(num =>{
|
|
512
|
+
let index=this.checkActionArr(this.addActionFastMethodDefault[num]);
|
|
513
|
+
if(index <0){
|
|
514
|
+
if(!this.addActionFastMethodDefault[num].uuId){
|
|
515
|
+
this.$set(this.addActionFastMethodDefault[num],'uuId',this.COMMON_FUNC.getUuidByParams(16));
|
|
516
|
+
}
|
|
517
|
+
this.actionObjArr.push(this.addActionFastMethodDefault[num]);
|
|
518
|
+
this.$set(this.addActionFastMethodDefault[num],'tag',true);
|
|
519
|
+
}
|
|
520
|
+
})
|
|
521
|
+
this.sortByKey(this.actionObjArr,'order');
|
|
522
|
+
this.addActionFastIndex=[];
|
|
523
|
+
},
|
|
524
|
+
// 删除操作权限
|
|
525
|
+
delActionMethod(){
|
|
526
|
+
let arr=this.$refs.actionObjArrTbale.selection;
|
|
527
|
+
// 遍历选中数组 找到在原数组中的索引 删除
|
|
528
|
+
arr.forEach( data =>{
|
|
529
|
+
let index = this.actionObjArr.findIndex(item => {
|
|
530
|
+
if(item == data){
|
|
531
|
+
return true;
|
|
532
|
+
}
|
|
533
|
+
})
|
|
534
|
+
// 快速引入判断
|
|
535
|
+
let index2=this.checkActionDefaultArr(this.actionObjArr[index]);
|
|
536
|
+
if(index2>=0){
|
|
537
|
+
this.$set(this.addActionFastMethodDefault[index2],"tag",false);
|
|
538
|
+
}
|
|
539
|
+
this.actionObjArr.splice(index,1);
|
|
540
|
+
});
|
|
541
|
+
this.sortByKey(this.actionObjArr,'order');
|
|
542
|
+
this.actionObjArrBak=[];
|
|
543
|
+
this.lasActionRowIndex=-1;
|
|
544
|
+
},
|
|
545
|
+
// 可编辑
|
|
546
|
+
clickActionEdit(index){
|
|
547
|
+
this.lasActionRowIndex=index;
|
|
548
|
+
this.actionObjArrBak=JSON.parse(JSON.stringify(this.actionObjArr));
|
|
549
|
+
this.addActionFastMethodDefaultBak=JSON.parse(JSON.stringify(this.addActionFastMethodDefault));
|
|
550
|
+
},
|
|
551
|
+
isActionEdit(row,index){
|
|
552
|
+
let flag = false;
|
|
553
|
+
if(index == this.lasActionRowIndex){
|
|
554
|
+
flag = true;
|
|
555
|
+
}
|
|
556
|
+
return flag;
|
|
557
|
+
},
|
|
558
|
+
isActionNotEdit(row,index){
|
|
559
|
+
let flag = false;
|
|
560
|
+
if(index != this.lasActionRowIndex){
|
|
561
|
+
flag = true;
|
|
562
|
+
}
|
|
563
|
+
return flag;
|
|
564
|
+
},
|
|
565
|
+
//操作权限修改保存
|
|
566
|
+
clickActionEditSave(row,num){
|
|
567
|
+
const reg = /^\+?([1-9][0-9]*)$/;
|
|
568
|
+
if(row.name== "" || row.order=="" || row.code== ""){
|
|
569
|
+
this.$message.error("修改数据不能为空!");
|
|
570
|
+
}else if(!reg.test(row.order)){
|
|
571
|
+
this.$message.error("顺序必须为正整数");
|
|
572
|
+
}else{
|
|
573
|
+
let obj={"name":row.name,"code":row.code,"order":row.order};
|
|
574
|
+
// 判断 是否重复添加数据
|
|
575
|
+
let index=-1;
|
|
576
|
+
for(let k=0;k<this.actionObjArrBak.length;k++){
|
|
577
|
+
if(obj.code == this.actionObjArrBak[k].code || obj.name == this.actionObjArrBak[k].name || obj.order == this.actionObjArrBak[k].order ){
|
|
578
|
+
if(k == num){
|
|
579
|
+
continue;
|
|
580
|
+
}else{
|
|
581
|
+
index=k;
|
|
582
|
+
break;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
if(index >= 0){
|
|
587
|
+
this.$message.error("修改失败,该操作权限已存在!");
|
|
588
|
+
this.actionObjArr=JSON.parse(JSON.stringify(this.actionObjArrBak));
|
|
589
|
+
}else{
|
|
590
|
+
// 快速引入判断 :修改数据是否是快速引入已有,有则禁用快速引入
|
|
591
|
+
this.addActionFastMethodDefault=JSON.parse(JSON.stringify(this.addActionFastMethodDefaultBak));
|
|
592
|
+
let index2=this.checkActionDefaultArr(obj);
|
|
593
|
+
if(index2>=0){
|
|
594
|
+
this.$set(this.addActionFastMethodDefault[index2],"tag",true);
|
|
595
|
+
}
|
|
596
|
+
this.lasActionRowIndex=-1;
|
|
597
|
+
}
|
|
598
|
+
this.sortByKey(this.actionObjArr,'order');
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
// 操作权限修改取消
|
|
602
|
+
clickActionEditClose(){
|
|
603
|
+
this.actionObjArr=JSON.parse(JSON.stringify(this.actionObjArrBak));
|
|
604
|
+
this.lasActionRowIndex=-1;
|
|
605
|
+
},
|
|
606
|
+
// 判断当前数据权限数组有无目标对象 有则返回在数组中的索引
|
|
607
|
+
checkDataArr(obj){
|
|
608
|
+
let index=this.dataObjArr.findIndex(data => {
|
|
609
|
+
if(obj.code == data.code || obj.name == data.name || obj.order == data.order){
|
|
610
|
+
return true;
|
|
611
|
+
}
|
|
612
|
+
})
|
|
613
|
+
return index;
|
|
614
|
+
},
|
|
615
|
+
// 增加操作权限
|
|
616
|
+
addDataMethod(addDataRules){
|
|
617
|
+
this.$refs[addDataRules].validate((valid) => {
|
|
618
|
+
if (valid) {
|
|
619
|
+
this.dataObjArr.push(this.dataObj);
|
|
620
|
+
this.addDataMethodShow=false;
|
|
621
|
+
this.dataObj={};
|
|
622
|
+
} else {
|
|
623
|
+
// this.$message.error("增加失败!")
|
|
624
|
+
return false;
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
this.sortByKey(this.dataObjArr,'order');
|
|
628
|
+
},
|
|
629
|
+
// 删除数据权限
|
|
630
|
+
delDataMethod(){
|
|
631
|
+
let arr=this.$refs.dataObjArrTbale.selection
|
|
632
|
+
// 遍历选中数组 找到在原数组中的索引 删除
|
|
633
|
+
arr.forEach( data =>{
|
|
634
|
+
let index = this.dataObjArr.findIndex(item => {
|
|
635
|
+
if(item == data){
|
|
636
|
+
return true;
|
|
637
|
+
}
|
|
638
|
+
})
|
|
639
|
+
this.dataObjArr.splice(index,1);
|
|
640
|
+
})
|
|
641
|
+
this.dataObjArrBak=[];
|
|
642
|
+
this.lasDataRowIndex=-1;
|
|
643
|
+
this.sortByKey(this.dataObjArr,'order');
|
|
644
|
+
},
|
|
645
|
+
// 可编辑
|
|
646
|
+
clickDataEdit(index){
|
|
647
|
+
this.lasDataRowIndex=index;
|
|
648
|
+
this.dataObjArrBak=JSON.parse(JSON.stringify(this.dataObjArr));
|
|
649
|
+
},
|
|
650
|
+
isDataEdit(row,index){
|
|
651
|
+
let flag = false;
|
|
652
|
+
if(index == this.lasDataRowIndex){
|
|
653
|
+
flag = true;
|
|
654
|
+
}
|
|
655
|
+
return flag;
|
|
656
|
+
},
|
|
657
|
+
isDataNotEdit(row,index){
|
|
658
|
+
let flag = false;
|
|
659
|
+
if(index != this.lasDataRowIndex){
|
|
660
|
+
flag = true;
|
|
661
|
+
}
|
|
662
|
+
return flag;
|
|
663
|
+
},
|
|
664
|
+
//数据权限修改保存
|
|
665
|
+
clickDataEditSave(row,num){
|
|
666
|
+
const reg = /^\+?([1-9][0-9]*)$/;
|
|
667
|
+
if(row.name== "" || row.order=="" || row.code== ""){
|
|
668
|
+
this.$message.error("修改数据不能为空!")
|
|
669
|
+
}else if(!reg.test(row.order)){
|
|
670
|
+
this.$message.error("顺序必须为正整数!")
|
|
671
|
+
}else{
|
|
672
|
+
let obj={"name":row.name,"code":row.code,"order":row.order};
|
|
673
|
+
// 判断 是否重复添加数据
|
|
674
|
+
let index=-1;
|
|
675
|
+
for(let i=0;i<this.dataObjArrBak.length;i++){
|
|
676
|
+
if(obj.code == this.dataObjArrBak[i].code || obj.name == this.dataObjArrBak[i].name || obj.order == this.dataObjArrBak[i].order ){
|
|
677
|
+
if(i == num){
|
|
678
|
+
continue;
|
|
679
|
+
}else{
|
|
680
|
+
index=i;
|
|
681
|
+
break;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
if(index >= 0){
|
|
686
|
+
this.$message.error("修改失败,该数据权限已存在");
|
|
687
|
+
this.dataObjArr=JSON.parse(JSON.stringify(this.dataObjArrBak));
|
|
688
|
+
}else{
|
|
689
|
+
this.lasDataRowIndex=-1;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
this.sortByKey(this.dataObjArr,'order');
|
|
693
|
+
},
|
|
694
|
+
// 数据权限修改取消
|
|
695
|
+
clickDataEditClose(){
|
|
696
|
+
this.dataObjArr=JSON.parse(JSON.stringify(this.dataObjArrBak));
|
|
697
|
+
this.lasDataRowIndex=-1;
|
|
698
|
+
},
|
|
699
|
+
// 提交
|
|
700
|
+
submitAdd(baseInfoObj){
|
|
701
|
+
this.$refs[baseInfoObj].validate((valid) =>{
|
|
702
|
+
if(valid){
|
|
703
|
+
this.$set(this.baseInfoObj,"permissionsActionNote",JSON.stringify(this.actionObjArr));
|
|
704
|
+
this.$set(this.baseInfoObj,"permissionsDataNote",JSON.stringify(this.dataObjArr));
|
|
705
|
+
|
|
706
|
+
let permissionsAction="";
|
|
707
|
+
this.actionObjArr.forEach(data =>{
|
|
708
|
+
permissionsAction +=data.name+"、";
|
|
709
|
+
});
|
|
710
|
+
this.$set(this.baseInfoObj,"permissionsAction",permissionsAction.substr(0,permissionsAction.length-1));
|
|
711
|
+
|
|
712
|
+
let permissionsData="";
|
|
713
|
+
this.dataObjArr.forEach(data =>{
|
|
714
|
+
permissionsData +=data.name+"、";
|
|
715
|
+
});
|
|
716
|
+
this.$set(this.baseInfoObj,"permissionsData",permissionsData.substr(0,permissionsData.length-1));
|
|
717
|
+
// 功能类别 筛选手动输入重复
|
|
718
|
+
let index=this.functionTypeArr.findIndex(data => {
|
|
719
|
+
if(data == this.baseInfoObj.functionType){
|
|
720
|
+
return true;
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
if(index <0){
|
|
724
|
+
this.functionTypeArr.push(this.baseInfoObj.functionType);
|
|
725
|
+
}
|
|
726
|
+
let opreate = this.addOrUpdata === "update" ? 'update': 'add';
|
|
727
|
+
this.axios.post(this.api.urlResource[opreate],this.baseInfoObj).then(res =>{
|
|
728
|
+
if(res.data && res.data.operateObj){
|
|
729
|
+
let urlObj = res.data.operateObj;
|
|
730
|
+
let permissionsOptArr = JSON.parse(res.data.operateObj.permissionsActionNote || "[]"); //数据权限
|
|
731
|
+
let permissionsDataArr = JSON.parse(res.data.operateObj.permissionsDataNote || "[]"); //操作权限
|
|
732
|
+
let optArr = []; //保存的操作权限
|
|
733
|
+
let dataArr = []; //保存的数据权限
|
|
734
|
+
|
|
735
|
+
permissionsOptArr.forEach(opt =>{
|
|
736
|
+
optArr.push({
|
|
737
|
+
'type':'opt',
|
|
738
|
+
'powerCode':opt.code,
|
|
739
|
+
'powerName':opt.name,
|
|
740
|
+
'powerKey':opt.uuId,
|
|
741
|
+
'parentId':'-1',
|
|
742
|
+
'parentTree':'-1',
|
|
743
|
+
});
|
|
744
|
+
});
|
|
745
|
+
permissionsDataArr.forEach(data =>{
|
|
746
|
+
dataArr.push({
|
|
747
|
+
'type':'data',
|
|
748
|
+
'powerCode':data.code,
|
|
749
|
+
'powerName':data.name,
|
|
750
|
+
'powerKey':data.uuId,
|
|
751
|
+
'parentId':'-1',
|
|
752
|
+
'parentTree':'-1',
|
|
753
|
+
})
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
let resourceParam = {
|
|
757
|
+
rType: 'page', //url页面资源
|
|
758
|
+
rName : urlObj.functionName, //功能名称
|
|
759
|
+
rKey : urlObj.id, //唯一R_KRY
|
|
760
|
+
rAgentUrl:urlObj.functionUrl, //代理地址
|
|
761
|
+
externalAccess:'1',
|
|
762
|
+
noLoginRequired:'1',//默认不需要登录
|
|
763
|
+
passSwitch: '0',
|
|
764
|
+
rSource: 'url', //资源类型 url
|
|
765
|
+
rClass: urlObj.functionType,
|
|
766
|
+
rClassId: urlObj.functionType,
|
|
767
|
+
operatePermis: JSON.stringify(optArr || []),
|
|
768
|
+
dataPermis: JSON.stringify(dataArr || []),
|
|
769
|
+
rStatus:'1'
|
|
770
|
+
};
|
|
771
|
+
this.axios.post(this.api.resources.saveResources, resourceParam); //注册or更新到资源池
|
|
772
|
+
this.crud.doSearch(null,"保存成功!");
|
|
773
|
+
this.dialogVisible= false;
|
|
774
|
+
this.clearDatas();
|
|
775
|
+
}
|
|
776
|
+
});
|
|
777
|
+
}else{
|
|
778
|
+
return false;
|
|
779
|
+
}
|
|
780
|
+
})
|
|
781
|
+
},
|
|
782
|
+
// 关闭对话框
|
|
783
|
+
closeDialog(){
|
|
784
|
+
this.dialogVisible = false;
|
|
785
|
+
this.clearDatas();
|
|
786
|
+
this.$refs['baseInfoObj'].clearValidate();
|
|
787
|
+
},
|
|
788
|
+
// 清空数据
|
|
789
|
+
clearDatas(){
|
|
790
|
+
this.baseInfoObj= {};
|
|
791
|
+
this.actionObj= {};
|
|
792
|
+
this.dataObj= {};
|
|
793
|
+
this.actionObjArr=[];
|
|
794
|
+
this.dataObjArr=[];
|
|
795
|
+
this.addActionFastMethodDefault=[{"name":"增加","code":"add","order":"1","tag":false},
|
|
796
|
+
{"name":"修改","code":"update","order":"2","tag":false},{"name":"删除","code":"delete","order":"3","tag":false},
|
|
797
|
+
{"name":"查询","code":"query","order":"4","tag":false}];
|
|
798
|
+
},
|
|
799
|
+
// 修改table数据
|
|
800
|
+
updateData(row,index){
|
|
801
|
+
this.urlTitle="修改URL资源";
|
|
802
|
+
this.dialogVisible=true;
|
|
803
|
+
this.addOrUpdata="update";
|
|
804
|
+
this.$set(this.baseInfoObj,"functionName",row.functionName);
|
|
805
|
+
this.$set(this.baseInfoObj,"functionOrder",row.functionOrder);
|
|
806
|
+
this.$set(this.baseInfoObj,"functionType",row.functionType);
|
|
807
|
+
this.$set(this.baseInfoObj,"functionUrl",row.functionUrl);
|
|
808
|
+
this.$set(this.baseInfoObj,"notes",row.notes);
|
|
809
|
+
this.$set(this.baseInfoObj,"id",row.id);
|
|
810
|
+
this.actionObjArr=JSON.parse(row.permissionsActionNote);
|
|
811
|
+
this.actionObjArr.forEach(data => {
|
|
812
|
+
let index=this.checkActionDefaultArr(data);
|
|
813
|
+
if(index >=0){
|
|
814
|
+
this.$set(this.addActionFastMethodDefault[index],'tag',true);
|
|
815
|
+
}
|
|
816
|
+
})
|
|
817
|
+
this.dataObjArr=JSON.parse(row.permissionsDataNote);
|
|
818
|
+
this.sortByKey(this.actionObjArr,'order');
|
|
819
|
+
this.sortByKey(this.dataObjArr,'order');
|
|
820
|
+
},
|
|
821
|
+
|
|
822
|
+
removeResource(){
|
|
823
|
+
//删除事件
|
|
824
|
+
this.deleteIdArr = [];
|
|
825
|
+
let selection = this.$refs[this.crud.tableRef].selection || [];
|
|
826
|
+
let noDeleteNameArr = [];
|
|
827
|
+
selection.forEach(item =>{
|
|
828
|
+
if(!Number(item.noDelete)){
|
|
829
|
+
this.deleteIdArr.push(item.id);
|
|
830
|
+
}else{
|
|
831
|
+
noDeleteNameArr.push(item.functionName);
|
|
832
|
+
}
|
|
833
|
+
});
|
|
834
|
+
if(noDeleteNameArr.length > 0){
|
|
835
|
+
this.$message.error("选择项中包含开发者拥有的固定资源,“" + noDeleteNameArr.join(",") + "”无法被删除,请取消这些资源后继续删除!");
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
this.crud.remove();
|
|
839
|
+
},
|
|
840
|
+
|
|
841
|
+
afterRemoveSuccess(){
|
|
842
|
+
//同步删除资源池信息
|
|
843
|
+
this.axios.post(this.api.resources.deleteResources,{'rkeys':this.deleteIdArr.join(","),'rsouces':'url'});
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
|
|
847
|
+
}
|
|
848
|
+
</script>
|
|
849
|
+
<style scoped>
|
|
850
|
+
.el-main table-list-container {
|
|
851
|
+
padding-left: 5px;
|
|
852
|
+
padding-right: 5px;
|
|
853
|
+
padding-top: 10px;
|
|
854
|
+
padding-bottom: 10px;
|
|
855
|
+
}
|
|
856
|
+
</style>
|