sasp-admin 0.2.63 → 0.2.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/index.js +38 -31
  2. package/package.json +1 -1
  3. package/router.js +5 -1
  4. package/src/assets/font/iconfont.css +1902 -1846
  5. package/src/assets/font/iconfont.eot +0 -0
  6. package/src/assets/font/iconfont.js +1 -1
  7. package/src/assets/font/iconfont.svg +959 -825
  8. package/src/assets/font/iconfont.ttf +0 -0
  9. package/src/assets/font/iconfont.woff +0 -0
  10. package/src/assets/js/api/apiAdmin.js +10 -0
  11. package/src/assets/js/global/dataGlobal.js +7 -3
  12. package/src/assets/js/global/userGlobal.js +9 -3
  13. package/src/components/complexViewRendering.vue +214 -198
  14. package/src/components/ifmLink.vue +20 -3
  15. package/src/components/public/data/plDataSelect.vue +8 -6
  16. package/src/components/public/org/sysOrgPosUserSelect.vue +56 -17
  17. package/src/components/public/upload/images/ofd.png +0 -0
  18. package/src/components/public/upload/plImage.vue +3 -1
  19. package/src/components/public/upload/plUpload.vue +167 -40
  20. package/src/components/public/upload/preview/OfdPreview.vue +223 -0
  21. package/src/components/public/upload/preview/officeViewer.vue +116 -0
  22. package/src/components/public/upload/preview/pdfPreview.vue +91 -0
  23. package/src/{views → components/public/upload}/preview/pdfViewer.vue +1 -1
  24. package/src/views/VueMenuView.vue +11 -13
  25. package/src/views/data/dataManage.vue +51 -5
  26. package/src/views/event/eventManager/vueEventDiy.vue +4 -6
  27. package/src/views/log/loginlog/logManageDevOrSup.vue +8 -5
  28. package/src/views/log/loginlog/logManageEnt.vue +96 -55
  29. package/src/views/log/loginlog/logManageGov.vue +8 -5
  30. package/src/views/menu/component/menuManageComponent.vue +3 -5
  31. package/src/views/menuRouter/menuView.vue +226 -117
  32. package/src/views/menuRouter/urlMenuRouter.vue +13 -16
  33. package/src/views/org/entOrgTree.vue +1 -3
  34. package/src/views/org/js/sysOrgUserDetailMixins.js +646 -0
  35. package/src/views/org/sysEntOrgUserDetail.vue +10 -632
  36. package/src/views/org/sysOrgDimension.vue +4 -8
  37. package/src/views/org/sysOrgPosUserDetail.vue +4 -619
  38. package/src/views/org/sysOrgTree.vue +2 -4
  39. package/src/views/param/sysParam.vue +2 -0
  40. package/src/views/resources/resRouter/resView.vue +9 -11
  41. package/src/views/resources/tabs/comp/pageResRegister.vue +3 -5
  42. package/src/views/resources/tabs/dataResources.vue +3 -1
  43. package/src/views/resources/tabs/pageResources.vue +3 -1
  44. package/src/views/role/authRole/component/allocateSetting.vue +2 -589
  45. package/src/views/role/authRole/component/authSetting.vue +2 -597
  46. package/src/views/role/authRole/component/js/authMixins.js +622 -0
  47. package/src/views/role/commonRole/commonRole.vue +122 -3
  48. package/src/views/role/commonRole/compoment/commonSetting.vue +4 -6
  49. package/src/views/role/commonRole/compoment/commonSettingAdjust.vue +2 -89
  50. package/src/views/role/commonRole/compoment/commonSettingNew.vue +13 -97
  51. package/src/views/role/commonRole/compoment/js/commonSettingMixins.js +90 -0
  52. package/src/views/role/commonRole/compoment/roleMenuPower.vue +17 -2
  53. package/src/views/role/commonRole/compoment/roleMenuSetting.vue +12 -5
  54. package/src/views/sms/sendSms.vue +1 -1
  55. package/src/views/threeinone/init/safeInitRegion.vue +2 -4
  56. package/src/views/threeinone/safeManager.vue +1 -0
  57. package/src/views/threeinone/safeOrgSpv.vue +360 -337
  58. package/src/views/threeinone/safeSpvEconView.vue +37 -17
  59. package/src/views/uploadManage/uploadManage.vue +133 -0
  60. package/src/views/user/empowerUser/empowerUserListViewMenuTree.vue +6 -2
  61. package/src/views/user/stationUserManage.vue +3 -5
  62. package/src/views/user/userManage.vue +99 -3
  63. package/src/views/user/userMangement.vue +4 -6
@@ -5,56 +5,63 @@
5
5
  <div class="search-form-parent el-card">
6
6
  <el-form :inline="true" :model="crud.searchForm" size="small"
7
7
  class="demo-form-inline" @keyup.enter.native="crud.doSearch()" onSubmit="return false;">
8
- <el-form-item label="登录时间" >
9
- <el-date-picker type="date" v-model="crud.searchForm.loginTimeQ"
10
- range-separator="至"
11
- start-placeholder="开始日期"
12
- end-placeholder="结束日期"
13
- style="width: 140px" >
14
-
15
- </el-date-picker> -
16
- <el-date-picker type="date" v-model="crud.searchForm.loginTimeZ" style="width: 140px" ></el-date-picker>
17
- </el-form-item>
18
-
19
- <el-form-item label="账号" style="margin-left: 20px">
20
- <el-input v-model="crud.searchForm.userAccount" style="width:120px" ></el-input>
21
- </el-form-item>
8
+ <!-- <el-form-item label="登录时间" >-->
9
+ <!-- <el-date-picker type="date" v-model="crud.searchForm.loginTimeQ"-->
10
+ <!-- range-separator="至"-->
11
+ <!-- start-placeholder="开始日期"-->
12
+ <!-- end-placeholder="结束日期"-->
13
+ <!-- style="width: 140px" >-->
14
+
15
+ <!-- </el-date-picker> - -->
16
+ <!-- <el-date-picker type="date" v-model="crud.searchForm.loginTimeZ" style="width: 140px" ></el-date-picker>-->
17
+ <!-- </el-form-item>-->
18
+
19
+ <!-- <el-form-item label="账号" style="margin-left: 20px">-->
20
+ <!-- <el-input v-model="crud.searchForm.userAccount" style="width:120px" ></el-input>-->
21
+ <!-- </el-form-item>-->
22
22
  <el-form-item label="姓名" style="margin-left: 20px">
23
- <el-input v-model="crud.searchForm.userName" style="width: 120px" ></el-input>
24
- </el-form-item>
25
-
26
- <el-form-item label="所在地区" label-position="right" style="margin-left: 20px" >
27
- <el-select v-model="crud.searchForm.city" style="width: 150px" @change="formTypeChangeCity">
28
- <el-option
29
- v-for="item in formTypeCityOptions"
30
- :key="item.id"
31
- :label="item.dataName"
32
- :value="item.id"
33
- >
34
- </el-option>
35
- </el-select>-
36
- <el-select v-model="crud.searchForm.area" style="width: 150px" @change="formTypeChangeArea" >
37
- <el-option
38
- v-for="item in formTypeAreaOptions"
39
- :key="item.id"
40
- :label="item.dataName"
41
- :value="item.id"
42
- >
43
- </el-option>
44
- </el-select>-
45
- <el-select v-model="crud.searchForm.street" style="width: 150px" >
46
- <el-option
47
- v-for="item in formTypeStreetOptions"
48
- :key="item.id"
49
- :label="item.dataName"
50
- :value="item.id">
51
- </el-option>
23
+ <el-select v-model="crud.searchForm.userId" clearable filterable placeholder="请选择">
24
+ <el-option
25
+ v-for="item in sysUserArr"
26
+ :key="item.id"
27
+ :label="item.userName"
28
+ :value="item.userId">
29
+ </el-option>
52
30
  </el-select>
53
31
  </el-form-item>
54
32
 
33
+ <!-- <el-form-item label="所在地区" label-position="right" style="margin-left: 20px" >-->
34
+ <!-- <el-select v-model="crud.searchForm.city" style="width: 150px" @change="formTypeChangeCity">-->
35
+ <!-- <el-option-->
36
+ <!-- v-for="item in formTypeCityOptions"-->
37
+ <!-- :key="item.id"-->
38
+ <!-- :label="item.dataName"-->
39
+ <!-- :value="item.id"-->
40
+ <!-- >-->
41
+ <!-- </el-option>-->
42
+ <!-- </el-select>- -->
43
+ <!-- <el-select v-model="crud.searchForm.area" style="width: 150px" @change="formTypeChangeArea" >-->
44
+ <!-- <el-option-->
45
+ <!-- v-for="item in formTypeAreaOptions"-->
46
+ <!-- :key="item.id"-->
47
+ <!-- :label="item.dataName"-->
48
+ <!-- :value="item.id"-->
49
+ <!-- >-->
50
+ <!-- </el-option>-->
51
+ <!-- </el-select>- -->
52
+ <!-- <el-select v-model="crud.searchForm.street" style="width: 150px" >-->
53
+ <!-- <el-option-->
54
+ <!-- v-for="item in formTypeStreetOptions"-->
55
+ <!-- :key="item.id"-->
56
+ <!-- :label="item.dataName"-->
57
+ <!-- :value="item.id">-->
58
+ <!-- </el-option>-->
59
+ <!-- </el-select>-->
60
+ <!-- </el-form-item>-->
61
+
55
62
 
56
63
  <el-form-item>
57
- <el-button type="primary" icon="el-icon-search" @click="crud.doSearch()">查询</el-button>
64
+ <el-button type="primary" icon="el-icon-search" @click="crud.doSearch()">查询</el-button>
58
65
  <el-button icon="el-icon-close" @click="crud.resetSearch()">清空</el-button>
59
66
  </el-form-item>
60
67
 
@@ -73,12 +80,12 @@
73
80
  <!-- <el-table-column label="单位及部门" prop="orgName" align="center"></el-table-column>-->
74
81
  <el-table-column label="账号" prop="userAccount" align="center" >
75
82
  <template slot-scope="scope">
76
- {{loginUser.userAccount}}
83
+ {{userNameFormat(scope.row,'account')}}
77
84
  </template>
78
85
  </el-table-column>
79
- <el-table-column label="姓名" prop="userName" align="center" >
86
+ <el-table-column label="姓名" prop="userName" align="center" >
80
87
  <template slot-scope="scope">
81
- {{loginUser.userName}}
88
+ {{userNameFormat(scope.row,'name')}}
82
89
  </template>
83
90
  </el-table-column>
84
91
  <el-table-column label="登录时间" prop="loginTime" :formatter="viewDateFormat" align="center" >
@@ -144,7 +151,7 @@
144
151
  formData:{
145
152
  id:"", 'orgName':"",'userAccount':"",'userName':"",'loginTime':"",'totalTime':"", 'clientIp':""
146
153
  }, //弹出框初始值
147
-
154
+ sysUserArr:[],
148
155
 
149
156
  }
150
157
  },
@@ -152,7 +159,20 @@
152
159
 
153
160
  created(){
154
161
  let vm = this;
155
- this.initData();
162
+ vm.axios.post(this.api.sysOrgPosUser.findNoPage).then(res=>{
163
+ if(res && res.data){
164
+
165
+ let obj = {
166
+ id:vm.loginUser.id,
167
+ userId:vm.loginUser.id,
168
+ userName: vm.loginUser.userName,
169
+ userNameQp: vm.loginUser.userAccount,
170
+ }
171
+ vm.sysUserArr = res.data;
172
+ vm.sysUserArr.push(obj);
173
+ }
174
+ this.initData();
175
+ })
156
176
  },
157
177
  watch: {
158
178
  //监听日期表单变化 crud.searchForm.area
@@ -220,7 +240,25 @@
220
240
  crud.search(vm.checkSelectedMsg);
221
241
  },
222
242
 
223
-
243
+ userNameFormat(val,type){
244
+ let returnValue = '';
245
+ if(type == 'name'){
246
+ returnValue = this.loginUser.userName;
247
+ }else{
248
+ returnValue = this.loginUser.userAccount;
249
+ }
250
+ (this.sysUserArr || []).forEach(item=>{
251
+ if(item.userId == val.userId){
252
+ if(type == 'name'){
253
+ returnValue = item.userName;
254
+ }
255
+ if(type == 'account'){
256
+ returnValue = item.userNameQp;
257
+ }
258
+ }
259
+ })
260
+ return returnValue;
261
+ },
224
262
  //日期格式化
225
263
  viewDateFormat(value, time) {
226
264
  let d = new Date(value.createTime);
@@ -236,11 +274,14 @@
236
274
  "q+": Math.floor((date.getMonth() + 3) / 3), //季度
237
275
  "S": date.getMilliseconds() //毫秒
238
276
  };
239
- if (/(y+)/.test(fmt))
240
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
241
- for (let k in o)
242
- if (new RegExp("(" + k + ")").test(fmt))
243
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
277
+ if (/(y+)/.test(fmt)) {
278
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
279
+ }
280
+ for (let k in o) {
281
+ if (new RegExp("(" + k + ")").test(fmt)) {
282
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
283
+ }
284
+ }
244
285
  } else {
245
286
  fmt = '无';
246
287
  }
@@ -224,11 +224,14 @@
224
224
  "q+": Math.floor((date.getMonth() + 3) / 3), //季度
225
225
  "S": date.getMilliseconds() //毫秒
226
226
  };
227
- if (/(y+)/.test(fmt))
228
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
229
- for (let k in o)
230
- if (new RegExp("(" + k + ")").test(fmt))
231
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
227
+ if (/(y+)/.test(fmt)) {
228
+ fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
229
+ }
230
+ for (let k in o) {
231
+ if (new RegExp("(" + k + ")").test(fmt)) {
232
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
233
+ }
234
+ }
232
235
  } else {
233
236
  fmt = '无';
234
237
  }
@@ -1974,11 +1974,9 @@
1974
1974
  */
1975
1975
  initTreeCheck(dataArr,keysArr){
1976
1976
  (dataArr || []).forEach(item =>{
1977
- if(!item["childrens"]){ //因为下级全部选中上级自动选中,所以不用考虑上级
1977
+ if(!item["childrens"]&&item['enable']){ //因为下级全部选中上级自动选中,所以不用考虑上级
1978
1978
  // this.$refs.operatePermisRef.setCheckedKeys([item['key']]);
1979
- if(item['enable']){ //当前已选择
1980
- keysArr.push(item['key']);
1981
- }
1979
+ keysArr.push(item['key']);
1982
1980
  }
1983
1981
  if(item["childrens"]){
1984
1982
  this.initTreeCheck(item["childrens"],keysArr);
@@ -2111,7 +2109,7 @@
2111
2109
  item["childrens"].splice(index,1);
2112
2110
  keyArr.splice(index,1);
2113
2111
  }else{
2114
- this.$set(child,'enable',true); ;//设置可编辑状态
2112
+ this.$set(child,'enable',true);//设置可编辑状态
2115
2113
  this.isHalfOperationKeyArr.push(child.key);
2116
2114
  }
2117
2115
  halfOperatArr = item["childrens"];
@@ -1,129 +1,238 @@
1
1
  <template>
2
- <ifm-link :link-url="linkUrl" v-if="isIfm">
3
- </ifm-link>
2
+ <ifm-link :link-url="linkUrl" v-if="isIfm">
3
+ </ifm-link>
4
4
  </template>
5
5
 
6
6
  <script>
7
- import IfmLink from "../../components/ifmLink";
8
- export default {
9
- name: "menuView",
10
- components: {IfmLink},
11
- data(){
12
- return{
13
- oldFullPath:this.$route.fullPath,
14
- resourceId:this.$route.params.resourceId,
15
- menuId:this.$route.query.menuId,
16
- menuResourceUrl:{},
17
- linkUrl:'', //外部链接地址
18
- isIfm:false
7
+ import IfmLink from "../../components/ifmLink";
8
+
9
+ export default {
10
+ name: "menuView",
11
+ components: {IfmLink},
12
+ data() {
13
+ return {
14
+ oldFullPath: "",
15
+ resourceId: this.$route.params.resourceId,
16
+ menuId: this.$route.query.menuId,
17
+ menuResourceUrl: {},
18
+ linkUrl: '', //外部链接地址
19
+ isIfm: false,
20
+ operateAuthArr: [], // 操作权限Arr(这里主要是为了自定义跳转时添加上router参数)
21
+ dataPowerKeyArr: [] // 数据权限Arr
22
+
23
+ }
24
+ },
25
+ created() {
26
+ this.initRouter();
27
+ this.oldFullPath = this.$route.fullPath;
28
+ },
29
+ watch: {
30
+ '$route.fullPath'() {
31
+ if (this.$route.fullPath.indexOf("/menuView/") == -1) {
32
+ return;
33
+ }
34
+ if (this.$route.fullPath !== this.oldFullPath) {
35
+ return;
36
+ }
37
+ window.menuViewWatch = window.menuViewWatch || {};
38
+ if (window.menuViewWatch[this.$route.fullPath] && new Date().getTime() - window.menuViewWatch[this.$route.fullPath] < 10) {
39
+ return;
40
+ }
41
+ window.menuViewWatch[this.$route.fullPath] = new Date().getTime();
42
+ // console.log("...oldFullPath...", this.oldFullPath);
43
+ // console.log("...fullPath...", this.$route.fullPath);
44
+ this.menuId = this.$route.query.menuId;
45
+ if (this.$route.params.resourceId && this.resourceId != this.$route.params.resourceId) {
46
+ this.resourceId = this.$route.params.resourceId;
47
+ }
48
+ this.initRouter();
49
+ },
50
+ },
51
+ methods: {
52
+ initRouter() { //初始化跳转
53
+ this.linkUrl = '';
54
+ this.isIfm = false;
55
+ // 会涉及到同异步问题,所以需要多次判断
56
+ if (this.$route.fullPath.indexOf("/menuView/") == -1) {
57
+ this.routerPush(this.$route.fullPath);
58
+ return;
59
+ }
60
+ if (this.menuResourceUrl[this.menuId]) {
61
+ if (this.menuResourceUrl[this.menuId].indexOf("http://") > -1 || this.menuResourceUrl[this.menuId].indexOf("https://") > -1 ||
62
+ this.menuResourceUrl[this.menuId].indexOf(".jsp") > -1 || this.menuResourceUrl[this.menuId].indexOf(".html") > -1) {
63
+ this.linkUrl = this.menuResourceUrl[this.menuId];
64
+ this.isIfm = true;
65
+ return false;
66
+ } else {
67
+ this.routerPush(this.menuResourceUrl[this.menuId]);
68
+ }
69
+ return;
70
+ }
71
+ this.RES_GLOBAL.getById(this.resourceId).then(resData => {
72
+ let url = "";
73
+ if (resData) {
74
+ if (resData.rstatus == '0') {
75
+ this.$message({
76
+ message: "该资源已禁用,无法访问!",
77
+ type: 'warning'
78
+ });
79
+ return false;
80
+ }
81
+ let firstUrl = this.$route.fullPath;
82
+
83
+ // 会涉及到同异步问题,所以需要多次判断
84
+ if (firstUrl.indexOf("/menuView/") == -1) {
85
+ url = this.$route.fullPath;
86
+ } else if (resData.rsource == "url") {
87
+ url = resData.ragentUrl;
88
+ } else if (this.VIEW_COMPONENTS[resData.rsource]) {
89
+ firstUrl = firstUrl.substring(0, firstUrl.indexOf("/menuView/"));
90
+ url = firstUrl + "/" + this.VIEW_COMPONENTS[resData.rsource].menu + "/" + this.resourceId;
91
+ } else {
92
+ let resourceKey = "";
93
+ this.QIANKUN_ACTIVE_RULES.forEach(item => {
94
+ if (resData.rsource.indexOf(item) > -1) {
95
+ resourceKey = item;
96
+ }
97
+ if (this.VIEW_COMPONENTS[resourceKey]) {
98
+ firstUrl = firstUrl.substring(0, firstUrl.indexOf("/menuView/"));
99
+ url = firstUrl + "/" + this.VIEW_COMPONENTS[resourceKey].menu + "/" + this.resourceId;
100
+ }
101
+ });
102
+ }
103
+ }
104
+ this.menuId && (this.menuResourceUrl[this.menuId] = url);
105
+ //执行跳转
106
+ if (url.indexOf("http://") > -1 || url.indexOf("https://") > -1) {
107
+ this.linkUrl = url;
108
+ this.isIfm = true;
109
+ // window.open(url);
110
+ return false;
111
+ } else if (url.indexOf(".jsp") > -1 || url.indexOf(".html") > -1) {
112
+ this.$message("暂无功能!");
113
+ return false;
114
+ }
115
+ this.$nextTick(() => {
116
+ setTimeout(() => {
117
+ this.routerPush(url);
118
+ })
119
+ // 执行跳转
120
+ })
121
+
122
+ });
123
+ },
124
+
125
+ /**
126
+ * 生成数据权限与操作权限
127
+ */
128
+ buildOptAndDataAuth(){
129
+ return new Promise((resolve, reject) => {
130
+ this.operateAuthArr = [];
131
+ this.dataPowerKeyArr = [];
132
+ let menuObj = window.menuIdToMenuObj[this.menuId];
133
+ this.RES_GLOBAL.getById(this.resourceId).then(resourceObj => {
134
+ this.RES_GLOBAL.getUserOwnMenuOpt().then(datas => {
135
+ let roleOptArr = [];
136
+ (datas || []).forEach(item => {
137
+ if (item.menuId === this.menuId) {
138
+ roleOptArr.push(item);
139
+ }
140
+ });
141
+ if(roleOptArr.length > 0){
142
+ //遍历权限
143
+ let optPowerArr = []; //操作权限
144
+ let dataPowerArr = []; //数据权限
145
+ roleOptArr.forEach(item =>{
146
+ if(item.optPower){
147
+ optPowerArr = optPowerArr.concat(item.optPower.split(",") || []);
148
+ }
149
+ if (item.dataPower){
150
+ dataPowerArr = dataPowerArr.concat(item.dataPower.split(",") || []);
151
+ }
152
+ });
153
+ //去重
154
+ let optPowerSet = new Set(optPowerArr);
155
+ optPowerArr = Array.from(optPowerSet);
156
+ //去重
157
+ let dataPowerSet = new Set(dataPowerArr);
158
+ dataPowerArr = Array.from(dataPowerSet);
159
+ let operatePermisList = ((menuObj || {}).operatePermis || '').split(","); //菜单操作权限
160
+ (resourceObj.operatePermisList || []).forEach(item =>{
161
+ // 菜单与角色权限同时存在时可以显示
162
+ if((optPowerArr || []) .indexOf(item.id) > -1 && operatePermisList.indexOf(item.id) > -1){
163
+ this.operateAuthArr.push(item.powerCode); //操作权限
164
+ }
165
+ });
166
+ let dataPermisList = ((menuObj || {}).dataPermis || '').split(",");//菜单数据权限
167
+ (resourceObj.dataPermisList || []).forEach(item =>{ //数据权限
168
+ if((dataPowerArr || []) .indexOf(item.id) > -1 && dataPermisList.indexOf(item.id) > -1){
169
+ this.dataPowerKeyArr.push(item.powerCode); //数据权限 arr
170
+ }
171
+ });
172
+ }
173
+ resolve();
174
+ })
175
+ })
176
+ })
177
+ },
178
+
179
+ /**
180
+ * 请求跳转
181
+ */
182
+ routerPush(url, param) {
183
+ this.buildOptAndDataAuth().then(() => {
184
+ // 获取完整的url
185
+ let getFullUrl = (url) => {
186
+ // 使用正则判断原有url中是否包含resourceId和menuId,如果有则替换,没有则追加
187
+ if (url.match(/resourceId=/)) {
188
+ url = url.replace(/resourceId=[^&]*/, `resourceId=${this.resourceId || ''}`);
189
+ } else {
190
+ url += `&resourceId=${this.resourceId || ''}`;
191
+ }
192
+
193
+ if (url.match(/menuId=/)) {
194
+ url = url.replace(/menuId=[^&]*/, `menuId=${this.menuId || ''}`);
195
+ } else {
196
+ url += `&menuId=${this.menuId || ''}`;
197
+ }
198
+
199
+ url = url.replace("?&", "?");
200
+ (url.indexOf("?") == -1) && (url = url.replace("&", "?"));
201
+
202
+ // 拼接操作权限
203
+ if(this.operateAuthArr.length > 0){
204
+ url += "&spcpOptCode=" + (this.operateAuthArr || []).join(",");
205
+ }
206
+ // 拼接数据权限
207
+ if(this.dataPowerKeyArr.length > 0){
208
+ url += "&spcpDataCode=" + (this.dataPowerKeyArr || []).join(",");
209
+ }
210
+
211
+ return url;
19
212
  }
20
- },
21
- created(){
22
- this.initRouter();
23
- },
24
- watch: {
25
- '$route.fullPath'() {
26
- window.menuViewWatch = window.menuViewWatch || {};
27
- if (window.menuViewWatch[this.$route.fullPath] && new Date().getTime() - window.menuViewWatch[this.$route.fullPath] < 10) {
28
- return;
213
+ let sFullUrl = getFullUrl(url);
214
+
215
+ if (this.$route.fullPath === sFullUrl) {
216
+ return;
29
217
  }
30
- window.menuViewWatch[this.$route.fullPath] = new Date().getTime();
31
- // console.log("...oldFullPath...", this.oldFullPath);
32
- // console.log("...fullPath...", this.$route.fullPath);
33
- this.menuId = this.$route.query.menuId;
34
- if (this.$route.params.resourceId && this.resourceId != this.$route.params.resourceId) {
35
- this.resourceId = this.$route.params.resourceId;
218
+
219
+ // while循环获取调用replaceRealMenuUrl方法,避免死循环
220
+ let $parent = this.$parent;
221
+ let i = 0;
222
+
223
+ while ((!$parent.replaceRealMenuUrl) && ($parent != this.$root) && (++i < 10)) {
224
+ $parent = $parent.$parent;
36
225
  }
37
- this.initRouter();
38
- },
39
- },
40
- methods: {
41
- initRouter() { //初始化跳转
42
- this.linkUrl = '';
43
- this.isIfm = false;
44
- // 会涉及到同异步问题,所以需要多次判断
45
- if (this.$route.fullPath.indexOf("/menuView/") == -1) {
46
- this.routerPush(this.$route.fullPath);
47
- return;
48
- }
49
- if (this.menuResourceUrl[this.menuId]) {
50
- if(this.menuResourceUrl[this.menuId].indexOf("http://") > -1 || this.menuResourceUrl[this.menuId].indexOf("https://") > -1||
51
- this.menuResourceUrl[this.menuId].indexOf(".jsp")>-1||this.menuResourceUrl[this.menuId].indexOf(".html")>-1){
52
- this.linkUrl = this.menuResourceUrl[this.menuId];
53
- this.isIfm = true;
54
- return false;
55
- }else{
56
- this.routerPush(this.menuResourceUrl[this.menuId]);
57
- }
58
- return;
59
- }
226
+ $parent && $parent.replaceRealMenuUrl && $parent.replaceRealMenuUrl(sFullUrl);
60
227
 
61
- this.RES_GLOBAL.getById(this.resourceId).then(resData => {
62
- let url = "";
63
- if (resData) {
64
- if(resData.rstatus == '0'){
65
- this.$message({
66
- message: "该资源已禁用,无法访问!",
67
- type: 'warning'
68
- });
69
- return false;
70
- }
71
- let firstUrl = this.$route.fullPath;
72
-
73
- // 会涉及到同异步问题,所以需要多次判断
74
- if (firstUrl.indexOf("/menuView/") == -1) {
75
- url = this.$route.fullPath;
76
- }else if (resData.rsource == "url") {
77
- url = resData.ragentUrl;
78
- } else if(this.VIEW_COMPONENTS[resData.rsource]){
79
- firstUrl = firstUrl.substring(0, firstUrl.indexOf("/menuView/"));
80
- url = firstUrl + "/" + this.VIEW_COMPONENTS[resData.rsource].menu + "/" + this.resourceId;
81
- } else {
82
- let resourceKey = "";
83
- this.QIANKUN_ACTIVE_RULES.forEach(item => {
84
- if (resData.rsource.indexOf(item) > -1) {
85
- resourceKey = item;
86
- }
87
- if (this.VIEW_COMPONENTS[resourceKey]) {
88
- firstUrl = firstUrl.substring(0, firstUrl.indexOf("/menuView/"));
89
- url = firstUrl + "/" + this.VIEW_COMPONENTS[resourceKey].menu + "/" + this.resourceId;
90
- }
91
- });
92
- }
93
- }
94
- this.menuId&&(this.menuResourceUrl[this.menuId] = url);
95
- //执行跳转
96
- if(url.indexOf("http://") > -1 || url.indexOf("https://") > -1){
97
- this.linkUrl = url;
98
- this.isIfm = true;
99
- // window.open(url);
100
- return false;
101
- }else if(url.indexOf(".jsp")>-1||url.indexOf(".html")>-1){
102
- this.$message("暂无功能!");
103
- return false;
104
- }
105
-
106
- this.$nextTick(() => {
107
- // 执行跳转
108
- this.routerPush(url);
109
- })
110
-
111
- });
112
- },
113
-
114
- /**
115
- * 请求跳转
116
- */
117
- routerPush(url,param) {
118
- this.$router.push({
119
- path: url,
120
- query: {resourceId: this.resourceId,menuId:this.menuId}
121
- });
122
-
123
- },
228
+ this.$router.push({
229
+ path: sFullUrl
230
+ });
231
+ });
232
+ },
124
233
 
125
- }
126
- }
234
+ }
235
+ }
127
236
 
128
237
  </script>
129
238
 
@@ -110,24 +110,21 @@
110
110
  },
111
111
  eachRouterSet(allRouterArr,urlArr,index){
112
112
  allRouterArr.forEach(item =>{
113
- if(urlArr[index + 1]){
114
- if(urlArr[index +1] == (item.name ? item.name : item.path)){
115
- //当前匹配
116
- //判断 urlArr是否存在下级
117
- if(index+2 >= urlArr.length){ //则当前地址为我需要的实际地址
118
- let componentString = item.component.toString();
119
- let arr = componentString.split("\"");
120
- this.activeUrl = arr[arr.length - 2] || '';
121
- this.activeIndex = item.component;
122
- }else if(item.children && item.children.length > 0) {
123
- //如果存在下级
124
- allRouterArr = item.children || [];
125
- index = index + 1;
126
- this.eachRouterSet(allRouterArr,urlArr,index);
127
- }
113
+ if(urlArr[index + 1] && urlArr[index +1] == (item.name ? item.name : item.path)){
114
+ //当前匹配
115
+ //判断 urlArr是否存在下级
116
+ if(index+2 >= urlArr.length){ //则当前地址为我需要的实际地址
117
+ let componentString = item.component.toString();
118
+ let arr = componentString.split("\"");
119
+ this.activeUrl = arr[arr.length - 2] || '';
120
+ this.activeIndex = item.component;
121
+ }else if(item.children && item.children.length > 0) {
122
+ //如果存在下级
123
+ allRouterArr = item.children || [];
124
+ index = index + 1;
125
+ this.eachRouterSet(allRouterArr,urlArr,index);
128
126
  }
129
127
  }
130
-
131
128
  })
132
129
  },
133
130
  /**
@@ -580,10 +580,8 @@
580
580
  if (currentData[elem]) {
581
581
  regionArr.push(currentData[elem]);
582
582
  } else {
583
- if (!currentData["province"]) {
584
- if(vm.cascadeOptions[0]){
583
+ if (!currentData["province"] && vm.cascadeOptions[0]) {
585
584
  regionArr.push(vm.cascadeOptions[0].id);
586
- }
587
585
  }
588
586
  break;
589
587
  }