system-clients 3.2.95-temp → 3.2.95-temp-1
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/package.json +105 -105
- package/src/components/server/ResSelect.vue +175 -175
- package/src/plugins/GetLoginInfoService.js +17 -75
package/package.json
CHANGED
@@ -1,105 +1,105 @@
|
|
1
|
-
{
|
2
|
-
"name": "system-clients",
|
3
|
-
"version": "3.2.95-temp",
|
4
|
-
"description": "系统基础框架",
|
5
|
-
"main": "src/index.js",
|
6
|
-
"directories": {
|
7
|
-
"doc": "doc",
|
8
|
-
"example": "examples",
|
9
|
-
"test": "test"
|
10
|
-
},
|
11
|
-
"scripts": {
|
12
|
-
"example": "node build/example-server.js",
|
13
|
-
"dev": "node build/dev-server.js",
|
14
|
-
"lint": "eslint src/**.js test/e2e/**.js test/unit/specs/** build/**.js",
|
15
|
-
"build": "rimraf dist && mkdirp dist && ncp static dist/static && cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.prod.conf.js",
|
16
|
-
"e2e": "node test/e2e/runner.js",
|
17
|
-
"unit": "karma start test/unit/karma.conf.js",
|
18
|
-
"makeall": "rimraf dist && mkdirp dist && ncp static dist/static && cross-env NODE_OPTIONS=--max_old_space_size=4096 NODE_ENV=production webpack --progress --hide-modules --config build/webpack.example.conf.js",
|
19
|
-
"release": "npm set registry http://registry.npmjs.org && npm publish && npm set registry http://registry.npm.taobao.org"
|
20
|
-
},
|
21
|
-
"dependencies": {
|
22
|
-
"base64-js": "^1.3.0",
|
23
|
-
"js-base64": "^2.4.9",
|
24
|
-
"less": "^2.7.1",
|
25
|
-
"less-loader": "^2.2.3",
|
26
|
-
"nyc": "^15.1.0",
|
27
|
-
"src": "^1.1.2",
|
28
|
-
"vue": "^1.0.17"
|
29
|
-
},
|
30
|
-
"devDependencies": {
|
31
|
-
"babel-core": "^6.0.0",
|
32
|
-
"babel-loader": "^6.0.0",
|
33
|
-
"babel-plugin-transform-runtime": "^6.0.0",
|
34
|
-
"babel-preset-es2015": "^6.0.0",
|
35
|
-
"babel-preset-stage-2": "^6.0.0",
|
36
|
-
"chai": "^3.5.0",
|
37
|
-
"connect-history-api-fallback": "^1.1.0",
|
38
|
-
"cross-env": "^1.0.7",
|
39
|
-
"cross-spawn": "^2.1.5",
|
40
|
-
"css-loader": "^0.23.0",
|
41
|
-
"eslint": "^2.0.0",
|
42
|
-
"eslint-config-standard": "^5.1.0",
|
43
|
-
"eslint-friendly-formatter": "^1.2.2",
|
44
|
-
"eslint-loader": "^1.3.0",
|
45
|
-
"eslint-plugin-html": "^1.3.0",
|
46
|
-
"eslint-plugin-promise": "^1.0.8",
|
47
|
-
"eslint-plugin-standard": "^1.3.2",
|
48
|
-
"eslint-plugin-vue": "^0.1.1",
|
49
|
-
"eventsource-polyfill": "^0.9.6",
|
50
|
-
"express": "^4.13.3",
|
51
|
-
"extract-text-webpack-plugin": "^1.0.1",
|
52
|
-
"file-loader": "^0.8.4",
|
53
|
-
"function-bind": "^1.0.2",
|
54
|
-
"html-webpack-plugin": "^2.8.1",
|
55
|
-
"http-proxy-middleware": "^0.11.0",
|
56
|
-
"inject-loader": "^2.0.1",
|
57
|
-
"isparta-loader": "^2.0.0",
|
58
|
-
"jasmine-core": "^2.4.1",
|
59
|
-
"jquery": "^3.3.1",
|
60
|
-
"jsencrypt": "^3.0.0-rc.1",
|
61
|
-
"json-loader": "^0.5.4",
|
62
|
-
"karma": "^1.4.1",
|
63
|
-
"karma-chrome-launcher": "^2.2.0",
|
64
|
-
"karma-coverage": "^1.1.1",
|
65
|
-
"karma-mocha": "^1.3.0",
|
66
|
-
"karma-sinon-chai": "^1.3.1",
|
67
|
-
"karma-sourcemap-loader": "^0.3.7",
|
68
|
-
"karma-spec-reporter": "0.0.31",
|
69
|
-
"karma-webpack": "^2.0.2",
|
70
|
-
"manage-client": "^1.4.20",
|
71
|
-
"mkdirp": "^0.5.1",
|
72
|
-
"mocha": "^3.2.0",
|
73
|
-
"ncp": "^2.0.0",
|
74
|
-
"nightwatch": "^0.8.18",
|
75
|
-
"rimraf": "^2.5.0",
|
76
|
-
"selenium-server": "2.52.0",
|
77
|
-
"sinon": "^2.1.0",
|
78
|
-
"sinon-chai": "^2.8.0",
|
79
|
-
"style": "0.0.3",
|
80
|
-
"style-loader": "^0.20.3",
|
81
|
-
"url-loader": "^0.5.7",
|
82
|
-
"vue-client": "1.24.107-test",
|
83
|
-
"vue-hot-reload-api": "^1.2.0",
|
84
|
-
"vue-html-loader": "^1.0.0",
|
85
|
-
"vue-loader": "^8.2.1",
|
86
|
-
"vue-resource": "^1.5.0",
|
87
|
-
"vue-router": "^0.7.13",
|
88
|
-
"vue-strap": "^1.0.9",
|
89
|
-
"vue-style-loader": "^1.0.0",
|
90
|
-
"vue-validator": "2.1.7",
|
91
|
-
"webpack": "^1.12.2",
|
92
|
-
"webpack-dev-middleware": "^1.4.0",
|
93
|
-
"webpack-hot-middleware": "^2.6.0",
|
94
|
-
"webpack-merge": "^0.8.3"
|
95
|
-
},
|
96
|
-
"repository": {
|
97
|
-
"type": "git",
|
98
|
-
"url": "https://gitee.com/aotu/System"
|
99
|
-
},
|
100
|
-
"keywords": [
|
101
|
-
"system_clients"
|
102
|
-
],
|
103
|
-
"author": "杨文宇",
|
104
|
-
"license": "ISC"
|
105
|
-
}
|
1
|
+
{
|
2
|
+
"name": "system-clients",
|
3
|
+
"version": "3.2.95-temp-1",
|
4
|
+
"description": "系统基础框架",
|
5
|
+
"main": "src/index.js",
|
6
|
+
"directories": {
|
7
|
+
"doc": "doc",
|
8
|
+
"example": "examples",
|
9
|
+
"test": "test"
|
10
|
+
},
|
11
|
+
"scripts": {
|
12
|
+
"example": "node build/example-server.js",
|
13
|
+
"dev": "node build/dev-server.js",
|
14
|
+
"lint": "eslint src/**.js test/e2e/**.js test/unit/specs/** build/**.js",
|
15
|
+
"build": "rimraf dist && mkdirp dist && ncp static dist/static && cross-env NODE_ENV=production webpack --progress --hide-modules --config build/webpack.prod.conf.js",
|
16
|
+
"e2e": "node test/e2e/runner.js",
|
17
|
+
"unit": "karma start test/unit/karma.conf.js",
|
18
|
+
"makeall": "rimraf dist && mkdirp dist && ncp static dist/static && cross-env NODE_OPTIONS=--max_old_space_size=4096 NODE_ENV=production webpack --progress --hide-modules --config build/webpack.example.conf.js",
|
19
|
+
"release": "npm set registry http://registry.npmjs.org && npm publish && npm set registry http://registry.npm.taobao.org"
|
20
|
+
},
|
21
|
+
"dependencies": {
|
22
|
+
"base64-js": "^1.3.0",
|
23
|
+
"js-base64": "^2.4.9",
|
24
|
+
"less": "^2.7.1",
|
25
|
+
"less-loader": "^2.2.3",
|
26
|
+
"nyc": "^15.1.0",
|
27
|
+
"src": "^1.1.2",
|
28
|
+
"vue": "^1.0.17"
|
29
|
+
},
|
30
|
+
"devDependencies": {
|
31
|
+
"babel-core": "^6.0.0",
|
32
|
+
"babel-loader": "^6.0.0",
|
33
|
+
"babel-plugin-transform-runtime": "^6.0.0",
|
34
|
+
"babel-preset-es2015": "^6.0.0",
|
35
|
+
"babel-preset-stage-2": "^6.0.0",
|
36
|
+
"chai": "^3.5.0",
|
37
|
+
"connect-history-api-fallback": "^1.1.0",
|
38
|
+
"cross-env": "^1.0.7",
|
39
|
+
"cross-spawn": "^2.1.5",
|
40
|
+
"css-loader": "^0.23.0",
|
41
|
+
"eslint": "^2.0.0",
|
42
|
+
"eslint-config-standard": "^5.1.0",
|
43
|
+
"eslint-friendly-formatter": "^1.2.2",
|
44
|
+
"eslint-loader": "^1.3.0",
|
45
|
+
"eslint-plugin-html": "^1.3.0",
|
46
|
+
"eslint-plugin-promise": "^1.0.8",
|
47
|
+
"eslint-plugin-standard": "^1.3.2",
|
48
|
+
"eslint-plugin-vue": "^0.1.1",
|
49
|
+
"eventsource-polyfill": "^0.9.6",
|
50
|
+
"express": "^4.13.3",
|
51
|
+
"extract-text-webpack-plugin": "^1.0.1",
|
52
|
+
"file-loader": "^0.8.4",
|
53
|
+
"function-bind": "^1.0.2",
|
54
|
+
"html-webpack-plugin": "^2.8.1",
|
55
|
+
"http-proxy-middleware": "^0.11.0",
|
56
|
+
"inject-loader": "^2.0.1",
|
57
|
+
"isparta-loader": "^2.0.0",
|
58
|
+
"jasmine-core": "^2.4.1",
|
59
|
+
"jquery": "^3.3.1",
|
60
|
+
"jsencrypt": "^3.0.0-rc.1",
|
61
|
+
"json-loader": "^0.5.4",
|
62
|
+
"karma": "^1.4.1",
|
63
|
+
"karma-chrome-launcher": "^2.2.0",
|
64
|
+
"karma-coverage": "^1.1.1",
|
65
|
+
"karma-mocha": "^1.3.0",
|
66
|
+
"karma-sinon-chai": "^1.3.1",
|
67
|
+
"karma-sourcemap-loader": "^0.3.7",
|
68
|
+
"karma-spec-reporter": "0.0.31",
|
69
|
+
"karma-webpack": "^2.0.2",
|
70
|
+
"manage-client": "^1.4.20",
|
71
|
+
"mkdirp": "^0.5.1",
|
72
|
+
"mocha": "^3.2.0",
|
73
|
+
"ncp": "^2.0.0",
|
74
|
+
"nightwatch": "^0.8.18",
|
75
|
+
"rimraf": "^2.5.0",
|
76
|
+
"selenium-server": "2.52.0",
|
77
|
+
"sinon": "^2.1.0",
|
78
|
+
"sinon-chai": "^2.8.0",
|
79
|
+
"style": "0.0.3",
|
80
|
+
"style-loader": "^0.20.3",
|
81
|
+
"url-loader": "^0.5.7",
|
82
|
+
"vue-client": "1.24.107-test",
|
83
|
+
"vue-hot-reload-api": "^1.2.0",
|
84
|
+
"vue-html-loader": "^1.0.0",
|
85
|
+
"vue-loader": "^8.2.1",
|
86
|
+
"vue-resource": "^1.5.0",
|
87
|
+
"vue-router": "^0.7.13",
|
88
|
+
"vue-strap": "^1.0.9",
|
89
|
+
"vue-style-loader": "^1.0.0",
|
90
|
+
"vue-validator": "2.1.7",
|
91
|
+
"webpack": "^1.12.2",
|
92
|
+
"webpack-dev-middleware": "^1.4.0",
|
93
|
+
"webpack-hot-middleware": "^2.6.0",
|
94
|
+
"webpack-merge": "^0.8.3"
|
95
|
+
},
|
96
|
+
"repository": {
|
97
|
+
"type": "git",
|
98
|
+
"url": "https://gitee.com/aotu/System"
|
99
|
+
},
|
100
|
+
"keywords": [
|
101
|
+
"system_clients"
|
102
|
+
],
|
103
|
+
"author": "杨文宇",
|
104
|
+
"license": "ISC"
|
105
|
+
}
|
@@ -1,175 +1,175 @@
|
|
1
|
-
<template>
|
2
|
-
<v-select :options='resoptions' placeholder='请选择'
|
3
|
-
:value.sync="selectres"
|
4
|
-
:multiple="isMul"
|
5
|
-
search="true"
|
6
|
-
:disabled="mustselect"
|
7
|
-
:close-on-select="!isMul"
|
8
|
-
@change="resChange"
|
9
|
-
>
|
10
|
-
</v-select>
|
11
|
-
</template>
|
12
|
-
<script>
|
13
|
-
import {HttpResetClass} from 'vue-client'
|
14
|
-
|
15
|
-
export default {
|
16
|
-
title: '资源选择',
|
17
|
-
props: {
|
18
|
-
|
19
|
-
//资源类型
|
20
|
-
restype:'',
|
21
|
-
//是否只查询营业厅
|
22
|
-
specialquery: {
|
23
|
-
type: Boolean,
|
24
|
-
default: false
|
25
|
-
},
|
26
|
-
//资源数据
|
27
|
-
resObj:{},
|
28
|
-
isMul: {
|
29
|
-
type: Boolean,
|
30
|
-
default: true
|
31
|
-
},
|
32
|
-
//资源初始化数据
|
33
|
-
initresid: {
|
34
|
-
type: Array,
|
35
|
-
default() { return [] },
|
36
|
-
},
|
37
|
-
//父层id
|
38
|
-
parentresid: {
|
39
|
-
type: Array,
|
40
|
-
default() { return [] },
|
41
|
-
},
|
42
|
-
mustselect: {
|
43
|
-
type: Boolean,
|
44
|
-
default: false
|
45
|
-
},
|
46
|
-
},
|
47
|
-
data () {
|
48
|
-
return {
|
49
|
-
//资源数据
|
50
|
-
resObj:{},
|
51
|
-
//资源数据列表
|
52
|
-
resoptions:[],
|
53
|
-
//选中资源数据
|
54
|
-
selectres: [],
|
55
|
-
}
|
56
|
-
},
|
57
|
-
ready () {
|
58
|
-
//获取资源列表
|
59
|
-
this.getResList()
|
60
|
-
},
|
61
|
-
methods:{
|
62
|
-
//树形结构变成list
|
63
|
-
findById(val) {
|
64
|
-
if(val){
|
65
|
-
if(this.checkidres(val)){
|
66
|
-
this.treetoList(val,'')
|
67
|
-
}else if(val.children.length>0){
|
68
|
-
for (let value of val.children) {
|
69
|
-
this.findById(value)
|
70
|
-
}
|
71
|
-
}
|
72
|
-
}
|
73
|
-
},
|
74
|
-
//树形结构变成list
|
75
|
-
treetoList(val,parentname) {
|
76
|
-
for (let value of val.children) {
|
77
|
-
this.ergodicList(value,parentname)
|
78
|
-
}
|
79
|
-
},
|
80
|
-
//找到跟节点
|
81
|
-
ergodicList (val,parentname) {
|
82
|
-
if(val.children.length > 0 ){
|
83
|
-
parentname=parentname+val.name
|
84
|
-
this.treetoList(val,parentname)
|
85
|
-
}else {
|
86
|
-
//截取组织机构【组织机构】
|
87
|
-
if(this.restype=='organization'){
|
88
|
-
parentname=parentname.replace("组织机构","")
|
89
|
-
this.resoptions.push({label: val.name+' - '+parentname, value: val.id})
|
90
|
-
}else{
|
91
|
-
if (this.specialquery && this.restype == 'department') {
|
92
|
-
if (val.f_dep_type === '营业厅') {
|
93
|
-
this.resoptions.push({label: val.name, value: val.id})
|
94
|
-
}
|
95
|
-
}else {
|
96
|
-
this.resoptions.push({label: val.name, value: val.id})
|
97
|
-
}
|
98
|
-
}
|
99
|
-
}
|
100
|
-
},
|
101
|
-
//检查id是否存在
|
102
|
-
checkidres(val){
|
103
|
-
let flag=false
|
104
|
-
//如果没传值得话 不过滤
|
105
|
-
if(this.parentresid.length==0&&this.restype=='organization'){
|
106
|
-
flag=true
|
107
|
-
}
|
108
|
-
this.parentresid.forEach((item) => {
|
109
|
-
if(item==val.id){
|
110
|
-
flag=true
|
111
|
-
}
|
112
|
-
})
|
113
|
-
return flag;
|
114
|
-
},
|
115
|
-
//资源改变
|
116
|
-
resChange(val){
|
117
|
-
let orgnames=[]
|
118
|
-
Object.keys(this.resoptions).forEach((key) => {
|
119
|
-
if(this.selectres.includes(this.resoptions[key].value))
|
120
|
-
orgnames.push(this.resoptions[key].label)
|
121
|
-
})
|
122
|
-
console.log('资源改变。。', val, orgnames)
|
123
|
-
this.$dispatch('res-select', this.selectres, orgnames)
|
124
|
-
},
|
125
|
-
//获取资源数据
|
126
|
-
async getResList() {
|
127
|
-
|
128
|
-
let http = new HttpResetClass()
|
129
|
-
|
130
|
-
let req = await http.load('POST', '/rs/search', {data: {
|
131
|
-
source: `tool.getFullTree(this.getRights().where(row.getType()==$${this.restype}$))`,
|
132
|
-
userid: this.$login.f.id
|
133
|
-
}}, {resolveMsg: null, rejectMsg: '获取组织结构数据出错'})
|
134
|
-
this.resObj=req.data[0]
|
135
|
-
this.dealdata()
|
136
|
-
},
|
137
|
-
dealdata(){
|
138
|
-
this.resoptions=[]
|
139
|
-
this.findById(this.resObj);
|
140
|
-
//赋值资源数据
|
141
|
-
let arryselect=[]
|
142
|
-
this.resoptions.forEach((item) => {
|
143
|
-
if(this.initresid.length>0){
|
144
|
-
this.initresid.forEach((init) => {
|
145
|
-
if(item.value==init){
|
146
|
-
arryselect.push(item.value)
|
147
|
-
}
|
148
|
-
})
|
149
|
-
}
|
150
|
-
})
|
151
|
-
//赋值资源选中初始值
|
152
|
-
this.selectres=arryselect
|
153
|
-
}
|
154
|
-
},
|
155
|
-
watch: {
|
156
|
-
//监听初始化资源id
|
157
|
-
'initresid.length'(){
|
158
|
-
this.dealdata()
|
159
|
-
},
|
160
|
-
//监听初始化资源id
|
161
|
-
'parentresid'(){
|
162
|
-
this.dealdata()
|
163
|
-
},
|
164
|
-
initresid: {
|
165
|
-
handler(newVal, oldVal) {
|
166
|
-
// 避免重复触发
|
167
|
-
if (JSON.stringify(newVal) === JSON.stringify(oldVal)) {
|
168
|
-
return;
|
169
|
-
}
|
170
|
-
this.dealdata();
|
171
|
-
},
|
172
|
-
}
|
173
|
-
},
|
174
|
-
}
|
175
|
-
</script>
|
1
|
+
<template>
|
2
|
+
<v-select :options='resoptions' placeholder='请选择'
|
3
|
+
:value.sync="selectres"
|
4
|
+
:multiple="isMul"
|
5
|
+
search="true"
|
6
|
+
:disabled="mustselect"
|
7
|
+
:close-on-select="!isMul"
|
8
|
+
@change="resChange"
|
9
|
+
>
|
10
|
+
</v-select>
|
11
|
+
</template>
|
12
|
+
<script>
|
13
|
+
import {HttpResetClass} from 'vue-client'
|
14
|
+
|
15
|
+
export default {
|
16
|
+
title: '资源选择',
|
17
|
+
props: {
|
18
|
+
|
19
|
+
//资源类型
|
20
|
+
restype:'',
|
21
|
+
//是否只查询营业厅
|
22
|
+
specialquery: {
|
23
|
+
type: Boolean,
|
24
|
+
default: false
|
25
|
+
},
|
26
|
+
//资源数据
|
27
|
+
resObj:{},
|
28
|
+
isMul: {
|
29
|
+
type: Boolean,
|
30
|
+
default: true
|
31
|
+
},
|
32
|
+
//资源初始化数据
|
33
|
+
initresid: {
|
34
|
+
type: Array,
|
35
|
+
default() { return [] },
|
36
|
+
},
|
37
|
+
//父层id
|
38
|
+
parentresid: {
|
39
|
+
type: Array,
|
40
|
+
default() { return [] },
|
41
|
+
},
|
42
|
+
mustselect: {
|
43
|
+
type: Boolean,
|
44
|
+
default: false
|
45
|
+
},
|
46
|
+
},
|
47
|
+
data () {
|
48
|
+
return {
|
49
|
+
//资源数据
|
50
|
+
resObj:{},
|
51
|
+
//资源数据列表
|
52
|
+
resoptions:[],
|
53
|
+
//选中资源数据
|
54
|
+
selectres: [],
|
55
|
+
}
|
56
|
+
},
|
57
|
+
ready () {
|
58
|
+
//获取资源列表
|
59
|
+
this.getResList()
|
60
|
+
},
|
61
|
+
methods:{
|
62
|
+
//树形结构变成list
|
63
|
+
findById(val) {
|
64
|
+
if(val){
|
65
|
+
if(this.checkidres(val)){
|
66
|
+
this.treetoList(val,'')
|
67
|
+
}else if(val.children.length>0){
|
68
|
+
for (let value of val.children) {
|
69
|
+
this.findById(value)
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
},
|
74
|
+
//树形结构变成list
|
75
|
+
treetoList(val,parentname) {
|
76
|
+
for (let value of val.children) {
|
77
|
+
this.ergodicList(value,parentname)
|
78
|
+
}
|
79
|
+
},
|
80
|
+
//找到跟节点
|
81
|
+
ergodicList (val,parentname) {
|
82
|
+
if(val.children.length > 0 ){
|
83
|
+
parentname=parentname+val.name
|
84
|
+
this.treetoList(val,parentname)
|
85
|
+
}else {
|
86
|
+
//截取组织机构【组织机构】
|
87
|
+
if(this.restype=='organization'){
|
88
|
+
parentname=parentname.replace("组织机构","")
|
89
|
+
this.resoptions.push({label: val.name+' - '+parentname, value: val.id})
|
90
|
+
}else{
|
91
|
+
if (this.specialquery && this.restype == 'department') {
|
92
|
+
if (val.f_dep_type === '营业厅') {
|
93
|
+
this.resoptions.push({label: val.name, value: val.id})
|
94
|
+
}
|
95
|
+
}else {
|
96
|
+
this.resoptions.push({label: val.name, value: val.id})
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
},
|
101
|
+
//检查id是否存在
|
102
|
+
checkidres(val){
|
103
|
+
let flag=false
|
104
|
+
//如果没传值得话 不过滤
|
105
|
+
if(this.parentresid.length==0&&this.restype=='organization'){
|
106
|
+
flag=true
|
107
|
+
}
|
108
|
+
this.parentresid.forEach((item) => {
|
109
|
+
if(item==val.id){
|
110
|
+
flag=true
|
111
|
+
}
|
112
|
+
})
|
113
|
+
return flag;
|
114
|
+
},
|
115
|
+
//资源改变
|
116
|
+
resChange(val){
|
117
|
+
let orgnames=[]
|
118
|
+
Object.keys(this.resoptions).forEach((key) => {
|
119
|
+
if(this.selectres.includes(this.resoptions[key].value))
|
120
|
+
orgnames.push(this.resoptions[key].label)
|
121
|
+
})
|
122
|
+
console.log('资源改变。。', val, orgnames)
|
123
|
+
this.$dispatch('res-select', this.selectres, orgnames)
|
124
|
+
},
|
125
|
+
//获取资源数据
|
126
|
+
async getResList() {
|
127
|
+
|
128
|
+
let http = new HttpResetClass()
|
129
|
+
|
130
|
+
let req = await http.load('POST', '/rs/search', {data: {
|
131
|
+
source: `tool.getFullTree(this.getRights().where(row.getType()==$${this.restype}$))`,
|
132
|
+
userid: this.$login.f.id
|
133
|
+
}}, {resolveMsg: null, rejectMsg: '获取组织结构数据出错'})
|
134
|
+
this.resObj=req.data[0]
|
135
|
+
this.dealdata()
|
136
|
+
},
|
137
|
+
dealdata(){
|
138
|
+
this.resoptions=[]
|
139
|
+
this.findById(this.resObj);
|
140
|
+
//赋值资源数据
|
141
|
+
let arryselect=[]
|
142
|
+
this.resoptions.forEach((item) => {
|
143
|
+
if(this.initresid.length>0){
|
144
|
+
this.initresid.forEach((init) => {
|
145
|
+
if(item.value==init){
|
146
|
+
arryselect.push(item.value)
|
147
|
+
}
|
148
|
+
})
|
149
|
+
}
|
150
|
+
})
|
151
|
+
//赋值资源选中初始值
|
152
|
+
this.selectres=arryselect
|
153
|
+
}
|
154
|
+
},
|
155
|
+
watch: {
|
156
|
+
//监听初始化资源id
|
157
|
+
'initresid.length'(){
|
158
|
+
this.dealdata()
|
159
|
+
},
|
160
|
+
//监听初始化资源id
|
161
|
+
'parentresid'(){
|
162
|
+
this.dealdata()
|
163
|
+
},
|
164
|
+
initresid: {
|
165
|
+
handler(newVal, oldVal) {
|
166
|
+
// 避免重复触发
|
167
|
+
if (JSON.stringify(newVal) === JSON.stringify(oldVal)) {
|
168
|
+
return;
|
169
|
+
}
|
170
|
+
this.dealdata();
|
171
|
+
},
|
172
|
+
}
|
173
|
+
},
|
174
|
+
}
|
175
|
+
</script>
|
@@ -2,33 +2,21 @@ import Vue from 'vue'
|
|
2
2
|
import {HttpResetClass} from 'vue-client'
|
3
3
|
import cryptJS from './EncryptUtil'
|
4
4
|
|
5
|
-
let loginGen = async function (
|
6
|
-
let data = {
|
7
|
-
|
8
|
-
|
9
|
-
if (getLogin.data.states === '登录成功') {
|
10
|
-
//获取jwt
|
11
|
-
Vue.$login.jwt = getLogin.data.jwt
|
12
|
-
Vue.$login.jwtNew = getLogin.data.jwtNew
|
13
|
-
// 调用远程登录服务,获取所有有权访问的功能
|
14
|
-
data = {username: name, password: password}
|
15
|
-
data = cryptJS.RSAEncrypt(JSON.stringify(data))
|
16
|
-
const resource = await Vue.resetpost(`/rs/user/userLogin/客服系统`, data, {
|
17
|
-
resolveMsg: null,
|
18
|
-
rejectMsg: null
|
5
|
+
let loginGen = async function (username, password, cue) {
|
6
|
+
let data = {username, password,resourceName:'客服系统'}
|
7
|
+
const getLogin = await Vue.resetpost('/api/af-auth/login', data,
|
8
|
+
{resolveMsg: null, rejectMsg: null,headerConfig:{'Content-type': "application/json"}
|
19
9
|
})
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
Vue.$login.f = resource.data.data
|
29
|
-
} else {
|
30
|
-
Vue.$login.f = resource.data
|
10
|
+
if (getLogin.data) {
|
11
|
+
//获取jwt
|
12
|
+
if (getLogin.data.resources.data && getLogin.data.resources.data.id){
|
13
|
+
Vue.$login.jwt = getLogin.data.resources.data.id
|
14
|
+
Vue.$login.f = getLogin.data.resources.data
|
15
|
+
}else {
|
16
|
+
Vue.$login.jwt = getLogin.data.resources.id
|
17
|
+
Vue.$login.f = getLogin.data.resources
|
31
18
|
}
|
19
|
+
Vue.$login.jwtNew = getLogin.data.access_token
|
32
20
|
// 把登录用户添加到cookie里
|
33
21
|
Vue.cookie.set('loginId', Vue.$login.f.id)
|
34
22
|
try {
|
@@ -37,7 +25,6 @@ let loginGen = async function (name, password, cue) {
|
|
37
25
|
source: "tool.getFullTree(this.getRights().where(row.getType() == $function$))",
|
38
26
|
userid: Vue.$login.f.id
|
39
27
|
}, { resolveMsg: null, rejectMsg: null })
|
40
|
-
console.log('有权限功能返回数据', JSON.stringify(hasRight.data))
|
41
28
|
//准备替换功能树
|
42
29
|
var fun = []
|
43
30
|
hasRight.data[0].children[0].children.forEach((item) => {
|
@@ -47,8 +34,6 @@ let loginGen = async function (name, password, cue) {
|
|
47
34
|
})
|
48
35
|
}
|
49
36
|
})
|
50
|
-
// console.log('替换前', JSON.stringify(Vue.$login.f.functions))
|
51
|
-
// console.log('替换后', JSON.stringify(fun))
|
52
37
|
Vue.$login.f.functions = fun
|
53
38
|
} catch (error) {
|
54
39
|
}
|
@@ -99,21 +84,6 @@ let loginGen = async function (name, password, cue) {
|
|
99
84
|
Vue.$login.f.f_installman = []
|
100
85
|
console.log('安装人模块', error)
|
101
86
|
}
|
102
|
-
// 获取换表员
|
103
|
-
// try {
|
104
|
-
// let getChangeMeterman = await Vue.resetpost('/rs/search', {
|
105
|
-
// source: 'this.getParentByType($organization$).getChildByName($换表员$).getUsers()',
|
106
|
-
// userid: Vue.$login.f.id
|
107
|
-
// }, {resolveMsg: null, rejectMsg: null})
|
108
|
-
// let changemeterman = []
|
109
|
-
// for (let i = 0; i < getChangeMeterman.data.length; i++) {
|
110
|
-
// changemeterman.push(getChangeMeterman.data[i])
|
111
|
-
// }
|
112
|
-
// Vue.$login.f.f_changemeterman = changemeterman
|
113
|
-
// }catch (error) {
|
114
|
-
// Vue.$login.f.f_changemeterman = []
|
115
|
-
// console.log('换表员模块',error)
|
116
|
-
// }
|
117
87
|
// 获取资源服务权限
|
118
88
|
try {
|
119
89
|
let getLic = await Vue.resetpost('/rs/search', {
|
@@ -131,37 +101,6 @@ let loginGen = async function (name, password, cue) {
|
|
131
101
|
Vue.$login.f.f_gasman = []
|
132
102
|
console.log('资源服务权限', error)
|
133
103
|
}
|
134
|
-
// // 票据使用人
|
135
|
-
// try {
|
136
|
-
// let getPaperUseman = await Vue.resetpost('/rs/search', {
|
137
|
-
// source: 'this.getParentByType($organization$).getChildByName($票据使用人$).getUsers()',
|
138
|
-
// userid: Vue.$login.f.id
|
139
|
-
// }, {resolveMsg: null, rejectMsg: null})
|
140
|
-
// let perperuseman = []
|
141
|
-
// for (let i = 0; i < getPaperUseman.data.length; i++) {
|
142
|
-
// perperuseman.push(getPaperUseman.data[i])
|
143
|
-
// }
|
144
|
-
// Vue.$login.f.f_paperUseman = perperuseman
|
145
|
-
// }catch (error) {
|
146
|
-
// Vue.$login.f.f_paperUseman = []
|
147
|
-
// console.log('票据使用人模块',error)
|
148
|
-
//
|
149
|
-
// }
|
150
|
-
// // 票据分配人
|
151
|
-
// try {
|
152
|
-
// let getPaperAllotman = await Vue.resetpost('/rs/search', {
|
153
|
-
// source: 'this.getParentByType($organization$).getChildByName($票据分配人$).getUsers()',
|
154
|
-
// userid: Vue.$login.f.id
|
155
|
-
// }, {resolveMsg: null, rejectMsg: null})
|
156
|
-
// let paperallotman = []
|
157
|
-
// for (let i = 0; i < getPaperAllotman.data.length; i++) {
|
158
|
-
// paperallotman.push(getPaperAllotman.data[i])
|
159
|
-
// }
|
160
|
-
// Vue.$login.f.f_paperAllotman = paperallotman
|
161
|
-
// }catch (error) {
|
162
|
-
// Vue.$login.f.f_paperAllotman = []
|
163
|
-
// console.log('票据分配人模块',error)
|
164
|
-
// }
|
165
104
|
// TODO 处理界面细节
|
166
105
|
try {
|
167
106
|
let viewDetails = await Vue.resetpost('rs/search', {
|
@@ -205,7 +144,10 @@ let loginGen = async function (name, password, cue) {
|
|
205
144
|
}
|
206
145
|
|
207
146
|
} else {
|
208
|
-
let error = {status: 401, data:
|
147
|
+
let error = {status: 401, data: "登录失败,请稍后重试"}
|
148
|
+
if (getLogin.data.code !== 500) {
|
149
|
+
error = {status: getLogin.data.code, data: getLogin.data.msg}
|
150
|
+
}
|
209
151
|
// 抛出错误
|
210
152
|
throw error
|
211
153
|
}
|